![]() |
Component Library:Sensor Driver for NMH1000
v1.0
Platform agnostic sensor driver interfaces for NMH1000 sensor
|
This header contains definitions and interface for the nmh1000 sensor driver. More...
Go to the source code of this file.
Data Structures | |
struct | nmh1000_driver |
Typedefs | |
typedef enum nmh1000_error_code | nmh1000_error_code_t |
nmh1000 error_code More... | |
typedef struct nmh1000_driver | nmh1000_driver_t |
Enumerations | |
enum | nmh1000_error_code { NMH1000_DEVICE_NOT_FOUND = 1, NMH1000_DEVICE_ERROR = 2 } |
nmh1000 error_code More... | |
Functions | |
uint8_t | nmh1000_init (nmh1000_driver_t *pDriver) |
The interface function to initialize the nmh1000 sensor. More... | |
uint8_t | nmh1000_read_reg (nmh1000_driver_t *pDriver, uint16_t address, uint8_t *pReadBuffer) |
The interface function read from the nmh1000 sensor register. More... | |
uint8_t | nmh1000_write_reg (nmh1000_driver_t *pDriver, uint16_t pWriteAddress, uint8_t data) |
The interface function write to a nmh1000 sensor register. More... | |
uint8_t | nmh1000_get_magnetic_data (nmh1000_driver_t *pDriver, uint8_t *pMagData) |
The interface function to get magnetic data. More... | |
This header contains definitions and interface for the nmh1000 sensor driver.
Definition in file nmh1000_driver.h.
typedef struct nmh1000_driver nmh1000_driver_t |
nmh1000 driver handler
typedef enum nmh1000_error_code nmh1000_error_code_t |
nmh1000 error_code
enum nmh1000_error_code |
nmh1000 error_code
Enumerator | |
---|---|
NMH1000_DEVICE_NOT_FOUND | Device not found, wrong who I am value. |
NMH1000_DEVICE_ERROR | Device error, Wrong data. |
Definition at line 32 of file nmh1000_driver.h.
uint8_t nmh1000_get_magnetic_data | ( | nmh1000_driver_t * | pDriver, |
uint8_t * | pMagData | ||
) |
The interface function to get magnetic data.
read magnetic data from the OUT_M_REG register
[in] | pDriver | - Pointer to the driver. |
[out] | pPressure | - return the pressure data |
Definition at line 90 of file nmh1000_driver.c.
References nmh1000_driver::comHandle, and NMH1000_OUT_M_REG.
uint8_t nmh1000_init | ( | nmh1000_driver_t * | pDriver | ) |
The interface function to initialize the nmh1000 sensor.
This function initialize the nmh1000 sensor.
[in] | pDriver | - Pointer to the driver. |
Definition at line 38 of file nmh1000_driver.c.
References nmh1000_driver::comHandle, NMH1000_WHO_AM_I, and nmh1000_driver::whoAMI.
uint8_t nmh1000_read_reg | ( | nmh1000_driver_t * | pDriver, |
uint16_t | address, | ||
uint8_t * | pReadBuffer | ||
) |
The interface function read from the nmh1000 sensor register.
This function read a register value from a nmh1000 sensor register. Note: it supports only single byte read at a time
[in] | pDriver | - Pointer to the driver. |
[in] | address | - Address from the register to read. |
[out] | pReadBuffer | - a pointer to read buffer to to store the requested data read. |
Definition at line 58 of file nmh1000_driver.c.
References nmh1000_driver::comHandle.
uint8_t nmh1000_write_reg | ( | nmh1000_driver_t * | pDriver, |
uint16_t | pWriteAddress, | ||
uint8_t | data | ||
) |
The interface function write to a nmh1000 sensor register.
This function write to the nmh1000 sensor register.Note: it supports only single byte write at a time
[in] | pDriver | - Pointer to the driver. |
[in] | pWriteAddress | - Address from the register to read. |
[in] | data | - data to be written. |
Definition at line 74 of file nmh1000_driver.c.
References nmh1000_driver::comHandle.