RV32 SoC DS UG
High-Perf RV32 SoC DS UG
RV64 SoC DS UG API and Examples
Embedded IDE UG
Loading...
Searching...
No Matches

Overview

Common Function definitions for Temperature Sensor driver.

Functions

temp_sensor_status_t tempSensor_applyConfig (temp_sensor_instance_t *temp)
 Apply I2C + Temp Sensor configuration.
temp_sensor_status_t tempSensor_enableErrorInterrupt (temp_sensor_instance_t *temp)
 Enable error interrupt for the Temperature Sensor.
u8 tempSensor_readTempReg (temp_sensor_instance_t *temp, const u8 reg)
 Read a register from the Temperature Sensor.
u8 tempSensor_writeTempReg (temp_sensor_instance_t *temp, const u8 reg, const u8 data)
 Write a value to a register in the Temperature Sensor.
u8 tempSensor_encodeTempLimit (float val, u8 is_extended, u8 *out_hb, u8 *out_lb)
 Encode temperature limit into high and low byte format.
float tempSensor_calTempCelsius (u8 hb, u8 lb, u8 is_extended)
 Calculate temperature in Celsius from high and low byte format.

Function Documentation

◆ tempSensor_applyConfig()

temp_sensor_status_t tempSensor_applyConfig ( temp_sensor_instance_t * temp)

#include <temp_sensor.h>

Apply I2C + Temp Sensor configuration.

Parameters
rtcPointer to Temperature Sensor instance.
Returns
Status code of the operation.

Definition at line 21 of file temp_sensor.c.

◆ tempSensor_calTempCelsius()

float tempSensor_calTempCelsius ( u8 hb,
u8 lb,
u8 is_extended )

#include <temp_sensor.h>

Calculate temperature in Celsius from high and low byte format.

Parameters
hbHigh byte of the temperature value.
lbLow byte of the temperature value.
is_extendedFlag indicating if extended range is used.
Returns
Calculated temperature in Celsius.

Definition at line 59 of file temp_sensor.c.

◆ tempSensor_enableErrorInterrupt()

temp_sensor_status_t tempSensor_enableErrorInterrupt ( temp_sensor_instance_t * temp)

#include <temp_sensor.h>

Enable error interrupt for the Temperature Sensor.

Parameters
rtcPointer to Temperature Sensor instance.
Returns
Status code of the operation.

Definition at line 31 of file temp_sensor.c.

◆ tempSensor_encodeTempLimit()

u8 tempSensor_encodeTempLimit ( float val,
u8 is_extended,
u8 * out_hb,
u8 * out_lb )

#include <temp_sensor.h>

Encode temperature limit into high and low byte format.

Parameters
valTemperature value to encode.
is_extendedFlag indicating if extended range is used.
out_hbPointer to store the output high byte.
out_lbPointer to store the output low byte.
Returns
Status code of the operation.

Definition at line 72 of file temp_sensor.c.

◆ tempSensor_readTempReg()

u8 tempSensor_readTempReg ( temp_sensor_instance_t * temp,
const u8 reg )

#include <temp_sensor.h>

Read a register from the Temperature Sensor.

Parameters
tempPointer to Temperature Sensor instance.
regRegister address to read from.
Returns
Value read from the register.

Definition at line 39 of file temp_sensor.c.

◆ tempSensor_writeTempReg()

u8 tempSensor_writeTempReg ( temp_sensor_instance_t * temp,
const u8 reg,
const u8 data )

#include <temp_sensor.h>

Write a value to a register in the Temperature Sensor.

Parameters
tempPointer to Temperature Sensor instance.
regRegister address to write to.
dataValue to write to the register.
Returns
Status code of the operation.

Definition at line 49 of file temp_sensor.c.