38 lines
1002 B
C
38 lines
1002 B
C
#ifndef IMS_AS3935_H
|
|
#define IMS_AS3935_H
|
|
|
|
#include "imsensors/common/sensors_common.h"
|
|
|
|
typedef enum {
|
|
IMS_AS3935_MODE_ACTIVE = 0U,
|
|
IMS_AS3935_MODE_POWER_DOWN = 1U,
|
|
} ims_as3935_mode_t;
|
|
|
|
typedef enum {
|
|
IMS_AS3935_AFE_INDOOR = 0x12U,
|
|
IMS_AS3935_AFE_OUTDOOR = 0x0EU,
|
|
} ims_as3935_afe_mode_t;
|
|
|
|
typedef enum {
|
|
IMS_AS3935_IRQ_TYPE_NH = 0x01U, /* Noise level too high */
|
|
IMS_AS3935_IRQ_TYPE_D = 0x04U, /* Disturber detected */
|
|
IMS_AS3935_IRQ_TYPE_L = 0x08U, /* Lightning detected */
|
|
} ims_as3935_irq_type_t;
|
|
|
|
typedef struct {
|
|
ims_i2c_xfer_t i2c_xfer;
|
|
ims_delay_t delay;
|
|
} ims_as3935_cb_t;
|
|
|
|
typedef struct {
|
|
void *pdev;
|
|
ims_as3935_cb_t cb;
|
|
} ims_as3935_t;
|
|
|
|
ims_ret_t ims_as3935_init(ims_as3935_t *ltn);
|
|
ims_ret_t ims_as3935_get_noise_floor(ims_as3935_t *ltn, uint8_t *nf);
|
|
ims_ret_t ims_as3935_set_noise_floor(ims_as3935_t *ltn, uint8_t nf);
|
|
ims_ret_t ims_as3935_get_irq_status(ims_as3935_t *ltn, uint8_t *irq_status);
|
|
|
|
#endif // IMS_AS3935_H
|