22 lines
368 B
C
22 lines
368 B
C
#ifndef _LORA32_H__
|
|
#define _LORA32_H__
|
|
|
|
typedef struct {
|
|
float K;
|
|
float offset_voltage;
|
|
int8_t pin_led;
|
|
adc1_channel_t adc_channel;
|
|
adc_unit_t adc_unit;
|
|
} gp2y_cfg_t;
|
|
|
|
#define GP2Y_DEFAULT_CFG {\
|
|
.K = 0.5,\
|
|
.offset_voltage = 0.6,\
|
|
.pin_led = -1,\
|
|
.adc_channel = -1\
|
|
}
|
|
|
|
int32_t gp2y_read(gp2y_cfg_t *cfg, uint8_t samples);
|
|
|
|
#endif // _ESP32_GP2Y_H__
|