Data Structures | |
struct | io_ports_private_t |
struct | io_ports_cfg_t |
Functions | |
uint8_t | ioports_available (io_port_type_t type, io_port_direction_t dir) |
Get number of digital or analog ports available. More... | |
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. More... | |
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. More... | |
void | ioport_assign_function (aux_ctrl_t *aux_ctrl, pin_function_t *function) |
Reassign pin function. More... | |
void | ioport_assign_out_function (aux_ctrl_out_t *aux_ctrl, pin_function_t *function) |
bool | ioport_can_claim_explicit (void) |
Check if ports can be claimed by aux number or not. More... | |
bool | ioports_enumerate (io_port_type_t type, io_port_direction_t dir, pin_cap_t filter, ioports_enumerate_callback_ptr callback, void *data) |
bool | ioport_analog_out_config (uint8_t port, pwm_config_t *config) |
bool | ioport_digital_in_config (uint8_t port, gpio_in_config_t *config) |
bool | ioport_enable_irq (uint8_t port, pin_irq_mode_t irq_mode, ioport_interrupt_callback_ptr handler) |
bool | ioport_digital_out_config (uint8_t port, gpio_out_config_t *config) |
bool | ioport_digital_pwm_config (uint8_t port, pwm_config_t *config) |
bool | ioports_add (io_ports_data_t *ports, io_port_type_t type, uint8_t n_in, uint8_t n_out) |
ISR_CODE uint8_t ISR_FUNC() | ioports_map_reverse (io_ports_detail_t *type, uint8_t port) |
bool | ioports_precompute_pwm_values (pwm_config_t *config, ioports_pwm_t *pwm_data, uint32_t clock_hz) |
Precompute PWM values for faster conversion. More... | |
uint_fast16_t | ioports_compute_pwm_value (ioports_pwm_t *pwm_data, float value) |
Analog value to PWM conversion. More... | |
void | ioport_save_input_settings (xbar_t *xbar, gpio_in_config_t *config) |
void | ioport_save_output_settings (xbar_t *xbar, gpio_out_config_t *config) |
void | ioport_setting_changed (setting_id_t id) |
void | ioports_add_settings (driver_settings_load_ptr settings_loaded, setting_changed_ptr setting_changed) |
Some wrapper functions for the io_port_t API. They perform the necessary checks for both availability of ports and advanced functionality simplifying plugin code that uses them.
bool ioport_analog_out_config | ( | uint8_t | port, |
pwm_config_t * | config | ||
) |
void ioport_assign_function | ( | aux_ctrl_t * | aux_ctrl, |
pin_function_t * | function | ||
) |
Reassign pin function.
port | pointer to an aux_ctrl_t structure with a valid port number. |
function | pointer to a pin_function_t enum value to be updated. |
void ioport_assign_out_function | ( | aux_ctrl_out_t * | aux_ctrl, |
pin_function_t * | function | ||
) |
bool ioport_can_claim_explicit | ( | void | ) |
Check if ports can be claimed by aux number or not.
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.
type | as an io_port_type_t enum value. |
dir | as an io_port_direction_t enum value. |
port | pointer to a uint8_t holding the ports aux number, returns the actual port number to use if successful. |
description | pointer to a char constant for the pin description. |
bool ioport_digital_in_config | ( | uint8_t | port, |
gpio_in_config_t * | config | ||
) |
bool ioport_digital_out_config | ( | uint8_t | port, |
gpio_out_config_t * | config | ||
) |
bool ioport_digital_pwm_config | ( | uint8_t | port, |
pwm_config_t * | config | ||
) |
bool ioport_enable_irq | ( | uint8_t | port, |
pin_irq_mode_t | irq_mode, | ||
ioport_interrupt_callback_ptr | handler | ||
) |
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.
type | as an io_port_type_t enum value. |
dir | as an io_port_direction_t enum value. |
description | pointer to a char constant for the pin description of a previousely claimed port or NULL if searching for the first free port. |
void ioport_save_input_settings | ( | xbar_t * | xbar, |
gpio_in_config_t * | config | ||
) |
void ioport_save_output_settings | ( | xbar_t * | xbar, |
gpio_out_config_t * | config | ||
) |
void ioport_setting_changed | ( | setting_id_t | id | ) |
bool ioports_add | ( | io_ports_data_t * | ports, |
io_port_type_t | type, | ||
uint8_t | n_in, | ||
uint8_t | n_out | ||
) |
void ioports_add_settings | ( | driver_settings_load_ptr | settings_loaded, |
setting_changed_ptr | setting_changed | ||
) |
uint8_t ioports_available | ( | io_port_type_t | type, |
io_port_direction_t | dir | ||
) |
Get number of digital or analog ports available.
type | as an io_port_type_t enum value. |
dir | as an io_port_direction_t enum value. |
uint_fast16_t ioports_compute_pwm_value | ( | ioports_pwm_t * | pwm_data, |
float | value | ||
) |
Analog value to PWM conversion.
pwm_data | pointer to a ioports_pwm_t structure. |
value | analog value to be converted. |
NOTE: ioports_precompute_pwm_values() must be called to precompute values before this function is called. Typically this is done by the ioports initialization code.
bool ioports_enumerate | ( | io_port_type_t | type, |
io_port_direction_t | dir, | ||
pin_cap_t | filter, | ||
ioports_enumerate_callback_ptr | callback, | ||
void * | data | ||
) |
ISR_CODE uint8_t ISR_FUNC() ioports_map_reverse | ( | io_ports_detail_t * | type, |
uint8_t | port | ||
) |
bool ioports_precompute_pwm_values | ( | pwm_config_t * | config, |
ioports_pwm_t * | pwm_data, | ||
uint32_t | clock_hz | ||
) |
Precompute PWM values for faster conversion.
config | pointer to a pwm_config_t structure. |
pwm_data | pointer to a ioports_pwm_t structure, to hold the precomputed values. |
clock_hz | timer clock frequency used for PWM generation. |