Firmware SDK
|
Driver for general purpose input/output. More...
Functions | |
void | twr_gpio_init (twr_gpio_channel_t channel) |
Initialize GPIO channel. More... | |
void | twr_gpio_set_pull (twr_gpio_channel_t channel, twr_gpio_pull_t pull) |
Set pull-up/pull-down configuration for GPIO channel. More... | |
twr_gpio_pull_t | twr_gpio_get_pull (twr_gpio_channel_t channel) |
Get pull-up/pull-down configuration for GPIO channel. More... | |
void | twr_gpio_set_mode (twr_gpio_channel_t channel, twr_gpio_mode_t mode) |
Set mode of operation for GPIO channel. More... | |
twr_gpio_mode_t | twr_gpio_get_mode (twr_gpio_channel_t channel) |
Get mode of operation for GPIO channel. More... | |
int | twr_gpio_get_input (twr_gpio_channel_t channel) |
Get input state for GPIO channel. More... | |
void | twr_gpio_set_output (twr_gpio_channel_t channel, int state) |
Set output state for GPIO channel. More... | |
int | twr_gpio_get_output (twr_gpio_channel_t channel) |
Get output state for GPIO channel. More... | |
void | twr_gpio_toggle_output (twr_gpio_channel_t channel) |
Toggle output state for GPIO channel. More... | |
Driver for general purpose input/output.
enum twr_gpio_channel_t |
GPIO channels.
Definition at line 12 of file twr_gpio.h.
enum twr_gpio_mode_t |
GPIO mode of operation.
Definition at line 102 of file twr_gpio.h.
enum twr_gpio_pull_t |
GPIO pull-up/pull-down setting.
Enumerator | |
---|---|
TWR_GPIO_PULL_NONE | GPIO channel has no pull-up/pull-down. |
TWR_GPIO_PULL_UP | GPIO channel has pull-up. |
TWR_GPIO_PULL_DOWN | GPIO channel has pull-down. |
Definition at line 87 of file twr_gpio.h.
int twr_gpio_get_input | ( | twr_gpio_channel_t | channel | ) |
Get input state for GPIO channel.
channel | GPIO channel |
Definition at line 465 of file twr_gpio.c.
Referenced by twr_module_sensor_get_input().
twr_gpio_mode_t twr_gpio_get_mode | ( | twr_gpio_channel_t | channel | ) |
Get mode of operation for GPIO channel.
[in] | channel | GPIO channel |
Definition at line 428 of file twr_gpio.c.
int twr_gpio_get_output | ( | twr_gpio_channel_t | channel | ) |
Get output state for GPIO channel.
[in] | channel | GPIO channel |
Definition at line 477 of file twr_gpio.c.
Referenced by twr_module_sensor_get_output().
twr_gpio_pull_t twr_gpio_get_pull | ( | twr_gpio_channel_t | channel | ) |
Get pull-up/pull-down configuration for GPIO channel.
[in] | channel | GPIO channel |
Definition at line 361 of file twr_gpio.c.
Referenced by twr_module_sensor_get_pull().
void twr_gpio_init | ( | twr_gpio_channel_t | channel | ) |
Initialize GPIO channel.
channel | GPIO channel |
Definition at line 325 of file twr_gpio.c.
Referenced by twr_hc_sr04_init(), twr_i2c_init(), twr_module_battery_init(), twr_module_encoder_init(), twr_module_power_init(), twr_module_sensor_init(), twr_pwm_enable(), twr_rf_ook_init(), twr_switch_init(), twr_td1207r_init(), twr_uart_init(), and twr_wssfm10r1at_init().
void twr_gpio_set_mode | ( | twr_gpio_channel_t | channel, |
twr_gpio_mode_t | mode | ||
) |
Set mode of operation for GPIO channel.
[in] | channel | GPIO channel |
[in] | mode | Desired mode of operation |
Definition at line 367 of file twr_gpio.c.
Referenced by twr_button_init(), twr_hc_sr04_init(), twr_i2c_deinit(), twr_i2c_init(), twr_led_init(), twr_module_encoder_deinit(), twr_module_power_init(), twr_module_sensor_onewire_power_up(), twr_module_sensor_set_mode(), twr_pwm_disable(), twr_rf_ook_init(), twr_switch_init(), twr_td1207r_init(), twr_uart_deinit(), twr_uart_init(), and twr_wssfm10r1at_init().
void twr_gpio_set_output | ( | twr_gpio_channel_t | channel, |
int | state | ||
) |
Set output state for GPIO channel.
[in] | channel | GPIO channel |
[in] | state | Desired output state |
Definition at line 471 of file twr_gpio.c.
Referenced by twr_hc_sr04_init(), twr_module_power_relay_set_state(), twr_module_sensor_set_output(), twr_td1207r_init(), and twr_wssfm10r1at_init().
void twr_gpio_set_pull | ( | twr_gpio_channel_t | channel, |
twr_gpio_pull_t | pull | ||
) |
Set pull-up/pull-down configuration for GPIO channel.
[in] | channel | GPIO channel |
[in] | pull | Desired pull-up/pull-down configuration |
Definition at line 340 of file twr_gpio.c.
Referenced by twr_button_init(), twr_i2c_deinit(), twr_i2c_init(), twr_module_sensor_set_pull(), twr_switch_init(), twr_uart_deinit(), and twr_uart_init().
void twr_gpio_toggle_output | ( | twr_gpio_channel_t | channel | ) |
Toggle output state for GPIO channel.
[in] | channel | GPIO channel |
Definition at line 483 of file twr_gpio.c.
Referenced by twr_module_sensor_toggle_output().