GPIO output handling.
More...
#include "sarmfsw.h"
#include "GPIO_out.h"
|
| FctERR | GPIO_out_init (GPIO_out *const out, GPIO_TypeDef *const GPIOx, const uint16_t GPIO_Pin, const GPIO_PinState polarity) |
| | Initialize GPIO_out instance.
|
| |
GPIO output handling.
- Author
- SMFSW
- Copyright
- MIT (c) 2017-2026, SMFSW
- Note
- Define
LOGIC_OUT_IT shared symbol at project level to use GPIO_out from timer interrupts (for more timing precision if required)
-
When using GPIO_out from interrupts, shared
LOGIC_OUT_IT_PER period is defined by default with a period of 1000µs (can be customly defined)
- Warning
- Logic_out & GPIO_out shares interrupt behavior, thus needs to be implemented the same way (it or loop) if both are used at the same time
◆ GPIO_out_init()
| FctERR GPIO_out_init |
( |
GPIO_out *const | out, |
|
|
GPIO_TypeDef *const | GPIOx, |
|
|
const uint16_t | GPIO_Pin, |
|
|
const GPIO_PinState | polarity ) |
Initialize GPIO_out instance.
- Parameters
-
| [in,out] | out | - GPIO_out instance to initialize |
| [in] | GPIOx | - port to write to |
| [in] | GPIO_Pin | - pin to write to |
| [in] | polarity | - set to GPIO_PIN_RESET if active state is GND, GPIO_PIN_SET if Vdd |
- Returns
- FctERR - Error code