Go to the documentation of this file.
35 #include "mikrosdk_version.h"
38 #if mikroSDK_GET_VERSION < 20800ul
39 #include "rcu_delays.h"
45 #include "drv_digital_out.h"
46 #include "drv_digital_in.h"
47 #include "drv_spi_master.h"
70 #define GYRO8_REG_RATE 0x01
71 #define GYRO8_REG_TEMP 0x07
72 #define GYRO8_REG_RATE_STATUS_1 0x09
73 #define GYRO8_REG_RATE_STATUS_2 0x0A
74 #define GYRO8_REG_ACC_STATUS 0x0F
75 #define GYRO8_REG_TEST 0x15
76 #define GYRO8_REG_RESET_CONTROL 0x16
77 #define GYRO8_REG_SERIAL_ID0 0x18
78 #define GYRO8_REG_SERIAL_ID1 0x19
79 #define GYRO8_REG_COMMON_STATUS 0x1B
80 #define GYRO8_REG_ID 0x1D
81 #define GYRO8_REG_STATUS_SUMMARY 0x1F
99 #define GYRO8_ID 0x0500
105 #define GYRO8_TEMP_SENS 14.7f
106 #define GYRO8_TEMP_OFFSET 60.0f
107 #define GYRO8_GYRO_SENS 50.0f
117 #define GYRO8_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
118 #define GYRO8_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
136 #define GYRO8_MAP_MIKROBUS( cfg, mikrobus ) \
137 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
138 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
139 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
140 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
141 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST );
pin_name_t rst
Definition: gyro8.h:175
digital_out_t rst
Definition: gyro8.h:153
spi_master_mode_t spi_mode
Definition: gyro8.h:179
pin_name_t cs
Definition: gyro8.h:172
void gyro8_cfg_setup(gyro8_cfg_t *cfg)
Gyro 8 configuration object setup function.
void gyro8_reset_device(gyro8_t *ctx)
Gyro 8 reset device function.
void gyro8_set_rst_pin(gyro8_t *ctx, uint8_t state)
Gyro 8 set rst pin function.
err_t gyro8_read_serial_id(gyro8_t *ctx, uint32_t *serial_id)
Gyro 8 read serial id function.
err_t gyro8_read_temperature(gyro8_t *ctx, float *temperature)
Gyro 8 read temperature function.
This file contains SPI specific macros, functions, etc.
pin_name_t sck
Definition: gyro8.h:171
err_t gyro8_init(gyro8_t *ctx, gyro8_cfg_t *cfg)
Gyro 8 initialization function.
err_t gyro8_read_register(gyro8_t *ctx, uint8_t reg, uint16_t *data_out)
Gyro 8 read register function.
gyro8_return_value_t
Gyro 8 Click return value data.
Definition: gyro8.h:189
err_t gyro8_check_communication(gyro8_t *ctx)
Gyro 8 check communication function.
@ GYRO8_OK
Definition: gyro8.h:190
Gyro 8 Click context object.
Definition: gyro8.h:151
@ GYRO8_ERROR
Definition: gyro8.h:191
uint32_t spi_speed
Definition: gyro8.h:178
spi_master_chip_select_polarity_t cs_polarity
Definition: gyro8.h:180
err_t gyro8_default_cfg(gyro8_t *ctx)
Gyro 8 default configuration function.
pin_name_t chip_select
Definition: gyro8.h:158
pin_name_t mosi
Definition: gyro8.h:170
pin_name_t miso
Definition: gyro8.h:169
err_t gyro8_write_register(gyro8_t *ctx, uint8_t reg, uint16_t data_in)
Gyro 8 write register function.
err_t gyro8_read_angular_rate(gyro8_t *ctx, float *rate)
Gyro 8 read angular rate function.
Gyro 8 Click configuration object.
Definition: gyro8.h:167
spi_master_t spi
Definition: gyro8.h:156