![]() |
nrfx 4.5.0
|
Hardware access layer for managing the TIMER peripheral. More...
Macros | |
| #define | NRF_TIMER_INST_GET(idx) |
| Macro getting pointer to the structure of registers of the TIMER peripheral. | |
| #define | NRF_TIMER_HAS_CC4 1 |
| Symbol indicating whether timer has capture/compare channel 4. | |
| #define | NRF_TIMER_HAS_CC5 1 |
| Symbol indicating whether timer has capture/compare channel 5. | |
| #define | NRF_TIMER_HAS_CC6 1 |
| Symbol indicating whether timer has capture/compare channel 6. | |
| #define | NRF_TIMER_HAS_CC7 1 |
| Symbol indicating whether timer has capture/compare channel 7. | |
| #define | NRF_TIMER_HAS_LOW_POWER_MODE 1 |
| Symbol indicating whether timer supports low power mode. | |
| #define | NRF_TIMER_HAS_ONE_SHOT 1 |
| Symbol indicating whether timer supports one-shot operation. | |
| #define | NRF_TIMER_HAS_SHUTDOWN 1 |
| Symbol indicating whether timer supports shutdown task. | |
| #define | NRF_TIMER_BASE_FREQUENCY_320MHZ (NRFX_MHZ_TO_HZ(320UL)) |
| Base frequency value 320 MHz for TIMER. | |
| #define | NRF_TIMER_BASE_FREQUENCY_256MHZ (NRFX_MHZ_TO_HZ(256UL)) |
| Base frequency value 256 MHz for TIMER. | |
| #define | NRF_TIMER_BASE_FREQUENCY_128MHZ (NRFX_MHZ_TO_HZ(128UL)) |
| Base frequency value 128 MHz for TIMER. | |
| #define | NRF_TIMER_BASE_FREQUENCY_64MHZ (NRFX_MHZ_TO_HZ(64UL)) |
| Base frequency value 64 MHz for TIMER. | |
| #define | NRF_TIMER_BASE_FREQUENCY_32MHZ (NRFX_MHZ_TO_HZ(32UL)) |
| Base frequency value 32 MHz for TIMER. | |
| #define | NRF_TIMER_BASE_FREQUENCY_16MHZ (NRFX_MHZ_TO_HZ(16UL)) |
| Base frequency value 16 MHz for TIMER. | |
| #define | NRF_TIMER_PRESCALER_MAX TIMER_PRESCALER_PRESCALER_Max |
| Maximum value of PRESCALER register. | |
| #define | TIMER_MAX_SIZE(id) |
| Macro for getting the maximum bit resolution of the specified timer instance. | |
| #define | TIMER_BIT_WIDTH_MAX(id, bit_width) |
| Macro for validating the correctness of the bit width resolution setting. | |
| #define | _NRF_TIMER_IS_BIT_WIDTH_VALID_ELEM(periph_name, prefix, idx, reg, bit_width) |
| Internal macro used by NRF_TIMER_IS_BIT_WIDTH_VALID. | |
| #define | NRF_TIMER_IS_BIT_WIDTH_VALID(p_reg, bit_width) |
| Macro for checking correctness of bit width configuration for the specified timer. | |
| #define | NRF_TIMER_IS_320MHZ_TIMER(p_reg) |
| Macro for checking whether the base frequency for the specified timer is 320 MHz. | |
| #define | NRF_TIMER_IS_256MHZ_TIMER(p_reg) |
| Macro for checking whether the base frequency for the specified timer is 256 MHz. | |
| #define | NRF_TIMER_IS_128MHZ_TIMER(p_reg) |
| Macro for checking whether the base frequency for the specified timer is 128 MHz. | |
| #define | NRF_TIMER_IS_64MHZ_TIMER(p_reg) |
| Macro for checking whether the base frequency for the specified timer is 64 MHz. | |
| #define | NRF_TIMER_IS_32MHZ_TIMER(p_reg) |
| Macro for checking whether the base frequency for the specified timer is 32 MHz. | |
| #define | NRF_TIMER_BASE_FREQUENCY_GET(p_reg) |
| Macro for getting base frequency value in Hz for the specified timer. | |
| #define | NRF_TIMER_PRESCALER_CALCULATE(base_freq, frequency) |
| Macro for computing prescaler value for given base frequency and desired frequency. | |
| #define | NRF_TIMER_FREQUENCY_STATIC_CHECK(p_reg, frequency) |
| Macro for checking whether specified frequency can be achived for given timer instance. | |
| #define | NRF_TIMER_CC_CHANNEL_COUNT(id) |
| Macro for getting the number of capture/compare channels available in a given timer instance. | |
| #define | NRF_TIMER_CC_COUNT_MAX NRFX_ARRAY_SIZE(((NRF_TIMER_Type*)0)->EVENTS_COMPARE) |
| Symbol specifying maximum number of available compare channels. | |
| #define | NRF_TIMER_ALL_CHANNELS_INT_MASK ((uint32_t)((1 << NRF_TIMER_CC_COUNT_MAX) - 1) << TIMER_INTENSET_COMPARE0_Pos) |
| Symbol for creating the interrupt bitmask for all compare channels. | |
Enumerations | |
| enum | nrf_timer_task_t { NRF_TIMER_TASK_START = offsetof(NRF_TIMER_Type, TASKS_START) , NRF_TIMER_TASK_STOP = offsetof(NRF_TIMER_Type, TASKS_STOP) , NRF_TIMER_TASK_COUNT = offsetof(NRF_TIMER_Type, TASKS_COUNT) , NRF_TIMER_TASK_CLEAR = offsetof(NRF_TIMER_Type, TASKS_CLEAR) , NRF_TIMER_TASK_SHUTDOWN = offsetof(NRF_TIMER_Type, TASKS_SHUTDOWN) , NRF_TIMER_TASK_CAPTURE0 = offsetof(NRF_TIMER_Type, TASKS_CAPTURE[0]) , NRF_TIMER_TASK_CAPTURE1 = offsetof(NRF_TIMER_Type, TASKS_CAPTURE[1]) , NRF_TIMER_TASK_CAPTURE2 = offsetof(NRF_TIMER_Type, TASKS_CAPTURE[2]) , NRF_TIMER_TASK_CAPTURE3 = offsetof(NRF_TIMER_Type, TASKS_CAPTURE[3]) , NRF_TIMER_TASK_CAPTURE4 = offsetof(NRF_TIMER_Type, TASKS_CAPTURE[4]) , NRF_TIMER_TASK_CAPTURE5 = offsetof(NRF_TIMER_Type, TASKS_CAPTURE[5]) , NRF_TIMER_TASK_CAPTURE6 = offsetof(NRF_TIMER_Type, TASKS_CAPTURE[6]) , NRF_TIMER_TASK_CAPTURE7 = offsetof(NRF_TIMER_Type, TASKS_CAPTURE[7]) } |
| Timer tasks. More... | |
| enum | nrf_timer_event_t { NRF_TIMER_EVENT_COMPARE0 = offsetof(NRF_TIMER_Type, EVENTS_COMPARE[0]) , NRF_TIMER_EVENT_COMPARE1 = offsetof(NRF_TIMER_Type, EVENTS_COMPARE[1]) , NRF_TIMER_EVENT_COMPARE2 = offsetof(NRF_TIMER_Type, EVENTS_COMPARE[2]) , NRF_TIMER_EVENT_COMPARE3 = offsetof(NRF_TIMER_Type, EVENTS_COMPARE[3]) , NRF_TIMER_EVENT_COMPARE4 = offsetof(NRF_TIMER_Type, EVENTS_COMPARE[4]) , NRF_TIMER_EVENT_COMPARE5 = offsetof(NRF_TIMER_Type, EVENTS_COMPARE[5]) , NRF_TIMER_EVENT_COMPARE6 = offsetof(NRF_TIMER_Type, EVENTS_COMPARE[6]) , NRF_TIMER_EVENT_COMPARE7 = offsetof(NRF_TIMER_Type, EVENTS_COMPARE[7]) } |
| Timer events. More... | |
| enum | nrf_timer_short_mask_t { NRF_TIMER_SHORT_COMPARE0_STOP_MASK = TIMER_SHORTS_COMPARE0_STOP_Msk , NRF_TIMER_SHORT_COMPARE1_STOP_MASK = TIMER_SHORTS_COMPARE1_STOP_Msk , NRF_TIMER_SHORT_COMPARE2_STOP_MASK = TIMER_SHORTS_COMPARE2_STOP_Msk , NRF_TIMER_SHORT_COMPARE3_STOP_MASK = TIMER_SHORTS_COMPARE3_STOP_Msk , NRF_TIMER_SHORT_COMPARE4_STOP_MASK = TIMER_SHORTS_COMPARE4_STOP_Msk , NRF_TIMER_SHORT_COMPARE5_STOP_MASK = TIMER_SHORTS_COMPARE5_STOP_Msk , NRF_TIMER_SHORT_COMPARE6_STOP_MASK = TIMER_SHORTS_COMPARE6_STOP_Msk , NRF_TIMER_SHORT_COMPARE7_STOP_MASK = TIMER_SHORTS_COMPARE7_STOP_Msk , NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK = TIMER_SHORTS_COMPARE0_CLEAR_Msk , NRF_TIMER_SHORT_COMPARE1_CLEAR_MASK = TIMER_SHORTS_COMPARE1_CLEAR_Msk , NRF_TIMER_SHORT_COMPARE2_CLEAR_MASK = TIMER_SHORTS_COMPARE2_CLEAR_Msk , NRF_TIMER_SHORT_COMPARE3_CLEAR_MASK = TIMER_SHORTS_COMPARE3_CLEAR_Msk , NRF_TIMER_SHORT_COMPARE4_CLEAR_MASK = TIMER_SHORTS_COMPARE4_CLEAR_Msk , NRF_TIMER_SHORT_COMPARE5_CLEAR_MASK = TIMER_SHORTS_COMPARE5_CLEAR_Msk , NRF_TIMER_SHORT_COMPARE6_CLEAR_MASK = TIMER_SHORTS_COMPARE6_CLEAR_Msk , NRF_TIMER_SHORT_COMPARE7_CLEAR_MASK = TIMER_SHORTS_COMPARE7_CLEAR_Msk } |
| Types of timer shortcuts. More... | |
| enum | nrf_timer_mode_t { NRF_TIMER_MODE_TIMER = TIMER_MODE_MODE_Timer , NRF_TIMER_MODE_COUNTER = TIMER_MODE_MODE_Counter , NRF_TIMER_MODE_LOW_POWER_COUNTER = TIMER_MODE_MODE_LowPowerCounter } |
| Timer modes. More... | |
| enum | nrf_timer_bit_width_t { NRF_TIMER_BIT_WIDTH_8 = TIMER_BITMODE_BITMODE_08Bit , NRF_TIMER_BIT_WIDTH_16 = TIMER_BITMODE_BITMODE_16Bit , NRF_TIMER_BIT_WIDTH_24 = TIMER_BITMODE_BITMODE_24Bit , NRF_TIMER_BIT_WIDTH_32 = TIMER_BITMODE_BITMODE_32Bit } |
| Timer bit width. More... | |
| enum | nrf_timer_frequency_t { NRF_TIMER_FREQ_16MHz = 0 , NRF_TIMER_FREQ_8MHz , NRF_TIMER_FREQ_4MHz , NRF_TIMER_FREQ_2MHz , NRF_TIMER_FREQ_1MHz , NRF_TIMER_FREQ_500kHz , NRF_TIMER_FREQ_250kHz , NRF_TIMER_FREQ_125kHz , NRF_TIMER_FREQ_62500Hz , NRF_TIMER_FREQ_31250Hz } |
| Timer prescalers. More... | |
| enum | nrf_timer_cc_channel_t { NRF_TIMER_CC_CHANNEL0 = 0 , NRF_TIMER_CC_CHANNEL1 , NRF_TIMER_CC_CHANNEL2 , NRF_TIMER_CC_CHANNEL3 , NRF_TIMER_CC_CHANNEL4 , NRF_TIMER_CC_CHANNEL5 , NRF_TIMER_CC_CHANNEL6 , NRF_TIMER_CC_CHANNEL7 } |
| Timer capture/compare channels. More... | |
| enum | nrf_timer_int_mask_t { NRF_TIMER_INT_COMPARE0_MASK = TIMER_INTENSET_COMPARE0_Msk , NRF_TIMER_INT_COMPARE1_MASK = TIMER_INTENSET_COMPARE1_Msk , NRF_TIMER_INT_COMPARE2_MASK = TIMER_INTENSET_COMPARE2_Msk , NRF_TIMER_INT_COMPARE3_MASK = TIMER_INTENSET_COMPARE3_Msk , NRF_TIMER_INT_COMPARE4_MASK = TIMER_INTENSET_COMPARE4_Msk , NRF_TIMER_INT_COMPARE5_MASK = TIMER_INTENSET_COMPARE5_Msk , NRF_TIMER_INT_COMPARE6_MASK = TIMER_INTENSET_COMPARE6_Msk , NRF_TIMER_INT_COMPARE7_MASK = TIMER_INTENSET_COMPARE7_Msk } |
| Timer interrupts. More... | |
Functions | |
| NRF_STATIC_INLINE void | nrf_timer_prescaler_set (NRF_TIMER_Type *p_reg, uint32_t prescaler_factor) |
| Function for setting the prescaler factor. | |
| NRF_STATIC_INLINE uint32_t | nrf_timer_prescaler_get (NRF_TIMER_Type const *p_reg) |
| Function for retrieving the prescaler factor. | |
| NRF_STATIC_INLINE void | nrf_timer_task_trigger (NRF_TIMER_Type *p_reg, nrf_timer_task_t task) |
| Function for activating the specified timer task. | |
| NRF_STATIC_INLINE uint32_t | nrf_timer_task_address_get (NRF_TIMER_Type const *p_reg, nrf_timer_task_t task) |
| Function for getting the address of the specified timer task register. | |
| NRF_STATIC_INLINE void | nrf_timer_event_clear (NRF_TIMER_Type *p_reg, nrf_timer_event_t event) |
| Function for clearing the specified timer event. | |
| NRF_STATIC_INLINE bool | nrf_timer_event_check (NRF_TIMER_Type const *p_reg, nrf_timer_event_t event) |
| Function for retrieving the state of the TIMER event. | |
| NRF_STATIC_INLINE uint32_t | nrf_timer_event_address_get (NRF_TIMER_Type const *p_reg, nrf_timer_event_t event) |
| Function for getting the address of the specified timer event register. | |
| NRF_STATIC_INLINE void | nrf_timer_shorts_enable (NRF_TIMER_Type *p_reg, uint32_t mask) |
| Function for enabling the specified shortcuts. | |
| NRF_STATIC_INLINE void | nrf_timer_shorts_disable (NRF_TIMER_Type *p_reg, uint32_t mask) |
| Function for disabling the specified shortcuts. | |
| NRF_STATIC_INLINE void | nrf_timer_shorts_set (NRF_TIMER_Type *p_reg, uint32_t mask) |
| Function for setting the specified shortcuts. | |
| NRF_STATIC_INLINE nrf_timer_short_mask_t | nrf_timer_short_compare_clear_get (uint8_t channel) |
| Function for getting COMPARE_CLEAR short mask for the specified channel. | |
| NRF_STATIC_INLINE nrf_timer_short_mask_t | nrf_timer_short_compare_stop_get (uint8_t channel) |
| Function for getting COMPARE_STOP short mask for the specified channel. | |
| NRF_STATIC_INLINE void | nrf_timer_int_enable (NRF_TIMER_Type *p_reg, uint32_t mask) |
| Function for enabling the specified interrupts. | |
| NRF_STATIC_INLINE void | nrf_timer_int_disable (NRF_TIMER_Type *p_reg, uint32_t mask) |
| Function for disabling the specified interrupts. | |
| NRF_STATIC_INLINE uint32_t | nrf_timer_int_enable_check (NRF_TIMER_Type const *p_reg, uint32_t mask) |
| Function for checking if the specified interrupts are enabled. | |
| NRF_STATIC_INLINE void | nrf_timer_subscribe_set (NRF_TIMER_Type *p_reg, nrf_timer_task_t task, uint8_t channel) |
| Function for setting the subscribe configuration for a given TIMER task. | |
| NRF_STATIC_INLINE uint32_t | nrf_timer_subscribe_get (NRF_TIMER_Type const *p_reg, nrf_timer_task_t task) |
| Function for getting the subscribe configuration for a given TIMER task. | |
| NRF_STATIC_INLINE void | nrf_timer_subscribe_clear (NRF_TIMER_Type *p_reg, nrf_timer_task_t task) |
| Function for clearing the subscribe configuration for a given TIMER task. | |
| NRF_STATIC_INLINE void | nrf_timer_publish_set (NRF_TIMER_Type *p_reg, nrf_timer_event_t event, uint8_t channel) |
| Function for setting the publish configuration for a given TIMER event. | |
| NRF_STATIC_INLINE void | nrf_timer_publish_clear (NRF_TIMER_Type *p_reg, nrf_timer_event_t event) |
| Function for clearing the publish configuration for a given TIMER event. | |
| NRF_STATIC_INLINE uint32_t | nrf_timer_publish_get (NRF_TIMER_Type const *p_reg, nrf_timer_event_t event) |
| Function for getting the publish configuration for a given TIMER event. | |
| NRF_STATIC_INLINE void | nrf_timer_mode_set (NRF_TIMER_Type *p_reg, nrf_timer_mode_t mode) |
| Function for setting the timer mode. | |
| NRF_STATIC_INLINE nrf_timer_mode_t | nrf_timer_mode_get (NRF_TIMER_Type const *p_reg) |
| Function for retrieving the timer mode. | |
| NRF_STATIC_INLINE void | nrf_timer_bit_width_set (NRF_TIMER_Type *p_reg, nrf_timer_bit_width_t bit_width) |
| Function for setting the timer bit width. | |
| NRF_STATIC_INLINE nrf_timer_bit_width_t | nrf_timer_bit_width_get (NRF_TIMER_Type const *p_reg) |
| Function for retrieving the timer bit width. | |
| NRF_STATIC_INLINE void | nrf_timer_cc_set (NRF_TIMER_Type *p_reg, nrf_timer_cc_channel_t cc_channel, uint32_t cc_value) |
| Function for setting the capture/compare register for the specified channel. | |
| NRF_STATIC_INLINE uint32_t | nrf_timer_cc_get (NRF_TIMER_Type const *p_reg, nrf_timer_cc_channel_t cc_channel) |
| Function for retrieving the capture/compare value for a specified channel. | |
| NRF_STATIC_INLINE nrf_timer_task_t | nrf_timer_capture_task_get (uint8_t channel) |
| Function for getting the specified timer capture task. | |
| NRF_STATIC_INLINE nrf_timer_event_t | nrf_timer_compare_event_get (uint8_t channel) |
| Function for getting the specified timer compare event. | |
| NRF_STATIC_INLINE nrf_timer_int_mask_t | nrf_timer_compare_int_get (uint8_t channel) |
| Function for getting the specified timer compare interrupt. | |
| NRF_STATIC_INLINE uint32_t | nrf_timer_us_to_ticks (uint32_t time_us, nrf_timer_frequency_t frequency) |
| Function for calculating the number of timer ticks for a given time (in microseconds) and timer frequency. | |
| NRF_STATIC_INLINE uint32_t | nrf_timer_ms_to_ticks (uint32_t time_ms, nrf_timer_frequency_t frequency) |
| Function for calculating the number of timer ticks for a given time (in milliseconds) and timer frequency. | |
| NRF_STATIC_INLINE void | nrf_timer_one_shot_enable (NRF_TIMER_Type *p_reg, nrf_timer_cc_channel_t cc_channel) |
| Function for enabling one-shot operation for the specified capture/compare channel. | |
| NRF_STATIC_INLINE void | nrf_timer_one_shot_disable (NRF_TIMER_Type *p_reg, nrf_timer_cc_channel_t cc_channel) |
| Function for disabling one-shot operation for the specified capture/compare channel. | |
Hardware access layer for managing the TIMER peripheral.
| #define _NRF_TIMER_IS_BIT_WIDTH_VALID_ELEM | ( | periph_name, | |
| prefix, | |||
| idx, | |||
| reg, | |||
| bit_width ) |
Internal macro used by NRF_TIMER_IS_BIT_WIDTH_VALID.
| #define NRF_TIMER_BASE_FREQUENCY_GET | ( | p_reg | ) |
Macro for getting base frequency value in Hz for the specified timer.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| #define NRF_TIMER_CC_CHANNEL_COUNT | ( | id | ) |
Macro for getting the number of capture/compare channels available in a given timer instance.
| [in] | id | Index of the specified timer instance. |
| #define NRF_TIMER_FREQUENCY_STATIC_CHECK | ( | p_reg, | |
| frequency ) |
Macro for checking whether specified frequency can be achived for given timer instance.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | frequency | Desired frequency value in Hz. |
| #define NRF_TIMER_INST_GET | ( | idx | ) |
Macro getting pointer to the structure of registers of the TIMER peripheral.
| [in] | idx | TIMER instance index. |
| #define NRF_TIMER_IS_128MHZ_TIMER | ( | p_reg | ) |
Macro for checking whether the base frequency for the specified timer is 128 MHz.
| #define NRF_TIMER_IS_256MHZ_TIMER | ( | p_reg | ) |
Macro for checking whether the base frequency for the specified timer is 256 MHz.
| #define NRF_TIMER_IS_320MHZ_TIMER | ( | p_reg | ) |
Macro for checking whether the base frequency for the specified timer is 320 MHz.
| #define NRF_TIMER_IS_32MHZ_TIMER | ( | p_reg | ) |
Macro for checking whether the base frequency for the specified timer is 32 MHz.
| #define NRF_TIMER_IS_64MHZ_TIMER | ( | p_reg | ) |
Macro for checking whether the base frequency for the specified timer is 64 MHz.
| #define NRF_TIMER_IS_BIT_WIDTH_VALID | ( | p_reg, | |
| bit_width ) |
Macro for checking correctness of bit width configuration for the specified timer.
| [in] | p_reg | Timer instance register. |
| [in] | bit_width | Bit width resolution value to be checked. |
| true | Timer instance supports the specified bit width resolution value. |
| false | Timer instance does not support the specified bit width resolution value. |
| #define NRF_TIMER_PRESCALER_CALCULATE | ( | base_freq, | |
| frequency ) |
Macro for computing prescaler value for given base frequency and desired frequency.
| [in] | base_freq | Base clock frequency for timer in Hz. |
| [in] | frequency | Desired frequency value in Hz. |
| #define TIMER_BIT_WIDTH_MAX | ( | id, | |
| bit_width ) |
Macro for validating the correctness of the bit width resolution setting.
| [in] | id | Index of the specified timer instance. |
| [in] | bit_width | Bit width resolution value to be checked. |
| true | Timer instance supports the specified bit width resolution value. |
| false | Timer instance does not support the specified bit width resolution value. |
| #define TIMER_MAX_SIZE | ( | id | ) |
Macro for getting the maximum bit resolution of the specified timer instance.
| [in] | id | Index of the specified timer instance. |
| Maximum | bit resolution of the specified timer instance. |
Timer capture/compare channels.
| enum nrf_timer_event_t |
Timer events.
Timer prescalers.
| enum nrf_timer_int_mask_t |
Timer interrupts.
| enum nrf_timer_mode_t |
Types of timer shortcuts.
| enum nrf_timer_task_t |
Timer tasks.
| NRF_STATIC_INLINE nrf_timer_bit_width_t nrf_timer_bit_width_get | ( | NRF_TIMER_Type const * | p_reg | ) |
Function for retrieving the timer bit width.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRF_STATIC_INLINE void nrf_timer_bit_width_set | ( | NRF_TIMER_Type * | p_reg, |
| nrf_timer_bit_width_t | bit_width ) |
Function for setting the timer bit width.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | bit_width | Timer bit width. |
| NRF_STATIC_INLINE nrf_timer_task_t nrf_timer_capture_task_get | ( | uint8_t | channel | ) |
Function for getting the specified timer capture task.
| [in] | channel | Capture channel. |
| NRF_STATIC_INLINE uint32_t nrf_timer_cc_get | ( | NRF_TIMER_Type const * | p_reg, |
| nrf_timer_cc_channel_t | cc_channel ) |
Function for retrieving the capture/compare value for a specified channel.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | cc_channel | The specified capture/compare channel. |
| NRF_STATIC_INLINE void nrf_timer_cc_set | ( | NRF_TIMER_Type * | p_reg, |
| nrf_timer_cc_channel_t | cc_channel, | ||
| uint32_t | cc_value ) |
Function for setting the capture/compare register for the specified channel.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | cc_channel | The specified capture/compare channel. |
| [in] | cc_value | Value to write to the capture/compare register. |
| NRF_STATIC_INLINE nrf_timer_event_t nrf_timer_compare_event_get | ( | uint8_t | channel | ) |
Function for getting the specified timer compare event.
| [in] | channel | Compare channel. |
| NRF_STATIC_INLINE nrf_timer_int_mask_t nrf_timer_compare_int_get | ( | uint8_t | channel | ) |
Function for getting the specified timer compare interrupt.
| [in] | channel | Compare channel. |
| NRF_STATIC_INLINE uint32_t nrf_timer_event_address_get | ( | NRF_TIMER_Type const * | p_reg, |
| nrf_timer_event_t | event ) |
Function for getting the address of the specified timer event register.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | event | The specified event. |
| NRF_STATIC_INLINE bool nrf_timer_event_check | ( | NRF_TIMER_Type const * | p_reg, |
| nrf_timer_event_t | event ) |
Function for retrieving the state of the TIMER event.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | event | Event to be checked. |
| true | The event has been generated. |
| false | The event has not been generated. |
| NRF_STATIC_INLINE void nrf_timer_event_clear | ( | NRF_TIMER_Type * | p_reg, |
| nrf_timer_event_t | event ) |
Function for clearing the specified timer event.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | event | Event to clear. |
| NRF_STATIC_INLINE void nrf_timer_int_disable | ( | NRF_TIMER_Type * | p_reg, |
| uint32_t | mask ) |
Function for disabling the specified interrupts.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | mask | Mask of interrupts to be disabled. Use nrf_timer_int_mask_t values for bit masking. |
| NRF_STATIC_INLINE void nrf_timer_int_enable | ( | NRF_TIMER_Type * | p_reg, |
| uint32_t | mask ) |
Function for enabling the specified interrupts.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | mask | Mask of interrupts to be enabled. Use nrf_timer_int_mask_t values for bit masking. |
| NRF_STATIC_INLINE uint32_t nrf_timer_int_enable_check | ( | NRF_TIMER_Type const * | p_reg, |
| uint32_t | mask ) |
Function for checking if the specified interrupts are enabled.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | mask | Mask of interrupts to be checked. Use nrf_timer_int_mask_t values for bit masking. |
| NRF_STATIC_INLINE nrf_timer_mode_t nrf_timer_mode_get | ( | NRF_TIMER_Type const * | p_reg | ) |
Function for retrieving the timer mode.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRF_STATIC_INLINE void nrf_timer_mode_set | ( | NRF_TIMER_Type * | p_reg, |
| nrf_timer_mode_t | mode ) |
Function for setting the timer mode.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | mode | Timer mode. |
| NRF_STATIC_INLINE uint32_t nrf_timer_ms_to_ticks | ( | uint32_t | time_ms, |
| nrf_timer_frequency_t | frequency ) |
Function for calculating the number of timer ticks for a given time (in milliseconds) and timer frequency.
| [in] | time_ms | Time in milliseconds. |
| [in] | frequency | Timer frequency. |
| NRF_STATIC_INLINE void nrf_timer_one_shot_disable | ( | NRF_TIMER_Type * | p_reg, |
| nrf_timer_cc_channel_t | cc_channel ) |
Function for disabling one-shot operation for the specified capture/compare channel.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | cc_channel | Capture/compare channel. |
| NRF_STATIC_INLINE void nrf_timer_one_shot_enable | ( | NRF_TIMER_Type * | p_reg, |
| nrf_timer_cc_channel_t | cc_channel ) |
Function for enabling one-shot operation for the specified capture/compare channel.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | cc_channel | Capture/compare channel. |
| NRF_STATIC_INLINE uint32_t nrf_timer_prescaler_get | ( | NRF_TIMER_Type const * | p_reg | ) |
Function for retrieving the prescaler factor.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRF_STATIC_INLINE void nrf_timer_prescaler_set | ( | NRF_TIMER_Type * | p_reg, |
| uint32_t | prescaler_factor ) |
Function for setting the prescaler factor.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | prescaler_factor | Prescaler factor. |
| NRF_STATIC_INLINE void nrf_timer_publish_clear | ( | NRF_TIMER_Type * | p_reg, |
| nrf_timer_event_t | event ) |
Function for clearing the publish configuration for a given TIMER event.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | event | Event for which to clear the configuration. |
| NRF_STATIC_INLINE uint32_t nrf_timer_publish_get | ( | NRF_TIMER_Type const * | p_reg, |
| nrf_timer_event_t | event ) |
Function for getting the publish configuration for a given TIMER event.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | event | Event for which to read the configuration. |
| NRF_STATIC_INLINE void nrf_timer_publish_set | ( | NRF_TIMER_Type * | p_reg, |
| nrf_timer_event_t | event, | ||
| uint8_t | channel ) |
Function for setting the publish configuration for a given TIMER event.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | event | Event for which to set the configuration. |
| [in] | channel | Channel through which to publish the event. |
| NRF_STATIC_INLINE nrf_timer_short_mask_t nrf_timer_short_compare_clear_get | ( | uint8_t | channel | ) |
Function for getting COMPARE_CLEAR short mask for the specified channel.
| [in] | channel | Channel. |
| NRF_STATIC_INLINE nrf_timer_short_mask_t nrf_timer_short_compare_stop_get | ( | uint8_t | channel | ) |
Function for getting COMPARE_STOP short mask for the specified channel.
| [in] | channel | Channel. |
| NRF_STATIC_INLINE void nrf_timer_shorts_disable | ( | NRF_TIMER_Type * | p_reg, |
| uint32_t | mask ) |
Function for disabling the specified shortcuts.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | mask | Shortcuts to be disabled. |
| NRF_STATIC_INLINE void nrf_timer_shorts_enable | ( | NRF_TIMER_Type * | p_reg, |
| uint32_t | mask ) |
Function for enabling the specified shortcuts.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | mask | Shortcuts to be enabled. |
| NRF_STATIC_INLINE void nrf_timer_shorts_set | ( | NRF_TIMER_Type * | p_reg, |
| uint32_t | mask ) |
Function for setting the specified shortcuts.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | mask | Shortcuts to be set. |
| NRF_STATIC_INLINE void nrf_timer_subscribe_clear | ( | NRF_TIMER_Type * | p_reg, |
| nrf_timer_task_t | task ) |
Function for clearing the subscribe configuration for a given TIMER task.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | task | Task for which to clear the configuration. |
| NRF_STATIC_INLINE uint32_t nrf_timer_subscribe_get | ( | NRF_TIMER_Type const * | p_reg, |
| nrf_timer_task_t | task ) |
Function for getting the subscribe configuration for a given TIMER task.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | task | Task for which to read the configuration. |
| NRF_STATIC_INLINE void nrf_timer_subscribe_set | ( | NRF_TIMER_Type * | p_reg, |
| nrf_timer_task_t | task, | ||
| uint8_t | channel ) |
Function for setting the subscribe configuration for a given TIMER task.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | task | Task for which to set the configuration. |
| [in] | channel | Channel through which to subscribe events. |
| NRF_STATIC_INLINE uint32_t nrf_timer_task_address_get | ( | NRF_TIMER_Type const * | p_reg, |
| nrf_timer_task_t | task ) |
Function for getting the address of the specified timer task register.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | task | The specified task. |
| NRF_STATIC_INLINE void nrf_timer_task_trigger | ( | NRF_TIMER_Type * | p_reg, |
| nrf_timer_task_t | task ) |
Function for activating the specified timer task.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | task | Task to be activated. |
| NRF_STATIC_INLINE uint32_t nrf_timer_us_to_ticks | ( | uint32_t | time_us, |
| nrf_timer_frequency_t | frequency ) |
Function for calculating the number of timer ticks for a given time (in microseconds) and timer frequency.
| [in] | time_us | Time in microseconds. |
| [in] | frequency | Timer frequency. |