#infdef SENSOR_H #define SENSOR_H #include #ifdef __cplusplus extern "C" { #endif typedef struct { uint8_t lower; uint8_t upper; adc_t line; adc_res_t res; } sensor_params_t; typedef struct { sensor_params_t p; } sensor_t /** * @brief Initializes the sensor * * @param[in] dev device settings struct * @param[in] params settings for parameters */ int sensor_init(sensor_t *dev, const sensor_params_t *params); /** * @brief Read data from the sensor and checks the value is between given thresholds * * @param[in] dev device settings struct * @param[out] data boolean that is true when sensor value is within thresholds. */ int sensor_read(sensor_t *dev, bool *data); #ifdef __cplusplus } #endif #endif /* SENSOR_H */