63#ifndef CONFIG_SM_PWM_01C_SAMPLE_TIME
64#define CONFIG_SM_PWM_01C_SAMPLE_TIME (100 * US_PER_MS)
72#ifndef CONFIG_SM_PWM_01C_WINDOW_TIME
73#define CONFIG_SM_PWM_01C_WINDOW_TIME (10 * US_PER_SEC)
76#if defined(MODULE_SM_PWM_01C_MA) || defined(DOXYGEN)
82#define SM_PWM_01C_BUFFER_LEN (CONFIG_SM_PWM_01C_WINDOW_TIME / \
83 CONFIG_SM_PWM_01C_SAMPLE_TIME)
95#ifndef CONFIG_SM_PWM_01C_EXP_WEIGHT
96#define CONFIG_SM_PWM_01C_EXP_WEIGHT (5)
102#if defined(MODULE_SM_PWM_01C_MA) || defined(DOXYGEN)
147#ifdef MODULE_SM_PWM_01C_MA
Low-level GPIO peripheral driver interface definitions.
#define SM_PWM_01C_BUFFER_LEN
Length in time of the measuring window.
void sm_pwm_01c_read_data(sm_pwm_01c_t *dev, sm_pwm_01c_data_t *data)
Reads particle concentration values.
void sm_pwm_01c_start(sm_pwm_01c_t *dev)
Start continuous measurement of Large and Small particle concentrations.
int sm_pwm_01c_init(sm_pwm_01c_t *dev, const sm_pwm_01c_params_t *params)
Initialize the given SM_PWM_01C device.
void sm_pwm_01c_stop(sm_pwm_01c_t *dev)
Stops continuous measurement of Large and Small particle concentration.
Adds include for missing inttype definitions.
Circular buffer holding moving average values.
size_t head
current buffer head
LPO and concentration (ug/m3) values for small and large particles.
uint16_t mc_pm_10
Large particle concentration ug/m3.
uint16_t mc_pm_2p5
Small particle concentration ug/m3.
Parameters for the SM_PWM_01c sensor.
gpio_t tlp_pin
Low Pulse Signal Output (P2) of large Particle, active low, PM10 equivalent.
gpio_t tsp_pin
Low Pulse Signal Output (P1) of small Particle, active low, PM2.5 equivalent.
Device descriptor for the SM_PWM_01c sensor.
sm_pwm_01c_values_t _values
Internal data to calculate concentration from tsl/tsp low Pulse Output Occupancy.
sm_pwm_01c_params_t params
Device driver parameters.
ztimer_t _sampler
internal sampling timer
LPO and concentration (ug/m3) values for small and large particles.
uint32_t tsp_lpo
Small particle low Pulse active time us.
uint32_t tlp_start_time
Last time tlp pin went low.
sm_pwm_01c_data_t data
Current value for the exponentially averaged particle concentration values.
uint32_t tsp_start_time
Last time tsp pin went low.
uint32_t tlp_lpo
Large Particle low Pulse active time us.
Utility library for comparing and computing timestamps.