smartdof2  2.1.0.0
smartdof2.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2020 MikroElektronika d.o.o.
3 ** Contact: https://www.mikroe.com/contact
4 **
5 ** Permission is hereby granted, free of charge, to any person obtaining a copy
6 ** of this software and associated documentation files (the "Software"), to deal
7 ** in the Software without restriction, including without limitation the rights
8 ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 ** copies of the Software, and to permit persons to whom the Software is
10 ** furnished to do so, subject to the following conditions:
11 ** The above copyright notice and this permission notice shall be
12 ** included in all copies or substantial portions of the Software.
13 **
14 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
16 ** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 ** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
19 ** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 ** USE OR OTHER DEALINGS IN THE SOFTWARE.
21 ****************************************************************************/
22 
28 #ifndef SMARTDOF2_H
29 #define SMARTDOF2_H
30 
31 #ifdef __cplusplus
32 extern "C"{
33 #endif
34 
35 #include "drv_digital_out.h"
36 #include "drv_digital_in.h"
37 #include "drv_i2c_master.h"
38 #include "drv_spi_master.h"
39 #include "spi_specifics.h"
40 
61 #define SMARTDOF2_REG_FUNC_CFG_ACCESS 0x01
62 #define SMARTDOF2_REG_PIN_CTRL 0x02
63 #define SMARTDOF2_REG_IF_CFG 0x03
64 #define SMARTDOF2_REG_S4S_TPH_L 0x04
65 #define SMARTDOF2_REG_S4S_TPH_H 0x05
66 #define SMARTDOF2_REG_S4S_RR 0x06
67 #define SMARTDOF2_REG_FIFO_CTRL1 0x07
68 #define SMARTDOF2_REG_FIFO_CTRL2 0x08
69 #define SMARTDOF2_REG_FIFO_CTRL3 0x09
70 #define SMARTDOF2_REG_FIFO_CTRL4 0x0A
71 #define SMARTDOF2_REG_COUNTER_BDR_REG1 0x0B
72 #define SMARTDOF2_REG_COUNTER_BDR_REG2 0x0C
73 #define SMARTDOF2_REG_INT1_CTRL 0x0D
74 #define SMARTDOF2_REG_INT2_CTRL 0x0E
75 #define SMARTDOF2_REG_WHO_AM_I 0x0F
76 #define SMARTDOF2_REG_CTRL1 0x10
77 #define SMARTDOF2_REG_CTRL2 0x11
78 #define SMARTDOF2_REG_CTRL3 0x12
79 #define SMARTDOF2_REG_CTRL4 0x13
80 #define SMARTDOF2_REG_CTRL5 0x14
81 #define SMARTDOF2_REG_CTRL6 0x15
82 #define SMARTDOF2_REG_CTRL7 0x16
83 #define SMARTDOF2_REG_CTRL8 0x17
84 #define SMARTDOF2_REG_CTRL9 0x18
85 #define SMARTDOF2_REG_CTRL10 0x19
86 #define SMARTDOF2_REG_CTRL_STATUS 0x1A
87 #define SMARTDOF2_REG_FIFO_STATUS1 0x1B
88 #define SMARTDOF2_REG_FIFO_STATUS2 0x1C
89 #define SMARTDOF2_REG_ALL_INT_SRC 0x1D
90 #define SMARTDOF2_REG_STATUS_REG 0x1E
91 #define SMARTDOF2_REG_OUT_TEMP_L 0x20
92 #define SMARTDOF2_REG_OUT_TEMP_H 0x21
93 #define SMARTDOF2_REG_OUTX_L_G 0x22
94 #define SMARTDOF2_REG_OUTX_H_G 0x23
95 #define SMARTDOF2_REG_OUTY_L_G 0x24
96 #define SMARTDOF2_REG_OUTY_H_G 0x25
97 #define SMARTDOF2_REG_OUTZ_L_G 0x26
98 #define SMARTDOF2_REG_OUTZ_H_G 0x27
99 #define SMARTDOF2_REG_OUTX_L_A 0x28
100 #define SMARTDOF2_REG_OUTX_H_A 0x29
101 #define SMARTDOF2_REG_OUTY_L_A 0x2A
102 #define SMARTDOF2_REG_OUTY_H_A 0x2B
103 #define SMARTDOF2_REG_OUTZ_L_A 0x2C
104 #define SMARTDOF2_REG_OUTZ_H_A 0x2D
105 #define SMARTDOF2_REG_UI_OUTX_L_G_OIS_EIS 0x2E
106 #define SMARTDOF2_REG_UI_OUTX_H_G_OIS_EIS 0x2F
107 #define SMARTDOF2_REG_UI_OUTY_L_G_OIS_EIS 0x30
108 #define SMARTDOF2_REG_UI_OUTY_H_G_OIS_EIS 0x31
109 #define SMARTDOF2_REG_UI_OUTZ_L_G_OIS_EIS 0x32
110 #define SMARTDOF2_REG_UI_OUTZ_H_G_OIS_EIS 0x33
111 #define SMARTDOF2_REG_UI_OUTX_L_A_OIS_DUALC 0x34
112 #define SMARTDOF2_REG_UI_OUTX_H_A_OIS_DUALC 0x35
113 #define SMARTDOF2_REG_UI_OUTY_L_A_OIS_DUALC 0x36
114 #define SMARTDOF2_REG_UI_OUTY_H_A_OIS_DUALC 0x37
115 #define SMARTDOF2_REG_UI_OUTZ_L_A_OIS_DUALC 0x38
116 #define SMARTDOF2_REG_UI_OUTZ_H_A_OIS_DUALC 0x39
117 #define SMARTDOF2_REG_AH_QVAR_OUT_L 0x3A
118 #define SMARTDOF2_REG_AH_QVAR_OUT_H 0x3B
119 #define SMARTDOF2_REG_TIMESTAMP0 0x40
120 #define SMARTDOF2_REG_TIMESTAMP1 0x41
121 #define SMARTDOF2_REG_TIMESTAMP2 0x42
122 #define SMARTDOF2_REG_TIMESTAMP3 0x43
123 #define SMARTDOF2_REG_UI_STATUS_REG_OIS 0x44
124 #define SMARTDOF2_REG_WAKE_UP_SRC 0x45
125 #define SMARTDOF2_REG_TAP_SRC 0x46
126 #define SMARTDOF2_REG_D6D_SRC 0x47
127 #define SMARTDOF2_REG_STATUS_MASTER_MAINPAGE 0x48
128 #define SMARTDOF2_REG_EMB_FUNC_STATUS_MAINPAGE 0x49
129 #define SMARTDOF2_REG_FSM_STATUS_MAINPAGE 0x4A
130 #define SMARTDOF2_REG_MLC_STATUS_MAINPAGE 0x4B
131 #define SMARTDOF2_REG_INTERNAL_FREQ 0x4F
132 #define SMARTDOF2_REG_FUNCTIONS_ENABLE 0x50
133 #define SMARTDOF2_REG_DEN 0x51
134 #define SMARTDOF2_REG_INACTIVITY_DUR 0x54
135 #define SMARTDOF2_REG_INACTIVITY_THS 0x55
136 #define SMARTDOF2_REG_TAP_CFG0 0x56
137 #define SMARTDOF2_REG_TAP_CFG1 0x57
138 #define SMARTDOF2_REG_TAP_CFG2 0x58
139 #define SMARTDOF2_REG_TAP_THS_6D 0x59
140 #define SMARTDOF2_REG_INT_DUR2 0x5A
141 #define SMARTDOF2_REG_WAKE_UP_THS 0x5B
142 #define SMARTDOF2_REG_WAKE_UP_DUR 0x5C
143 #define SMARTDOF2_REG_FREE_FALL 0x5D
144 #define SMARTDOF2_REG_MD1_CFG 0x5E
145 #define SMARTDOF2_REG_MD2_CFG 0x5F
146 #define SMARTDOF2_REG_S4S_ST_CMD_CODE 0x60
147 #define SMARTDOF2_REG_S4S_DT_REG 0x61
148 #define SMARTDOF2_REG_EMB_FUNC_CFG 0x63
149 #define SMARTDOF2_REG_UI_HANDSHAKE_CTRL 0x64
150 #define SMARTDOF2_REG_UI_SPI2_SHARED_0 0x65
151 #define SMARTDOF2_REG_UI_SPI2_SHARED_1 0x66
152 #define SMARTDOF2_REG_UI_SPI2_SHARED_2 0x67
153 #define SMARTDOF2_REG_UI_SPI2_SHARED_3 0x68
154 #define SMARTDOF2_REG_UI_SPI2_SHARED_4 0x69
155 #define SMARTDOF2_REG_UI_SPI2_SHARED_5 0x6A
156 #define SMARTDOF2_REG_CTRL_EIS 0x6B
157 #define SMARTDOF2_REG_UI_INT_OIS 0x6F
158 #define SMARTDOF2_REG_UI_CTRL1_OIS 0x70
159 #define SMARTDOF2_REG_UI_CTRL2_OIS 0x71
160 #define SMARTDOF2_REG_UI_CTRL3_OIS 0x72
161 #define SMARTDOF2_REG_X_OFS_USR 0x73
162 #define SMARTDOF2_REG_Y_OFS_USR 0x74
163 #define SMARTDOF2_REG_Z_OFS_USR 0x75
164 #define SMARTDOF2_REG_FIFO_DATA_OUT_TAG 0x78
165 #define SMARTDOF2_REG_FIFO_DATA_OUT_X_L 0x79
166 #define SMARTDOF2_REG_FIFO_DATA_OUT_X_H 0x7A
167 #define SMARTDOF2_REG_FIFO_DATA_OUT_Y_L 0x7B
168 #define SMARTDOF2_REG_FIFO_DATA_OUT_Y_H 0x7C
169 #define SMARTDOF2_REG_FIFO_DATA_OUT_Z_L 0x7D
170 #define SMARTDOF2_REG_FIFO_DATA_OUT_Z_H 0x7E
171 
172  // smartdof2_reg
174 
194 #define SMARTDOF2_DEVICE_ID 0x70
195 
200 #define SMARTDOF2_IF_INC_DISABLE 0x00
201 #define SMARTDOF2_IF_INC_ENABLE 0x04
202 #define SMARTDOF2_IF_INC_BIT_MASK 0xFB
203 #define SMARTDOF2_BDU_DISABLE 0x00
204 #define SMARTDOF2_BDU_ENABLE 0x40
205 #define SMARTDOF2_BDU_BIT_MASK 0xBF
206 
211 #define SMARTDOF2_FIFO_MODE_BYPASS 0x00
212 #define SMARTDOF2_FIFO_MODE_FIFO 0x01
213 #define SMARTDOF2_FIFO_MODE_STREAM_WTM_TO_FULL 0x02
214 #define SMARTDOF2_FIFO_MODE_STREAM_TO_FIFO 0x03
215 #define SMARTDOF2_FIFO_MODE_BYPASS_TO_STREAM 0x04
216 #define SMARTDOF2_FIFO_MODE_STREAM 0x06
217 #define SMARTDOF2_FIFO_MODE_BYPASS_TO_FIFO 0x07
218 #define SMARTDOF2_FIFO_MODE_BIT_MASK 0xF8
219 
224 #define SMARTDOF2_ODR_OFF 0x00
225 #define SMARTDOF2_ODR_AT_1Hz875 0x01
226 #define SMARTDOF2_ODR_AT_7Hz5 0x02
227 #define SMARTDOF2_ODR_AT_15Hz 0x03
228 #define SMARTDOF2_ODR_AT_30Hz 0x04
229 #define SMARTDOF2_ODR_AT_60Hz 0x05
230 #define SMARTDOF2_ODR_AT_120Hz 0x06
231 #define SMARTDOF2_ODR_AT_240Hz 0x07
232 #define SMARTDOF2_ODR_AT_480Hz 0x08
233 #define SMARTDOF2_ODR_AT_960Hz 0x09
234 #define SMARTDOF2_ODR_AT_1920Hz 0x0A
235 #define SMARTDOF2_ODR_AT_3840Hz 0x0B
236 #define SMARTDOF2_ODR_AT_7680Hz 0x0C
237 #define SMARTDOF2_ODR_BIT_MASK 0xF0
238 
243 #define SMARTDOF2_XL_FULL_SCALE_2g 0x00
244 #define SMARTDOF2_XL_FULL_SCALE_4g 0x01
245 #define SMARTDOF2_XL_FULL_SCALE_8g 0x02
246 #define SMARTDOF2_XL_FULL_SCALE_16g 0x03
247 #define SMARTDOF2_XL_FULL_SCALE_BIT_MASK 0xF8
248 
253 #define SMARTDOF2_GY_FULL_SCALE_125dps 0x00
254 #define SMARTDOF2_GY_FULL_SCALE_250dps 0x01
255 #define SMARTDOF2_GY_FULL_SCALE_500dps 0x02
256 #define SMARTDOF2_GY_FULL_SCALE_1000dps 0x03
257 #define SMARTDOF2_GY_FULL_SCALE_2000dps 0x04
258 #define SMARTDOF2_GY_FULL_SCALE_4000dps 0x0C
259 #define SMARTDOF2_GY_FULL_SCALE_BIT_MASK 0xF0
260 
265 #define SMARTDOF2_ACC_SENSITIVITY_FS_2g 0.061
266 #define SMARTDOF2_ACC_SENSITIVITY_FS_4g 0.122
267 #define SMARTDOF2_ACC_SENSITIVITY_FS_8g 0.244
268 #define SMARTDOF2_ACC_SENSITIVITY_FS_16g 0.488
269 
274 #define SMARTDOF2_GYRO_SENSITIVITY_FS_125dps 4.375
275 #define SMARTDOF2_GYRO_SENSITIVITY_FS_250dps 8.750
276 #define SMARTDOF2_GYRO_SENSITIVITY_FS_500dps 17.500
277 #define SMARTDOF2_GYRO_SENSITIVITY_FS_1000dps 35.000
278 #define SMARTDOF2_GYRO_SENSITIVITY_FS_2000dps 70.000
279 #define SMARTDOF2_GYRO_SENSITIVITY_FS_4000dps 140.000
280 
286 #define SMARTDOF2_DEVICE_ADDRESS_GND 0x6A
287 #define SMARTDOF2_DEVICE_ADDRESS_VCC 0x6B
288 
297 #define SMARTDOF2_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
298 #define SMARTDOF2_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
299  // smartdof2_set
301 
316 #define SMARTDOF2_MAP_MIKROBUS( cfg, mikrobus ) \
317  cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
318  cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
319  cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
320  cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
321  cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
322  cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
323  cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
324  cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
325  // smartdof2_map // smartdof2
328 
333 typedef enum
334 {
339 
344 typedef err_t ( *smartdof2_master_io_t )( struct smartdof2_s*, uint8_t, uint8_t*, uint8_t );
350 typedef struct smartdof2_s
351 {
352  digital_out_t rst;
354  digital_in_t int_pin;
356  i2c_master_t i2c;
357  spi_master_t spi;
359  uint8_t slave_address;
360  pin_name_t chip_select;
367 
372 typedef struct
373 {
374  pin_name_t scl;
375  pin_name_t sda;
376  pin_name_t miso;
377  pin_name_t mosi;
378  pin_name_t sck;
379  pin_name_t cs;
380  pin_name_t rst;
381  pin_name_t int_pin;
383  uint32_t i2c_speed;
384  uint8_t i2c_address;
386  uint32_t spi_speed;
387  spi_master_mode_t spi_mode;
388  spi_master_chip_select_polarity_t cs_polarity;
393 
398 typedef struct
399 {
400  int16_t x;
401  int16_t y;
402  int16_t z;
403 
405 
410 typedef struct
411 {
412  float x;
413  float y;
414  float z;
415 
417 
422 typedef enum
423 {
425  SMARTDOF2_ERROR = -1
426 
428 
445 
461 
476 
490 
505 err_t smartdof2_generic_write ( smartdof2_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len );
506 
521 err_t smartdof2_generic_read ( smartdof2_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len );
522 
536 err_t smartdof2_get_device_id ( smartdof2_t *ctx, uint8_t *device_id );
537 
552 
567 
588 err_t smartdof2_set_fifo_mode ( smartdof2_t *ctx, uint8_t fifo_mode );
589 
616 err_t smartdof2_set_acc_data_rate ( smartdof2_t *ctx, uint8_t data_rate );
617 
631 err_t smartdof2_get_acc_full_scale ( smartdof2_t *ctx, uint8_t *data_scale );
632 
650 err_t smartdof2_set_acc_full_scale ( smartdof2_t *ctx, uint8_t data_scale );
651 
669 err_t smartdof2_set_gyro_data_rate ( smartdof2_t *ctx, uint8_t data_rate );
670 
684 err_t smartdof2_get_gyro_full_scale ( smartdof2_t *ctx, uint8_t *data_scale );
685 
703 err_t smartdof2_set_gyro_full_scale ( smartdof2_t *ctx, uint8_t data_scale );
704 
719 
734 
748 err_t smartdof2_get_acc_sensitivity ( smartdof2_t *ctx, float *sensitivity );
749 
763 err_t smartdof2_get_gyro_sensitivity ( smartdof2_t *ctx, float *sensitivity );
764 
779 
794 
808 err_t smartdof2_get_temperature_raw ( smartdof2_t *ctx, int16_t *temp_raw );
809 
824 err_t smartdof2_get_temperature ( smartdof2_t *ctx, float *temperature );
825 
839 
840 #ifdef __cplusplus
841 }
842 #endif
843 #endif // SMARTDOF2_H
844  // smartdof2
846 
847 // ------------------------------------------------------------------------ END
smartdof2_default_cfg
err_t smartdof2_default_cfg(smartdof2_t *ctx)
Smart DOF 2 default configuration function.
smartdof2_get_acc_axis_data
err_t smartdof2_get_acc_axis_data(smartdof2_t *ctx, smartdof2_axis_data_t *acc_axis)
Smart DOF 2 get accel data function.
smartdof2_axis_t::x
float x
Definition: smartdof2.h:412
smartdof2_cfg_t::miso
pin_name_t miso
Definition: smartdof2.h:376
smartdof2_s::slave_address
uint8_t slave_address
Definition: smartdof2.h:359
smartdof2_axis_data_t::y
int16_t y
Definition: smartdof2.h:401
smartdof2_cfg_t::i2c_address
uint8_t i2c_address
Definition: smartdof2.h:384
smartdof2_enable_block_data_update
err_t smartdof2_enable_block_data_update(smartdof2_t *ctx)
Smart DOF 2 enable block data update function.
smartdof2_get_int_pin
uint8_t smartdof2_get_int_pin(smartdof2_t *ctx)
Smart DOF 2 get interrupt function.
smartdof2_s::int_pin
digital_in_t int_pin
Definition: smartdof2.h:354
smartdof2_axis_data_t
Smart DOF 2 Click axis raw data structure object.
Definition: smartdof2.h:399
SMARTDOF2_DRV_SEL_SPI
@ SMARTDOF2_DRV_SEL_SPI
Definition: smartdof2.h:335
spi_specifics.h
This file contains SPI specific macros, functions, etc.
smartdof2_cfg_t::spi_mode
spi_master_mode_t spi_mode
Definition: smartdof2.h:387
smartdof2_s::i2c
i2c_master_t i2c
Definition: smartdof2.h:356
smartdof2_cfg_setup
void smartdof2_cfg_setup(smartdof2_cfg_t *cfg)
Smart DOF 2 configuration object setup function.
smartdof2_get_gyro_axis
err_t smartdof2_get_gyro_axis(smartdof2_t *ctx, smartdof2_axis_t *gyro_axis)
Smart DOF 2 get gyro sensor axes function.
smartdof2_get_acc_axis
err_t smartdof2_get_acc_axis(smartdof2_t *ctx, smartdof2_axis_t *acc_axis)
Smart DOF 2 get accel sensor axes function.
smartdof2_get_temperature_raw
err_t smartdof2_get_temperature_raw(smartdof2_t *ctx, int16_t *temp_raw)
Smart DOF 2 get temperature data function.
SMARTDOF2_DRV_SEL_I2C
@ SMARTDOF2_DRV_SEL_I2C
Definition: smartdof2.h:336
smartdof2_axis_t::y
float y
Definition: smartdof2.h:413
smartdof2_drv_t
smartdof2_drv_t
Smart DOF 2 Click driver selector.
Definition: smartdof2.h:334
smartdof2_s::rst
digital_out_t rst
Definition: smartdof2.h:352
smartdof2_cfg_t::sck
pin_name_t sck
Definition: smartdof2.h:378
smartdof2_cfg_t::rst
pin_name_t rst
Definition: smartdof2.h:380
smartdof2_cfg_t
Smart DOF 2 Click configuration object.
Definition: smartdof2.h:373
smartdof2_init
err_t smartdof2_init(smartdof2_t *ctx, smartdof2_cfg_t *cfg)
Smart DOF 2 initialization function.
smartdof2_get_gyro_full_scale
err_t smartdof2_get_gyro_full_scale(smartdof2_t *ctx, uint8_t *data_scale)
Smart DOF 2 get full-scale gyro range function.
smartdof2_drv_interface_selection
void smartdof2_drv_interface_selection(smartdof2_cfg_t *cfg, smartdof2_drv_t drv_sel)
Smart DOF 2 driver interface setup function.
smartdof2_generic_write
err_t smartdof2_generic_write(smartdof2_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
Smart DOF 2 data writing function.
smartdof2_s::write_f
smartdof2_master_io_t write_f
Definition: smartdof2.h:363
smartdof2_get_gyro_axis_data
err_t smartdof2_get_gyro_axis_data(smartdof2_t *ctx, smartdof2_axis_data_t *gyro_axis)
Smart DOF 2 get gyro data function.
smartdof2_enable_auto_increment
err_t smartdof2_enable_auto_increment(smartdof2_t *ctx)
Smart DOF 2 enable auto increment function.
smartdof2_axis_data_t::x
int16_t x
Definition: smartdof2.h:400
smartdof2_cfg_t::drv_sel
smartdof2_drv_t drv_sel
Definition: smartdof2.h:390
smartdof2_get_acc_sensitivity
err_t smartdof2_get_acc_sensitivity(smartdof2_t *ctx, float *sensitivity)
Smart DOF 2 get accel sensitivity function.
smartdof2_cfg_t::sda
pin_name_t sda
Definition: smartdof2.h:375
smartdof2_get_temperature
err_t smartdof2_get_temperature(smartdof2_t *ctx, float *temperature)
Smart DOF 2 get temperature function.
smartdof2_cfg_t::cs_polarity
spi_master_chip_select_polarity_t cs_polarity
Definition: smartdof2.h:388
smartdof2_generic_read
err_t smartdof2_generic_read(smartdof2_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
Smart DOF 2 data reading function.
smartdof2_master_io_t
err_t(* smartdof2_master_io_t)(struct smartdof2_s *, uint8_t, uint8_t *, uint8_t)
Smart DOF 2 Click driver interface.
Definition: smartdof2.h:344
smartdof2_s
Smart DOF 2 Click context object.
Definition: smartdof2.h:351
SMARTDOF2_OK
@ SMARTDOF2_OK
Definition: smartdof2.h:424
SMARTDOF2_ERROR
@ SMARTDOF2_ERROR
Definition: smartdof2.h:425
smartdof2_t
struct smartdof2_s smartdof2_t
Smart DOF 2 Click context object.
smartdof2_set_gyro_data_rate
err_t smartdof2_set_gyro_data_rate(smartdof2_t *ctx, uint8_t data_rate)
Smart DOF 2 set gyro data rate function.
smartdof2_axis_t
Smart DOF 2 Click sensor axes structure object.
Definition: smartdof2.h:411
smartdof2_get_device_id
err_t smartdof2_get_device_id(smartdof2_t *ctx, uint8_t *device_id)
Smart DOF 2 get device ID function.
smartdof2_get_acc_full_scale
err_t smartdof2_get_acc_full_scale(smartdof2_t *ctx, uint8_t *data_scale)
Smart DOF 2 get full-scale accel range function.
smartdof2_set_acc_full_scale
err_t smartdof2_set_acc_full_scale(smartdof2_t *ctx, uint8_t data_scale)
Smart DOF 2 set full-scale accel range function.
smartdof2_cfg_t::int_pin
pin_name_t int_pin
Definition: smartdof2.h:381
smartdof2_s::read_f
smartdof2_master_io_t read_f
Definition: smartdof2.h:364
smartdof2_cfg_t::mosi
pin_name_t mosi
Definition: smartdof2.h:377
smartdof2_set_fifo_mode
err_t smartdof2_set_fifo_mode(smartdof2_t *ctx, uint8_t fifo_mode)
Smart DOF 2 set FIFO mode function.
smartdof2_set_gyro_full_scale
err_t smartdof2_set_gyro_full_scale(smartdof2_t *ctx, uint8_t data_scale)
Smart DOF 2 set full-scale gyro range function.
smartdof2_get_gyro_sensitivity
err_t smartdof2_get_gyro_sensitivity(smartdof2_t *ctx, float *sensitivity)
Smart DOF 2 get gyro sensitivity function.
smartdof2_cfg_t::i2c_speed
uint32_t i2c_speed
Definition: smartdof2.h:383
smartdof2_return_value_t
smartdof2_return_value_t
Smart DOF 2 Click return value data.
Definition: smartdof2.h:423
smartdof2_axis_data_t::z
int16_t z
Definition: smartdof2.h:402
smartdof2_cfg_t::cs
pin_name_t cs
Definition: smartdof2.h:379
smartdof2_cfg_t::scl
pin_name_t scl
Definition: smartdof2.h:374
smartdof2_cfg_t::spi_speed
uint32_t spi_speed
Definition: smartdof2.h:386
smartdof2_s::spi
spi_master_t spi
Definition: smartdof2.h:357
smartdof2_s::chip_select
pin_name_t chip_select
Definition: smartdof2.h:360
smartdof2_axis_t::z
float z
Definition: smartdof2.h:414
smartdof2_set_acc_data_rate
err_t smartdof2_set_acc_data_rate(smartdof2_t *ctx, uint8_t data_rate)
Smart DOF 2 set accel data rate function.
smartdof2_s::drv_sel
smartdof2_drv_t drv_sel
Definition: smartdof2.h:361