Logic input handling.
More...
#include "sarmfsw.h"
Logic input handling.
- Author
- SMFSW
- Copyright
- MIT (c) 2017-2024, SMFSW
◆ Logic_in
typedef struct Logic_in Logic_in |
◆ get_Logic_in()
bool get_Logic_in |
( |
const Logic_in *const | in | ) |
|
|
inline |
Get Logic_in input value.
- Parameters
-
- Returns
- Input value
◆ get_Logic_in_edge()
bool get_Logic_in_edge |
( |
const Logic_in *const | in | ) |
|
|
inline |
Get Logic_in input edge.
- Parameters
-
- Returns
- Input edge
◆ Logic_in_handler()
void Logic_in_handler |
( |
Logic_in *const | in | ) |
|
Handles Logic_in read and treatment.
- Parameters
-
[in,out] | in | - input instance to handle |
◆ Logic_in_init()
void Logic_in_init |
( |
Logic_in *const | in, |
|
|
GPIO_PinState(* | getter )(const Logic_in *const), |
|
|
uint32_t *const | addr, |
|
|
const uint32_t | pos, |
|
|
const GPIO_PinState | polarity, |
|
|
const uint16_t | filter, |
|
|
void(* | onSet )(const Logic_in *const), |
|
|
void(* | onReset )(const Logic_in *const), |
|
|
const bool | repeat ) |
Initialize Logic_in instance.
- Parameters
-
[in,out] | in | - input instance to initialize |
[in] | getter | - Pointer to variable getter function (may be NULL: default behavior for handling RAM variable at address addr) |
[in] | addr | - Variable address to read from (pointer to unsigned 32b, may be NULL if getter handles everything) |
[in] | pos | - monitored bit position (may be unused if getter function is used) |
[in] | polarity | - active state |
[in] | filter | - input filtering time |
[in] | onSet | - Pointer to callback ON function |
[in] | onReset | - Pointer to callback OFF function |
[in] | repeat | - To repeat callback ON as long as input is set |