TEMP HAL

group nrf_temp_hal

Hardware access layer for managing the Temperature sensor (TEMP).

Defines

NRF_TEMP_HAS_CALIBRATION

Symbol indicating whether the calibration of temperature measurement is present.

Enums

enum nrf_temp_task_t

TEMP tasks.

Values:

enumerator NRF_TEMP_TASK_START

Start temperature measurement.

enumerator NRF_TEMP_TASK_STOP

Stop temperature measurement.

enum nrf_temp_event_t

TEMP events.

Values:

enumerator NRF_TEMP_EVENT_DATARDY

Temperature measurement complete, data ready.

enum nrf_temp_int_mask_t

TEMP interrupts.

Values:

enumerator NRF_TEMP_INT_DATARDY_MASK

Interrupt on DATARDY event.

Functions

NRF_STATIC_INLINE void nrf_temp_int_enable(NRF_TEMP_Type *p_reg, uint32_t mask)

Function for enabling specified interrupts.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mask[in] Mask of interrupts to be enabled.

NRF_STATIC_INLINE void nrf_temp_int_disable(NRF_TEMP_Type *p_reg, uint32_t mask)

Function for disabling specified interrupts.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mask[in] Mask of interrupts to be disabled.

NRF_STATIC_INLINE uint32_t nrf_temp_int_enable_check(NRF_TEMP_Type const *p_reg, uint32_t mask)

Function for checking if the specified interrupts are enabled.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mask[in] Mask of interrupts to be checked.

Returns:

Mask of enabled interrupts.

NRF_STATIC_INLINE uint32_t nrf_temp_task_address_get(NRF_TEMP_Type const *p_reg, nrf_temp_task_t task)

Function for getting the address of the specified TEMP task register.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • task[in] Requested task.

Returns:

Address of the requested task register.

NRF_STATIC_INLINE void nrf_temp_task_trigger(NRF_TEMP_Type *p_reg, nrf_temp_task_t task)

Function for activating the specified TEMP task.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • task[in] Task to be activated.

NRF_STATIC_INLINE uint32_t nrf_temp_event_address_get(NRF_TEMP_Type const *p_reg, nrf_temp_event_t event)

Function for getting the address of the specified TEMP event register.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • event[in] Requested event.

Returns:

Address of the requested event register.

NRF_STATIC_INLINE void nrf_temp_event_clear(NRF_TEMP_Type *p_reg, nrf_temp_event_t event)

Function for clearing the specified TEMP event.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • event[in] Event to clear.

NRF_STATIC_INLINE bool nrf_temp_event_check(NRF_TEMP_Type const *p_reg, nrf_temp_event_t event)

Function for getting the state of a specific event.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • event[in] Event to be checked.

Return values:
  • true – The event has been generated.

  • false – The event has not been generated.

NRF_STATIC_INLINE int32_t nrf_temp_result_get(NRF_TEMP_Type const *p_reg)

Function for getting the result of temperature measurement.

Note

Returned value is in 2’s complement format, 0.25 °C steps

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

Temperature value register contents.

NRF_STATIC_INLINE void nrf_temp_calibration_coeff_set(NRF_TEMP_Type *p_reg, uint32_t coeff)

Function for setting the calibration coefficient for the temperature measurement.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • coeff[in] Calibration coefficient.

NRF_STATIC_INLINE uint32_t nrf_temp_calibration_coeff_get(NRF_TEMP_Type const *p_reg)

Function for getting the calibration coefficient for the temperature measurement.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

Calibration coefficient.