Pulse Counter for counting pulses on an input while the Module is in sleep mode.
More...
|
| MYRIOTA_HARDWARE_API int | PulseCounterInit (uint32_t Limit, uint32_t Options) |
| | Initialise the pulse counter and configure the event generation logic.
|
| |
| MYRIOTA_HARDWARE_API uint64_t | PulseCounterGet (void) |
| | Get the total count of the pulse counter.
|
| |
|
MYRIOTA_HARDWARE_API void | PulseCounterDeinit (void) |
| | Deinitialise the pulse counter.
|
| |
Pulse Counter for counting pulses on an input while the Module is in sleep mode.
◆ PulseCounterOption
Pulse counter bit-wise options.
| Enumerator |
|---|
| PCNT_DEFAULT_OPTIONS | Count on rising edge.
|
| PCNT_EDGE_FALLING | Count on falling edge.
|
| PCNT_DEBOUNCE_DISABLE | Disable hardware debouncing, default enabled for about 160us.
|
| PCNT_PULL_UP | Enable pull-up, default pull-down.
|
◆ PulseCounterInit()
| MYRIOTA_HARDWARE_API int PulseCounterInit |
( |
uint32_t |
Limit, |
|
|
uint32_t |
Options |
|
) |
| |
Initialise the pulse counter and configure the event generation logic.
Event is generated when pulse count hits multiple of Limit.
- Parameters
-
| Limit | The pulse count limit for event generation. Can be set to 0 to 256, or multiple of 256. Set Limit to 0 to disable event generation. |
| Options | Used to configure the pulse counter. See PulseCounterOption for available options. |
- Returns
- 0 if succeeded, -1 if failed.
◆ PulseCounterGet()
| MYRIOTA_HARDWARE_API uint64_t PulseCounterGet |
( |
void |
| ) |
|
Get the total count of the pulse counter.
- Returns
- The total count accumulated since PulseCounterInit() was called.