46typedef GPIO_PinState (*input_get_hw_state)(
digInputs input);
retStatus input_init(digInputs input_name, digitalInputInitData digital_input_init_data)
Digital input initialization function.
Definition: di.c:150
uint8_t input_is_long_press(digInputs input_name)
Checks if the input detected long press.
dioStates input_logical_state_debounced(digInputs input_name)
Return the input debounced logical state.
Definition: di.c:216
retStatus input_ack_action(digInputs input_name, digitalInputActions action)
Acknowledge digital input action.
Definition: di.c:247
dioStates input_state_now(digInputs input_name)
Return the input state read from HW at the moment the function is called.
Definition: di.c:224
struct digitalInputInitData digitalInputInitData
digital input initialization structure
retStatus input_set(uint32_t input, uint16_t data, int32_t value)
Standardized setter function for digital input library.
Definition: di.c:100
__weak GPIO_PinState input_get_hw_HAL(digInputs input_name)
Get HW input state. In case you want to implement it differently (f.e. not using HAL)
Definition: di.c:255
retStatus input_get(uint32_t input, uint16_t data, int32_t *value)
Standardized getter function for digital input library.
Definition: di.c:65
digitalInputSWType
possible input SW types
Definition: di.h:69
@ INPUT_SW_ON_OFF_INPUT
only evaluates logical state and rising/falling edge best used for toggle switches or similar type of...
Definition: di.h:72
@ INPUT_SW_BUTTON
evaluates state and rising/falling edges and also detects three types of button presses best used for...
Definition: di.h:76
digitalInputHWType
possible input HW types
Definition: di.h:60
@ INPUT_HW_ACTIVE_HIGH
for inputs that are active if a voltage is applied to the pin (usually with pulldown resistor)
Definition: di.h:62
@ INPUT_HW_ACTIVE_LOW
for inputs that are activated when pulled to the GND (always with pullup resistor)
Definition: di.h:65
digitalInputDateTypes
digital input data
Definition: di.h:106
@ INPUT_DAT_DOUBLE_PRESS
input double press status read status with input_get, clean only the double press status with input_s...
Definition: di.h:145
@ INPUT_DAT_RISING_EDGE
logical rising edge detected for INPUT_HW_ACTIVE_HIGH this will be set if the input goes from "0" to ...
Definition: di.h:116
@ INPUT_DAT_LONG_PRESS
input long press status read status with input_get, clean only the long press status with input_set a...
Definition: di.h:138
@ INPUT_DAT_CURR
input current logical value (not debounced), reading directly from HW
Definition: di.h:107
@ INPUT_DAT_DEBOUNCED
input debounced logical value
Definition: di.h:108
@ INPUT_DAT_SHORT_PRESS
input short press status read status with input_get, clean only the short press status with input_set...
Definition: di.h:131
@ INPUT_DAT_FALLING_EDGE
logical falling edge detected for INPUT_HW_ACTIVE_HIGH this will be set if the input goes from "1" to...
Definition: di.h:124
uint8_t input_is_short_press(digInputs input_name)
Checks if the input detected short press. After reading out the value, you need to clean the action f...
void input_handle(void)
Handles digital input logic. Call every 1ms.
Definition: di.c:232
retStatus input_get_init_data(digInputs input_name, digitalInputInitData *digital_input_init_data)
Return input initialization data.
Definition: di.c:139
digInputs
Definition: di.h:41
digitalInputActions
possible input actions
Definition: di.h:50
@ INPUT_ACT_DOUBLE_PRESS
two short presses with maximal time between them
Definition: di.h:55
@ INPUT_ACT_FALLING_EDGE
falling edge of the input logical state
Definition: di.h:51
@ INPUT_ACT_SHORT_PRESS
short press (input active for a defined debounced time and release again, no second press follows)
Definition: di.h:53
@ INPUT_ACT_NONE
dummy so we can always have the enum length
Definition: di.h:56
@ INPUT_ACT_RISING_EDGE
rising edge of the input logical state
Definition: di.h:52
@ INPUT_ACT_LONG_PRESS
input is hold active for defined time
Definition: di.h:54
provides HAL includes for different MCU cores
Initialization of digital/analog inputs and outputs.
@ DI_NONE
DUMMY to keep the track of enum length.
Definition: init.h:23
Defines for turning on/off the library modules.
Defines and functions that are useful for all library files.
dioStates
digital input/output states
Definition: utility.h:31
retStatus
possible return values
Definition: utility.h:13