nrfx 4.5.0
Loading...
Searching...
No Matches
VPR CSR VTIM HAL

Hardware access layer for managing the VPR RISC-V CPU Control and Status Registers for VPR Timer (VPR CSR VTIM). More...

Macros

#define NRF_VPR_CSR_VTIM_COUNTER_VAL(cnt0, cnt1)
 Macro for generating 32-bit counter value.
 

Enumerations

enum  nrf_vpr_csr_vtim_count_t {
  NRF_VPR_CSR_VTIM_COUNT_STOP = VPRCSR_NORDIC_CNTMODE0_CNTMODE0_STOP ,
  NRF_VPR_CSR_VTIM_COUNT_WRAP = VPRCSR_NORDIC_CNTMODE0_CNTMODE0_WRAP ,
  NRF_VPR_CSR_VTIM_COUNT_RELOAD = VPRCSR_NORDIC_CNTMODE0_CNTMODE0_RELOAD ,
  NRF_VPR_CSR_VTIM_COUNT_TRIGGER_COMBINED = VPRCSR_NORDIC_CNTMODE0_CNTMODE0_TRIGCOMB
}
 Counter modes. More...
 

Functions

NRF_STATIC_INLINE nrf_vpr_csr_vtim_count_t nrf_vpr_cst_vtim_count_mode_get (uint8_t counter)
 Function for getting the counter mode.
 
NRF_STATIC_INLINE void nrf_vpr_csr_vtim_count_mode_set (uint8_t counter, nrf_vpr_csr_vtim_count_t mode)
 Function for setting the counter mode.
 
NRF_STATIC_INLINE uint16_t nrf_vpr_csr_vtim_simple_counter_get (uint8_t counter)
 Function for getting the counter value.
 
NRF_STATIC_INLINE void nrf_vpr_csr_vtim_simple_counter_set (uint8_t counter, uint16_t value)
 Function for setting the counter value.
 
NRF_STATIC_INLINE uint16_t nrf_vpr_csr_vtim_simple_counter_top_get (uint8_t counter)
 Function for getting the counter top.
 
NRF_STATIC_INLINE void nrf_vpr_csr_vtim_simple_counter_top_set (uint8_t counter, uint16_t value)
 Function for setting the counter top.
 
NRF_STATIC_INLINE void nrf_vpr_csr_vtim_simple_counter_add_set (uint8_t counter, uint16_t value)
 Function for setting the counter add.
 
NRF_STATIC_INLINE void nrf_vpr_csr_vtim_simple_wait_set (uint8_t counter, bool write, uint16_t value)
 Function for setting the wait register.
 
NRF_STATIC_INLINE uint32_t nrf_vpr_csr_vtim_combined_counter_get (void)
 Function for getting the combined counter value.
 
NRF_STATIC_INLINE void nrf_vpr_csr_vtim_combined_counter_set (uint32_t value)
 Function for setting the combined counter value.
 
NRF_STATIC_INLINE uint32_t nrf_vpr_csr_vtim_combined_counter_top_get (void)
 Function for getting the combined counter top.
 
NRF_STATIC_INLINE void nrf_vpr_csr_vtim_combined_counter_top_set (uint32_t value)
 Function for setting the combined counter top.
 
NRF_STATIC_INLINE void nrf_vpr_csr_vtim_combined_counter_add_set (uint32_t value)
 Function for setting the combined counter add.
 
NRF_STATIC_INLINE void nrf_vpr_csr_vtim_combined_wait_trigger (void)
 Function for triggering the wait.
 

Detailed Description

Hardware access layer for managing the VPR RISC-V CPU Control and Status Registers for VPR Timer (VPR CSR VTIM).

Macro Definition Documentation

◆ NRF_VPR_CSR_VTIM_COUNTER_VAL

#define NRF_VPR_CSR_VTIM_COUNTER_VAL ( cnt0,
cnt1 )
Value:
(((cnt0 << VPRCSR_NORDIC_CNT_CNT0_Pos) & VPRCSR_NORDIC_CNT_CNT0_Msk) | \
((cnt1 << VPRCSR_NORDIC_CNT_CNT1_Pos) & VPRCSR_NORDIC_CNT_CNT1_Msk))

Macro for generating 32-bit counter value.

Note
Use this macro when running two separate counters in trigger mode to write the values simultaneously using nrf_vpr_csr_vtim_combined_counter_set
Parameters
[in]cnt0Counter 0 value.
[in]cnt1Counter 1 value.

Enumeration Type Documentation

◆ nrf_vpr_csr_vtim_count_t

Counter modes.

Enumerator
NRF_VPR_CSR_VTIM_COUNT_STOP 

Counter stops at 0.

NRF_VPR_CSR_VTIM_COUNT_WRAP 

Counter will continue counting from 0xFFF.

NRF_VPR_CSR_VTIM_COUNT_RELOAD 

Counter will continue counting from the value in counter top.

NRF_VPR_CSR_VTIM_COUNT_TRIGGER_COMBINED 

Trigger (counter 0) or combined (counter 1) mode.

Trigger (applies to counter 0): Counter stops at 0. Counting will restart when a VIO event happens. Combined (applies to counter 1): Counter 1 acts as an extension of counter 0. (16 most significant bits of a 32-bit counter.)

Function Documentation

◆ nrf_vpr_csr_vtim_combined_counter_add_set()

NRF_STATIC_INLINE void nrf_vpr_csr_vtim_combined_counter_add_set ( uint32_t value)

Function for setting the combined counter add.

Note
This function should be used in 32-bit counter mode.
Parameters
[in]valueAdd value to be set.

◆ nrf_vpr_csr_vtim_combined_counter_get()

NRF_STATIC_INLINE uint32_t nrf_vpr_csr_vtim_combined_counter_get ( void )

Function for getting the combined counter value.

Note
Lower 16 bits represent counter 0, while higher 16 bits represent counter 1.
Returns
Counter value.

◆ nrf_vpr_csr_vtim_combined_counter_set()

NRF_STATIC_INLINE void nrf_vpr_csr_vtim_combined_counter_set ( uint32_t value)

Function for setting the combined counter value.

Note
Lower 16 bits represent counter 0, while higher 16 bits represent counter 1.
This function can also be used in trigger mode to make sure the counter values are written simultaneously. Use NRF_VPR_CSR_VTIM_COUNTER_VAL macro to generate value to be set.
Parameters
[in]valueValue to be set.

◆ nrf_vpr_csr_vtim_combined_counter_top_get()

NRF_STATIC_INLINE uint32_t nrf_vpr_csr_vtim_combined_counter_top_get ( void )

Function for getting the combined counter top.

Note
Lower 16 bits represent counter 0, while higher 16 bits represent counter 1.
Returns
Counter top.

◆ nrf_vpr_csr_vtim_combined_counter_top_set()

NRF_STATIC_INLINE void nrf_vpr_csr_vtim_combined_counter_top_set ( uint32_t value)

Function for setting the combined counter top.

Note
Lower 16 bits represent counter 0, while higher 16 bits represent counter 1.
Parameters
[in]valueTop value to be set.

◆ nrf_vpr_csr_vtim_combined_wait_trigger()

NRF_STATIC_INLINE void nrf_vpr_csr_vtim_combined_wait_trigger ( void )

Function for triggering the wait.

Writing to this register will stall the CPU until 32-bit counter reaches 0.

Note
This function should be used in 32-bit counter mode.

◆ nrf_vpr_csr_vtim_count_mode_set()

NRF_STATIC_INLINE void nrf_vpr_csr_vtim_count_mode_set ( uint8_t counter,
nrf_vpr_csr_vtim_count_t mode )

Function for setting the counter mode.

Parameters
[in]counterIndex of the counter.
[in]modeCounter mode to be set.

◆ nrf_vpr_csr_vtim_simple_counter_add_set()

NRF_STATIC_INLINE void nrf_vpr_csr_vtim_simple_counter_add_set ( uint8_t counter,
uint16_t value )

Function for setting the counter add.

Parameters
[in]counterIndex of the counter.
[in]valueAdd value to be set.

◆ nrf_vpr_csr_vtim_simple_counter_get()

NRF_STATIC_INLINE uint16_t nrf_vpr_csr_vtim_simple_counter_get ( uint8_t counter)

Function for getting the counter value.

Parameters
[in]counterIndex of the counter.
Returns
Counter value.

◆ nrf_vpr_csr_vtim_simple_counter_set()

NRF_STATIC_INLINE void nrf_vpr_csr_vtim_simple_counter_set ( uint8_t counter,
uint16_t value )

Function for setting the counter value.

Parameters
[in]counterIndex of the counter.
[in]valueValue to be set.

◆ nrf_vpr_csr_vtim_simple_counter_top_get()

NRF_STATIC_INLINE uint16_t nrf_vpr_csr_vtim_simple_counter_top_get ( uint8_t counter)

Function for getting the counter top.

Parameters
[in]counterIndex of the counter.
Returns
Counter top.

◆ nrf_vpr_csr_vtim_simple_counter_top_set()

NRF_STATIC_INLINE void nrf_vpr_csr_vtim_simple_counter_top_set ( uint8_t counter,
uint16_t value )

Function for setting the counter top.

Parameters
[in]counterIndex of the counter.
[in]valueTop value to be set.

◆ nrf_vpr_csr_vtim_simple_wait_set()

NRF_STATIC_INLINE void nrf_vpr_csr_vtim_simple_wait_set ( uint8_t counter,
bool write,
uint16_t value )

Function for setting the wait register.

Writing to this register will stall the CPU until counter reaches 0.

Parameters
[in]counterIndex of the counter.
[in]writeTrue if value is to be written to the counter value before starting the wait. False otherwise.
[in]valueValue to be written to the counter if write is true.

◆ nrf_vpr_cst_vtim_count_mode_get()

NRF_STATIC_INLINE nrf_vpr_csr_vtim_count_t nrf_vpr_cst_vtim_count_mode_get ( uint8_t counter)

Function for getting the counter mode.

Parameters
[in]counterIndex of the counter.
Returns
Counter mode.