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 "mikrosdk_version.h"
36 
37 #ifdef __GNUC__
38 #if mikroSDK_GET_VERSION < 20800ul
39 #include "rcu_delays.h"
40 #else
41 #include "delays.h"
42 #endif
43 #endif
44 
45 #include "drv_digital_out.h"
46 #include "drv_digital_in.h"
47 #include "drv_i2c_master.h"
48 #include "drv_spi_master.h"
49 #include "spi_specifics.h"
50 
71 #define SMARTDOF2_REG_FUNC_CFG_ACCESS 0x01
72 #define SMARTDOF2_REG_PIN_CTRL 0x02
73 #define SMARTDOF2_REG_IF_CFG 0x03
74 #define SMARTDOF2_REG_S4S_TPH_L 0x04
75 #define SMARTDOF2_REG_S4S_TPH_H 0x05
76 #define SMARTDOF2_REG_S4S_RR 0x06
77 #define SMARTDOF2_REG_FIFO_CTRL1 0x07
78 #define SMARTDOF2_REG_FIFO_CTRL2 0x08
79 #define SMARTDOF2_REG_FIFO_CTRL3 0x09
80 #define SMARTDOF2_REG_FIFO_CTRL4 0x0A
81 #define SMARTDOF2_REG_COUNTER_BDR_REG1 0x0B
82 #define SMARTDOF2_REG_COUNTER_BDR_REG2 0x0C
83 #define SMARTDOF2_REG_INT1_CTRL 0x0D
84 #define SMARTDOF2_REG_INT2_CTRL 0x0E
85 #define SMARTDOF2_REG_WHO_AM_I 0x0F
86 #define SMARTDOF2_REG_CTRL1 0x10
87 #define SMARTDOF2_REG_CTRL2 0x11
88 #define SMARTDOF2_REG_CTRL3 0x12
89 #define SMARTDOF2_REG_CTRL4 0x13
90 #define SMARTDOF2_REG_CTRL5 0x14
91 #define SMARTDOF2_REG_CTRL6 0x15
92 #define SMARTDOF2_REG_CTRL7 0x16
93 #define SMARTDOF2_REG_CTRL8 0x17
94 #define SMARTDOF2_REG_CTRL9 0x18
95 #define SMARTDOF2_REG_CTRL10 0x19
96 #define SMARTDOF2_REG_CTRL_STATUS 0x1A
97 #define SMARTDOF2_REG_FIFO_STATUS1 0x1B
98 #define SMARTDOF2_REG_FIFO_STATUS2 0x1C
99 #define SMARTDOF2_REG_ALL_INT_SRC 0x1D
100 #define SMARTDOF2_REG_STATUS_REG 0x1E
101 #define SMARTDOF2_REG_OUT_TEMP_L 0x20
102 #define SMARTDOF2_REG_OUT_TEMP_H 0x21
103 #define SMARTDOF2_REG_OUTX_L_G 0x22
104 #define SMARTDOF2_REG_OUTX_H_G 0x23
105 #define SMARTDOF2_REG_OUTY_L_G 0x24
106 #define SMARTDOF2_REG_OUTY_H_G 0x25
107 #define SMARTDOF2_REG_OUTZ_L_G 0x26
108 #define SMARTDOF2_REG_OUTZ_H_G 0x27
109 #define SMARTDOF2_REG_OUTX_L_A 0x28
110 #define SMARTDOF2_REG_OUTX_H_A 0x29
111 #define SMARTDOF2_REG_OUTY_L_A 0x2A
112 #define SMARTDOF2_REG_OUTY_H_A 0x2B
113 #define SMARTDOF2_REG_OUTZ_L_A 0x2C
114 #define SMARTDOF2_REG_OUTZ_H_A 0x2D
115 #define SMARTDOF2_REG_UI_OUTX_L_G_OIS_EIS 0x2E
116 #define SMARTDOF2_REG_UI_OUTX_H_G_OIS_EIS 0x2F
117 #define SMARTDOF2_REG_UI_OUTY_L_G_OIS_EIS 0x30
118 #define SMARTDOF2_REG_UI_OUTY_H_G_OIS_EIS 0x31
119 #define SMARTDOF2_REG_UI_OUTZ_L_G_OIS_EIS 0x32
120 #define SMARTDOF2_REG_UI_OUTZ_H_G_OIS_EIS 0x33
121 #define SMARTDOF2_REG_UI_OUTX_L_A_OIS_DUALC 0x34
122 #define SMARTDOF2_REG_UI_OUTX_H_A_OIS_DUALC 0x35
123 #define SMARTDOF2_REG_UI_OUTY_L_A_OIS_DUALC 0x36
124 #define SMARTDOF2_REG_UI_OUTY_H_A_OIS_DUALC 0x37
125 #define SMARTDOF2_REG_UI_OUTZ_L_A_OIS_DUALC 0x38
126 #define SMARTDOF2_REG_UI_OUTZ_H_A_OIS_DUALC 0x39
127 #define SMARTDOF2_REG_AH_QVAR_OUT_L 0x3A
128 #define SMARTDOF2_REG_AH_QVAR_OUT_H 0x3B
129 #define SMARTDOF2_REG_TIMESTAMP0 0x40
130 #define SMARTDOF2_REG_TIMESTAMP1 0x41
131 #define SMARTDOF2_REG_TIMESTAMP2 0x42
132 #define SMARTDOF2_REG_TIMESTAMP3 0x43
133 #define SMARTDOF2_REG_UI_STATUS_REG_OIS 0x44
134 #define SMARTDOF2_REG_WAKE_UP_SRC 0x45
135 #define SMARTDOF2_REG_TAP_SRC 0x46
136 #define SMARTDOF2_REG_D6D_SRC 0x47
137 #define SMARTDOF2_REG_STATUS_MASTER_MAINPAGE 0x48
138 #define SMARTDOF2_REG_EMB_FUNC_STATUS_MAINPAGE 0x49
139 #define SMARTDOF2_REG_FSM_STATUS_MAINPAGE 0x4A
140 #define SMARTDOF2_REG_MLC_STATUS_MAINPAGE 0x4B
141 #define SMARTDOF2_REG_INTERNAL_FREQ 0x4F
142 #define SMARTDOF2_REG_FUNCTIONS_ENABLE 0x50
143 #define SMARTDOF2_REG_DEN 0x51
144 #define SMARTDOF2_REG_INACTIVITY_DUR 0x54
145 #define SMARTDOF2_REG_INACTIVITY_THS 0x55
146 #define SMARTDOF2_REG_TAP_CFG0 0x56
147 #define SMARTDOF2_REG_TAP_CFG1 0x57
148 #define SMARTDOF2_REG_TAP_CFG2 0x58
149 #define SMARTDOF2_REG_TAP_THS_6D 0x59
150 #define SMARTDOF2_REG_INT_DUR2 0x5A
151 #define SMARTDOF2_REG_WAKE_UP_THS 0x5B
152 #define SMARTDOF2_REG_WAKE_UP_DUR 0x5C
153 #define SMARTDOF2_REG_FREE_FALL 0x5D
154 #define SMARTDOF2_REG_MD1_CFG 0x5E
155 #define SMARTDOF2_REG_MD2_CFG 0x5F
156 #define SMARTDOF2_REG_S4S_ST_CMD_CODE 0x60
157 #define SMARTDOF2_REG_S4S_DT_REG 0x61
158 #define SMARTDOF2_REG_EMB_FUNC_CFG 0x63
159 #define SMARTDOF2_REG_UI_HANDSHAKE_CTRL 0x64
160 #define SMARTDOF2_REG_UI_SPI2_SHARED_0 0x65
161 #define SMARTDOF2_REG_UI_SPI2_SHARED_1 0x66
162 #define SMARTDOF2_REG_UI_SPI2_SHARED_2 0x67
163 #define SMARTDOF2_REG_UI_SPI2_SHARED_3 0x68
164 #define SMARTDOF2_REG_UI_SPI2_SHARED_4 0x69
165 #define SMARTDOF2_REG_UI_SPI2_SHARED_5 0x6A
166 #define SMARTDOF2_REG_CTRL_EIS 0x6B
167 #define SMARTDOF2_REG_UI_INT_OIS 0x6F
168 #define SMARTDOF2_REG_UI_CTRL1_OIS 0x70
169 #define SMARTDOF2_REG_UI_CTRL2_OIS 0x71
170 #define SMARTDOF2_REG_UI_CTRL3_OIS 0x72
171 #define SMARTDOF2_REG_X_OFS_USR 0x73
172 #define SMARTDOF2_REG_Y_OFS_USR 0x74
173 #define SMARTDOF2_REG_Z_OFS_USR 0x75
174 #define SMARTDOF2_REG_FIFO_DATA_OUT_TAG 0x78
175 #define SMARTDOF2_REG_FIFO_DATA_OUT_X_L 0x79
176 #define SMARTDOF2_REG_FIFO_DATA_OUT_X_H 0x7A
177 #define SMARTDOF2_REG_FIFO_DATA_OUT_Y_L 0x7B
178 #define SMARTDOF2_REG_FIFO_DATA_OUT_Y_H 0x7C
179 #define SMARTDOF2_REG_FIFO_DATA_OUT_Z_L 0x7D
180 #define SMARTDOF2_REG_FIFO_DATA_OUT_Z_H 0x7E
181 
182  // smartdof2_reg
184 
199 #define SMARTDOF2_DEVICE_ID 0x70
200 
205 #define SMARTDOF2_IF_INC_DISABLE 0x00
206 #define SMARTDOF2_IF_INC_ENABLE 0x04
207 #define SMARTDOF2_IF_INC_BIT_MASK 0xFB
208 #define SMARTDOF2_BDU_DISABLE 0x00
209 #define SMARTDOF2_BDU_ENABLE 0x40
210 #define SMARTDOF2_BDU_BIT_MASK 0xBF
211 
216 #define SMARTDOF2_FIFO_MODE_BYPASS 0x00
217 #define SMARTDOF2_FIFO_MODE_FIFO 0x01
218 #define SMARTDOF2_FIFO_MODE_STREAM_WTM_TO_FULL 0x02
219 #define SMARTDOF2_FIFO_MODE_STREAM_TO_FIFO 0x03
220 #define SMARTDOF2_FIFO_MODE_BYPASS_TO_STREAM 0x04
221 #define SMARTDOF2_FIFO_MODE_STREAM 0x06
222 #define SMARTDOF2_FIFO_MODE_BYPASS_TO_FIFO 0x07
223 #define SMARTDOF2_FIFO_MODE_BIT_MASK 0xF8
224 
229 #define SMARTDOF2_ODR_OFF 0x00
230 #define SMARTDOF2_ODR_AT_1Hz875 0x01
231 #define SMARTDOF2_ODR_AT_7Hz5 0x02
232 #define SMARTDOF2_ODR_AT_15Hz 0x03
233 #define SMARTDOF2_ODR_AT_30Hz 0x04
234 #define SMARTDOF2_ODR_AT_60Hz 0x05
235 #define SMARTDOF2_ODR_AT_120Hz 0x06
236 #define SMARTDOF2_ODR_AT_240Hz 0x07
237 #define SMARTDOF2_ODR_AT_480Hz 0x08
238 #define SMARTDOF2_ODR_AT_960Hz 0x09
239 #define SMARTDOF2_ODR_AT_1920Hz 0x0A
240 #define SMARTDOF2_ODR_AT_3840Hz 0x0B
241 #define SMARTDOF2_ODR_AT_7680Hz 0x0C
242 #define SMARTDOF2_ODR_BIT_MASK 0xF0
243 
248 #define SMARTDOF2_XL_FULL_SCALE_2g 0x00
249 #define SMARTDOF2_XL_FULL_SCALE_4g 0x01
250 #define SMARTDOF2_XL_FULL_SCALE_8g 0x02
251 #define SMARTDOF2_XL_FULL_SCALE_16g 0x03
252 #define SMARTDOF2_XL_FULL_SCALE_BIT_MASK 0xF8
253 
258 #define SMARTDOF2_GY_FULL_SCALE_125dps 0x00
259 #define SMARTDOF2_GY_FULL_SCALE_250dps 0x01
260 #define SMARTDOF2_GY_FULL_SCALE_500dps 0x02
261 #define SMARTDOF2_GY_FULL_SCALE_1000dps 0x03
262 #define SMARTDOF2_GY_FULL_SCALE_2000dps 0x04
263 #define SMARTDOF2_GY_FULL_SCALE_4000dps 0x0C
264 #define SMARTDOF2_GY_FULL_SCALE_BIT_MASK 0xF0
265 
270 #define SMARTDOF2_ACC_SENSITIVITY_FS_2g 0.061
271 #define SMARTDOF2_ACC_SENSITIVITY_FS_4g 0.122
272 #define SMARTDOF2_ACC_SENSITIVITY_FS_8g 0.244
273 #define SMARTDOF2_ACC_SENSITIVITY_FS_16g 0.488
274 
279 #define SMARTDOF2_GYRO_SENSITIVITY_FS_125dps 4.375
280 #define SMARTDOF2_GYRO_SENSITIVITY_FS_250dps 8.750
281 #define SMARTDOF2_GYRO_SENSITIVITY_FS_500dps 17.500
282 #define SMARTDOF2_GYRO_SENSITIVITY_FS_1000dps 35.000
283 #define SMARTDOF2_GYRO_SENSITIVITY_FS_2000dps 70.000
284 #define SMARTDOF2_GYRO_SENSITIVITY_FS_4000dps 140.000
285 
291 #define SMARTDOF2_DEVICE_ADDRESS_GND 0x6A
292 #define SMARTDOF2_DEVICE_ADDRESS_VCC 0x6B
293 
302 #define SMARTDOF2_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
303 #define SMARTDOF2_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
304  // smartdof2_set
306 
321 #define SMARTDOF2_MAP_MIKROBUS( cfg, mikrobus ) \
322  cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
323  cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
324  cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
325  cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
326  cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
327  cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
328  cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
329  // smartdof2_map // smartdof2
332 
337 typedef enum
338 {
343 
348 typedef err_t ( *smartdof2_master_io_t )( struct smartdof2_s*, uint8_t, uint8_t*, uint8_t );
354 typedef struct smartdof2_s
355 {
356  digital_in_t int_pin;
358  i2c_master_t i2c;
359  spi_master_t spi;
361  uint8_t slave_address;
362  pin_name_t chip_select;
369 
374 typedef struct
375 {
376  pin_name_t scl;
377  pin_name_t sda;
378  pin_name_t miso;
379  pin_name_t mosi;
380  pin_name_t sck;
381  pin_name_t cs;
382  pin_name_t int_pin;
384  uint32_t i2c_speed;
385  uint8_t i2c_address;
387  uint32_t spi_speed;
388  spi_master_mode_t spi_mode;
389  spi_master_chip_select_polarity_t cs_polarity;
394 
399 typedef struct
400 {
401  int16_t x;
402  int16_t y;
403  int16_t z;
404 
406 
411 typedef struct
412 {
413  float x;
414  float y;
415  float z;
416 
418 
423 typedef enum
424 {
426  SMARTDOF2_ERROR = -1
427 
429 
446 
462 
477 
491 
506 err_t smartdof2_generic_write ( smartdof2_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len );
507 
522 err_t smartdof2_generic_read ( smartdof2_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len );
523 
537 err_t smartdof2_get_device_id ( smartdof2_t *ctx, uint8_t *device_id );
538 
553 
568 
589 err_t smartdof2_set_fifo_mode ( smartdof2_t *ctx, uint8_t fifo_mode );
590 
617 err_t smartdof2_set_acc_data_rate ( smartdof2_t *ctx, uint8_t data_rate );
618 
632 err_t smartdof2_get_acc_full_scale ( smartdof2_t *ctx, uint8_t *data_scale );
633 
651 err_t smartdof2_set_acc_full_scale ( smartdof2_t *ctx, uint8_t data_scale );
652 
670 err_t smartdof2_set_gyro_data_rate ( smartdof2_t *ctx, uint8_t data_rate );
671 
685 err_t smartdof2_get_gyro_full_scale ( smartdof2_t *ctx, uint8_t *data_scale );
686 
704 err_t smartdof2_set_gyro_full_scale ( smartdof2_t *ctx, uint8_t data_scale );
705 
720 
735 
749 err_t smartdof2_get_acc_sensitivity ( smartdof2_t *ctx, float *sensitivity );
750 
764 err_t smartdof2_get_gyro_sensitivity ( smartdof2_t *ctx, float *sensitivity );
765 
780 
795 
809 err_t smartdof2_get_temperature_raw ( smartdof2_t *ctx, int16_t *temp_raw );
810 
825 err_t smartdof2_get_temperature ( smartdof2_t *ctx, float *temperature );
826 
840 
841 #ifdef __cplusplus
842 }
843 #endif
844 #endif // SMARTDOF2_H
845  // smartdof2
847 
848 // ------------------------------------------------------------------------ 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:413
smartdof2_cfg_t::miso
pin_name_t miso
Definition: smartdof2.h:378
smartdof2_s::slave_address
uint8_t slave_address
Definition: smartdof2.h:361
smartdof2_axis_data_t::y
int16_t y
Definition: smartdof2.h:402
smartdof2_cfg_t::i2c_address
uint8_t i2c_address
Definition: smartdof2.h:385
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:356
smartdof2_axis_data_t
Smart DOF 2 Click axis raw data structure object.
Definition: smartdof2.h:400
SMARTDOF2_DRV_SEL_SPI
@ SMARTDOF2_DRV_SEL_SPI
Definition: smartdof2.h:339
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:388
smartdof2_s::i2c
i2c_master_t i2c
Definition: smartdof2.h:358
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:340
smartdof2_axis_t::y
float y
Definition: smartdof2.h:414
smartdof2_drv_t
smartdof2_drv_t
Smart DOF 2 Click driver selector.
Definition: smartdof2.h:338
smartdof2_cfg_t::sck
pin_name_t sck
Definition: smartdof2.h:380
smartdof2_cfg_t
Smart DOF 2 Click configuration object.
Definition: smartdof2.h:375
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:365
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:401
smartdof2_cfg_t::drv_sel
smartdof2_drv_t drv_sel
Definition: smartdof2.h:391
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:377
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:389
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:348
smartdof2_s
Smart DOF 2 Click context object.
Definition: smartdof2.h:355
SMARTDOF2_OK
@ SMARTDOF2_OK
Definition: smartdof2.h:425
SMARTDOF2_ERROR
@ SMARTDOF2_ERROR
Definition: smartdof2.h:426
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:412
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:382
smartdof2_s::read_f
smartdof2_master_io_t read_f
Definition: smartdof2.h:366
smartdof2_cfg_t::mosi
pin_name_t mosi
Definition: smartdof2.h:379
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:384
smartdof2_return_value_t
smartdof2_return_value_t
Smart DOF 2 Click return value data.
Definition: smartdof2.h:424
smartdof2_axis_data_t::z
int16_t z
Definition: smartdof2.h:403
smartdof2_cfg_t::cs
pin_name_t cs
Definition: smartdof2.h:381
smartdof2_cfg_t::scl
pin_name_t scl
Definition: smartdof2.h:376
smartdof2_cfg_t::spi_speed
uint32_t spi_speed
Definition: smartdof2.h:387
smartdof2_s::spi
spi_master_t spi
Definition: smartdof2.h:359
smartdof2_s::chip_select
pin_name_t chip_select
Definition: smartdof2.h:362
smartdof2_axis_t::z
float z
Definition: smartdof2.h:415
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:363