In Pulse Based Mode you can specify the threshold number of pulses. Pulses will be counted until the user-defined threshold number is reached. Then counting starts again from 0 and the counter sends an event to the user application.
The pulse counter registers the number of detected pulses and the elapsed time. You can suspend time and pulse counting, resume or reset it at any time.
As opposed to Time Based Mode, in Pulse Based Mode you specify the threshold number of pulses. Pulses will be counted until the number of pulses reaches this user-defined value. You can also retrieve this threshold number, as well as the elapsed time and the number of detected pulses.
To configure pulse counter settings, send GPIO_SET_PLS_CNT_CFG command. The Pulse Based Mode can be selected in Bits 7..4: PLS_CNT_MODE of Byte 3. In Bytes 5..7: LIMIT you can specify the threshold number of pulses. This value is specified in the range from 1 to 16,777,215.
If you want to receive GPIO_EV_PLS_CNT event, when threshold number of pulses is reached, specify 1 in Bit 2: EV_MATCH of Byte 3. The event will return the elapsed time.
You may also configure the pulse counter to send events periodically. The repeat interval is specified in Byte 4: REPEAT in units of 10 ms. The event will return the number of detected pulses.
For more detailed information about the GPIO_EV_PLS_CNT event see Section 11.2, “Pulse Counter Event”.
You can suspend pulse counting by GPIO_SUSPEND_PLS_CNT command. This command suspends both time counting and pulse counting. If a pulse counter is suspended, it will not run until you send the GPIO_RESUME_PLS_CNT command.
You can reset the time count or pulse count with GPIO_RESET_PLS_CNT command. To change the defined threshold number, send GPIO_SET_PLS_CNT_LIMIT command (make sure that GPIO_PLS_CNT_VAL_PULSES (0) value is specified in Byte 3: LIMIT_TYPE of this command). To retrieve this threshold number, use GPIO_GET_PLS_CNT_LIMIT command.
You can retrieve current number of pulses and timer readings with GPIO_GET_PLS_CNT_VAL command. To retrieve the pulse counter configuration settings, send GPIO_GET_PLS_CNT_CFG command.