Temperature sensor (TEMP) driver.
More...
|
| int | nrfx_temp_init (nrfx_temp_config_t const *p_config, nrfx_temp_data_handler_t handler) |
| | Function for initializing the TEMP driver.
|
| |
|
void | nrfx_temp_uninit (void) |
| | Function for uninitializing the TEMP driver.
|
| |
| bool | nrfx_temp_init_check (void) |
| | Function for checking if the TEMP driver is initialized.
|
| |
| NRFX_STATIC_INLINE int32_t | nrfx_temp_result_get (void) |
| | Function for getting the temperature measurement in a 2's complement signed value representation.
|
| |
| int32_t | nrfx_temp_calculate (int32_t raw_measurement) |
| | Function for calculating the temperature value in Celsius scale from raw data.
|
| |
| int | nrfx_temp_measure (void) |
| | Function for starting the temperature measurement.
|
| |
Temperature sensor (TEMP) driver.
◆ NRFX_TEMP_DEFAULT_CONFIG
| #define NRFX_TEMP_DEFAULT_CONFIG |
Value: { \
.interrupt_priority = NRFX_TEMP_DEFAULT_CONFIG_IRQ_PRIORITY, \
}
TEMP default configuration.
◆ nrfx_temp_data_handler_t
| typedef void(* nrfx_temp_data_handler_t) (int32_t temperature) |
TEMP driver data ready handler type.
- Parameters
-
| temperature | Raw temperature in a 2's complement signed value representation. This value can be converted to Celsius scale using the nrfx_temp_calculate() function. |
◆ nrfx_temp_calculate()
| int32_t nrfx_temp_calculate |
( |
int32_t | raw_measurement | ) |
|
Function for calculating the temperature value in Celsius scale from raw data.
The returned temperature value is in Celsius scale, multiplied by 100 For example, the actual temperature of 25.75[C] will be returned as a 2575 signed integer. Measurement accuracy is 0.25[C].
- Parameters
-
| [in] | raw_measurement | Temperature value in a 2's complement signed value representation. |
- Returns
- Temperature measurement result.
◆ nrfx_temp_init()
Function for initializing the TEMP driver.
- Parameters
-
| [in] | p_config | Pointer to the structure with initial configuration. |
| [in] | handler | Data handler provided by the user. If not provided, the driver is initialized in blocking mode. |
- Return values
-
| 0 | Driver was successfully initialized. |
| -EALREADY | Driver was already initialized. |
◆ nrfx_temp_init_check()
| bool nrfx_temp_init_check |
( |
void | | ) |
|
Function for checking if the TEMP driver is initialized.
- Return values
-
| true | Driver is already initialized. |
| false | Driver is not initialized. |
◆ nrfx_temp_measure()
| int nrfx_temp_measure |
( |
void | | ) |
|
Function for starting the temperature measurement.
Non-blocking mode: This function returns immediately. After a measurement, the handler specified during initialization is called, with measurement result as the parameter.
Blocking mode: This function waits until the measurement is finished. The value should be read using the nrfx_temp_result_get() function.
- Return values
-
| 0 | In non-blocking mode: Measurement was started. An interrupt will be generated soon.
In blocking mode: Measurement was started and finished. Data can be read using the nrfx_temp_result_get() function. |
| -ECANCELED | In non-blocking mode: Not applicable.
In blocking mode: Measurement data ready event did not occur. |
◆ nrfx_temp_result_get()
| NRFX_STATIC_INLINE int32_t nrfx_temp_result_get |
( |
void | | ) |
|
Function for getting the temperature measurement in a 2's complement signed value representation.
This function returns the last value prepared by the TEMP peripheral. In blocking mode, it should be used after calling the nrfx_temp_measure() function. In non-blocking mode, it is called internally by the driver, and the value it returns is passed to the data handler.
- Returns
- Temperature measurement result in a 2's complement signed value representation.