no-OS
adxrs453.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef __ADXRS453_H__
40 #define __ADXRS453_H__
41 
42 /******************************************************************************/
43 /***************************** Include Files **********************************/
44 /******************************************************************************/
45 #include <stdint.h>
46 #include "no_os_spi.h"
47 
48 /******************************************************************************/
49 /************************** ADXRS453 Definitions ******************************/
50 /******************************************************************************/
51 
52 #define ADXRS453_READ (1 << 7)
53 #define ADXRS453_WRITE (1 << 6)
54 #define ADXRS453_SENSOR_DATA (1 << 5)
55 
56 #define ADXRS453_REG_RATE 0x00
57 #define ADXRS453_REG_TEM 0x02
58 #define ADXRS453_REG_LOCST 0x04
59 #define ADXRS453_REG_HICST 0x06
60 #define ADXRS453_REG_QUAD 0x08
61 #define ADXRS453_REG_FAULT 0x0A
62 #define ADXRS453_REG_PID 0x0C
63 #define ADXRS453_REG_SN_HIGH 0x0E
64 #define ADXRS453_REG_SN_LOW 0x10
65 
66 /******************************************************************************/
67 /*************************** Types Declarations *******************************/
68 /******************************************************************************/
69 
70 struct adxrs453_dev {
71  /* SPI */
73 };
74 
76  /* SPI */
78 };
79 
80 /******************************************************************************/
81 /************************ Functions Declarations ******************************/
82 /******************************************************************************/
83 
85 int32_t adxrs453_init(struct adxrs453_dev **device,
87 
89 int32_t adxrs453_remove(struct adxrs453_dev *dev);
90 
92 uint16_t adxrs453_get_register_value(struct adxrs453_dev *dev,
93  uint8_t register_address);
94 
97  uint8_t register_address,
98  uint16_t register_value);
99 
101 uint32_t adxrs453_get_sensor_data(struct adxrs453_dev *dev);
102 
104 float adxrs453_get_rate(struct adxrs453_dev *dev);
105 
107 float adxrs453_get_temperature(struct adxrs453_dev *dev);
108 
109 #endif // __ADXRS453_H__
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:82
ADXRS453_REG_TEM
#define ADXRS453_REG_TEM
Definition: adxrs453.h:57
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:107
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:225
adxrs453_get_sensor_data
uint32_t adxrs453_get_sensor_data(struct adxrs453_dev *dev)
Reads the sensor data.
Definition: adxrs453.c:185
ADXRS453_SENSOR_DATA
#define ADXRS453_SENSOR_DATA
Definition: adxrs453.h:54
ADXRS453_READ
#define ADXRS453_READ
Definition: adxrs453.h:52
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:249
adxrs453_get_rate
float adxrs453_get_rate(struct adxrs453_dev *dev)
Reads the rate data and converts it to degrees/second.
Definition: adxrs453.c:225
ADXRS453_REG_RATE
#define ADXRS453_REG_RATE
Definition: adxrs453.h:56
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:107
device
Definition: ad9361_util.h:75
adxrs453_get_sensor_data
uint32_t adxrs453_get_sensor_data(struct adxrs453_dev *dev)
Reads the sensor data.
Definition: adxrs453.c:185
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:150
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:132
adxrs453_dev
Definition: adxrs453.h:70
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:249
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:150
adxrs453_remove
int32_t adxrs453_remove(struct adxrs453_dev *dev)
Free the resources allocated by adxrs453_init().
Definition: adxrs453.c:88
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:58
adxrs453_init_param::spi_init
no_os_spi_init_param spi_init
Definition: adxrs453.h:77
adxrs453_remove
int32_t adxrs453_remove(struct adxrs453_dev *dev)
Free the resources allocated by adxrs453_init().
Definition: adxrs453.c:88
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:96
ADXRS453_WRITE
#define ADXRS453_WRITE
Definition: adxrs453.h:53
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:70
adxrs453_init_param
Definition: adxrs453.h:75
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:58
adxrs453_dev::spi_desc
no_os_spi_desc * spi_desc
Definition: adxrs453.h:72
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:51
adxrs453.h
Header file of ADXRS453 Driver.
ADXRS453_REG_PID
#define ADXRS453_REG_PID
Definition: adxrs453.h:62
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:112