Go to the documentation of this file.
35 #include "drv_digital_out.h"
36 #include "drv_digital_in.h"
37 #include "drv_i2c_master.h"
59 #define ACCEL17_REG_ACCEL_CONFIG 0x00
60 #define ACCEL17_REG_ACCEL_X_MSB 0x01
61 #define ACCEL17_REG_ACCEL_X_LSB 0x02
62 #define ACCEL17_REG_ACCEL_Y_MSB 0x03
63 #define ACCEL17_REG_ACCEL_Y_LSB 0x04
81 #define ACCEL17_TOEN_MASK 0x08 // Temperature Out Status
82 #define ACCEL17_TOEN_DISABLE 0x00 // Temperature Out Disable
83 #define ACCEL17_TOEN_ENABLE 0x08 // Temperature Out Enable
84 #define ACCEL17_BGTST_MASK 0x04 // BandGap Test Status
85 #define ACCEL17_BGTST_NORMAL 0x00 // Normal Test
86 #define ACCEL17_BGTST_BANDGAP 0x04 // Bandga Test
87 #define ACCEL17_ST_MASK 0x02 // Self Test Status
88 #define ACCEL17_ST_OFF 0x00 // Self Test Off
89 #define ACCEL17_ST_ON 0x02 // Self Test On
90 #define ACCEL17_PD_MASK 0x01 // Power Status
91 #define ACCEL17_PD_ON 0x00 // Power On
92 #define ACCEL17_PD_DOWN 0x01 // Power Down
98 #define ACCEL17_OFFSET 2048
99 #define ACCEL17_SENSITIVITY 512.0
100 #define ACCEL17_DEGREE_RES 90
107 #define ACCEL17_SET_DEV_ADDR 0x10
125 #define ACCEL17_MAP_MIKROBUS( cfg, mikrobus ) \
126 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
127 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA );
uint32_t i2c_speed
Definition: accel17.h:155
float y
Definition: accel17.h:167
err_t accel17_default_cfg(accel17_t *ctx)
Accel 17 default configuration function.
pin_name_t sda
Definition: accel17.h:153
Accel 17 Click context object.
Definition: accel17.h:137
Accel 17 Click configuration object.
Definition: accel17.h:151
accel17_return_value_t
Accel 17 Click return value data.
Definition: accel17.h:176
float x
Definition: accel17.h:166
err_t accel17_init(accel17_t *ctx, accel17_cfg_t *cfg)
Accel 17 initialization function.
@ ACCEL17_OK
Definition: accel17.h:177
@ ACCEL17_ERROR
Definition: accel17.h:178
i2c_master_t i2c
Definition: accel17.h:139
uint8_t slave_address
Definition: accel17.h:142
uint8_t i2c_address
Definition: accel17.h:156
Accel 17 Click axes data.
Definition: accel17.h:165
void accel17_cfg_setup(accel17_cfg_t *cfg)
Accel 17 configuration object setup function.
err_t accel17_generic_write(accel17_t *ctx, uint8_t reg, uint8_t tx_data)
Accel 17 I2C writing function.
err_t accel17_get_axes_data(accel17_t *ctx, accel17_axes_t *axes)
Accel data reading.
pin_name_t scl
Definition: accel17.h:152
err_t accel17_generic_read(accel17_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
Accel 17 I2C reading function.