Functions | |
s32 | MIOS32_SRIO_Init (u32 mode) |
u8 | MIOS32_SRIO_ScanNumGet (void) |
s32 | MIOS32_SRIO_ScanNumSet (u8 new_num_sr) |
s32 | MIOS32_SRIO_DoutPageGet (void) |
u32 | MIOS32_SRIO_DebounceGet (void) |
s32 | MIOS32_SRIO_DebounceSet (u8 _debounce_time) |
s32 | MIOS32_SRIO_DebounceStart (void) |
s32 | MIOS32_SRIO_ScanStart (void *_notify_hook) |
Variables | |
volatile u8 | mios32_srio_dout [MIOS32_SRIO_NUM_DOUT_PAGES][MIOS32_SRIO_NUM_SR] |
volatile u8 | mios32_srio_din [MIOS32_SRIO_NUM_SR] |
volatile u8 | mios32_srio_din_buffer [MIOS32_SRIO_NUM_SR] |
volatile u8 | mios32_srio_din_changed [MIOS32_SRIO_NUM_SR] |
SRIO Driver for MIOS32
u32 MIOS32_SRIO_DebounceGet | ( | void | ) |
Returns the debounce counter reload value of the DIN SR registers
Sets the debounce counter reload value for the DIN SR registers which are not assigned to rotary encoders (or other drivers which get use of MIOS32_DIN_SRChangedGetAndClear()) to debounce low-quality buttons.
Debouncing is realized in the following way: on every button movement the debounce preload value will be loaded into the debounce counter register. The counter will be decremented on every SRIO update cycle (usually 1 mS) As long as this counter isn't zero, button changes will still be recorded, but they won't trigger the APP_DIN_NotifyToggle hook.
No (intended) button movement will get lost, but the latency will be increased. Example: if the update frequency is set to 1 mS, and the debounce value to 32, the first button movement will be regognized with a worst-case latency of 1 mS. Every additional button movement which happens within 32 mS will be regognized within a worst-case latency of 32 mS. After the debounce time has passed, the worst-case latency is 1 mS again.
This function affects all DIN registers. If the application should record pin changes from digital sensors which are switching very fast, then debouncing should be ommited.
[in] | debounce_time | delay in mS (1..255) 0 disables debouncing (default) |
s32 MIOS32_SRIO_DebounceStart | ( | void | ) |
Internally used function to start the debounce delay after a button has been moved.
This function is used by MIOS32_DIN_Handler(), there is no need to use it in a common application.
s32 MIOS32_SRIO_DoutPageGet | ( | void | ) |
Initializes SPI pins and peripheral
[in] | mode | currently only mode 0 supported |
u8 MIOS32_SRIO_ScanNumGet | ( | void | ) |
Returns the number of SRs which will be scanned by the SRIO driver
Allows to change the number of SRs which will be scanned by the SRIO driver during runtime.
[in] | new_num_sr | must be lower or equal MIOS32_SRIO_NUM_SR |
s32 MIOS32_SRIO_ScanStart | ( | void * | _notify_hook | ) |
(Re-)Starts the SPI IRQ Handler which scans the SRIO chain
[in] | _notify_hook | notification function which will be called after the scan has been finished (all DOUT registers written, all DIN registers read) use NULL if no function should be called |
volatile u8 mios32_srio_din[MIOS32_SRIO_NUM_SR] |
volatile u8 mios32_srio_din_buffer[MIOS32_SRIO_NUM_SR] |
volatile u8 mios32_srio_din_changed[MIOS32_SRIO_NUM_SR] |
volatile u8 mios32_srio_dout[MIOS32_SRIO_NUM_DOUT_PAGES][MIOS32_SRIO_NUM_SR] |