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

over temperature alarm

over temperature alarm

This file provides a set of functions needed to drive the stts751 enhanced inertial module. More...

Modules

 STTS751_Interfaces_Functions
 

This section provide a set of functions used to read and write a generic register of the device.


 STTS751_Sensitivity
 

These functions convert raw-data into engineering units and vice-versa .


 STTS751_Sensitivity_Reverse
 

This conversion is useful but not need by the driver.


 STTS751_Data_Generation
 

This section groups all the functions concerning data generation.


 STTS751_Data_Output
 

This section groups all the data output functions.


 STTS751_Interrupt_Pins
 

This section groups all the functions that manage event pin.


 STTS751_Interrupt_on_threshold
 

This section groups all the functions that manage interrupt on threshold event.


 STTS751_Common
 

This section groups common useful functions.


 STTS751_sensors_common_types
 STTS751_Infos
 STTS751_Register_Union
 

This union group all the registers that has a bitfield description.


Functions

int32_t stts751_ota_thermal_limit_set (stts751_ctx_t *ctx, int8_t val)
 Thermal Limit.
int32_t stts751_ota_thermal_limit_get (stts751_ctx_t *ctx, int8_t *val)
 Thermal Limit.
int32_t stts751_ota_thermal_hyst_set (stts751_ctx_t *ctx, int8_t val)
 Thermal hysteresis.
int32_t stts751_ota_thermal_hyst_get (stts751_ctx_t *ctx, int8_t *val)
 Thermal hysteresis.
int32_t stts751_read_reg (stts751_ctx_t *ctx, uint8_t reg, uint8_t *data, uint16_t len)
 Read generic device register.
int32_t stts751_write_reg (stts751_ctx_t *ctx, uint8_t reg, uint8_t *data, uint16_t len)
 Write generic device register.
int32_t stts751_temp_data_rate_set (stts751_ctx_t *ctx, stts751_odr_t val)
 Temperature sensor data rate selection.
int32_t stts751_temp_data_rate_get (stts751_ctx_t *ctx, stts751_odr_t *val)
 Temperature sensor data rate selection.
int32_t stts751_resolution_set (stts751_ctx_t *ctx, stts751_tres_t val)
 Temperature sensor resolution selection.
int32_t stts751_resolution_get (stts751_ctx_t *ctx, stts751_tres_t *val)
 Temperature sensor resolution selection.
int32_t stts751_status_reg_get (stts751_ctx_t *ctx, stts751_status_t *val)
 The STATUS_REG register of the device.
int32_t stts751_flag_busy_get (stts751_ctx_t *ctx, uint8_t *val)
 Temperature sensor "conversion on-going" flag.
int32_t stts751_temperature_raw_get (stts751_ctx_t *ctx, int16_t *buff)
 Temperature data output register (r).
int32_t stts751_pin_event_route_set (stts751_ctx_t *ctx, uint8_t val)
 Route interrupt signal threshold on event pad.
int32_t stts751_pin_event_route_get (stts751_ctx_t *ctx, uint8_t *val)
 Route interrupt signal threshold on event pad.
int32_t stts751_high_temperature_threshold_set (stts751_ctx_t *ctx, int16_t buff)
 high temperature theshold.
int32_t stts751_high_temperature_threshold_get (stts751_ctx_t *ctx, int16_t *buff)
 high temperature theshold.
int32_t stts751_low_temperature_threshold_set (stts751_ctx_t *ctx, int16_t buff)
 low temperature theshold.
int32_t stts751_low_temperature_threshold_get (stts751_ctx_t *ctx, int16_t *buff)
 low temperature theshold.
int32_t stts751_smbus_timeout_set (stts751_ctx_t *ctx, uint8_t val)
 SMBus timeout.At power-up, the STTS751 is configured with an SMBus timeout of 25 to 35 milliseconds.
int32_t stts751_smbus_timeout_get (stts751_ctx_t *ctx, uint8_t *val)
 SMBus timeout.At power-up, the STTS751 is configured with an SMBus timeout of 25 to 35 milliseconds.
int32_t stts751_device_id_get (stts751_ctx_t *ctx, stts751_id_t *buff)
 Device Who am I.

Detailed Description

This file provides a set of functions needed to drive the stts751 enhanced inertial module.

This section groups all the functions that manage over temperature alarm functionality.


Function Documentation

int32_t stts751_device_id_get ( stts751_ctx_t *  ctx,
stts751_id_t *  buff 
)

Device Who am I.

[get]

Parameters:
ctxread / write interface definitions
buffbuffer that stores data read
Return values:
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 687 of file stts751_reg.c.

int32_t stts751_flag_busy_get ( stts751_ctx_t *  ctx,
uint8_t *  val 
)

Temperature sensor "conversion on-going" flag.

[get]

Parameters:
ctxread / write interface definitions
valget the values of busy in reg STATUS
Return values:
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 325 of file stts751_reg.c.

int32_t stts751_high_temperature_threshold_get ( stts751_ctx_t *  ctx,
int16_t *  buff 
)

high temperature theshold.

[get]

Parameters:
ctxread / write interface definitions
buffbuffer that stores data read
Return values:
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 473 of file stts751_reg.c.

int32_t stts751_high_temperature_threshold_set ( stts751_ctx_t *  ctx,
int16_t  buff 
)

high temperature theshold.

[set]

Parameters:
ctxread / write interface definitions
buffbuffer that contains data to write
Return values:
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 446 of file stts751_reg.c.

int32_t stts751_low_temperature_threshold_get ( stts751_ctx_t *  ctx,
int16_t *  buff 
)

low temperature theshold.

[get]

Parameters:
ctxread / write interface definitions
buffbuffer that stores data read
Return values:
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 528 of file stts751_reg.c.

int32_t stts751_low_temperature_threshold_set ( stts751_ctx_t *  ctx,
int16_t  buff 
)

low temperature theshold.

[set]

Parameters:
ctxread / write interface definitions
buffbuffer that contains data to write
Return values:
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 500 of file stts751_reg.c.

int32_t stts751_ota_thermal_hyst_get ( stts751_ctx_t *  ctx,
int8_t *  val 
)

Thermal hysteresis.

1 LSB = 1 degC.[get] max 127 degC min -127 degC.

Parameters:
ctxread / write interface definitions
valget the values of reg THERM_HYSTERESIS
Return values:
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 619 of file stts751_reg.c.

int32_t stts751_ota_thermal_hyst_set ( stts751_ctx_t *  ctx,
int8_t  val 
)

Thermal hysteresis.

1 LSB = 1 degC.[set] max 127 degC min -127 degC.

Parameters:
ctxread / write interface definitions
valchange the values of reg THERM_HYSTERESIS
Return values:
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 602 of file stts751_reg.c.

int32_t stts751_ota_thermal_limit_get ( stts751_ctx_t *  ctx,
int8_t *  val 
)

Thermal Limit.

1 LSB = 1 degC (max 127 degC min -127 degC ).[get]

Parameters:
ctxread / write interface definitions
valget the values of reg THERM_LIMIT
Return values:
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 585 of file stts751_reg.c.

int32_t stts751_ota_thermal_limit_set ( stts751_ctx_t *  ctx,
int8_t  val 
)

Thermal Limit.

1 LSB = 1 degC (max 127 degC min -127 degC ).[set]

Parameters:
ctxread / write interface definitions
valchange the values of reg THERM_LIMIT
Return values:
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 570 of file stts751_reg.c.

int32_t stts751_pin_event_route_get ( stts751_ctx_t *  ctx,
uint8_t *  val 
)

Route interrupt signal threshold on event pad.

[get]

Parameters:
ctxread / write interface definitions
valget mask1 bit in register CONFIGURATION.
Return values:
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 416 of file stts751_reg.c.

int32_t stts751_pin_event_route_set ( stts751_ctx_t *  ctx,
uint8_t  val 
)

Route interrupt signal threshold on event pad.

[set]

Parameters:
ctxread / write interface definitions
valset mask1 bit in register CONFIGURATION.
Return values:
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 395 of file stts751_reg.c.

int32_t stts751_read_reg ( stts751_ctx_t *  ctx,
uint8_t  reg,
uint8_t *  data,
uint16_t  len 
)

Read generic device register.

Parameters:
ctxread / write interface definitions(ptr)
regregister to read
datapointer to buffer that store the data read(ptr)
lennumber of consecutive register to read
Return values:
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 66 of file stts751_reg.c.

int32_t stts751_resolution_get ( stts751_ctx_t *  ctx,
stts751_tres_t *  val 
)

Temperature sensor resolution selection.

[get]

Parameters:
ctxread / write interface definitions
valGet the values of tres in reg CONFIGURATION
Return values:
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 275 of file stts751_reg.c.

int32_t stts751_resolution_set ( stts751_ctx_t *  ctx,
stts751_tres_t  val 
)

Temperature sensor resolution selection.

[set]

Parameters:
ctxread / write interface definitions
valchange the values of tres in reg CONFIGURATION
Return values:
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 254 of file stts751_reg.c.

int32_t stts751_smbus_timeout_get ( stts751_ctx_t *  ctx,
uint8_t *  val 
)

SMBus timeout.At power-up, the STTS751 is configured with an SMBus timeout of 25 to 35 milliseconds.

[get]

Parameters:
ctxread / write interface definitions
valget timeout bit in register SMBUS_TIMEOUT.
Return values:
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 670 of file stts751_reg.c.

int32_t stts751_smbus_timeout_set ( stts751_ctx_t *  ctx,
uint8_t  val 
)

SMBus timeout.At power-up, the STTS751 is configured with an SMBus timeout of 25 to 35 milliseconds.

[set]

Parameters:
ctxread / write interface definitions
valset timeout bit in register SMBUS_TIMEOUT.
Return values:
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 648 of file stts751_reg.c.

int32_t stts751_status_reg_get ( stts751_ctx_t *  ctx,
stts751_status_t *  val 
)

The STATUS_REG register of the device.

[get]

Parameters:
ctxread / write interface definitions
valunion of registers from STATUS to
Return values:
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 310 of file stts751_reg.c.

int32_t stts751_temp_data_rate_get ( stts751_ctx_t *  ctx,
stts751_odr_t *  val 
)

Temperature sensor data rate selection.

[get]

Parameters:
ctxread / write interface definitions
valGet the sensor data rate
Return values:
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 190 of file stts751_reg.c.

int32_t stts751_temp_data_rate_set ( stts751_ctx_t *  ctx,
stts751_odr_t  val 
)

Temperature sensor data rate selection.

[set]

Parameters:
ctxread / write interface definitions
valchange the sensor data rate
Return values:
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 153 of file stts751_reg.c.

int32_t stts751_temperature_raw_get ( stts751_ctx_t *  ctx,
int16_t *  buff 
)

Temperature data output register (r).

L and H registers together express a 16-bit word in two’s complement.[get]

Parameters:
ctxread / write interface definitions
buffbuffer that stores data read
Return values:
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 357 of file stts751_reg.c.

int32_t stts751_write_reg ( stts751_ctx_t *  ctx,
uint8_t  reg,
uint8_t *  data,
uint16_t  len 
)

Write generic device register.

Parameters:
ctxread / write interface definitions(ptr)
regregister to write
datapointer to data to write in register reg(ptr)
lennumber of consecutive register to write
Return values:
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 84 of file stts751_reg.c.