TSNS driver APIs. More...
Macros | |
| #define | TSNS_TEMP_SCALE 256 |
Enumerations | |
| enum | tsns_clear_type_mask_t { tsns_clear_min = TSNS_FLAG_RECORD_MIN_CLR_MASK , tsns_clear_max = TSNS_FLAG_RECORD_MAX_CLR_MASK , tsns_clear_under_temp = TSNS_FLAG_UNDER_TEMP_MASK , tsns_clear_over_temp = TSNS_FLAG_OVER_TEMP_MASK , tsns_clear_irq = TSNS_FLAG_IRQ_MASK } |
| enum | tsns_event_t { tsns_event_irq = 0 , tsns_event_reset } |
Functions | |
| static void | tsns_enable (TSNS_Type *ptr) |
| Enable temperature sensor. More... | |
| static void | tsns_disable (TSNS_Type *ptr) |
| Disable temperature sensor. More... | |
| static bool | tsns_temperature_is_valid (TSNS_Type *ptr) |
| Check if current temperature value is valid or not. More... | |
| static int32_t | tsns_get_max_temp_raw (TSNS_Type *ptr) |
| Get maximum measured temperature in raw. More... | |
| static int32_t | tsns_get_min_temp_raw (TSNS_Type *ptr) |
| Get minimum measured temperature in raw. More... | |
| static int32_t | tsns_get_current_temp_in_raw (TSNS_Type *ptr) |
| Get current temperature in raw. More... | |
| static float | tsns_get_current_temp (TSNS_Type *ptr) |
| Get current temperature in celsius degree. More... | |
| static uint32_t | tsns_get_temp_age (TSNS_Type *ptr) |
| Get temperature age. More... | |
| static void | tsns_set_reset_threshold_high (TSNS_Type *ptr, uint32_t high) |
| Set temperature high limit to trigger rest. More... | |
| static void | tsns_set_reset_threshold_low (TSNS_Type *ptr, uint32_t low) |
| Set temperature low limit to trigger reset. More... | |
| static void | tsns_enable_limit_trigger_reset (TSNS_Type *ptr) |
| Enable temperature limit to trigger irq. More... | |
| static void | tsns_disable_limit_trigger_irq (TSNS_Type *ptr) |
| Disable temperature limit to trigger irq. More... | |
| static void | tsns_set_irq_threshold_high (TSNS_Type *ptr, uint32_t high) |
| Set temperature high limit to trigger irq. More... | |
| static void | tsns_set_irq_threshold_low (TSNS_Type *ptr, uint32_t low) |
| Set temperature low limit to trigger irq. More... | |
| static void | tsns_enable_limit_trigger_irq (TSNS_Type *ptr) |
| Enable temperature limit to trigger irq. More... | |
| static void | tsns_set_validity (TSNS_Type *ptr, uint32_t validity) |
| Set validity of current measured temperature in 24Mhz clock cycles. More... | |
| static void | tsns_config_irq_threshold (TSNS_Type *ptr, uint32_t high, uint32_t low) |
| Set temperature limit to trigger irq. More... | |
| static void | tsns_config_reset_threshold (TSNS_Type *ptr, uint32_t high, uint32_t low) |
| Set temperature limit to trigger reset. More... | |
| static void | tsns_enable_compare_max (TSNS_Type *ptr) |
| Enable compare max temperature. More... | |
| static void | tsns_enable_compare_min (TSNS_Type *ptr) |
| Enable compare min temperature. More... | |
| static void | tsns_disable_compare_max (TSNS_Type *ptr) |
| Disable compare max temperature. More... | |
| static void | tsns_disable_compare_min (TSNS_Type *ptr) |
| Disable compare min temperature. More... | |
| static void | tsns_set_speed (TSNS_Type *ptr, uint8_t speed) |
| Set measurement speed. More... | |
| static void | tsns_set_average (TSNS_Type *ptr, uint8_t average) |
| Set average. More... | |
| static void | tsns_enable_async_mode (TSNS_Type *ptr) |
| Enable Async mode. More... | |
| static void | tsns_disable_async_mode (TSNS_Type *ptr) |
| Disable Async mode and switch to active mode. More... | |
| static void | tsns_enable_trigger_mode (TSNS_Type *ptr) |
| Enable trigger mode. More... | |
| static void | tsns_enable_continuous_mode (TSNS_Type *ptr) |
| Enable continuous mode. More... | |
| static void | tsns_trigger_measurement (TSNS_Type *ptr) |
| trigger measurement More... | |
| static void | tsns_clear_with_mask (TSNS_Type *ptr, tsns_clear_type_mask_t mask) |
| clear tsns flag or recorded data More... | |
| static uint32_t | tsns_get_flag_value (TSNS_Type *ptr) |
| Get the flag value from a TSNS. More... | |
| void | tsns_configure_low_limit_event (TSNS_Type *ptr, int32_t low, tsns_event_t e) |
| configure low temperature limite to trigger event More... | |
| void | tsns_configure_high_limit_event (TSNS_Type *ptr, int32_t high, tsns_event_t e) |
| configure high temperature limite to trigger event More... | |
| void | tsns_configure_limit_event (TSNS_Type *ptr, int32_t high, int32_t low, tsns_event_t e) |
| configure temperature limite to trigger event More... | |
TSNS driver APIs.
| #define TSNS_TEMP_SCALE 256 |
#include <drivers/inc/hpm_tsns_drv.h>
#include <drivers/inc/hpm_tsns_drv.h>
| Enumerator | |
|---|---|
| tsns_clear_min | |
| tsns_clear_max | |
| tsns_clear_under_temp | |
| tsns_clear_over_temp | |
| tsns_clear_irq | |
| enum tsns_event_t |
#include <drivers/inc/hpm_tsns_drv.h>
| Enumerator | |
|---|---|
| tsns_event_irq | |
| tsns_event_reset | |
|
inlinestatic |
#include <drivers/inc/hpm_tsns_drv.h>
clear tsns flag or recorded data
| ptr | base address |
| mask | flag or data to be cleared |
|
inlinestatic |
#include <drivers/inc/hpm_tsns_drv.h>
Set temperature limit to trigger irq.
| ptr | base address |
| high | high temperature |
| low | low temperature |
|
inlinestatic |
#include <drivers/inc/hpm_tsns_drv.h>
Set temperature limit to trigger reset.
| ptr | base address |
| high | high temperature |
| low | low temperature |
| void tsns_configure_high_limit_event | ( | TSNS_Type * | ptr, |
| int32_t | high, | ||
| tsns_event_t | e | ||
| ) |
#include <drivers/inc/hpm_tsns_drv.h>
configure high temperature limite to trigger event
| ptr | base address |
| high | temperature value |
| e | event type, tsns_event_irq or tsns_event_reset |
| void tsns_configure_limit_event | ( | TSNS_Type * | ptr, |
| int32_t | high, | ||
| int32_t | low, | ||
| tsns_event_t | e | ||
| ) |
#include <drivers/inc/hpm_tsns_drv.h>
configure temperature limite to trigger event
| ptr | base address |
| high | temperature value |
| low | temperature value |
| e | event type, tsns_event_irq or tsns_event_reset |
| void tsns_configure_low_limit_event | ( | TSNS_Type * | ptr, |
| int32_t | low, | ||
| tsns_event_t | e | ||
| ) |
#include <drivers/inc/hpm_tsns_drv.h>
configure low temperature limite to trigger event
| ptr | base address |
| low | temperature value |
| e | event type, tsns_event_irq or tsns_event_reset |
|
inlinestatic |
|
inlinestatic |
#include <drivers/inc/hpm_tsns_drv.h>
Disable Async mode and switch to active mode.
| ptr | base address |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
#include <drivers/inc/hpm_tsns_drv.h>
Disable temperature limit to trigger irq.
| ptr | base address |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
#include <drivers/inc/hpm_tsns_drv.h>
Enable temperature limit to trigger irq.
| ptr | base address |
|
inlinestatic |
#include <drivers/inc/hpm_tsns_drv.h>
Enable temperature limit to trigger irq.
| ptr | base address |
|
inlinestatic |
|
inlinestatic |
#include <drivers/inc/hpm_tsns_drv.h>
Get current temperature in celsius degree.
| ptr | base address |
|
inlinestatic |
#include <drivers/inc/hpm_tsns_drv.h>
Get current temperature in raw.
| ptr | base address |
|
inlinestatic |
#include <drivers/inc/hpm_tsns_drv.h>
Get the flag value from a TSNS.
| ptr | Pointer to a TSNS_Type structure |
|
inlinestatic |
#include <drivers/inc/hpm_tsns_drv.h>
Get maximum measured temperature in raw.
| ptr | base address |
|
inlinestatic |
#include <drivers/inc/hpm_tsns_drv.h>
Get minimum measured temperature in raw.
| ptr | base address |
|
inlinestatic |
#include <drivers/inc/hpm_tsns_drv.h>
Get temperature age.
| ptr | base address |
|
inlinestatic |
#include <drivers/inc/hpm_tsns_drv.h>
Set average.
| ptr | base address |
| average | range 0 - 7 (0: 2^0 = 1 means measure once and return ... 2: 2^2 = 4 means measure 4 times and average) |
|
inlinestatic |
#include <drivers/inc/hpm_tsns_drv.h>
Set temperature high limit to trigger irq.
| ptr | base address |
| high | temperature value |
|
inlinestatic |
#include <drivers/inc/hpm_tsns_drv.h>
Set temperature low limit to trigger irq.
| ptr | base address |
| low | temperature value |
|
inlinestatic |
#include <drivers/inc/hpm_tsns_drv.h>
Set temperature high limit to trigger rest.
| ptr | base address |
| high | temperature value |
|
inlinestatic |
#include <drivers/inc/hpm_tsns_drv.h>
Set temperature low limit to trigger reset.
| ptr | base address |
| low | temperature value |
|
inlinestatic |
#include <drivers/inc/hpm_tsns_drv.h>
Set measurement speed.
| ptr | base address |
| speed | speed from 24-255 |
|
inlinestatic |
#include <drivers/inc/hpm_tsns_drv.h>
Set validity of current measured temperature in 24Mhz clock cycles.
| ptr | base address |
| validity | clock cycle count |
|
inlinestatic |
#include <drivers/inc/hpm_tsns_drv.h>
Check if current temperature value is valid or not.
| ptr | base address |
|
inlinestatic |