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 "drv_digital_out.h"
36 #include "drv_digital_in.h"
37 #include "drv_i2c_master.h"
38 #include "drv_spi_master.h"
39 
60 #define ACCEL15_REG_CHIP_ID 0x00
61 #define ACCEL15_REG_ERROR 0x02
62 #define ACCEL15_REG_STATUS 0x03
63 #define ACCEL15_REG_DATA_0 0x0A
64 #define ACCEL15_REG_DATA_8 0x12
65 #define ACCEL15_REG_SENSORTIME_0 0x18
66 #define ACCEL15_REG_EVENT 0x1B
67 #define ACCEL15_REG_INT_STAT_0 0x1C
68 #define ACCEL15_REG_INT_STAT_1 0x1D
69 #define ACCEL15_REG_TEMPERATURE 0x22
70 #define ACCEL15_REG_FIFO_LENGTH_0 0x24
71 #define ACCEL15_REG_FIFO_DATA 0x26
72 #define ACCEL15_REG_INTERNAL_STAT 0x2A
73 #define ACCEL15_REG_ACCEL_CONFIG 0x40
74 #define ACCEL15_REG_ACCEL_RANGE 0x41
75 #define ACCEL15_REG_AUX_CONF 0x44
76 #define ACCEL15_REG_FIFO_DOWN 0x45
77 #define ACCEL15_REG_FIFO_WTM_0 0x46
78 #define ACCEL15_REG_FIFO_CONFIG_0 0x48
79 #define ACCEL15_REG_FIFO_CONFIG_1 0x49
80 #define ACCEL15_REG_AUX_DEV_ID 0x4B
81 #define ACCEL15_REG_AUX_IF_CONF 0x4C
82 #define ACCEL15_REG_AUX_RD 0x4D
83 #define ACCEL15_REG_INT1_IO_CTRL 0x53
84 #define ACCEL15_REG_INT2_IO_CTRL 0x54
85 #define ACCEL15_REG_INT_LATCH 0x55
86 #define ACCEL15_REG_INT_MAP_1 0x56
87 #define ACCEL15_REG_INT_MAP_2 0x57
88 #define ACCEL15_REG_INT_MAP_DATA 0x58
89 #define ACCEL15_REG_INIT_CTRL 0x59
90 #define ACCEL15_REG_RESERVED_REG_5B 0x5B
91 #define ACCEL15_REG_RESERVED_REG_5C 0x5C
92 #define ACCEL15_REG_FEATURE_CONFIG 0x5E
93 #define ACCEL15_REG_INTERNAL_ERROR 0x5F
94 #define ACCEL15_REG_ACC_SELF_TEST 0x6D
95 #define ACCEL15_REG_ACC_SELF_TEST 0x6D
96 #define ACCEL15_REG_NV_CONFIG 0x70
97 #define ACCEL15_REG_OFFSET_0 0x71
98 #define ACCEL15_REG_OFFSET_1 0x72
99 #define ACCEL15_REG_OFFSET_2 0x73
100 #define ACCEL15_REG_POWER_CONF 0x7C
101 #define ACCEL15_REG_POWER_CTRL 0x7D
102 #define ACCEL15_REG_CMD 0x7E
103  // accel15_reg
105 
125 #define ACCEL15_CHIP_ID 0x1A
126 #define ACCEL15_FEATURE_SIZE 0x0C
127 #define ACCEL15_RD_WR_MIN_LEN 0x02
128 #define ACCEL15_RD_WR_MAX_LEN 1300
129 
134 #define ACCEL15_ANY_MOT_START_ADDR 0x00
135 #define ACCEL15_NO_MOT_START_ADDR 0x04
136 #define ACCEL15_CONFIG_ID_START_ADDR 0x08
137 #define ACCEL15_AXES_REMAP_START_ADDR 0x0A
138 
144 #define ACCEL15_X_AXIS_MSK 0x03
145 #define ACCEL15_X_AXIS_SIGN_MSK 0x04
146 #define ACCEL15_Y_AXIS_MSK 0x18
147 #define ACCEL15_Y_AXIS_SIGN_MSK 0x20
148 #define ACCEL15_Z_AXIS_MSK 0xC0
149 #define ACCEL15_Z_AXIS_SIGN_MSK 0x01
150 
156 #define ACCEL15_X_AXIS_SIGN_POS 0x02
157 #define ACCEL15_Y_AXIS_POS 0x03
158 #define ACCEL15_Y_AXIS_SIGN_POS 0x05
159 #define ACCEL15_Z_AXIS_POS 0x06
160 
166 #define ACCEL15_X_AXIS_EN 0x01
167 #define ACCEL15_Y_AXIS_EN 0x02
168 #define ACCEL15_Z_AXIS_EN 0x04
169 #define ACCEL15_EN_ALL_AXIS 0x07
170 #define ACCEL15_DIS_ALL_AXIS 0x00
171 
177 #define ACCEL15_ANY_MOT_INT 0x20
178 #define ACCEL15_NO_MOT_INT 0x40
179 #define ACCEL15_ERROR_INT 0x80
180 
186 #define ACCEL15_INT1_IO_CTRL_INPUT_EN 0x10
187 #define ACCEL15_INT1_IO_CTRL_OUTPUT_EN 0x08
188 #define ACCEL15_INT1_IO_CTRL_OD_EN 0x04
189 #define ACCEL15_INT1_IO_CTRL_LVL_HIGH 0x02
190 #define ACCEL15_INT1_IO_CTRL_EDGE_EN 0x01
191 
197 #define ACCEL15_INT_MAP_DATA_INT2_DRDY 0x40
198 #define ACCEL15_INT_MAP_DATA_INT2_FWM 0x20
199 #define ACCEL15_INT_MAP_DATA_INT2_FFULL 0x10
200 #define ACCEL15_INT_MAP_DATA_INT1_DRDY 0x04
201 #define ACCEL15_INT_MAP_DATA_INT1_FWM 0x02
202 #define ACCEL15_INT_MAP_DATA_INT1_FFULL 0x01
203 
209 #define ACCEL15_
210 
216 #define ACCEL15_ACCEL_OFF 0x00
217 #define ACCEL15_ACCEL_ON 0x04
218 #define ACCEL15_AUX_OFF 0x00
219 #define ACCEL15_AUX_ON 0x01
220 
226 #define ACCEL15_APS_OFF 0x00
227 #define ACCEL15_APS_ON 0x01
228 #define ACCEL15_FSW_OFF 0x00
229 #define ACCEL15_FSW_ON 0x02
230 
236 #define ACCEL15_CONFIG_MAJOR_POS 0x06
237 
243 #define ACCEL15_DRDY 0x01
244 #define ACCEL15_ACCEL_EN 0x40
245 #define ACCEL15_ACCEL_DRDY 0x80
246 
252 #define ACCEL15_SPI_WR_MASK 0x7F
253 #define ACCEL15_SPI_RD_MASK 0x80
254 
260 #define ACCEL15_ENABLE 0x01
261 #define ACCEL15_DISABLE 0x00
262 
268 #define ACCEL15_CIC_AVG_MODE 0
269 #define ACCEL15_CONTINUOUS_MODE 1
270 
276 #define ACCEL15_ADVANCE_POWER_SAVE_MSK 0x01
277 
283 #define ACCEL15_12_BIT_RESOLUTION 12
284 #define ACCEL15_16_BIT_RESOLUTION 16
285 
291 #define ACCEL15_ACCEL_ENABLE_POS 2
292 #define ACCEL15_ACCEL_ENABLE_MSK 0x04
293 
299 #define ACCEL15_SOFT_RESET 0x6B
300 
306 #define ACCEL15_ACCEL_ODR_MSK 0x0F
307 #define ACCEL15_ACCEL_BW_POS 4
308 #define ACCEL15_ACCEL_BW_MSK 0x70
309 #define ACCEL15_ACCEL_RANGE_MSK 0x03
310 #define ACCEL15_ACCEL_PERFMODE_POS 7
311 #define ACCEL15_ACCEL_PERFMODE_MSK 0x80
312 
318 #define ACCEL15_ACCEL_CONFIG_LENGTH 2
319 #define ACCEL15_FIFO_CONFIG_LENGTH 2
320 #define ACCEL15_FIFO_WM_LENGTH 2
321 #define ACCEL15_ACCEL_DATA_LENGTH 6
322 #define ACCEL15_FIFO_DATA_LENGTH 2
323 #define ACCEL15_MA_FIFO_A_X_LSB 8
324 #define ACCEL15_SENSOR_TIME_MSB_BYTE 2
325 #define ACCEL15_SENSOR_TIME_XLSB_BYTE 1
326 #define ACCEL15_SENSOR_TIME_LSB_BYTE 0
327 #define ACCEL15_FIFO_LENGTH_MSB_BYTE 1
328 
334 #define ACCEL15_OUTPUT_DATA_RATE_12_5HZ 0x05
335 #define ACCEL15_OUTPUT_DATA_RATE_25HZ 0x06
336 #define ACCEL15_OUTPUT_DATA_RATE_50HZ 0x07
337 #define ACCEL15_OUTPUT_DATA_RATE_100HZ 0x08
338 #define ACCEL15_OUTPUT_DATA_RATE_200HZ 0x09
339 #define ACCEL15_OUTPUT_DATA_RATE_400HZ 0x0A
340 #define ACCEL15_OUTPUT_DATA_RATE_800HZ 0x0B
341 #define ACCEL15_OUTPUT_DATA_RATE_1600HZ 0x0C
342 
348 #define ACCEL15_ACCEL_OSR4_AVG1 0
349 #define ACCEL15_ACCEL_OSR2_AVG2 1
350 #define ACCEL15_ACCEL_NORMAL_AVG4 2
351 #define ACCEL15_ACCEL_CIC_AVG8 3
352 #define ACCEL15_ACCEL_RES_AVG16 4
353 #define ACCEL15_ACCEL_RES_AVG32 5
354 #define ACCEL15_ACCEL_RES_AVG64 6
355 #define ACCEL15_ACCEL_RES_AVG128 7
356 
362 #define ACCEL15_ACCEL_RANGE_16G 0
363 #define ACCEL15_ACCEL_RANGE_8G 1
364 #define ACCEL15_ACCEL_RANGE_4G 2
365 #define ACCEL15_ACCEL_RANGE_2G 3
366 
372 #define ACCEL15_FATAL_ERR_MSK 0x01
373 #define ACCEL15_CMD_ERR_POS 1
374 #define ACCEL15_CMD_ERR_MSK 0x02
375 #define ACCEL15_ERR_CODE_POS 2
376 #define ACCEL15_ERR_CODE_MSK 0x1C
377 #define ACCEL15_FIFO_ERR_POS 6
378 #define ACCEL15_FIFO_ERR_MSK 0x40
379 
385 #define ACCEL15_FIFO_SELF_WAKE_UP_POS 1
386 #define ACCEL15_FIFO_SELF_WAKE_UP_MSK 0x02
387 #define ACCEL15_FIFO_BYTE_COUNTER_MSB_MSK 0x3F
388 #define ACCEL15_FIFO_DATA_POS 0
389 #define ACCEL15_FIFO_DATA_MSK 0xFF
390 #define ACCEL15_FIFO_DOWN_ACCEL_POS 4
391 #define ACCEL15_FIFO_DOWN_ACCEL_MSK 0x70
392 #define ACCEL15_FIFO_FILTER_ACCEL_POS 7
393 #define ACCEL15_FIFO_FILTER_ACCEL_MSK 0x80
394 
400 #define ACCEL15_FIFO_HEADER_ACC 0x84
401 #define ACCEL15_FIFO_HEADER_MAG 0x90
402 #define ACCEL15_FIFO_HEADER_MAG_ACC 0x94
403 #define ACCEL15_FIFO_HEADER_SENSOR_TIME 0x44
404 #define ACCEL15_FIFO_HEADER_INPUT_CONFIG 0x48
405 #define ACCEL15_FIFO_HEADER_SKIP_FRAME 0x40
406 #define ACCEL15_FIFO_HEADER_OVER_READ_MSB 0x80
407 #define ACCEL15_FIFO_HEADER_SAMPLE_DROP 0x50
408 #define ACCEL15_FIFO_MAG_ACC_ENABLE 0x60
409 #define ACCEL15_FIFO_ACC_ENABLE 0x40
410 #define ACCEL15_FIFO_MAG_ENABLE 0x20
411 #define ACCEL15_FIFO_STOP_ON_FULL 0x01
412 #define ACCEL15_FIFO_TIME 0x02
413 #define ACCEL15_FIFO_TAG_INTR2 0x04
414 #define ACCEL15_FIFO_TAG_INTR1 0x08
415 #define ACCEL15_FIFO_HEADER 0x10
416 #define ACCEL15_FIFO_MAG 0x20
417 #define ACCEL15_FIFO_ACCEL 0x40
418 #define ACCEL15_FIFO_ALL 0x7F
419 #define ACCEL15_FIFO_CONFIG_0_MASK 0x03
420 #define ACCEL15_FIFO_CONFIG_1_MASK 0xFC
421 
427 #define ACCEL15_FIFO_LSB_CONFIG_CHECK 0x00
428 #define ACCEL15_FIFO_MSB_CONFIG_CHECK 0x80
429 #define ACCEL15_FIFO_TAG_INTR_MASK 0xFC
430 
436 #define ACCEL15_ACCEL_AUX_FIFO_DROP 0x05
437 #define ACCEL15_ACCEL_FIFO_DROP 0x01
438 
444 #define ACCEL15_INIT_START 0x00
445 #define ACCEL15_INIT_STOP 0x01
446 
452 #define ACCEL15_SENSOR_TIME_LENGTH 3
453 
459 #define ACCEL15_FIFO_ACC_LENGTH 6
460 #define ACCEL15_FIFO_MAG_LENGTH 8
461 #define ACCEL15_FIFO_MAG_ACC_LENGTH 14
462 #define ACCEL15_CONFIG_STREAM_MESSAGE_MSK 0x0F
463 #define ACCEL15_ASIC_INITIALIZED 0x01
464 
470 #define ACCEL15_ACCEL_CONFIG_FOC 0xB7
471 
477 #define ACCEL15_X_AXIS 0
478 #define ACCEL15_Y_AXIS 1
479 #define ACCEL15_Z_AXIS 2
480 
486 #define ACCEL15_NV_ENABLE_I2C 0x00
487 #define ACCEL15_NV_DISABLE_I2C 0x01
488 #define ACCEL15_NV_ACCEL_OFFSET_POS 3
489 #define ACCEL15_NV_ACCEL_OFFSET_MSK 0x08
490 
496 #define ACCEL15_SELFTEST_PASS 0
497 #define ACCEL15_SELFTEST_FAIL 1
498 #define ACCEL15_SELFTEST_DIFF_X_AXIS_FAILED 1
499 #define ACCEL15_SELFTEST_DIFF_Y_AXIS_FAILED 2
500 #define ACCEL15_SELFTEST_DIFF_Z_AXIS_FAILED 3
501 #define ACCEL15_SELFTEST_DIFF_X_AND_Y_AXIS_FAILED 4
502 #define ACCEL15_SELFTEST_DIFF_X_AND_Z_AXIS_FAILED 5
503 #define ACCEL15_SELFTEST_DIFF_Y_AND_Z_AXIS_FAILED 6
504 #define ACCEL15_SELFTEST_DIFF_X_Y_AND_Z_AXIS_FAILED 7
505 
511 #define ACCEL15_ACCEL_SELFTEST_ENABLE_MSK 0x01
512 #define ACCEL15_ACCEL_SELFTEST_SIGN_POS 2
513 #define ACCEL15_ACCEL_SELFTEST_SIGN_MSK 0x04
514 #define ACCEL15_SELFTEST_AMP_POS 3
515 #define ACCEL15_SELFTEST_AMP_MSK 0x08
516 
522 #define ACCEL15_MAX_VALUE_FIFO_FILTER 1
523 #define ACCEL15_MAX_VALUE_SPI3 1
524 #define ACCEL15_MAX_VALUE_SELFTEST_AMP 1
525 #define ACCEL15_MAX_IF_MODE 3
526 #define ACCEL15_MAX_VALUE_SELFTEST_SIGN 1
527 
533 #define ACCEL15_FOC_ACC_CONF_VAL 0xB7
534 
540 #define ACCEL15_SPI_WRITE 0x00
541 #define ACCEL15_SPI_READ 0x80
542 
548 #define ACCEL15_SET_DEV_ADDR_GND 0x18
549 #define ACCEL15_SET_DEV_ADDR_VCC 0x19
550  // accel15_set
552 
567 #define ACCEL15_MAP_MIKROBUS( cfg, mikrobus ) \
568  cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
569  cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
570  cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
571  cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
572  cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
573  cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
574  cfg.in2 = MIKROBUS( mikrobus, MIKROBUS_AN ); \
575  cfg.in1 = MIKROBUS( mikrobus, MIKROBUS_INT )
576  // accel15_map // accel15
579 
584 typedef enum
585 {
590 
595 typedef err_t ( *accel15_master_io_t )( struct accel15_s*, uint8_t, uint8_t*, uint8_t );
601 typedef struct accel15_s
602 {
603  digital_in_t in2;
604  digital_in_t in1;
606  i2c_master_t i2c;
607  spi_master_t spi;
609  uint8_t slave_address;
610  pin_name_t chip_select;
617 
622 typedef struct
623 {
624  pin_name_t scl;
625  pin_name_t sda;
626  pin_name_t miso;
627  pin_name_t mosi;
628  pin_name_t sck;
629  pin_name_t cs;
630  pin_name_t in2;
631  pin_name_t in1;
633  uint32_t i2c_speed;
634  uint8_t i2c_address;
636  uint32_t spi_speed;
637  spi_master_mode_t spi_mode;
638  spi_master_chip_select_polarity_t cs_polarity;
642 } accel15_cfg_t;
643 
647 typedef struct
648 {
649  int16_t x;
650  int16_t y;
651  int16_t z;
652 
654 
659 typedef enum
660 {
662  ACCEL15_ERROR = -1
663 
665 
682 
698 
713 err_t accel15_init ( accel15_t *ctx, accel15_cfg_t *cfg );
714 
728 
744 err_t accel15_generic_write ( accel15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len );
745 
761 err_t accel15_generic_read ( accel15_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len );
762 
775 
790 
802 uint8_t accel15_get_error ( accel15_t *ctx );
803 
815 uint8_t accel15_get_status ( accel15_t *ctx );
816 
829 
855 void accel15_cfg_accel ( accel15_t *ctx, uint8_t acc_odr, uint8_t g_range );
856 
869 
884 
897 uint8_t accel15_get_int_1 ( accel15_t *ctx );
898 
911 uint8_t accel15_get_int_2 ( accel15_t *ctx );
912 
913 #ifdef __cplusplus
914 }
915 #endif
916 #endif // ACCEL15_H
917  // accel15
919 
920 // ------------------------------------------------------------------------ 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:636
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:595
accel15_drv_t
accel15_drv_t
Accel 15 Click driver selector.
Definition: accel15.h:585
accel15_axis_t::y
int16_t y
Definition: accel15.h:650
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:624
accel15_cfg_t::mosi
pin_name_t mosi
Definition: accel15.h:627
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:630
accel15_axis_t
Accel axis data structure.
Definition: accel15.h:648
accel15_s::in2
digital_in_t in2
Definition: accel15.h:603
accel15_axis_t::z
int16_t z
Definition: accel15.h:651
accel15_cfg_t::sck
pin_name_t sck
Definition: accel15.h:628
accel15_cfg_t::in1
pin_name_t in1
Definition: accel15.h:631
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:610
accel15_s::i2c
i2c_master_t i2c
Definition: accel15.h:606
accel15_s::slave_address
uint8_t slave_address
Definition: accel15.h:609
accel15_cfg_t
Accel 15 Click configuration object.
Definition: accel15.h:623
accel15_s
Accel 15 Click context object.
Definition: accel15.h:602
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:634
accel15_cfg_t::miso
pin_name_t miso
Definition: accel15.h:626
accel15_cfg_t::sda
pin_name_t sda
Definition: accel15.h:625
accel15_s::write_f
accel15_master_io_t write_f
Definition: accel15.h:613
accel15_init
err_t accel15_init(accel15_t *ctx, accel15_cfg_t *cfg)
Accel 15 initialization function.
ACCEL15_OK
@ ACCEL15_OK
Definition: accel15.h:661
accel15_s::in1
digital_in_t in1
Definition: accel15.h:604
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:586
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:640
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:607
accel15_s::drv_sel
accel15_drv_t drv_sel
Definition: accel15.h:611
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:587
accel15_cfg_t::cs
pin_name_t cs
Definition: accel15.h:629
ACCEL15_ERROR
@ ACCEL15_ERROR
Definition: accel15.h:662
accel15_cfg_t::cs_polarity
spi_master_chip_select_polarity_t cs_polarity
Definition: accel15.h:638
accel15_cfg_t::spi_mode
spi_master_mode_t spi_mode
Definition: accel15.h:637
accel15_cfg_t::i2c_speed
uint32_t i2c_speed
Definition: accel15.h:633
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:614
accel15_axis_t::x
int16_t x
Definition: accel15.h:649
accel15_return_value_t
accel15_return_value_t
Accel 15 Click return value data.
Definition: accel15.h:660
accel15_get_status
uint8_t accel15_get_status(accel15_t *ctx)
Accel 15 status function.