Loading...
Searching...
No Matches
HSC temperature and pressure sensor

Device driver interface for the HSC sensor. More...

Detailed Description

Device driver interface for the HSC sensor.

This driver provides [S]ensor [A]ctuator [U]ber [L]ayer capabilities.

Files

file  hsc_internals.h
 Internal addresses, constants for the HSC sensor.
 
file  hsc_params.h
 Default configuration for HSC.
 
file  hsc.h
 Device driver interface for the HSC sensor.
 

Data Structures

struct  hsc_params_t
 Device initialization parameters. More...
 
struct  hsc_t
 Device descriptor for the HSC sensor. More...
 

Functions

int hsc_init (hsc_t *dev, const hsc_params_t *params)
 Initialize the given HSC device.
 
int hsc_read_temperature (const hsc_t *dev, int16_t *dest)
 Read temperature value from the given HSC device, returned in 0.1°C.
 
int hsc_read_pressure (const hsc_t *dev, int32_t *dest)
 Read pressure value from the given HSC device, returned in uBar.
 

Default configuration values

#define CONFIG_HSC_I2C_ADDR   (0x28)
 Use address 0x28 by default.
 
#define CONFIG_HSC_RANGE   (40U)
 Default to 40 millibar range.
 

Macro Definition Documentation

◆ CONFIG_HSC_I2C_ADDR

#define CONFIG_HSC_I2C_ADDR   (0x28)

Use address 0x28 by default.

Definition at line 91 of file hsc.h.

◆ CONFIG_HSC_RANGE

#define CONFIG_HSC_RANGE   (40U)

Default to 40 millibar range.

Definition at line 94 of file hsc.h.

Function Documentation

◆ hsc_init()

int hsc_init ( hsc_t dev,
const hsc_params_t params 
)

Initialize the given HSC device.

Parameters
[out]devInitialized device descriptor of HSC device
[in]paramsInitialization parameters
Return values
0Success
-ENXIONo HSC at given address
Returns
-EIO An error occurred when reading calibration values

◆ hsc_read_pressure()

int hsc_read_pressure ( const hsc_t dev,
int32_t *  dest 
)

Read pressure value from the given HSC device, returned in uBar.

Parameters
[in]devDevice descriptor of HSC device to read from
[out]destPressure in uBar
Return values
0Success
-ENXIONo HSC at given address
Returns
-EIO An error occurred when reading calibration values

◆ hsc_read_temperature()

int hsc_read_temperature ( const hsc_t dev,
int16_t *  dest 
)

Read temperature value from the given HSC device, returned in 0.1°C.

Parameters
[in]devDevice descriptor of HSC device to read from
[out]destTemperature in 0.1°C
Return values
0Success
-ENXIONo HSC at given address
Returns
-EIO An error occurred when reading calibration values