Go to the documentation of this file.
39 #ifdef PREINIT_SUPPORTED
43 #ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49 #include "drv_digital_out.h"
50 #include "drv_digital_in.h"
51 #include "drv_i2c_master.h"
73 #define ACCEL17_REG_ACCEL_CONFIG 0x00
74 #define ACCEL17_REG_ACCEL_X_MSB 0x01
75 #define ACCEL17_REG_ACCEL_X_LSB 0x02
76 #define ACCEL17_REG_ACCEL_Y_MSB 0x03
77 #define ACCEL17_REG_ACCEL_Y_LSB 0x04
95 #define ACCEL17_TOEN_MASK 0x08 // Temperature Out Status
96 #define ACCEL17_TOEN_DISABLE 0x00 // Temperature Out Disable
97 #define ACCEL17_TOEN_ENABLE 0x08 // Temperature Out Enable
98 #define ACCEL17_BGTST_MASK 0x04 // BandGap Test Status
99 #define ACCEL17_BGTST_NORMAL 0x00 // Normal Test
100 #define ACCEL17_BGTST_BANDGAP 0x04 // Bandga Test
101 #define ACCEL17_ST_MASK 0x02 // Self Test Status
102 #define ACCEL17_ST_OFF 0x00 // Self Test Off
103 #define ACCEL17_ST_ON 0x02 // Self Test On
104 #define ACCEL17_PD_MASK 0x01 // Power Status
105 #define ACCEL17_PD_ON 0x00 // Power On
106 #define ACCEL17_PD_DOWN 0x01 // Power Down
112 #define ACCEL17_OFFSET 2048
113 #define ACCEL17_SENSITIVITY 512.0
114 #define ACCEL17_DEGREE_RES 90
121 #define ACCEL17_SET_DEV_ADDR 0x10
139 #define ACCEL17_MAP_MIKROBUS( cfg, mikrobus ) \
140 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
141 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA );
uint32_t i2c_speed
Definition: accel17.h:169
float y
Definition: accel17.h:181
err_t accel17_default_cfg(accel17_t *ctx)
Accel 17 default configuration function.
pin_name_t sda
Definition: accel17.h:167
Accel 17 Click context object.
Definition: accel17.h:151
Accel 17 Click configuration object.
Definition: accel17.h:165
accel17_return_value_t
Accel 17 Click return value data.
Definition: accel17.h:190
float x
Definition: accel17.h:180
err_t accel17_init(accel17_t *ctx, accel17_cfg_t *cfg)
Accel 17 initialization function.
@ ACCEL17_OK
Definition: accel17.h:191
@ ACCEL17_ERROR
Definition: accel17.h:192
i2c_master_t i2c
Definition: accel17.h:153
uint8_t slave_address
Definition: accel17.h:156
uint8_t i2c_address
Definition: accel17.h:170
Accel 17 Click axes data.
Definition: accel17.h:179
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:166
err_t accel17_generic_read(accel17_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
Accel 17 I2C reading function.