174 #define iports_get_pnum(type, port) type.get_pnum(&type, port)
175 #define ioports_map(type, port) ( type.map ? type.map[port] : port )
pin_function_t
Definition: crossbar.h:27
pin_irq_mode_t
Pin interrupt modes, may be or'ed when reporting pin capability.
Definition: crossbar.h:458
wait_mode_t
M66 Allowed L-parameter values.
Definition: gcode.h:278
bool(* analog_out_ptr)(uint8_t port, float value)
Pointer to function for setting an analog output.
Definition: ioports.h:45
uint8_t ioports_available(io_port_type_t type, io_port_direction_t dir)
Get number of digital or analog ports available.
Definition: ioports.c:71
bool ioports_add(io_ports_data_t *ports, io_port_type_t type, uint8_t n_in, uint8_t n_out)
Definition: ioports.c:274
void ioports_add_settings(driver_settings_load_ptr settings_loaded, setting_changed_ptr setting_changed)
Definition: ioports.c:819
io_port_direction_t
Definition: ioports.h:29
@ Port_Input
0
Definition: ioports.h:30
@ Port_Output
1
Definition: ioports.h:31
bool(* swap_pins_ptr)(io_port_type_t type, io_port_direction_t dir, uint8_t port_from, uint8_t port_to)
Pointer to function for swapping two digital or analog ports.
Definition: ioports.h:92
bool(* ioports_enumerate_callback_ptr)(xbar_t *properties, uint8_t port, void *data)
Definition: ioports.h:108
bool ioport_digital_in_config(uint8_t port, gpio_in_config_t *config)
Definition: ioports.c:238
io_port_type_t
Definition: ioports.h:24
@ Port_Analog
0
Definition: ioports.h:25
@ Port_Digital
1
Definition: ioports.h:26
void ioport_assign_out_function(aux_ctrl_out_t *aux_ctrl, pin_function_t *function)
Definition: ioports.c:194
bool ioport_analog_out_config(uint8_t port, pwm_config_t *config)
Definition: ioports.c:230
void ioport_assign_function(aux_ctrl_t *aux_ctrl, pin_function_t *function)
Reassign pin function.
Definition: ioports.c:179
void ioport_save_output_settings(xbar_t *xbar, gpio_out_config_t *config)
Definition: ioports.c:469
uint8_t ioport_find_free(io_port_type_t type, io_port_direction_t dir, const char *description)
find first free or claimed digital or analog port.
Definition: ioports.c:104
bool ioport_digital_out_config(uint8_t port, gpio_out_config_t *config)
Definition: ioports.c:251
uint_fast16_t ioports_compute_pwm_value(ioports_pwm_t *pwm_data, float value)
Analog value to PWM conversion.
Definition: ioports.c:425
xbar_t *(* get_pin_info_ptr)(io_port_type_t type, io_port_direction_t dir, uint8_t port)
Pointer to function for getting information about a digital or analog port. NOTE: The port informati...
Definition: ioports.h:74
void ioport_setting_changed(setting_id_t id)
Definition: ioports.c:747
uint8_t ioports_map_reverse(io_ports_detail_t *type, uint8_t port)
Definition: ioports.c:365
bool(* ioport_register_interrupt_handler_ptr)(uint8_t port, pin_irq_mode_t irq_mode, ioport_interrupt_callback_ptr interrupt_callback)
Pointer to function for registering or deregistering an interrupt handler for a digital input port.
Definition: ioports.h:106
struct io_ports_data io_ports_data_t
bool ioport_can_claim_explicit(void)
Check if ports can be claimed by aux number or not.
Definition: ioports.c:210
bool ioport_claim(io_port_type_t type, io_port_direction_t dir, uint8_t *port, const char *description)
Claim a digital or analog port for exclusive use.
Definition: ioports.c:140
bool ioport_enable_irq(uint8_t port, pin_irq_mode_t irq_mode, ioport_interrupt_callback_ptr handler)
Definition: ioports.c:246
int32_t(* wait_on_input_ptr)(io_port_type_t type, uint8_t port, wait_mode_t wait_mode, float timeout)
Pointer to function for reading a digital or analog input.
Definition: ioports.h:57
void(* ioport_interrupt_callback_ptr)(uint8_t port, bool state)
Pointer to callback function for input port interrupt events.
Definition: ioports.h:98
bool ioports_precompute_pwm_values(pwm_config_t *config, ioports_pwm_t *pwm_data, uint32_t clock_hz)
Precompute PWM values for faster conversion.
Definition: ioports.c:396
bool(* claim_port_ptr)(io_port_type_t type, io_port_direction_t dir, uint8_t *port, const char *description)
Pointer to function for claiming a digital or analog port for exclusive use.
Definition: ioports.h:83
void(* set_pin_description_ptr)(io_port_type_t type, io_port_direction_t dir, uint8_t port, const char *s)
Pointer to function for setting pin description for a digital or analog port.
Definition: ioports.h:65
bool ioports_enumerate(io_port_type_t type, io_port_direction_t dir, pin_cap_t filter, ioports_enumerate_callback_ptr callback, void *data)
Definition: ioports.c:215
void ioport_save_input_settings(xbar_t *xbar, gpio_in_config_t *config)
Definition: ioports.c:445
bool ioport_digital_pwm_config(uint8_t port, pwm_config_t *config)
Definition: ioports.c:259
void(* digital_out_ptr)(uint8_t port, bool on)
Pointer to function for setting a digital output.
Definition: ioports.h:38
void(* setting_changed_ptr)(setting_id_t id)
Definition: settings.h:995
setting_id_t
Definition: settings.h:46
void(* driver_settings_load_ptr)(void)
Definition: settings.h:1003
Definition: crossbar.h:616
Definition: crossbar.h:606
/a cfg_data argument to /a xbar_config_ptr for gpio input pins
Definition: crossbar.h:567
/a cfg_data argument to /a xbar_config_ptr for gpio output pins
Definition: crossbar.h:574
Properties and handlers for auxiliary digital and analog I/O.
Definition: ioports.h:111
claim_port_ptr claim
Optional handler for claiming an auxiliary pin for exclusive use.
Definition: ioports.h:121
wait_on_input_ptr wait_on_input
Optional handler for reading a digital or analog input.
Definition: ioports.h:118
uint8_t num_digital_in
Number of digital inputs available.
Definition: ioports.h:112
swap_pins_ptr swap_pins
Optional handler for swapping pins.
Definition: ioports.h:122
uint8_t num_analog_out
Number of analog outputs available.
Definition: ioports.h:115
set_pin_description_ptr set_pin_description
Optional handler for setting a description of an auxiliary pin.
Definition: ioports.h:119
analog_out_ptr analog_out
Optional handler for setting an analog output.
Definition: ioports.h:117
uint8_t num_digital_out
Number of digital outputs available.
Definition: ioports.h:113
digital_out_ptr digital_out
Optional handler for setting a digital output.
Definition: ioports.h:116
ioport_register_interrupt_handler_ptr register_interrupt_handler
Definition: ioports.h:123
uint8_t num_analog_in
Number of analog inputs available.
Definition: ioports.h:114
get_pin_info_ptr get_pin_info
Optional handler for getting information about an auxiliary pin.
Definition: ioports.h:120
Definition: ioports.h:149
io_ports_detail_t out
Definition: ioports.h:152
io_ports_detail_t in
Definition: ioports.h:151
char * pnum
Definition: ioports.h:150
Definition: ioports.h:143
uint8_t * map
Definition: ioports.h:146
uint8_t n_start
Definition: ioports.h:145
uint8_t n_ports
Definition: ioports.h:144
Precalculated values that may be set/used by HAL driver to speed up analog input to PWM conversions....
Definition: ioports.h:157
uint_fast16_t period
Definition: ioports.h:159
uint_fast16_t off_value
NOTE: this value holds the inverted version if software PWM inversion is enabled by the driver.
Definition: ioports.h:160
uint32_t f_clock
Definition: ioports.h:158
bool invert_pwm
NOTE: set (by driver) when inversion is done in code.
Definition: ioports.h:165
uint_fast16_t min_value
Definition: ioports.h:161
float min
Minimum analog input value.
Definition: ioports.h:163
bool always_on
Definition: ioports.h:166
uint_fast16_t max_value
Definition: ioports.h:162
float pwm_gradient
Definition: ioports.h:164
/a cfg_data argument to /a xbar_config_ptr for PWM pins
Definition: crossbar.h:581
Definition: crossbar.h:624
Definition: crossbar.h:502