accel15  2.0.0.0
accel15.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 ACCEL15_H
29 #define ACCEL15_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 
70 #define ACCEL15_REG_CHIP_ID 0x00
71 #define ACCEL15_REG_ERROR 0x02
72 #define ACCEL15_REG_STATUS 0x03
73 #define ACCEL15_REG_DATA_0 0x0A
74 #define ACCEL15_REG_DATA_8 0x12
75 #define ACCEL15_REG_SENSORTIME_0 0x18
76 #define ACCEL15_REG_EVENT 0x1B
77 #define ACCEL15_REG_INT_STAT_0 0x1C
78 #define ACCEL15_REG_INT_STAT_1 0x1D
79 #define ACCEL15_REG_TEMPERATURE 0x22
80 #define ACCEL15_REG_FIFO_LENGTH_0 0x24
81 #define ACCEL15_REG_FIFO_DATA 0x26
82 #define ACCEL15_REG_INTERNAL_STAT 0x2A
83 #define ACCEL15_REG_ACCEL_CONFIG 0x40
84 #define ACCEL15_REG_ACCEL_RANGE 0x41
85 #define ACCEL15_REG_AUX_CONF 0x44
86 #define ACCEL15_REG_FIFO_DOWN 0x45
87 #define ACCEL15_REG_FIFO_WTM_0 0x46
88 #define ACCEL15_REG_FIFO_CONFIG_0 0x48
89 #define ACCEL15_REG_FIFO_CONFIG_1 0x49
90 #define ACCEL15_REG_AUX_DEV_ID 0x4B
91 #define ACCEL15_REG_AUX_IF_CONF 0x4C
92 #define ACCEL15_REG_AUX_RD 0x4D
93 #define ACCEL15_REG_INT1_IO_CTRL 0x53
94 #define ACCEL15_REG_INT2_IO_CTRL 0x54
95 #define ACCEL15_REG_INT_LATCH 0x55
96 #define ACCEL15_REG_INT_MAP_1 0x56
97 #define ACCEL15_REG_INT_MAP_2 0x57
98 #define ACCEL15_REG_INT_MAP_DATA 0x58
99 #define ACCEL15_REG_INIT_CTRL 0x59
100 #define ACCEL15_REG_RESERVED_REG_5B 0x5B
101 #define ACCEL15_REG_RESERVED_REG_5C 0x5C
102 #define ACCEL15_REG_FEATURE_CONFIG 0x5E
103 #define ACCEL15_REG_INTERNAL_ERROR 0x5F
104 #define ACCEL15_REG_ACC_SELF_TEST 0x6D
105 #define ACCEL15_REG_ACC_SELF_TEST 0x6D
106 #define ACCEL15_REG_NV_CONFIG 0x70
107 #define ACCEL15_REG_OFFSET_0 0x71
108 #define ACCEL15_REG_OFFSET_1 0x72
109 #define ACCEL15_REG_OFFSET_2 0x73
110 #define ACCEL15_REG_POWER_CONF 0x7C
111 #define ACCEL15_REG_POWER_CTRL 0x7D
112 #define ACCEL15_REG_CMD 0x7E
113  // accel15_reg
115 
135 #define ACCEL15_CHIP_ID 0x1A
136 #define ACCEL15_FEATURE_SIZE 0x0C
137 #define ACCEL15_RD_WR_MIN_LEN 0x02
138 #define ACCEL15_RD_WR_MAX_LEN 1300
139 
144 #define ACCEL15_ANY_MOT_START_ADDR 0x00
145 #define ACCEL15_NO_MOT_START_ADDR 0x04
146 #define ACCEL15_CONFIG_ID_START_ADDR 0x08
147 #define ACCEL15_AXES_REMAP_START_ADDR 0x0A
148 
154 #define ACCEL15_X_AXIS_MSK 0x03
155 #define ACCEL15_X_AXIS_SIGN_MSK 0x04
156 #define ACCEL15_Y_AXIS_MSK 0x18
157 #define ACCEL15_Y_AXIS_SIGN_MSK 0x20
158 #define ACCEL15_Z_AXIS_MSK 0xC0
159 #define ACCEL15_Z_AXIS_SIGN_MSK 0x01
160 
166 #define ACCEL15_X_AXIS_SIGN_POS 0x02
167 #define ACCEL15_Y_AXIS_POS 0x03
168 #define ACCEL15_Y_AXIS_SIGN_POS 0x05
169 #define ACCEL15_Z_AXIS_POS 0x06
170 
176 #define ACCEL15_X_AXIS_EN 0x01
177 #define ACCEL15_Y_AXIS_EN 0x02
178 #define ACCEL15_Z_AXIS_EN 0x04
179 #define ACCEL15_EN_ALL_AXIS 0x07
180 #define ACCEL15_DIS_ALL_AXIS 0x00
181 
187 #define ACCEL15_ANY_MOT_INT 0x20
188 #define ACCEL15_NO_MOT_INT 0x40
189 #define ACCEL15_ERROR_INT 0x80
190 
196 #define ACCEL15_INT1_IO_CTRL_INPUT_EN 0x10
197 #define ACCEL15_INT1_IO_CTRL_OUTPUT_EN 0x08
198 #define ACCEL15_INT1_IO_CTRL_OD_EN 0x04
199 #define ACCEL15_INT1_IO_CTRL_LVL_HIGH 0x02
200 #define ACCEL15_INT1_IO_CTRL_EDGE_EN 0x01
201 
207 #define ACCEL15_INT_MAP_DATA_INT2_DRDY 0x40
208 #define ACCEL15_INT_MAP_DATA_INT2_FWM 0x20
209 #define ACCEL15_INT_MAP_DATA_INT2_FFULL 0x10
210 #define ACCEL15_INT_MAP_DATA_INT1_DRDY 0x04
211 #define ACCEL15_INT_MAP_DATA_INT1_FWM 0x02
212 #define ACCEL15_INT_MAP_DATA_INT1_FFULL 0x01
213 
219 #define ACCEL15_
220 
226 #define ACCEL15_ACCEL_OFF 0x00
227 #define ACCEL15_ACCEL_ON 0x04
228 #define ACCEL15_AUX_OFF 0x00
229 #define ACCEL15_AUX_ON 0x01
230 
236 #define ACCEL15_APS_OFF 0x00
237 #define ACCEL15_APS_ON 0x01
238 #define ACCEL15_FSW_OFF 0x00
239 #define ACCEL15_FSW_ON 0x02
240 
246 #define ACCEL15_CONFIG_MAJOR_POS 0x06
247 
253 #define ACCEL15_DRDY 0x01
254 #define ACCEL15_ACCEL_EN 0x40
255 #define ACCEL15_ACCEL_DRDY 0x80
256 
262 #define ACCEL15_SPI_WR_MASK 0x7F
263 #define ACCEL15_SPI_RD_MASK 0x80
264 
270 #define ACCEL15_ENABLE 0x01
271 #define ACCEL15_DISABLE 0x00
272 
278 #define ACCEL15_CIC_AVG_MODE 0
279 #define ACCEL15_CONTINUOUS_MODE 1
280 
286 #define ACCEL15_ADVANCE_POWER_SAVE_MSK 0x01
287 
293 #define ACCEL15_12_BIT_RESOLUTION 12
294 #define ACCEL15_16_BIT_RESOLUTION 16
295 
301 #define ACCEL15_ACCEL_ENABLE_POS 2
302 #define ACCEL15_ACCEL_ENABLE_MSK 0x04
303 
309 #define ACCEL15_SOFT_RESET 0x6B
310 
316 #define ACCEL15_ACCEL_ODR_MSK 0x0F
317 #define ACCEL15_ACCEL_BW_POS 4
318 #define ACCEL15_ACCEL_BW_MSK 0x70
319 #define ACCEL15_ACCEL_RANGE_MSK 0x03
320 #define ACCEL15_ACCEL_PERFMODE_POS 7
321 #define ACCEL15_ACCEL_PERFMODE_MSK 0x80
322 
328 #define ACCEL15_ACCEL_CONFIG_LENGTH 2
329 #define ACCEL15_FIFO_CONFIG_LENGTH 2
330 #define ACCEL15_FIFO_WM_LENGTH 2
331 #define ACCEL15_ACCEL_DATA_LENGTH 6
332 #define ACCEL15_FIFO_DATA_LENGTH 2
333 #define ACCEL15_MA_FIFO_A_X_LSB 8
334 #define ACCEL15_SENSOR_TIME_MSB_BYTE 2
335 #define ACCEL15_SENSOR_TIME_XLSB_BYTE 1
336 #define ACCEL15_SENSOR_TIME_LSB_BYTE 0
337 #define ACCEL15_FIFO_LENGTH_MSB_BYTE 1
338 
344 #define ACCEL15_OUTPUT_DATA_RATE_12_5HZ 0x05
345 #define ACCEL15_OUTPUT_DATA_RATE_25HZ 0x06
346 #define ACCEL15_OUTPUT_DATA_RATE_50HZ 0x07
347 #define ACCEL15_OUTPUT_DATA_RATE_100HZ 0x08
348 #define ACCEL15_OUTPUT_DATA_RATE_200HZ 0x09
349 #define ACCEL15_OUTPUT_DATA_RATE_400HZ 0x0A
350 #define ACCEL15_OUTPUT_DATA_RATE_800HZ 0x0B
351 #define ACCEL15_OUTPUT_DATA_RATE_1600HZ 0x0C
352 
358 #define ACCEL15_ACCEL_OSR4_AVG1 0
359 #define ACCEL15_ACCEL_OSR2_AVG2 1
360 #define ACCEL15_ACCEL_NORMAL_AVG4 2
361 #define ACCEL15_ACCEL_CIC_AVG8 3
362 #define ACCEL15_ACCEL_RES_AVG16 4
363 #define ACCEL15_ACCEL_RES_AVG32 5
364 #define ACCEL15_ACCEL_RES_AVG64 6
365 #define ACCEL15_ACCEL_RES_AVG128 7
366 
372 #define ACCEL15_ACCEL_RANGE_16G 0
373 #define ACCEL15_ACCEL_RANGE_8G 1
374 #define ACCEL15_ACCEL_RANGE_4G 2
375 #define ACCEL15_ACCEL_RANGE_2G 3
376 
382 #define ACCEL15_FATAL_ERR_MSK 0x01
383 #define ACCEL15_CMD_ERR_POS 1
384 #define ACCEL15_CMD_ERR_MSK 0x02
385 #define ACCEL15_ERR_CODE_POS 2
386 #define ACCEL15_ERR_CODE_MSK 0x1C
387 #define ACCEL15_FIFO_ERR_POS 6
388 #define ACCEL15_FIFO_ERR_MSK 0x40
389 
395 #define ACCEL15_FIFO_SELF_WAKE_UP_POS 1
396 #define ACCEL15_FIFO_SELF_WAKE_UP_MSK 0x02
397 #define ACCEL15_FIFO_BYTE_COUNTER_MSB_MSK 0x3F
398 #define ACCEL15_FIFO_DATA_POS 0
399 #define ACCEL15_FIFO_DATA_MSK 0xFF
400 #define ACCEL15_FIFO_DOWN_ACCEL_POS 4
401 #define ACCEL15_FIFO_DOWN_ACCEL_MSK 0x70
402 #define ACCEL15_FIFO_FILTER_ACCEL_POS 7
403 #define ACCEL15_FIFO_FILTER_ACCEL_MSK 0x80
404 
410 #define ACCEL15_FIFO_HEADER_ACC 0x84
411 #define ACCEL15_FIFO_HEADER_MAG 0x90
412 #define ACCEL15_FIFO_HEADER_MAG_ACC 0x94
413 #define ACCEL15_FIFO_HEADER_SENSOR_TIME 0x44
414 #define ACCEL15_FIFO_HEADER_INPUT_CONFIG 0x48
415 #define ACCEL15_FIFO_HEADER_SKIP_FRAME 0x40
416 #define ACCEL15_FIFO_HEADER_OVER_READ_MSB 0x80
417 #define ACCEL15_FIFO_HEADER_SAMPLE_DROP 0x50
418 #define ACCEL15_FIFO_MAG_ACC_ENABLE 0x60
419 #define ACCEL15_FIFO_ACC_ENABLE 0x40
420 #define ACCEL15_FIFO_MAG_ENABLE 0x20
421 #define ACCEL15_FIFO_STOP_ON_FULL 0x01
422 #define ACCEL15_FIFO_TIME 0x02
423 #define ACCEL15_FIFO_TAG_INTR2 0x04
424 #define ACCEL15_FIFO_TAG_INTR1 0x08
425 #define ACCEL15_FIFO_HEADER 0x10
426 #define ACCEL15_FIFO_MAG 0x20
427 #define ACCEL15_FIFO_ACCEL 0x40
428 #define ACCEL15_FIFO_ALL 0x7F
429 #define ACCEL15_FIFO_CONFIG_0_MASK 0x03
430 #define ACCEL15_FIFO_CONFIG_1_MASK 0xFC
431 
437 #define ACCEL15_FIFO_LSB_CONFIG_CHECK 0x00
438 #define ACCEL15_FIFO_MSB_CONFIG_CHECK 0x80
439 #define ACCEL15_FIFO_TAG_INTR_MASK 0xFC
440 
446 #define ACCEL15_ACCEL_AUX_FIFO_DROP 0x05
447 #define ACCEL15_ACCEL_FIFO_DROP 0x01
448 
454 #define ACCEL15_INIT_START 0x00
455 #define ACCEL15_INIT_STOP 0x01
456 
462 #define ACCEL15_SENSOR_TIME_LENGTH 3
463 
469 #define ACCEL15_FIFO_ACC_LENGTH 6
470 #define ACCEL15_FIFO_MAG_LENGTH 8
471 #define ACCEL15_FIFO_MAG_ACC_LENGTH 14
472 #define ACCEL15_CONFIG_STREAM_MESSAGE_MSK 0x0F
473 #define ACCEL15_ASIC_INITIALIZED 0x01
474 
480 #define ACCEL15_ACCEL_CONFIG_FOC 0xB7
481 
487 #define ACCEL15_X_AXIS 0
488 #define ACCEL15_Y_AXIS 1
489 #define ACCEL15_Z_AXIS 2
490 
496 #define ACCEL15_NV_ENABLE_I2C 0x00
497 #define ACCEL15_NV_DISABLE_I2C 0x01
498 #define ACCEL15_NV_ACCEL_OFFSET_POS 3
499 #define ACCEL15_NV_ACCEL_OFFSET_MSK 0x08
500 
506 #define ACCEL15_SELFTEST_PASS 0
507 #define ACCEL15_SELFTEST_FAIL 1
508 #define ACCEL15_SELFTEST_DIFF_X_AXIS_FAILED 1
509 #define ACCEL15_SELFTEST_DIFF_Y_AXIS_FAILED 2
510 #define ACCEL15_SELFTEST_DIFF_Z_AXIS_FAILED 3
511 #define ACCEL15_SELFTEST_DIFF_X_AND_Y_AXIS_FAILED 4
512 #define ACCEL15_SELFTEST_DIFF_X_AND_Z_AXIS_FAILED 5
513 #define ACCEL15_SELFTEST_DIFF_Y_AND_Z_AXIS_FAILED 6
514 #define ACCEL15_SELFTEST_DIFF_X_Y_AND_Z_AXIS_FAILED 7
515 
521 #define ACCEL15_ACCEL_SELFTEST_ENABLE_MSK 0x01
522 #define ACCEL15_ACCEL_SELFTEST_SIGN_POS 2
523 #define ACCEL15_ACCEL_SELFTEST_SIGN_MSK 0x04
524 #define ACCEL15_SELFTEST_AMP_POS 3
525 #define ACCEL15_SELFTEST_AMP_MSK 0x08
526 
532 #define ACCEL15_MAX_VALUE_FIFO_FILTER 1
533 #define ACCEL15_MAX_VALUE_SPI3 1
534 #define ACCEL15_MAX_VALUE_SELFTEST_AMP 1
535 #define ACCEL15_MAX_IF_MODE 3
536 #define ACCEL15_MAX_VALUE_SELFTEST_SIGN 1
537 
543 #define ACCEL15_FOC_ACC_CONF_VAL 0xB7
544 
550 #define ACCEL15_SPI_WRITE 0x00
551 #define ACCEL15_SPI_READ 0x80
552 
558 #define ACCEL15_SET_DEV_ADDR_GND 0x18
559 #define ACCEL15_SET_DEV_ADDR_VCC 0x19
560  // accel15_set
562 
577 #define ACCEL15_MAP_MIKROBUS( cfg, mikrobus ) \
578  cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
579  cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
580  cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
581  cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
582  cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
583  cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
584  cfg.in2 = MIKROBUS( mikrobus, MIKROBUS_AN ); \
585  cfg.in1 = MIKROBUS( mikrobus, MIKROBUS_INT )
586  // accel15_map // accel15
589 
594 typedef enum
595 {
600 
605 typedef err_t ( *accel15_master_io_t )( struct accel15_s*, uint8_t, uint8_t*, uint8_t );
611 typedef struct accel15_s
612 {
613  digital_in_t in2;
614  digital_in_t in1;
616  i2c_master_t i2c;
617  spi_master_t spi;
619  uint8_t slave_address;
620  pin_name_t chip_select;
627 
632 typedef struct
633 {
634  pin_name_t scl;
635  pin_name_t sda;
636  pin_name_t miso;
637  pin_name_t mosi;
638  pin_name_t sck;
639  pin_name_t cs;
640  pin_name_t in2;
641  pin_name_t in1;
643  uint32_t i2c_speed;
644  uint8_t i2c_address;
646  uint32_t spi_speed;
647  spi_master_mode_t spi_mode;
648  spi_master_chip_select_polarity_t cs_polarity;
652 } accel15_cfg_t;
653 
657 typedef struct
658 {
659  int16_t x;
660  int16_t y;
661  int16_t z;
662 
664 
669 typedef enum
670 {
672  ACCEL15_ERROR = -1
673 
675 
692 
708 
723 err_t accel15_init ( accel15_t *ctx, accel15_cfg_t *cfg );
724 
738 
754 err_t accel15_generic_write ( accel15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len );
755 
771 err_t accel15_generic_read ( accel15_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len );
772 
785 
800 
812 uint8_t accel15_get_error ( accel15_t *ctx );
813 
825 uint8_t accel15_get_status ( accel15_t *ctx );
826 
839 
865 void accel15_cfg_accel ( accel15_t *ctx, uint8_t acc_odr, uint8_t g_range );
866 
879 
894 
907 uint8_t accel15_get_int_1 ( accel15_t *ctx );
908 
921 uint8_t accel15_get_int_2 ( accel15_t *ctx );
922 
923 #ifdef __cplusplus
924 }
925 #endif
926 #endif // ACCEL15_H
927  // accel15
929 
930 // ------------------------------------------------------------------------ END
accel15_get_axis_data
err_t accel15_get_axis_data(accel15_t *ctx, accel15_axis_t *axis)
Accel 15 get accelerometer axis function.
accel15_cfg_setup
void accel15_cfg_setup(accel15_cfg_t *cfg)
Accel 15 configuration object setup function.
accel15_cfg_t::spi_speed
uint32_t spi_speed
Definition: accel15.h:646
accel15_master_io_t
err_t(* accel15_master_io_t)(struct accel15_s *, uint8_t, uint8_t *, uint8_t)
Accel 15 Click driver interface.
Definition: accel15.h:605
accel15_drv_t
accel15_drv_t
Accel 15 Click driver selector.
Definition: accel15.h:595
accel15_axis_t::y
int16_t y
Definition: accel15.h:660
accel15_cfg_accel
void accel15_cfg_accel(accel15_t *ctx, uint8_t acc_odr, uint8_t g_range)
Accel 15 config accel function.
accel15_generic_write
err_t accel15_generic_write(accel15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
Accel 15 data writing function.
accel15_cfg_t::scl
pin_name_t scl
Definition: accel15.h:634
accel15_cfg_t::mosi
pin_name_t mosi
Definition: accel15.h:637
accel15_get_error
uint8_t accel15_get_error(accel15_t *ctx)
Accel 15 get error function.
accel15_cfg_t::in2
pin_name_t in2
Definition: accel15.h:640
accel15_axis_t
Accel axis data structure.
Definition: accel15.h:658
accel15_s::in2
digital_in_t in2
Definition: accel15.h:613
accel15_axis_t::z
int16_t z
Definition: accel15.h:661
accel15_cfg_t::sck
pin_name_t sck
Definition: accel15.h:638
accel15_cfg_t::in1
pin_name_t in1
Definition: accel15.h:641
accel15_get_int_2
uint8_t accel15_get_int_2(accel15_t *ctx)
Accel 15 get Interrupt 1 function.
accel15_s::chip_select
pin_name_t chip_select
Definition: accel15.h:620
accel15_s::i2c
i2c_master_t i2c
Definition: accel15.h:616
accel15_s::slave_address
uint8_t slave_address
Definition: accel15.h:619
accel15_cfg_t
Accel 15 Click configuration object.
Definition: accel15.h:633
accel15_s
Accel 15 Click context object.
Definition: accel15.h:612
accel15_get_int_1
uint8_t accel15_get_int_1(accel15_t *ctx)
Accel 15 get Interrupt 1 function.
accel15_cfg_t::i2c_address
uint8_t i2c_address
Definition: accel15.h:644
accel15_cfg_t::miso
pin_name_t miso
Definition: accel15.h:636
accel15_cfg_t::sda
pin_name_t sda
Definition: accel15.h:635
accel15_s::write_f
accel15_master_io_t write_f
Definition: accel15.h:623
accel15_init
err_t accel15_init(accel15_t *ctx, accel15_cfg_t *cfg)
Accel 15 initialization function.
ACCEL15_OK
@ ACCEL15_OK
Definition: accel15.h:671
accel15_s::in1
digital_in_t in1
Definition: accel15.h:614
accel15_default_cfg
err_t accel15_default_cfg(accel15_t *ctx)
Accel 15 default configuration function.
accel15_enable_accel
void accel15_enable_accel(accel15_t *ctx)
Accel 15 enable accel function.
ACCEL15_DRV_SEL_SPI
@ ACCEL15_DRV_SEL_SPI
Definition: accel15.h:596
accel15_t
struct accel15_s accel15_t
Accel 15 Click context object.
accel15_cfg_t::drv_sel
accel15_drv_t drv_sel
Definition: accel15.h:650
accel15_drv_interface_selection
void accel15_drv_interface_selection(accel15_cfg_t *cfg, accel15_drv_t drv_sel)
Accel 15 driver interface setup function.
accel15_s::spi
spi_master_t spi
Definition: accel15.h:617
accel15_s::drv_sel
accel15_drv_t drv_sel
Definition: accel15.h:621
accel15_check_id
err_t accel15_check_id(accel15_t *ctx)
Accel 15 check ID function.
accel15_soft_reset
void accel15_soft_reset(accel15_t *ctx)
Accel 15 soft reset function.
ACCEL15_DRV_SEL_I2C
@ ACCEL15_DRV_SEL_I2C
Definition: accel15.h:597
accel15_cfg_t::cs
pin_name_t cs
Definition: accel15.h:639
ACCEL15_ERROR
@ ACCEL15_ERROR
Definition: accel15.h:672
accel15_cfg_t::cs_polarity
spi_master_chip_select_polarity_t cs_polarity
Definition: accel15.h:648
accel15_cfg_t::spi_mode
spi_master_mode_t spi_mode
Definition: accel15.h:647
accel15_cfg_t::i2c_speed
uint32_t i2c_speed
Definition: accel15.h:643
accel15_generic_read
err_t accel15_generic_read(accel15_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
Accel 15 data reading function.
accel15_get_internal_status
uint8_t accel15_get_internal_status(accel15_t *ctx)
Accel 15 internal status function.
accel15_s::read_f
accel15_master_io_t read_f
Definition: accel15.h:624
accel15_axis_t::x
int16_t x
Definition: accel15.h:659
accel15_return_value_t
accel15_return_value_t
Accel 15 Click return value data.
Definition: accel15.h:670
accel15_get_status
uint8_t accel15_get_status(accel15_t *ctx)
Accel 15 status function.