Device driver interface for the Maxim DS75LX temperature sensor. More...

Detailed Description

Device driver interface for the Maxim DS75LX temperature sensor.

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

Files

file  ds75lx_internals.h
 Internal addresses, registers, constants for the DS75LX sensor.
 
file  ds75lx_params.h
 Default configuration for DS75LX.
 
file  ds75lx.h
 

Data Structures

struct  ds75lx_params_t
 Device initialization parameters. More...
 
struct  ds75lx_t
 Device descriptor for the DS75LX sensor. More...
 

Enumerations

enum  ds75lx_resolution_t { DS75LX_RESOLUTION_9 = 0, DS75LX_RESOLUTION_10, DS75LX_RESOLUTION_11, DS75LX_RESOLUTION_12 }
 Thermometer resolution. More...
 
enum  { DS75LX_OK = 0, DS75LX_ERR_I2C }
 Status and error return codes. More...
 

Functions

int ds75lx_init (ds75lx_t *dev, const ds75lx_params_t *params)
 Initialize the given DS75LX device. More...
 
int ds75lx_read_temperature (const ds75lx_t *dev, int16_t *temperature)
 Read temperature value from the given DS75LX device, returned in c°C. More...
 
int ds75lx_wakeup (const ds75lx_t *dev)
 Wakeup the sensor. More...
 
int ds75lx_shutdown (const ds75lx_t *dev)
 Shutdown the sensor. More...
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Status and error return codes.

Enumerator
DS75LX_OK 

everything was fine

DS75LX_ERR_I2C 

error when reading/writing I2C bus

Definition at line 62 of file ds75lx.h.

◆ ds75lx_resolution_t

Thermometer resolution.

Enumerator
DS75LX_RESOLUTION_9 

9 bits resolution, 25ms max conversion time

DS75LX_RESOLUTION_10 

10 bits resolution, 50ms max conversion time

DS75LX_RESOLUTION_11 

11 bits resolution, 100ms max conversion time

DS75LX_RESOLUTION_12 

12 bits resolution, 200ms max conversion time

Definition at line 36 of file ds75lx.h.

Function Documentation

◆ ds75lx_init()

int ds75lx_init ( ds75lx_t dev,
const ds75lx_params_t params 
)

Initialize the given DS75LX device.

Parameters
[out]devInitialized device descriptor of DS75LX device
[in]paramsInitialization parameters
Returns
DS75LX_OK on success
-DS75LX_ERR_I2C if an error occurred when reading/writing

◆ ds75lx_read_temperature()

int ds75lx_read_temperature ( const ds75lx_t dev,
int16_t *  temperature 
)

Read temperature value from the given DS75LX device, returned in c°C.

Parameters
[in]devDevice descriptor of DS75LX device
[out]temperatureTemperature in c°C
Returns
DS75LX_OK on success
-DS75LX_ERR_I2C if an error occurred when reading/writing

◆ ds75lx_shutdown()

int ds75lx_shutdown ( const ds75lx_t dev)

Shutdown the sensor.

Parameters
[in]devDevice descriptor of DS75LX device
Returns
DS75LX_OK on success
-DS75LX_ERR_I2C if an error occurred when reading/writing

◆ ds75lx_wakeup()

int ds75lx_wakeup ( const ds75lx_t dev)

Wakeup the sensor.

Parameters
[in]devDevice descriptor of DS75LX device
Returns
DS75LX_OK on success
-DS75LX_ERR_I2C if an error occurred when reading/writing