no-OS
Classes | Macros | Functions
adxrs453.h File Reference

Header file of ADXRS453 Driver. More...

#include <stdint.h>
#include "no_os_spi.h"
Include dependency graph for adxrs453.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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. More...
 
int32_t adxrs453_remove (struct adxrs453_dev *dev)
 Free the resources allocated by adxrs453_init(). More...
 
uint16_t adxrs453_get_register_value (struct adxrs453_dev *dev, uint8_t register_address)
 Reads the value of a register. More...
 
void adxrs453_set_register_value (struct adxrs453_dev *dev, uint8_t register_address, uint16_t register_value)
 Writes data into a register. More...
 
uint32_t adxrs453_get_sensor_data (struct adxrs453_dev *dev)
 Reads the sensor data. More...
 
float adxrs453_get_rate (struct adxrs453_dev *dev)
 Reads the rate data and converts it to degrees/second. More...
 
float adxrs453_get_temperature (struct adxrs453_dev *dev)
 Reads the temperature sensor data and converts it to degrees Celsius. More...
 

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.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

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.
Here is the caller graph for this function:

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