Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: X_NUCLEO_COMMON ST_INTERFACES
Dependents: X_NUCLEO_IKS01A3 X_NUCLEO_IKS01A3 X_NUCLEO_IKS01A3
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:
-
i2c object of an helper class which handles the I2C peripheral address the address of the component's instance int_pin the 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:
-
fptr an interrupt handler.
- Return values:
-
None.
Definition at line 85 of file STTS751Sensor.h.
| int disable | ( | void | ) |
Disable the STTS751 temperature sensor.
- Return values:
-
0 in 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:
-
0 in 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:
-
odr pointer where the output data rate is written
- Return values:
-
0 in 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:
-
status pointer to the one shot status (1 means measurements available, 0 means measurements not available yet)
- Return values:
-
0 in 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:
-
status the status of data ready bit
- Return values:
-
0 in 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_limit indicates that high temperature limit has been exceeded low_limit indicates that low temperature limit has been exceeded therm_limit indicates that therm temperature limit has been exceeded
- Return values:
-
0 in 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:
-
value pointer where the temperature value is written
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 276 of file STTS751Sensor.cpp.
| int init | ( | void * | init ) | [virtual] |
Initializing the component.
- Parameters:
-
init pointer to device specific initalization structure
- Return values:
-
0 in 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:
-
0 if 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:
-
0 if 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:
-
id the WHO_AM_I value
- Return values:
-
0 in 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:
-
reg address to be read data pointer where the value is written
- Return values:
-
0 in 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:
-
enable 0 disable the EVENT pin, 1 enable EVENT pin
- Return values:
-
0 in 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:
-
value the high temperature threshold to be set
- Return values:
-
0 in 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:
-
value the low temperature threshold to be set
- Return values:
-
0 in 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:
-
odr the output data rate value to be set
- Return values:
-
0 in 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:
-
0 in 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:
-
reg address to be written data value to be written
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 425 of file STTS751Sensor.cpp.
Generated on Fri Jul 15 2022 18:33:31 by
1.7.2