earthquake 2.0.0.0
earthquake.h File Reference

This file contains API for Earthquake Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  earthquake_t
 Click ctx object definition. More...
 
struct  earthquake_cfg_t
 Click configuration structure definition. More...
 

Macros

#define EARTHQUAKE_MAP_MIKROBUS(cfg, mikrobus)
 
#define EARTHQUAKE_STANDBY_MODE   0
 
#define EARTHQUAKE_NORMAL_MODE   1
 
#define EARTHQUAKE_INIT_INST   2
 
#define EARTHQUAKE_OFFSET_ACQ   3
 
#define EARTHQUAKE_SELF_DIAGNOSTIC   4
 
#define EARTHQUAKE_RETVAL   uint8_t
 
#define EARTHQUAKE_OK   0x00
 
#define EARTHQUAKE_INIT_ERROR   0xFF
 
#define EARTHQUAKE_I2C_ADDRESS   0x55
 
#define EARTHQUAKE_CLICK_ERR   0xFF
 
#define EARTHQUAKE_CLICK_OK   0x00
 
#define EARTHQUAKE_STATE   0x1000
 
#define EARTHQUAKE_AXIS_STATE   0x1001
 
#define EARTHQUAKE_EVENT   0x1002
 
#define EARTHQUAKE_MODE   0x1003
 
#define EARTHQUAKE_CTRL   0x1004
 
#define EARTHQUAKE_CLEAR_COMMAND   0x1005
 
#define EARTHQUAKE_MAIN_SI_H   0x2000
 
#define EARTHQUAKE_MAIN_SI_L   0x2001
 
#define EARTHQUAKE_MAIN_PGA_H   0x2002
 
#define EARTHQUAKE_MAIN_PGA_L   0x2003
 
#define EARTHQUAKE_N1_MAIN_OFFSET_X_H   0x3000
 
#define EARTHQUAKE_N1_MAIN_OFFSET_X_L   0x3001
 
#define EARTHQUAKE_N1_MAIN_OFFSET_Y_H   0x3002
 
#define EARTHQUAKE_N1_MAIN_OFFSET_Y_L   0x3003
 
#define EARTHQUAKE_N1_MAIN_OFFSET_Z_H   0x3004
 
#define EARTHQUAKE_N1_MAIN_OFFSET_Z_L   0x3005
 
#define EARTHQUAKE_N1_MAIN_T_AVE_H   0x3006
 
#define EARTHQUAKE_N1_MAIN_T_AVE_L   0x3007
 
#define EARTHQUAKE_N1_MAIN_SI_H   0x3008
 
#define EARTHQUAKE_N1_MAIN_SI_L   0x3009
 
#define EARTHQUAKE_N1_MAIN_PGA_H   0x300A
 
#define EARTHQUAKE_N1_MAIN_PGA_L   0x300B
 
#define EARTHQUAKE_N2_MAIN_OFFSET_X_H   0x3100
 
#define EARTHQUAKE_N2_MAIN_OFFSET_X_L   0x3101
 
#define EARTHQUAKE_N2_MAIN_OFFSET_Y_H   0x3102
 
#define EARTHQUAKE_N2_MAIN_OFFSET_Y_L   0x3103
 
#define EARTHQUAKE_N2_MAIN_OFFSET_Z_H   0x3104
 
#define EARTHQUAKE_N2_MAIN_OFFSET_Z_L   0x3105
 
#define EARTHQUAKE_N2_MAIN_T_AVE_H   0x3106
 
#define EARTHQUAKE_N2_MAIN_T_AVE_L   0x3107
 
#define EARTHQUAKE_N2_MAIN_SI_H   0x3108
 
#define EARTHQUAKE_N2_MAIN_SI_L   0x3109
 
#define EARTHQUAKE_N2_MAIN_PGA_H   0x310A
 
#define EARTHQUAKE_N2_MAIN_PGA_L   0x310B
 
#define EARTHQUAKE_N3_MAIN_OFFSET_X_H   0x3200
 
#define EARTHQUAKE_N3_MAIN_OFFSET_X_L   0x3201
 
#define EARTHQUAKE_N3_MAIN_OFFSET_Y_H   0x3202
 
#define EARTHQUAKE_N3_MAIN_OFFSET_Y_L   0x3203
 
#define EARTHQUAKE_N3_MAIN_OFFSET_Z_H   0x3204
 
#define EARTHQUAKE_N3_MAIN_OFFSET_Z_L   0x3205
 
#define EARTHQUAKE_N3_MAIN_T_AVE_H   0x3206
 
#define EARTHQUAKE_N3_MAIN_T_AVE_L   0x3207
 
#define EARTHQUAKE_N3_MAIN_SI_H   0x3208
 
#define EARTHQUAKE_N3_MAIN_SI_L   0x3209
 
#define EARTHQUAKE_N3_MAIN_PGA_H   0x320A
 
#define EARTHQUAKE_N3_MAIN_PGA_L   0x320B
 
#define EARTHQUAKE_N4_MAIN_OFFSET_X_H   0x3300
 
#define EARTHQUAKE_N4_MAIN_OFFSET_X_L   0x3301
 
#define EARTHQUAKE_N4_MAIN_OFFSET_Y_H   0x3302
 
#define EARTHQUAKE_N4_MAIN_OFFSET_Y_L   0x3303
 
#define EARTHQUAKE_N4_MAIN_OFFSET_Z_H   0x3304
 
#define EARTHQUAKE_N4_MAIN_OFFSET_Z_L   0x3305
 
#define EARTHQUAKE_N4_MAIN_T_AVE_H   0x3306
 
#define EARTHQUAKE_N4_MAIN_T_AVE_L   0x3307
 
#define EARTHQUAKE_N4_MAIN_SI_H   0x3308
 
#define EARTHQUAKE_N4_MAIN_SI_L   0x3309
 
#define EARTHQUAKE_N4_MAIN_PGA_H   0x330A
 
#define EARTHQUAKE_N4_MAIN_PGA_L   0x330B
 
#define EARTHQUAKE_N5_MAIN_OFFSET_X_H   0x3400
 
#define EARTHQUAKE_N5_MAIN_OFFSET_X_L   0x3401
 
#define EARTHQUAKE_N5_MAIN_OFFSET_Y_H   0x3402
 
#define EARTHQUAKE_N5_MAIN_OFFSET_Y_L   0x3403
 
#define EARTHQUAKE_N5_MAIN_OFFSET_Z_H   0x3404
 
#define EARTHQUAKE_N5_MAIN_OFFSET_Z_L   0x3405
 
#define EARTHQUAKE_N5_MAIN_T_AVE_H   0x3406
 
#define EARTHQUAKE_N5_MAIN_T_AVE_L   0x3407
 
#define EARTHQUAKE_N5_MAIN_SI_H   0x3408
 
#define EARTHQUAKE_N5_MAIN_SI_L   0x3409
 
#define EARTHQUAKE_N5_MAIN_PGA_H   0x340A
 
#define EARTHQUAKE_N5_MAIN_PGA_L   0x340B
 
#define EARTHQUAKE_M1_MAIN_OFFSET_X_H   0x3500
 
#define EARTHQUAKE_M1_MAIN_OFFSET_X_L   0x3501
 
#define EARTHQUAKE_M1_MAIN_OFFSET_Y_H   0x3502
 
#define EARTHQUAKE_M1_MAIN_OFFSET_Y_L   0x3503
 
#define EARTHQUAKE_M1_MAIN_OFFSET_Z_H   0x3504
 
#define EARTHQUAKE_M1_MAIN_OFFSET_Z_L   0x3505
 
#define EARTHQUAKE_M1_MAIN_T_AVE_H   0x3506
 
#define EARTHQUAKE_M1_MAIN_T_AVE_L   0x3507
 
#define EARTHQUAKE_M1_MAIN_SI_H   0x3508
 
#define EARTHQUAKE_M1_MAIN_SI_L   0x3509
 
#define EARTHQUAKE_M1_MAIN_PGA_H   0x350A
 
#define EARTHQUAKE_M1_MAIN_PGA_L   0x350B
 
#define EARTHQUAKE_M2_MAIN_OFFSET_X_H   0x3600
 
#define EARTHQUAKE_M2_MAIN_OFFSET_X_L   0x3601
 
#define EARTHQUAKE_M2_MAIN_OFFSET_Y_H   0x3602
 
#define EARTHQUAKE_M2_MAIN_OFFSET_Y_L   0x3603
 
#define EARTHQUAKE_M2_MAIN_OFFSET_Z_H   0x3604
 
#define EARTHQUAKE_M2_MAIN_OFFSET_Z_L   0x3605
 
#define EARTHQUAKE_M2_MAIN_T_AVE_H   0x3606
 
#define EARTHQUAKE_M2_MAIN_T_AVE_L   0x3607
 
#define EARTHQUAKE_M2_MAIN_SI_H   0x3608
 
#define EARTHQUAKE_M2_MAIN_SI_L   0x3609
 
#define EARTHQUAKE_M2_MAIN_PGA_H   0x360A
 
#define EARTHQUAKE_M2_MAIN_PGA_L   0x360B
 
#define EARTHQUAKE_M3_MAIN_OFFSET_X_H   0x3700
 
#define EARTHQUAKE_M3_MAIN_OFFSET_X_L   0x3701
 
#define EARTHQUAKE_M3_MAIN_OFFSET_Y_H   0x3702
 
#define EARTHQUAKE_M3_MAIN_OFFSET_Y_L   0x3703
 
#define EARTHQUAKE_M3_MAIN_OFFSET_Z_H   0x3704
 
#define EARTHQUAKE_M3_MAIN_OFFSET_Z_L   0x3705
 
#define EARTHQUAKE_M3_MAIN_T_AVE_H   0x3706
 
#define EARTHQUAKE_M3_MAIN_T_AVE_L   0x3707
 
#define EARTHQUAKE_M3_MAIN_SI_H   0x3708
 
#define EARTHQUAKE_M3_MAIN_SI_L   0x3709
 
#define EARTHQUAKE_M3_MAIN_PGA_H   0x370A
 
#define EARTHQUAKE_M3_MAIN_PGA_L   0x370B
 
#define EARTHQUAKE_M4_MAIN_OFFSET_X_H   0x3800
 
#define EARTHQUAKE_M4_MAIN_OFFSET_X_L   0x3801
 
#define EARTHQUAKE_M4_MAIN_OFFSET_Y_H   0x3802
 
#define EARTHQUAKE_M4_MAIN_OFFSET_Y_L   0x3803
 
#define EARTHQUAKE_M4_MAIN_OFFSET_Z_H   0x3804
 
#define EARTHQUAKE_M4_MAIN_OFFSET_Z_L   0x3805
 
#define EARTHQUAKE_M4_MAIN_T_AVE_H   0x3806
 
#define EARTHQUAKE_M4_MAIN_T_AVE_L   0x3807
 
#define EARTHQUAKE_M4_MAIN_SI_H   0x3808
 
#define EARTHQUAKE_M4_MAIN_SI_L   0x3809
 
#define EARTHQUAKE_M4_MAIN_PGA_H   0x380A
 
#define EARTHQUAKE_M4_MAIN_PGA_L   0x380B
 
#define EARTHQUAKE_M5_MAIN_OFFSET_X_H   0x3900
 
#define EARTHQUAKE_M5_MAIN_OFFSET_X_L   0x3901
 
#define EARTHQUAKE_M5_MAIN_OFFSET_Y_H   0x3902
 
#define EARTHQUAKE_M5_MAIN_OFFSET_Y_L   0x3903
 
#define EARTHQUAKE_M5_MAIN_OFFSET_Z_H   0x3904
 
#define EARTHQUAKE_M5_MAIN_OFFSET_Z_L   0x3905
 
#define EARTHQUAKE_M5_MAIN_T_AVE_H   0x3906
 
#define EARTHQUAKE_M5_MAIN_T_AVE_L   0x3907
 
#define EARTHQUAKE_M5_MAIN_SI_H   0x3908
 
#define EARTHQUAKE_M5_MAIN_SI_L   0x3909
 
#define EARTHQUAKE_M5_MAIN_PGA_H   0x390A
 
#define EARTHQUAKE_M5_MAIN_PGA_L   0x390B
 
#define EARTHQUAKE_OFFSET_SET_X_H   0x4000
 
#define EARTHQUAKE_OFFSET_SET_X_L   0x4001
 
#define EARTHQUAKE_OFFSET_SET_Y_H   0x4002
 
#define EARTHQUAKE_OFFSET_SET_Y_L   0x4003
 
#define EARTHQUAKE_OFFSET_SET_Z_H   0x4004
 
#define EARTHQUAKE_OFFSET_SET_Z_L   0x4005
 
#define EARTHQUAKE_OFFSET_SET_T_AVE_H   0x4006
 
#define EARTHQUAKE_OFFSET_SET_T_AVE_L   0x4007
 
#define EARTHQUAKE_OFFSET_SET_MAX_X_H   0x4008
 
#define EARTHQUAKE_OFFSET_SET_MAX_X_L   0x4009
 
#define EARTHQUAKE_OFFSET_SET_MAX_Y_H   0x400A
 
#define EARTHQUAKE_OFFSET_SET_MAX_Y_L   0x400B
 
#define EARTHQUAKE_OFFSET_SET_MAX_Z_H   0x400C
 
#define EARTHQUAKE_OFFSET_SET_MAX_Z_L   0x400D
 
#define EARTHQUAKE_OFFSET_SET_MIN_X_H   0x400E
 
#define EARTHQUAKE_OFFSET_SET_MIN_X_L   0x400F
 
#define EARTHQUAKE_OFFSET_SET_MIN_Y_H   0x4010
 
#define EARTHQUAKE_OFFSET_SET_MIN_Y_L   0x4011
 
#define EARTHQUAKE_OFFSET_SET_MIN_Z_H   0x4012
 
#define EARTHQUAKE_OFFSET_SET_MIN_Z_L   0x4013
 
#define EARTHQUAKE_OFFSET_SET_AXIS   0x4014
 
#define EARTHQUAKE_OFFSET_RECENT_X_H   0x4100
 
#define EARTHQUAKE_OFFSET_RECENT_X_L   0x4101
 
#define EARTHQUAKE_OFFSET_RECENT_Y_H   0x4102
 
#define EARTHQUAKE_OFFSET_RECENT_Y_L   0x4103
 
#define EARTHQUAKE_OFFSET_RECENT_Z_H   0x4104
 
#define EARTHQUAKE_OFFSET_RECENT_Z_L   0x4105
 
#define EARTHQUAKE_OFFSET_RECENT_T_AVE_H   0x4106
 
#define EARTHQUAKE_OFFSET_RECENT_T_AVE_L   0x4107
 
#define EARTHQUAKE_OFFSET_RECENT_MAX_X_H   0x4108
 
#define EARTHQUAKE_OFFSET_RECENT_MAX_X_L   0x4109
 
#define EARTHQUAKE_OFFSET_RECENT_MAX_Y_H   0x410A
 
#define EARTHQUAKE_OFFSET_RECENT_MAX_Y_L   0x410B
 
#define EARTHQUAKE_OFFSET_RECENT_MAX_Z_H   0x410C
 
#define EARTHQUAKE_OFFSET_RECENT_MAX_Z_L   0x410D
 
#define EARTHQUAKE_OFFSET_RECENT_MIN_X_H   0x410E
 
#define EARTHQUAKE_OFFSET_RECENT_MIN_X_L   0x410F
 
#define EARTHQUAKE_OFFSET_RECENT_MIN_Y_H   0x4110
 
#define EARTHQUAKE_OFFSET_RECENT_MIN_Y_L   0x4111
 
#define EARTHQUAKE_OFFSET_RECENT_MIN_Z_H   0x4112
 
#define EARTHQUAKE_OFFSET_RECENT_MIN_Z_L   0x4113
 
#define EARTHQUAKE_OFFSET_RECENT_STATE   0x4114
 
#define EARTHQUAKE_SELFTEST_BEFORE_X_H   0x4200
 
#define EARTHQUAKE_SELFTEST_BEFORE_X_L   0x4201
 
#define EARTHQUAKE_SELFTEST_AFTER_X_H   0x4202
 
#define EARTHQUAKE_SELFTEST_AFTER_X_L   0x4203
 
#define EARTHQUAKE_SELFTEST_BEFORE_Y_H   0x4204
 
#define EARTHQUAKE_SELFTEST_BEFORE_Y_L   0x4205
 
#define EARTHQUAKE_SELFTEST_AFTER_Y_H   0x4206
 
#define EARTHQUAKE_SELFTEST_AFTER_Y_L   0x4207
 
#define EARTHQUAKE_SELFTEST_BEFORE_Z_H   0x4208
 
#define EARTHQUAKE_SELFTEST_BEFORE_Z_L   0x4209
 
#define EARTHQUAKE_SELFTEST_AFTER_Z_H   0x420A
 
#define EARTHQUAKE_SELFTEST_AFTER_Z_L   0x420B
 
#define EARTHQUAKE_SELFTEST_T_AVE_H   0x420C
 
#define EARTHQUAKE_SELFTEST_T_AVE_L   0x420D
 
#define EARTHQUAKE_SELFTEST_ERROR   0x420E
 

Functions

void earthquake_cfg_setup (earthquake_cfg_t *cfg)
 Config Object Initialization function.
 
EARTHQUAKE_RETVAL earthquake_init (earthquake_t *ctx, earthquake_cfg_t *cfg)
 Initialization function.
 
void earthquake_generic_write (earthquake_t *ctx, uint16_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void earthquake_generic_read (earthquake_t *ctx, uint16_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t earthquake_proc_notify (earthquake_t *ctx)
 Shutoff output function.
 
uint8_t earthquake_shutoff_output (earthquake_t *ctx)
 Shutoff output function.
 
uint8_t earthquake_read_status (earthquake_t *ctx)
 Read status function.
 
uint16_t earthquake_read_si (earthquake_t *ctx)
 Read SI function.
 
void earthquake_clear_memory (earthquake_t *ctx)
 Clear Memory function.
 

Detailed Description

This file contains API for Earthquake Click driver.