temperature_sensor: Add new interface and reference counts so that phy and driver can use together
This commit is contained in:
@@ -14,6 +14,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -62,6 +65,33 @@ void sar_periph_ctrl_pwdet_power_acquire(void);
|
||||
*/
|
||||
void sar_periph_ctrl_pwdet_power_release(void);
|
||||
|
||||
/**
|
||||
* @brief Acquire the temperature sensor power
|
||||
*/
|
||||
void temperature_sensor_power_acquire(void);
|
||||
|
||||
/**
|
||||
* @brief Release the temperature sensor power
|
||||
*/
|
||||
void temperature_sensor_power_release(void);
|
||||
|
||||
/**
|
||||
* @brief Get the temperature value and choose the temperature sensor range. Will be both used in phy and peripheral.
|
||||
*
|
||||
* @param range_changed Pointer to whether range has been changed here. If you don't need this param, you can
|
||||
* set NULL directly.
|
||||
*
|
||||
* @return temperature sensor value.
|
||||
*/
|
||||
int16_t temp_sensor_get_raw_value(bool *range_changed);
|
||||
|
||||
/**
|
||||
* @brief Synchronize the tsens_idx between sar_periph and driver
|
||||
*
|
||||
* @param tsens_idx index value of temperature sensor attribute
|
||||
*/
|
||||
void temp_sensor_sync_tsens_idx(int tsens_idx);
|
||||
|
||||
/**
|
||||
* @brief Enable SAR power when system wakes up
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user