Deprecated C API for GPIO is staying in place for a few versions to support backwards compatibility.
More...
Deprecated C API for GPIO is staying in place for a few versions to support backwards compatibility.
This should not be used for anything new.
- Deprecated:
- These should only be used for casting to configs, and are planned to be reomved in a future version.
◆ dsy_gpio_mode
General Purpose IO driver Sets the mode of the GPIO
Enumerator |
---|
DSY_GPIO_MODE_INPUT | &
|
DSY_GPIO_MODE_OUTPUT_PP | Push-Pull
|
DSY_GPIO_MODE_OUTPUT_OD | Open-Drain
|
DSY_GPIO_MODE_ANALOG | &
|
DSY_GPIO_MODE_LAST | &
|
◆ dsy_gpio_pull
Configures whether an internal Pull up or Pull down resistor is used
Enumerator |
---|
DSY_GPIO_NOPULL | &
|
DSY_GPIO_PULLUP | &
|
DSY_GPIO_PULLDOWN | &
|
◆ dsy_gpio_deinit()
void dsy_gpio_deinit |
( |
const dsy_gpio * |
p | ) |
|
Deinitializes the gpio pin
- Parameters
-
◆ dsy_gpio_init()
void dsy_gpio_init |
( |
const dsy_gpio * |
p | ) |
|
Initializes the gpio with the settings configured.
- Parameters
-
◆ dsy_gpio_read()
uint8_t dsy_gpio_read |
( |
const dsy_gpio * |
p | ) |
|
Reads the state of the gpio pin
- Parameters
-
- Returns
- 1 if the pin is HIGH, and 0 if the pin is LOW
◆ dsy_gpio_toggle()
void dsy_gpio_toggle |
( |
const dsy_gpio * |
p | ) |
|
Toggles the state of the pin so that it is not at the same state as it was previously.
- Parameters
-
◆ dsy_gpio_write()
void dsy_gpio_write |
( |
const dsy_gpio * |
p, |
|
|
uint8_t |
state |
|
) |
| |
Writes the state to the gpio pin Pin will be set to 3v3 when state is 1, and 0V when state is 0
- Parameters
-
*p | Pin pointer |
state | State to write |