Class GpioHAL
#include <GpioHAL.h>
Public Functions
Type | Name |
---|---|
void | configurePin (uint8_t pin, gpio_flags_t flags) Configure an I/O pin. This must be done prior to accessing any other function from this API on the pin. |
uint8_t | readPin (uint8_t pin) Get the current value of a pin configured as input. |
void | resetPin (uint8_t pin) Reset the value of a pin configured as output to 0. |
void | setPin (uint8_t pin) Set the value of a pin configured as output to 1. |
void | togglePin (uint8_t pin) Toggle the value of a pin configured as output: |
void | writePin (uint8_t pin, uint8_t value) Set the value of a pin configured as output to a given value. |
Detailed Description
Class definition
Public Functions Documentation
function configurePin
Configure an I/O pin. This must be done prior to accessing any other function from this API on the pin.
Parameters:
-
pin
Number of pin. Format allowed: -
the Spin pin number from 1 to 58
- STM32-style pin name from
PA1
toPA15
,PB1
toPB15
,PC1
toPC15
andPD1
toPD3
Parameters:
flags
Pin configuration flags. Authorized values:INPUT
,INPUT_PULLUP
,OUTPUT
function readPin
Get the current value of a pin configured as input.
Parameters:
-
pin
Number of pin. Format allowed: -
the Spin pin number from 1 to 58
- STM32-style pin name from
PA1
toPA15
,PB1
toPB15
,PC1
toPC15
andPD1
toPD3
Returns:
Current value (0 or 1) of the pin.
function resetPin
Reset the value of a pin configured as output to 0.
Parameters:
-
pin
Number of pin. Format allowed: -
the Spin pin number from 1 to 58
- STM32-style pin name from
PA1
toPA15
,PB1
toPB15
,PC1
toPC15
andPD1
toPD3
function setPin
Set the value of a pin configured as output to 1.
Parameters:
-
pin
Number of pin. Format allowed: -
the Spin pin number from 1 to 58
- STM32-style pin name from
PA1
toPA15
,PB1
toPB15
,PC1
toPC15
andPD1
toPD3
function togglePin
Toggle the value of a pin configured as output:
Parameters:
-
pin
Number of pin. Format allowed: -
the Spin pin number from 1 to 58
- STM32-style pin name from
PA1
toPA15
,PB1
toPB15
,PC1
toPC15
andPD1
toPD3
function writePin
Set the value of a pin configured as output to a given value.
Parameters:
-
pin
Number of pin. Format allowed: -
the Spin pin number from 1 to 58
- STM32-style pin name from
PA1
toPA15
,PB1
toPB15
,PC1
toPC15
andPD1
toPD3
Parameters:
value
Value (0 or 1) to assign to the pin.
The documentation for this class was generated from the following file docs/core/zephyr/modules/owntech_spin_api/zephyr/src/GpioHAL.h