no-OS
Loading...
Searching...
No Matches
adxrs453.h File Reference

Header file of ADXRS453 Driver. More...

#include <stdint.h>
#include "no_os_spi.h"
Include dependency graph for adxrs453.h:

Classes

struct  adxrs453_dev
 
struct  adxrs453_init_param
 

Macros

#define ADXRS453_READ   (1 << 7)
 
#define ADXRS453_WRITE   (1 << 6)
 
#define ADXRS453_SENSOR_DATA   (1 << 5)
 
#define ADXRS453_REG_RATE   0x00
 
#define ADXRS453_REG_TEM   0x02
 
#define ADXRS453_REG_LOCST   0x04
 
#define ADXRS453_REG_HICST   0x06
 
#define ADXRS453_REG_QUAD   0x08
 
#define ADXRS453_REG_FAULT   0x0A
 
#define ADXRS453_REG_PID   0x0C
 
#define ADXRS453_REG_SN_HIGH   0x0E
 
#define ADXRS453_REG_SN_LOW   0x10
 

Functions

int32_t adxrs453_init (struct adxrs453_dev **device, struct adxrs453_init_param init_param)
 Initializes the ADXRS453 and checks if the device is present.
 
int32_t adxrs453_remove (struct adxrs453_dev *dev)
 Free the resources allocated by adxrs453_init().
 
uint16_t adxrs453_get_register_value (struct adxrs453_dev *dev, uint8_t register_address)
 Reads the value of a register.
 
void adxrs453_set_register_value (struct adxrs453_dev *dev, uint8_t register_address, uint16_t register_value)
 Writes data into a register.
 
uint32_t adxrs453_get_sensor_data (struct adxrs453_dev *dev)
 Reads the sensor data.
 
float adxrs453_get_rate (struct adxrs453_dev *dev)
 Reads the rate data and converts it to degrees/second.
 
float adxrs453_get_temperature (struct adxrs453_dev *dev)
 Reads the temperature sensor data and converts it to degrees Celsius.
 

Detailed Description

Header file of ADXRS453 Driver.

Author
DBogdan (drago.nosp@m.s.bo.nosp@m.gdan@.nosp@m.anal.nosp@m.og.co.nosp@m.m)

Copyright 2013(c) Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Macro Definition Documentation

◆ ADXRS453_READ

#define ADXRS453_READ   (1 << 7)

◆ ADXRS453_REG_FAULT

#define ADXRS453_REG_FAULT   0x0A

◆ ADXRS453_REG_HICST

#define ADXRS453_REG_HICST   0x06

◆ ADXRS453_REG_LOCST

#define ADXRS453_REG_LOCST   0x04

◆ ADXRS453_REG_PID

#define ADXRS453_REG_PID   0x0C

◆ ADXRS453_REG_QUAD

#define ADXRS453_REG_QUAD   0x08

◆ ADXRS453_REG_RATE

#define ADXRS453_REG_RATE   0x00

◆ ADXRS453_REG_SN_HIGH

#define ADXRS453_REG_SN_HIGH   0x0E

◆ ADXRS453_REG_SN_LOW

#define ADXRS453_REG_SN_LOW   0x10

◆ ADXRS453_REG_TEM

#define ADXRS453_REG_TEM   0x02

◆ ADXRS453_SENSOR_DATA

#define ADXRS453_SENSOR_DATA   (1 << 5)

◆ ADXRS453_WRITE

#define ADXRS453_WRITE   (1 << 6)

Function Documentation

◆ adxrs453_get_rate()

float adxrs453_get_rate ( struct adxrs453_dev * dev)

Reads the rate data and converts it to degrees/second.

Reads the rate data and converts it to degrees/second.

Parameters
dev- The device structure.
Returns
rate - The rate value in degrees/second.

< If data received is in positive degree range

< If data received is in negative degree range

◆ adxrs453_get_register_value()

uint16_t adxrs453_get_register_value ( struct adxrs453_dev * dev,
uint8_t register_address )

Reads the value of a register.

Reads the value of a register.

Parameters
dev- The device structure.
register_address- Address of the register.
Returns
register_value - Value of the register.

◆ adxrs453_get_sensor_data()

uint32_t adxrs453_get_sensor_data ( struct adxrs453_dev * dev)

Reads the sensor data.

Reads the sensor data.

Parameters
dev- The device structure.
Returns
register_value - The sensor data.

◆ adxrs453_get_temperature()

float adxrs453_get_temperature ( struct adxrs453_dev * dev)

Reads the temperature sensor data and converts it to degrees Celsius.

Reads the temperature sensor data and converts it to degrees Celsius.

Parameters
dev- The device structure.
Returns
temperature - The temperature value in degrees Celsius.

◆ 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.

Initializes the ADXRS453 and checks if the device is present.

Parameters
device- The device structure.
init_param- The structure that contains the device initial parameters.
Returns
status - Result of the initialization procedure. Example: 0 - if initialization was successful (ID starts with 0x52). -1 - if initialization was unsuccessful.

◆ adxrs453_remove()

int32_t adxrs453_remove ( struct adxrs453_dev * dev)

Free the resources allocated by adxrs453_init().

Free the resources allocated by adxrs453_init().

Parameters
dev- The device structure.
Returns
ret - The result of the remove procedure.

◆ 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.

Writes data into a register.

Parameters
dev- The device structure.
register_address- Address of the register.
register_value- Data value to write.