Low voltage digital temperature sensor

Dependencies:   X_NUCLEO_COMMON ST_INTERFACES

Dependents:   X_NUCLEO_IKS01A3 X_NUCLEO_IKS01A3 X_NUCLEO_IKS01A3

Embed: (wiki syntax)

« Back to documentation index

STTS751Sensor Class Reference

STTS751Sensor Class Reference

Abstract class of a STTS751 temperature sensor. More...

#include <STTS751Sensor.h>

Public Member Functions

 STTS751Sensor (DevI2C *i2c, uint8_t address=STTS751_0xxxx_ADD_7K5, PinName int_pin=NC)
 Constructor.
virtual int init (void *init)
 Initializing the component.
virtual int read_id (uint8_t *id)
 Get WHO_AM_I value.
virtual int get_temperature (float *value)
 Get the STTS751 temperature value.
int enable (void)
 Enable the STTS751 temperature sensor.
int disable (void)
 Disable the STTS751 temperature sensor.
int get_odr (float *odr)
 Get the STTS751 temperature sensor output data rate.
int set_odr (float odr)
 Set the STTS751 temperature sensor output data rate.
int read_reg (uint8_t reg, uint8_t *data)
 Get the STTS751 register value.
int write_reg (uint8_t reg, uint8_t data)
 Set the STTS751 register value.
int get_temp_drdy_status (uint8_t *status)
 Get the STTS751 temperature data ready bit value.
int set_low_temp_thr (float value)
 Set the STTS751 low temperature threshold value.
int set_high_temp_thr (float value)
 Set the STTS751 high temperature threshold value.
int get_temp_limit_status (uint8_t *high_limit, uint8_t *low_limit, uint8_t *therm_limit)
 Get the STTS751 temperature limits status.
int set_event_pin (uint8_t enable)
 Enable or disable interrupt on EVENT pin.
int set_one_shot ()
 Set the STTS751 One Shot Mode.
int get_one_shot_status (uint8_t *status)
 Get the STTS751 One Shot Status.
void attach_int_irq (void(*fptr)(void))
 Attaching an interrupt handler to the INT interrupt.
void enable_int_irq (void)
 Enabling the INT interrupt handling.
void disable_int_irq (void)
 Disabling the INT interrupt handling.
uint8_t io_read (uint8_t *pBuffer, uint8_t RegisterAddr, uint16_t NumByteToRead)
 Utility function to read data.
uint8_t io_write (uint8_t *pBuffer, uint8_t RegisterAddr, uint16_t NumByteToWrite)
 Utility function to write data.

Detailed Description

Abstract class of a STTS751 temperature sensor.

Definition at line 59 of file STTS751Sensor.h.


Constructor & Destructor Documentation

STTS751Sensor ( DevI2C *  i2c,
uint8_t  address = STTS751_0xxxx_ADD_7K5,
PinName  int_pin = NC 
)

Constructor.

Parameters:
i2cobject of an helper class which handles the I2C peripheral
addressthe address of the component's instance
int_pinthe interrupt pin

Definition at line 51 of file STTS751Sensor.cpp.


Member Function Documentation

void attach_int_irq ( void(*)(void)  fptr )

Attaching an interrupt handler to the INT interrupt.

Parameters:
fptran interrupt handler.
Return values:
None.

Definition at line 85 of file STTS751Sensor.h.

int disable ( void   )

Disable the STTS751 temperature sensor.

Return values:
0in case of success, an error code otherwise

Definition at line 132 of file STTS751Sensor.cpp.

void disable_int_irq ( void   )

Disabling the INT interrupt handling.

Parameters:
None.
Return values:
None.

Definition at line 105 of file STTS751Sensor.h.

int enable ( void   )

Enable the STTS751 temperature sensor.

Return values:
0in case of success, an error code otherwise

Definition at line 111 of file STTS751Sensor.cpp.

void enable_int_irq ( void   )

Enabling the INT interrupt handling.

Parameters:
None.
Return values:
None.

Definition at line 95 of file STTS751Sensor.h.

int get_odr ( float *  odr )

Get the STTS751 temperature sensor output data rate.

Parameters:
odrpointer where the output data rate is written
Return values:
0in case of success, an error code otherwise

Definition at line 159 of file STTS751Sensor.cpp.

int get_one_shot_status ( uint8_t *  status )

Get the STTS751 One Shot Status.

Parameters:
statuspointer to the one shot status (1 means measurements available, 0 means measurements not available yet)
Return values:
0in case of success, an error code otherwise

Definition at line 453 of file STTS751Sensor.cpp.

int get_temp_drdy_status ( uint8_t *  status )

Get the STTS751 temperature data ready bit value.

Parameters:
statusthe status of data ready bit
Return values:
0in case of success, an error code otherwise

Definition at line 295 of file STTS751Sensor.cpp.

int get_temp_limit_status ( uint8_t *  high_limit,
uint8_t *  low_limit,
uint8_t *  therm_limit 
)

Get the STTS751 temperature limits status.

Parameters:
high_limitindicates that high temperature limit has been exceeded
low_limitindicates that low temperature limit has been exceeded
therm_limitindicates that therm temperature limit has been exceeded
Return values:
0in case of success, an error code otherwise

Definition at line 357 of file STTS751Sensor.cpp.

int get_temperature ( float *  value ) [virtual]

Get the STTS751 temperature value.

Parameters:
valuepointer where the temperature value is written
Return values:
0in case of success, an error code otherwise

Definition at line 276 of file STTS751Sensor.cpp.

int init ( void *  init ) [virtual]

Initializing the component.

Parameters:
initpointer to device specific initalization structure
Return values:
0in case of success, an error code otherwise

Definition at line 64 of file STTS751Sensor.cpp.

uint8_t io_read ( uint8_t *  pBuffer,
uint8_t  RegisterAddr,
uint16_t  NumByteToRead 
)

Utility function to read data.

Parameters:
pBuffer,:pointer to data to be read.
RegisterAddr,:specifies internal address register to be read.
NumByteToRead,:number of bytes to be read.
Return values:
0if ok, an error code otherwise.

Definition at line 118 of file STTS751Sensor.h.

uint8_t io_write ( uint8_t *  pBuffer,
uint8_t  RegisterAddr,
uint16_t  NumByteToWrite 
)

Utility function to write data.

Parameters:
pBuffer,:pointer to data to be written.
RegisterAddr,:specifies internal address register to be written.
NumByteToWrite,:number of bytes to write.
Return values:
0if ok, an error code otherwise.

Definition at line 133 of file STTS751Sensor.h.

int read_id ( uint8_t *  id ) [virtual]

Get WHO_AM_I value.

Parameters:
idthe WHO_AM_I value
Return values:
0in case of success, an error code otherwise

Definition at line 94 of file STTS751Sensor.cpp.

int read_reg ( uint8_t  reg,
uint8_t *  data 
)

Get the STTS751 register value.

Parameters:
regaddress to be read
datapointer where the value is written
Return values:
0in case of success, an error code otherwise

Definition at line 410 of file STTS751Sensor.cpp.

int set_event_pin ( uint8_t  enable )

Enable or disable interrupt on EVENT pin.

Parameters:
enable0 disable the EVENT pin, 1 enable EVENT pin
Return values:
0in case of success, an error code otherwise

Definition at line 386 of file STTS751Sensor.cpp.

int set_high_temp_thr ( float  value )

Set the STTS751 high temperature threshold value.

Parameters:
valuethe high temperature threshold to be set
Return values:
0in case of success, an error code otherwise

Definition at line 336 of file STTS751Sensor.cpp.

int set_low_temp_thr ( float  value )

Set the STTS751 low temperature threshold value.

Parameters:
valuethe low temperature threshold to be set
Return values:
0in case of success, an error code otherwise

Definition at line 317 of file STTS751Sensor.cpp.

int set_odr ( float  odr )

Set the STTS751 temperature sensor output data rate.

Parameters:
odrthe output data rate value to be set
Return values:
0in case of success, an error code otherwise

Definition at line 227 of file STTS751Sensor.cpp.

int set_one_shot (  )

Set the STTS751 One Shot Mode.

Return values:
0in case of success, an error code otherwise

Definition at line 438 of file STTS751Sensor.cpp.

int write_reg ( uint8_t  reg,
uint8_t  data 
)

Set the STTS751 register value.

Parameters:
regaddress to be written
datavalue to be written
Return values:
0in case of success, an error code otherwise

Definition at line 425 of file STTS751Sensor.cpp.