InPlay API
|
HAL_GPIO. More...
Functions | |
void | hal_gpio_init (void) |
Initialize GPIO port values. More... | |
void | hal_gpio_pin_cfg (uint32_t pin_cfg) |
Config GPIO from the user's configuration settings . More... | |
void | hal_gpio_pin_dft (uint32_t pin_cfg) |
Restore GPIO pin to its default state. More... | |
int | hal_gpio_pin_mux (int port, int pin, int mux) |
Config GPIO pin mux. More... | |
int | hal_gpio_pad_oe_ie (int port, int pin, int oe, int ie) |
Config GPIO PAD as output or input. More... | |
int | hal_gpio_pad_pd_pu (int port, int pin, int pd, int pu) |
Config GPIO PAD as pull up or pull down. More... | |
int | hal_gpio_sleep_pad_mask (int port, int pin, int mask) |
Enable GPIO pad input during deep sleep. More... | |
int | hal_gpio_sleep_wup_mask (int port, int pin, int mask) |
Config GPIO pin as wake up pin during deep sleep. More... | |
int | hal_gpio_sleep_wup_polarity (int port, int pin, int pol) |
Change wake up GPIO pin polarity. More... | |
int | hal_gpio_sleep_wup_edge (int port, int pin, int rise, int fall) |
Wake up GPIO edge selection. More... | |
int | hal_gpio_sleep_wup_edge_clear_manual (int port, int pin) |
Manually clear wake up GPIO edge. More... | |
int | hal_gpio_sleep_wup_edge_clear_auto (int port, int pin, int en) |
Clear the wake up GPIO edge automatically. More... | |
int | hal_gpio_sleep_wup_edge_detect (int port, int pin, int en) |
Detect the wake up GPIO edge. More... | |
int | hal_gpio_sleep_wup_edge_latch (int port, int pin, int en) |
Latch the wake up GPIO edge. More... | |
void | hal_gpio_suspend (void) |
GPIO pin configuration store before power down. More... | |
void | hal_gpio_resume (void) |
GPIO pin configuration restore after power up. More... | |
int | hal_gpio_cfg_output (int port, int pin) |
Config pin to GPIO output. More... | |
int | hal_gpio_cfg_input (int port, int pin, int pull_cfg) |
Config pin to GPIO input. More... | |
int | hal_gpio_output_status (int port, int pin) |
GPIO output status. : The status is only valid if the output is enabled. More... | |
int | hal_gpio_input_status (int port, int pin) |
Get GPIO input value. More... | |
int | hal_gpio_pad_pc (int port, int pin, int on) |
Config GPIO PAD drive strength. More... | |
int | hal_gpio_output (int port, int pin, int high) |
Config GPIO output level. More... | |
int | hal_gpio_pin_inv (int port, int pin, int inv) |
Config GPIO pin invert. More... | |
int | hal_gpio_ext_int_prio (int port, int prio) |
Set GPIO interrupt polarity. One port only have one polarity. More... | |
int | hal_gpio_ext_int_reg (int port, int pin, void *arg, void(*callback)(void *, int, int, int)) |
Register external GPIO pin as interrupt. More... | |
int | hal_gpio_ext_int_unreg (int port, int pin) |
Unregister external GPIO pin as interrupt. More... | |
int | hal_gpio_ext_int_mask (int port, int pin, int rise, int fall, int wup) |
Mask GPIO pin interrupt. More... | |
int | hal_gpio_ext_int_unmask (int port, int pin, int rise, int fall, int wup) |
Unmask GPIO pin interrupt. More... | |
int | hal_gpio_cfg_wup_level (int port, int pin, int polarity) |
Config GPIO pin to level wake up. More... | |
int | hal_gpio_cfg_wup_edge (int port, int pin, int rise, int fall) |
Config GPIO pin to edge wake up. More... | |
int | hal_gpio_wup_dis (int port, int pin) |
Disable GPIO pin wake up. More... | |
int | hal_gpio_sleep_pad_latch (int port, int pin, int latch, int manual) |
Enable GPIO pad during deep sleep. More... | |
int | hal_gpio_sleep_output_grp_0 (int en, int port, int pin, int mux) |
Output always on domain (AON) signals thru GPIO mux. : The mux are divided into 4 group (see enum gpio_slp_grp_X_pin_mux) and different pins are assoicated with each group. More... | |
void | hal_gpio_reset_chip (int idx, int en, int port, int pin, int fall, int deb) |
Reset chip's PD1 domain by exteranl GPIO rise/fall edge. : This can reset cpu and peripherals but not always on domain (AON) HW. More... | |
void | hal_gpio_reset_arm (int en, int port, int pin, int fall, int deb, int sys_rst) |
Reset ARM CPU by exteranl GPIO rise/fall edge. : This can reset only cpu but not other HW. More... | |
HAL_GPIO.
int hal_gpio_cfg_input | ( | int | port, |
int | pin, | ||
int | pull_cfg | ||
) |
Config pin to GPIO input.
[in] | port | Port number, |
[in] | pin | Pin number, |
[in] | pull_cfg | Pull up or down configuration, |
int hal_gpio_cfg_output | ( | int | port, |
int | pin | ||
) |
Config pin to GPIO output.
[in] | port | Port number, |
[in] | pin | Pin number, |
int hal_gpio_cfg_wup_edge | ( | int | port, |
int | pin, | ||
int | rise, | ||
int | fall | ||
) |
Config GPIO pin to edge wake up.
[in] | port | Port number, |
[in] | pin | Pin number, |
[in] | rise | 1: rising; 0: otherwise |
[in] | fall | 1: falling; 0: otherwise |
int hal_gpio_cfg_wup_level | ( | int | port, |
int | pin, | ||
int | polarity | ||
) |
Config GPIO pin to level wake up.
[in] | port | Port number, |
[in] | pin | Pin number, |
[in] | polarity | 1: high; 0: low |
int hal_gpio_ext_int_mask | ( | int | port, |
int | pin, | ||
int | rise, | ||
int | fall, | ||
int | wup | ||
) |
Mask GPIO pin interrupt.
[in] | port | Port number, |
[in] | pin | Pin number, |
[in] | rise | 1: rising edge; 0: otherwise |
[in] | fall | 1: falling edge; 0: otherwise |
[in] | wup | 1: wake up; 0: otherwise |
int hal_gpio_ext_int_prio | ( | int | port, |
int | prio | ||
) |
Set GPIO interrupt polarity. One port only have one polarity.
[in] | port | Port number, |
[in] | prio | GPIO interrupt priority, |
int hal_gpio_ext_int_reg | ( | int | port, |
int | pin, | ||
void * | arg, | ||
void(*)(void *, int, int, int) | callback | ||
) |
Register external GPIO pin as interrupt.
[in] | port | Port number, |
[in] | pin | Pin number, |
[in] | arg | User provided interrupt callback parameter |
[in] | callback | User provided interrupt callback function |
int hal_gpio_ext_int_unmask | ( | int | port, |
int | pin, | ||
int | rise, | ||
int | fall, | ||
int | wup | ||
) |
Unmask GPIO pin interrupt.
[in] | port | Port number, |
[in] | pin | Pin number, |
[in] | rise | 1: rising edge; 0: otherwise |
[in] | fall | 1: falling edge; 0: otherwise |
[in] | wup | 1: wake up; 0: otherwise |
int hal_gpio_ext_int_unreg | ( | int | port, |
int | pin | ||
) |
Unregister external GPIO pin as interrupt.
[in] | port | Port number, |
[in] | pin | Pin number, |
void hal_gpio_init | ( | void | ) |
Initialize GPIO port values.
int hal_gpio_input_status | ( | int | port, |
int | pin | ||
) |
Get GPIO input value.
[in] | port | Port number, |
[in] | pin | Pin number, |
int hal_gpio_output | ( | int | port, |
int | pin, | ||
int | high | ||
) |
Config GPIO output level.
[in] | port | Port number, |
[in] | pin | Pin number, |
[in] | high | 1: HIGH output, 0: LOW output. |
int hal_gpio_output_status | ( | int | port, |
int | pin | ||
) |
GPIO output status. : The status is only valid if the output is enabled.
[in] | port | Port number, |
[in] | pin | Pin number, |
int hal_gpio_pad_oe_ie | ( | int | port, |
int | pin, | ||
int | oe, | ||
int | ie | ||
) |
Config GPIO PAD as output or input.
[in] | port | Port number, |
[in] | pin | Pin number, |
[in] | oe | 1: Ouput enable, 0: otherwise. |
[in] | ie | 1: Input enable, 0: otherwise. |
int hal_gpio_pad_pc | ( | int | port, |
int | pin, | ||
int | on | ||
) |
Config GPIO PAD drive strength.
[in] | port | Port number, |
[in] | pin | Pin number, |
[in] | on | 1: Change it, 0: otherwise. |
int hal_gpio_pad_pd_pu | ( | int | port, |
int | pin, | ||
int | pd, | ||
int | pu | ||
) |
Config GPIO PAD as pull up or pull down.
[in] | port | Port number, |
[in] | pin | Pin number, |
[in] | pd | 1: Pull down, 0: otherwise. |
[in] | pu | 1: Pull up, 0: otherwise. |
void hal_gpio_pin_cfg | ( | uint32_t | pin_cfg | ) |
Config GPIO from the user's configuration settings .
[in] | pin_cfg | Pin configuration from the configuration tool. |
void hal_gpio_pin_dft | ( | uint32_t | pin_cfg | ) |
Restore GPIO pin to its default state.
[in] | pin_cfg | Pin configuration from the configuration tool. |
int hal_gpio_pin_inv | ( | int | port, |
int | pin, | ||
int | inv | ||
) |
Config GPIO pin invert.
[in] | port | Port number, |
[in] | pin | Pin number, |
[in] | inv | Invert pin, 1: inverted, 0: otherwise. |
int hal_gpio_pin_mux | ( | int | port, |
int | pin, | ||
int | mux | ||
) |
Config GPIO pin mux.
[in] | port | Port number, |
[in] | pin | Pin number, |
[in] | mux | Mux number, |
void hal_gpio_reset_arm | ( | int | en, |
int | port, | ||
int | pin, | ||
int | fall, | ||
int | deb, | ||
int | sys_rst | ||
) |
Reset ARM CPU by exteranl GPIO rise/fall edge. : This can reset only cpu but not other HW.
[in] | en | 1: Enable, 0: otherwise |
[in] | port | Port number |
[in] | pin | Pin number |
[in] | fall | 1: falling edge, 0: otherwise |
[in] | deb | Debounce limit; from 0 ~255. |
[in] | sys_rst | 1: Arm's Debug core is not reset, 0: otherwise. |
void hal_gpio_reset_chip | ( | int | idx, |
int | en, | ||
int | port, | ||
int | pin, | ||
int | fall, | ||
int | deb | ||
) |
Reset chip's PD1 domain by exteranl GPIO rise/fall edge. : This can reset cpu and peripherals but not always on domain (AON) HW.
[in] | idx | From 0~2; At most 3 gpio pin can be used to reset the chip. |
[in] | en | 1: Enable, 0: otherwise |
[in] | port | Port number |
[in] | pin | Pin number |
[in] | fall | 1: falling edge, 0: otherwise |
[in] | deb | Debounce limit; from 0 ~255. |
void hal_gpio_resume | ( | void | ) |
GPIO pin configuration restore after power up.
int hal_gpio_sleep_output_grp_0 | ( | int | en, |
int | port, | ||
int | pin, | ||
int | mux | ||
) |
Output always on domain (AON) signals thru GPIO mux. : The mux are divided into 4 group (see enum gpio_slp_grp_X_pin_mux) and different pins are assoicated with each group.
[in] | en | 1: output enable, 0: otherwise |
[in] | port | Port number, |
[in] | pin | Pin number, |
[in] | mux | Pin mux, |
int hal_gpio_sleep_pad_latch | ( | int | port, |
int | pin, | ||
int | latch, | ||
int | manual | ||
) |
Enable GPIO pad during deep sleep.
[in] | port | Port number, |
[in] | pin | Pin number, |
[in] | latch | 1: latch, 0: otherwise |
[in] | manual | 1: latch clear by user, 0: auto clear after wake up |
int hal_gpio_sleep_pad_mask | ( | int | port, |
int | pin, | ||
int | mask | ||
) |
Enable GPIO pad input during deep sleep.
[in] | port | Port number, |
[in] | pin | Pin number, |
[in] | mask | 1: mask input, 0: otherwise |
int hal_gpio_sleep_wup_edge | ( | int | port, |
int | pin, | ||
int | rise, | ||
int | fall | ||
) |
Wake up GPIO edge selection.
[in] | port | Port number, |
[in] | pin | Pin number, |
[in] | rise | 1: Rising edge, 0: otherwise. |
[in] | fall | 1: Falling edge, 0: otherwise. |
int hal_gpio_sleep_wup_edge_clear_auto | ( | int | port, |
int | pin, | ||
int | en | ||
) |
Clear the wake up GPIO edge automatically.
[in] | port | Port number, |
[in] | pin | Pin number, |
[in] | en | 1: Enable, 0: otherwise. |
int hal_gpio_sleep_wup_edge_clear_manual | ( | int | port, |
int | pin | ||
) |
Manually clear wake up GPIO edge.
[in] | port | Port number, |
[in] | pin | Pin number, |
int hal_gpio_sleep_wup_edge_detect | ( | int | port, |
int | pin, | ||
int | en | ||
) |
Detect the wake up GPIO edge.
[in] | port | Port number, |
[in] | pin | Pin number, |
[in] | en | 1: Enable, 0: otherwise. |
int hal_gpio_sleep_wup_edge_latch | ( | int | port, |
int | pin, | ||
int | en | ||
) |
Latch the wake up GPIO edge.
[in] | port | Port number, |
[in] | pin | Pin number, |
[in] | en | 1: Enable, 0: otherwise. |
int hal_gpio_sleep_wup_mask | ( | int | port, |
int | pin, | ||
int | mask | ||
) |
Config GPIO pin as wake up pin during deep sleep.
[in] | port | Port number, |
[in] | pin | Pin number, |
[in] | mask | 1: mask, 0: unmask |
int hal_gpio_sleep_wup_polarity | ( | int | port, |
int | pin, | ||
int | pol | ||
) |
Change wake up GPIO pin polarity.
[in] | port | Port number, |
[in] | pin | Pin number, |
[in] | pol | 1: Pin level high as wake up, 0: otherwise. |
void hal_gpio_suspend | ( | void | ) |
GPIO pin configuration store before power down.
int hal_gpio_wup_dis | ( | int | port, |
int | pin | ||
) |
Disable GPIO pin wake up.
[in] | port | Port number, |
[in] | pin | Pin number, |