no-OS
adxrs453.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef __ADXRS453_H__
34 #define __ADXRS453_H__
35 
36 /******************************************************************************/
37 /***************************** Include Files **********************************/
38 /******************************************************************************/
39 #include <stdint.h>
40 #include "no_os_spi.h"
41 
42 /******************************************************************************/
43 /************************** ADXRS453 Definitions ******************************/
44 /******************************************************************************/
45 
46 #define ADXRS453_READ (1 << 7)
47 #define ADXRS453_WRITE (1 << 6)
48 #define ADXRS453_SENSOR_DATA (1 << 5)
49 
50 #define ADXRS453_REG_RATE 0x00
51 #define ADXRS453_REG_TEM 0x02
52 #define ADXRS453_REG_LOCST 0x04
53 #define ADXRS453_REG_HICST 0x06
54 #define ADXRS453_REG_QUAD 0x08
55 #define ADXRS453_REG_FAULT 0x0A
56 #define ADXRS453_REG_PID 0x0C
57 #define ADXRS453_REG_SN_HIGH 0x0E
58 #define ADXRS453_REG_SN_LOW 0x10
59 
60 /******************************************************************************/
61 /*************************** Types Declarations *******************************/
62 /******************************************************************************/
63 
64 struct adxrs453_dev {
65  /* SPI */
67 };
68 
70  /* SPI */
72 };
73 
74 /******************************************************************************/
75 /************************ Functions Declarations ******************************/
76 /******************************************************************************/
77 
79 int32_t adxrs453_init(struct adxrs453_dev **device,
81 
83 int32_t adxrs453_remove(struct adxrs453_dev *dev);
84 
86 uint16_t adxrs453_get_register_value(struct adxrs453_dev *dev,
87  uint8_t register_address);
88 
91  uint8_t register_address,
92  uint16_t register_value);
93 
95 uint32_t adxrs453_get_sensor_data(struct adxrs453_dev *dev);
96 
98 float adxrs453_get_rate(struct adxrs453_dev *dev);
99 
101 float adxrs453_get_temperature(struct adxrs453_dev *dev);
102 
103 #endif // __ADXRS453_H__
no_os_alloc.h
iio_trigger.h
Header file for iio_trigger.
no_os_spi_write_and_read
int32_t no_os_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI.
Definition: no_os_spi.c:159
ADXRS453_REG_TEM
#define ADXRS453_REG_TEM
Definition: adxrs453.h:51
adxrs453_get_register_value
uint16_t adxrs453_get_register_value(struct adxrs453_dev *dev, uint8_t register_address)
Reads the value of a register.
Definition: adxrs453.c:102
no_os_spi.h
Header file of SPI Interface.
adxrs453_get_rate
float adxrs453_get_rate(struct adxrs453_dev *dev)
Reads the rate data and converts it to degrees/second.
Definition: adxrs453.c:220
adxrs453_get_sensor_data
uint32_t adxrs453_get_sensor_data(struct adxrs453_dev *dev)
Reads the sensor data.
Definition: adxrs453.c:180
ADXRS453_SENSOR_DATA
#define ADXRS453_SENSOR_DATA
Definition: adxrs453.h:48
adxrs290_iio_trig_desc
struct iio_trigger adxrs290_iio_trig_desc
Definition: iio_adxrs290_trig.c:47
ADXRS453_READ
#define ADXRS453_READ
Definition: adxrs453.h:46
iio_trig_disable
int iio_trig_disable(void *trig)
Disable system interrupt which is linked to the given trigger.
Definition: iio_trigger.c:127
adxrs453_get_temperature
float adxrs453_get_temperature(struct adxrs453_dev *dev)
Reads the temperature sensor data and converts it to degrees Celsius.
Definition: adxrs453.c:244
adxrs453_get_rate
float adxrs453_get_rate(struct adxrs453_dev *dev)
Reads the rate data and converts it to degrees/second.
Definition: adxrs453.c:220
ADXRS453_REG_RATE
#define ADXRS453_REG_RATE
Definition: adxrs453.h:50
adxrs453_get_register_value
uint16_t adxrs453_get_register_value(struct adxrs453_dev *dev, uint8_t register_address)
Reads the value of a register.
Definition: adxrs453.c:102
device
Definition: ad9361_util.h:69
adxrs453_get_sensor_data
uint32_t adxrs453_get_sensor_data(struct adxrs453_dev *dev)
Reads the sensor data.
Definition: adxrs453.c:180
iio.h
Header file of iio.
iio_trig_enable
int iio_trig_enable(void *trig)
Enable system interrupt which is linked to the given trigger.
Definition: iio_trigger.c:110
adxrs453_set_register_value
void adxrs453_set_register_value(struct adxrs453_dev *dev, uint8_t register_address, uint16_t register_value)
Writes data into a register.
Definition: adxrs453.c:145
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
adxrs453_dev
Definition: adxrs453.h:64
adxrs453_init_param::spi_init
struct no_os_spi_init_param spi_init
Definition: adxrs453.h:71
adxrs453_get_temperature
float adxrs453_get_temperature(struct adxrs453_dev *dev)
Reads the temperature sensor data and converts it to degrees Celsius.
Definition: adxrs453.c:244
no_os_malloc
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
adxrs453_set_register_value
void adxrs453_set_register_value(struct adxrs453_dev *dev, uint8_t register_address, uint16_t register_value)
Writes data into a register.
Definition: adxrs453.c:145
adxrs453_remove
int32_t adxrs453_remove(struct adxrs453_dev *dev)
Free the resources allocated by adxrs453_init().
Definition: adxrs453.c:83
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
adxrs453_init
int32_t adxrs453_init(struct adxrs453_dev **device, struct adxrs453_init_param init_param)
Initializes the ADXRS453 and checks if the device is present.
Definition: adxrs453.c:53
adxrs453_remove
int32_t adxrs453_remove(struct adxrs453_dev *dev)
Free the resources allocated by adxrs453_init().
Definition: adxrs453.c:83
iio_trigger
Definition: iio_types.h:231
adxrs453_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: adxrs453.h:66
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
ADXRS453_WRITE
#define ADXRS453_WRITE
Definition: adxrs453.h:47
no_os_spi_remove
int32_t no_os_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by no_os_spi_init().
Definition: no_os_spi.c:116
adxrs453_init_param
Definition: adxrs453.h:69
adxrs453_init
int32_t adxrs453_init(struct adxrs453_dev **device, struct adxrs453_init_param init_param)
Initializes the ADXRS453 and checks if the device is present.
Definition: adxrs453.c:53
no_os_spi_init
int32_t no_os_spi_init(struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param)
Initialize the SPI communication peripheral.
Definition: no_os_spi.c:52
iio_trigger::is_synchronous
bool is_synchronous
Definition: iio_types.h:234
adxrs453.h
Header file of ADXRS453 Driver.
ADXRS453_REG_PID
#define ADXRS453_REG_PID
Definition: adxrs453.h:56
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140