LOGGER
Logger
Data Logging using ESP8266
|
#include "basetype.h"
Go to the source code of this file.
Macros | |
#define | MAX_PULSE_COUNTS 2 |
< version of this module More... | |
Functions | |
void | pincounterInit () |
Initialize the counting services, call once at system startup. | |
void | pincounterDump () |
Dump the status of the pin counting routines. | |
uint32_t | pincounterPulses (uint8_t *unused, uint8_t pinID) |
void | pincounterSetPulsesSinceBoot (uint8_t pinID, uint32_t pulses, uint8_t sensorID) |
uint32_t | pincounterFrequency (uint8_t *, uint8_t pinID) |
void | pincounterCountPulse (uint8_t pulseID) |
Services associated with counting the number of times a pin transitions.
#define MAX_PULSE_COUNTS 2 |
< version of this module
Maximum pulse counts that can be stored.
void pincounterCountPulse | ( | uint8_t | pulseID | ) |
Routine to call when a pin has transitioned to low. It is safe to call this from an ISR, but, typically it is called from code that polls sensor devices at a higher level.
pulseID | pulse ID is used as a table index |
uint32_t pincounterFrequency | ( | uint8_t * | , |
uint8_t | pinID | ||
) |
Report the frequency in thousands of pulses per minute that the counter is observing. There is some smoothing of the frequency by averaging over multiple counts.
The first parameter is to make the call compatible with sensor reading
pinID | ID of pin to read |
uint32_t pincounterPulses | ( | uint8_t * | unused, |
uint8_t | pinID | ||
) |
Report the number of pulses seen. Pulses are counted at each falling edge.
unused | to make the call compatible with sensor reading |
pinID | ID of pin to read |
void pincounterSetPulsesSinceBoot | ( | uint8_t | pinID, |
uint32_t | pulses, | ||
uint8_t | sensorID | ||
) |
Set the number of pulses seen since boot.
pinID | ID of pin to set count for |
pulses | pulses since boot for the pin |
sensorID | sensor that detects these pulses |