Sapphire SoC DS Sapphire SoC UG Sapphire HP SoC DS Sapphire HP SoC UG RISC-V Embedded IDE UG Board Support Package
Loading...
Searching...
No Matches

Overview

Common Function definitions for Temperature Sensor driver.

Functions

u8 temp_readTempReg (temp_sensor_instance_t *temp, const u8 reg)
 Read a register from the Temperature Sensor.
u8 temp_writeTempReg (temp_sensor_instance_t *temp, const u8 reg, const u8 data)
 Write a value to a register in the Temperature Sensor.
u8 encode_temp_limit (float val, u8 is_extended, u8 *out_hb, u8 *out_lb)
 Encode temperature limit into high and low byte format.
float calculate_temp_celsius (u8 hb, u8 lb, u8 is_extended)
 Calculate temperature in Celsius from high and low byte format.

Function Documentation

◆ calculate_temp_celsius()

float calculate_temp_celsius ( 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 42 of file temp_sensor.c.

◆ encode_temp_limit()

u8 encode_temp_limit ( 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 55 of file temp_sensor.c.

◆ temp_readTempReg()

u8 temp_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 22 of file temp_sensor.c.

◆ temp_writeTempReg()

u8 temp_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 32 of file temp_sensor.c.