Component Library:Sensor Driver for NMH1000  v1.0
Platform agnostic sensor driver interfaces for NMH1000 sensor
nmh1000_driver.c File Reference

The nmh1000_driver.c file implements the sensor driver interface for nmh1000 sensors. More...

#include "sensor_comm.h"
#include "nmh1000_driver.h"
#include "sensor_common.h"
Include dependency graph for nmh1000_driver.c:

Go to the source code of this file.

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 address, 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...
 

Detailed Description

The nmh1000_driver.c file implements the sensor driver interface for nmh1000 sensors.

Definition in file nmh1000_driver.c.

Function Documentation

◆ nmh1000_get_magnetic_data()

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

Parameters
[in]pDriver- Pointer to the driver.
[out]pPressure- return the pressure data
Returns
returns the status of the operation.

Definition at line 90 of file nmh1000_driver.c.

References nmh1000_driver::comHandle, and NMH1000_OUT_M_REG.

◆ nmh1000_init()

uint8_t nmh1000_init ( nmh1000_driver_t pDriver)

The interface function to initialize the nmh1000 sensor.

This function initialize the nmh1000 sensor.

Parameters
[in]pDriver- Pointer to the driver.
Returns
returns the status of the operation.

Definition at line 38 of file nmh1000_driver.c.

References nmh1000_driver::comHandle, NMH1000_WHO_AM_I, and nmh1000_driver::whoAMI.

◆ nmh1000_read_reg()

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

Parameters
[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.
Returns
returns the status of the operation.

Definition at line 58 of file nmh1000_driver.c.

References nmh1000_driver::comHandle.

◆ nmh1000_write_reg()

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

Parameters
[in]pDriver- Pointer to the driver.
[in]pWriteAddress- Address from the register to read.
[in]data- data to be written.
Returns
returns the status of the operation.

Definition at line 74 of file nmh1000_driver.c.

References nmh1000_driver::comHandle.