PRS - Peripheral Reflex System#
Peripheral Reflex System (PRS) Peripheral API.
This module contains functions to control the PRS peripheral of Silicon Labs 32-bit MCUs and SoCs. The PRS allows configurable, fast, and autonomous communication between peripherals on the MCU or SoC.
Enumerations#
PRS Signal.
Functions#
Set level control bit for one or more channels.
Get level control bit for all channels.
Get the PRS channel values for all channels.
Get the PRS channel value for a single channel.
Trigger a high pulse (one HFPERCLK) for one or more channels.
Set the PRS channel level for one asynchronous PRS channel.
Trigger a pulse on one PRS channel.
Set a source and signal for a channel.
Set the source and asynchronous signal for a channel.
Send the output of a PRS channel to a GPIO pin.
Search for the first free PRS channel.
Reset all PRS channels.
Connect a PRS signal to a channel.
Macros#
PRS Synchronous channel count.
PRS Asynchronous channel count.
PRS asynchronous support.
Enumeration Documentation#
PRS_ChType_t#
PRS_ChType_t
PRS Channel type.
Enumerator | |
---|---|
prsTypeAsync | Asynchronous channel type. |
prsTypeSync | Synchronous channel type. |
102
of file platform/emlib/inc/em_prs.h
PRS_Edge_TypeDef#
PRS_Edge_TypeDef
Edge detection type.
Enumerator | |
---|---|
prsEdgeOff | Leave signal as is. |
prsEdgePos | Generate pulses on positive edge. |
prsEdgeNeg | Generate pulses on negative edge. |
prsEdgeBoth | Generate pulses on both edges. |
108
of file platform/emlib/inc/em_prs.h
PRS_Signal_t#
PRS_Signal_t
PRS Signal.
Enumerator | |
---|---|
prsSignalNone | No Signal. |
prsSignalSW | Software-reserved Signal. |
prsSignalPRS_CH0 | PRS_CH0 signal. |
prsSignalPRS_CH1 | PRS_CH1 signal. |
prsSignalPRS_CH2 | PRS_CH2 signal. |
prsSignalPRS_CH3 | PRS_CH3 signal. |
prsSignalPRS_CH4 | PRS_CH4 signal. |
prsSignalPRS_CH5 | PRS_CH5 signal. |
prsSignalPRS_CH6 | PRS_CH6 signal. |
prsSignalPRS_CH7 | PRS_CH7 signal. |
prsSignalPRS_CH8 | PRS_CH8 signal. |
prsSignalPRS_CH9 | PRS_CH9 signal. |
prsSignalPRS_CH10 | PRS_CH10 signal. |
prsSignalPRS_CH11 | PRS_CH11 signal. |
prsSignalADC0_SINGLE | ADC0_SINGLE signal. |
prsSignalADC0_SCAN | ADC0_SCAN signal. |
prsSignalTIMER0_UF | TIMER0 underflow Signal. |
prsSignalTIMER0_OF | TIMER0 overflow Signal. |
prsSignalTIMER0_CC0 | TIMER0 capture/compare channel 0 Signal. |
prsSignalTIMER0_CC1 | TIMER0 capture/compare channel 1 Signal. |
prsSignalTIMER0_CC2 | TIMER0 capture/compare channel 2 Signal. |
prsSignalTIMER1_UF | TIMER1 underflow Signal. |
prsSignalTIMER1_OF | TIMER1 overflow Signal. |
prsSignalTIMER1_CC0 | TIMER1 capture/compare channel 0 Signal. |
prsSignalTIMER1_CC1 | TIMER1 capture/compare channel 1 Signal. |
prsSignalTIMER1_CC2 | TIMER1 capture/compare channel 2 Signal. |
prsSignalLETIMER0_CH0 | LETIMER0 channel 0 Signal. |
prsSignalLETIMER0_CH1 | LETIMER0 channel 1 Signal. |
prsSignalPCNT0_TCC | PCNT0_TCC Signal. |
prsSignalPCNT0_UFOF | PCNT0_TCC Signal. |
prsSignalPCNT0_DIR | PCNT0_TCC Signal. |
prsSignalPCNT1_TCC | PCNT1_TCC Signal. |
prsSignalPCNT1_UFOF | PCNT1_TCC Signal. |
prsSignalPCNT1_DIR | PCNT1_TCC Signal. |
prsSignalPCNT2_TCC | PCNT2_TCC Signal. |
prsSignalPCNT2_UFOF | PCNT2_TCC Signal. |
prsSignalPCNT2_DIR | PCNT2_TCC Signal. |
prsSignalCRYOTIMER_PERIOD | CRYOTIMER_PERIOD Signal. |
prsSignalRTCC_CCV0 | RTCC capture/compare channel 0 Signal. |
prsSignalRTCC_CCV1 | RTCC capture/compare channel 1 Signal. |
prsSignalRTCC_CCV2 | RTCC capture/compare channel 2 Signal. |
prsSignalACMP0_OUT | ACMP0 Signal. |
prsSignalACMP1_OUT | ACMP1 output Signal. |
prsSignalLESENSE_SCANRES0 | LESENSE_SCANRES0 Signal. |
prsSignalLESENSE_SCANRES1 | LESENSE_SCANRES1 Signal. |
prsSignalLESENSE_SCANRES2 | LESENSE_SCANRES2 Signal. |
prsSignalLESENSE_SCANRES3 | LESENSE_SCANRES3 Signal. |
prsSignalLESENSE_SCANRES4 | LESENSE_SCANRES4 Signal. |
prsSignalLESENSE_SCANRES5 | LESENSE_SCANRES5 Signal. |
prsSignalLESENSE_SCANRES6 | LESENSE_SCANRES6 Signal. |
prsSignalLESENSE_SCANRES7 | LESENSE_SCANRES7 Signal. |
prsSignalLESENSE_SCANRES8 | LESENSE_SCANRES8 Signal. |
prsSignalLESENSE_SCANRES9 | LESENSE_SCANRES9 Signal. |
prsSignalLESENSE_SCANRES10 | LESENSE_SCANRES10 Signal. |
prsSignalLESENSE_SCANRES11 | LESENSE_SCANRES11 Signal. |
prsSignalLESENSE_SCANRES12 | LESENSE_SCANRES12 Signal. |
prsSignalLESENSE_SCANRES13 | LESENSE_SCANRES13 Signal. |
prsSignalLESENSE_SCANRES14 | LESENSE_SCANRES14 Signal. |
prsSignalLESENSE_SCANRES15 | LESENSE_SCANRES15 Signal. |
prsSignalLESENSE_DEC0 | LESENSE_DEC0 Signal. |
prsSignalLESENSE_DEC1 | LESENSE_DEC1 Signal. |
prsSignalLESENSE_DEC2 | LESENSE_DEC2 Signal. |
prsSignalLESENSE_DECCMP | LESENSE_DECCMP Signal. |
prsSignalLESENSE_MEASACT | LESENSE_MEASACT Signal. |
prsSignalUSART0_TXC | USART0 TX complete Signal. |
prsSignalUSART0_RXDATAV | USART0 RX data available Signal. |
prsSignalUSART0_IRTX | USART0 IR TX Signal. |
prsSignalUSART0_RTS | USART0 RTS Signal. |
prsSignalUSART0_TX | USART0 TX Signal. |
prsSignalUSART0_CS | USART0 chip select Signal. |
prsSignalUSART1_TXC | USART1 TX complete Signal. |
prsSignalUSART1_RXDATAV | USART1 RX data available Signal. |
prsSignalUSART1_RTS | USART1 RTS Signal. |
prsSignalUSART1_TX | USART1 TX Signal. |
prsSignalUSART1_CS | USART1 chip select Signal. |
prsSignalUSART2_TXC | USART2 TX complete Signal. |
prsSignalUSART2_RXDATAV | USART2 RX data available Signal. |
prsSignalUSART2_IRTX | USART2 IR TX Signal. |
prsSignalUSART2_RTS | USART2 RTS Signal. |
prsSignalUSART2_TX | USART2 TX Signal. |
prsSignalUSART2_CS | USART2 chip select Signal. |
prsSignalUSART3_TXC | USART3 TX complete Signal. |
prsSignalUSART3_RXDATAV | USART3 RX data available Signal. |
prsSignalUSART3_RTS | USART3 RTS Signal. |
prsSignalUSART3_TX | USART3 TX Signal. |
prsSignalUSART3_CS | USART3 chip select Signal. |
prsSignalCM4_TXEV | TXEV Signal. |
prsSignalCM4_ICACHEPCHITSOF | ICACHEPCHITSOF Signal. |
prsSignalCM4_ICACHEPCMISSESOF | ICACHEPCMISSESOF Signal. |
prsSignalWTIMER0_UF | WTIMER0_UF Signal. |
prsSignalWTIMER0_OF | WTIMER0_OF Signal. |
prsSignalWTIMER0_CC0 | WTIMER0_CC0 Signal. |
prsSignalWTIMER0_CC1 | WTIMER0_CC1 Signal. |
prsSignalWTIMER0_CC2 | WTIMER0_CC2 Signal. |
prsSignalWTIMER1_UF | WTIMER1_UF Signal. |
prsSignalWTIMER1_OF | WTIMER1_OF Signal. |
prsSignalWTIMER1_CC0 | WTIMER1_CC0 Signal. |
prsSignalWTIMER1_CC1 | WTIMER1_CC1 Signal. |
prsSignalWTIMER1_CC2 | WTIMER1_CC2 Signal. |
prsSignalWTIMER1_CC3 | WTIMER1_CC3 Signal. |
prsSignalGPIO_PIN0 | GPIO Pin 0 Signal. |
prsSignalGPIO_PIN1 | GPIO Pin 1 Signal. |
prsSignalGPIO_PIN2 | GPIO Pin 2 Signal. |
prsSignalGPIO_PIN3 | GPIO Pin 3 Signal. |
prsSignalGPIO_PIN4 | GPIO Pin 4 Signal. |
prsSignalGPIO_PIN5 | GPIO Pin 5 Signal. |
prsSignalGPIO_PIN6 | GPIO Pin 6 Signal. |
prsSignalGPIO_PIN7 | GPIO Pin 7 Signal. |
prsSignalGPIO_PIN8 | GPIO Pin 8 Signal. |
prsSignalGPIO_PIN9 | GPIO Pin 9 Signal. |
prsSignalGPIO_PIN10 | GPIO Pin 10 Signal. |
prsSignalGPIO_PIN11 | GPIO Pin 11 Signal. |
prsSignalGPIO_PIN12 | GPIO Pin 12 Signal. |
prsSignalGPIO_PIN13 | GPIO Pin 13 Signal. |
prsSignalGPIO_PIN14 | GPIO Pin 14 Signal. |
prsSignalGPIO_PIN15 | GPIO Pin 15 Signal. |
prsSignalMODEM_FRAMEDET | MODEM_FRAMEDET Signal. |
prsSignalMODEM_TIMDET | MODEM_TIMDET Signal. |
prsSignalMODEM_SYNCSENT | MODEM_SYNCSENT Signal. |
prsSignalMODEM_PRESENT | MODEM_PRESENT Signal. |
prsSignalMODEM_ANT0 | MODEM_ANT0 Signal. |
prsSignalMODEM_ANT1 | MODEM_ANT1 Signal. |
prsSignalMODEM_FRAMESENT | MODEM_FRAMESENT Signal. |
prsSignalMODEM_PREDET | MODEM_PREDET Signal. |
prsSignalPROTIMER_LBTR | PROTIMER_LBTR Signal. |
prsSignalPROTIMER_LBTF | PROTIMER_LBTF Signal. |
prsSignalPROTIMER_LBTS | PROTIMER_LBTS Signal. |
prsSignalRAC_ACTIVE | RAC_ACTIVE Signal. |
prsSignalRAC_LNAEN | RAC_LNAEN Signal. |
prsSignalRAC_PAEN | RAC_PAEN Signal. |
prsSignalRAC_RX | RAC_RX Signal. |
prsSignalRAC_TX | RAC_TX Signal. |
138
of file platform/emlib/inc/em_prs.h
Function Documentation#
PRS_LevelSet#
void PRS_LevelSet (uint32_t level, uint32_t mask)
Set level control bit for one or more channels.
[in] | level | Level to use for channels indicated by |
[in] | mask | Mask indicating which channels to set level for. Use logical OR combination of PRS_SWLEVEL_CHnLEVEL defines. |
The level value for a channel is XORed with both the pulse possibly issued by PRS_PulseTrigger() and the PRS input signal selected for the channel(s).
1016
of file platform/emlib/inc/em_prs.h
PRS_LevelGet#
uint32_t PRS_LevelGet (void )
Get level control bit for all channels.
N/A |
Returns
The current software level configuration.
1032
of file platform/emlib/inc/em_prs.h
PRS_Values#
uint32_t PRS_Values (PRS_ChType_t type)
Get the PRS channel values for all channels.
[in] | type | PRS channel type. This can be either prsTypeAsync or prsTypeSync. |
Returns
The current PRS channel output values for all channels as a bitset.
1053
of file platform/emlib/inc/em_prs.h
PRS_ChannelValue#
bool PRS_ChannelValue (unsigned int ch, PRS_ChType_t type)
Get the PRS channel value for a single channel.
[in] | ch | PRS channel number. |
[in] | type | PRS channel type. This can be either prsTypeAsync or prsTypeSync. |
Returns
The current PRS channel output value. This is either 0 or 1.
1081
of file platform/emlib/inc/em_prs.h
PRS_PulseTrigger#
void PRS_PulseTrigger (uint32_t channels)
Trigger a high pulse (one HFPERCLK) for one or more channels.
[in] | channels | Logical ORed combination of channels to trigger a pulse for. Use PRS_SWPULSE_CHnPULSE defines. |
Setting a bit for a channel causes the bit in the register to remain high for one HFPERCLK cycle. Pulse is XORed with both the corresponding bit in PRS SWLEVEL register and the PRS input signal selected for the channel(s).
1101
of file platform/emlib/inc/em_prs.h
PRS_ChannelLevelSet#
void PRS_ChannelLevelSet (unsigned int ch, bool level)
Set the PRS channel level for one asynchronous PRS channel.
[in] | ch | PRS channel number. |
[in] | level | true to set the level high (1) and false to set the level low (0). |
1120
of file platform/emlib/inc/em_prs.h
PRS_ChannelPulse#
void PRS_ChannelPulse (unsigned int ch)
Trigger a pulse on one PRS channel.
[in] | ch | PRS channel number. |
1132
of file platform/emlib/inc/em_prs.h
PRS_SourceSignalSet#
void PRS_SourceSignalSet (unsigned int ch, uint32_t source, uint32_t signal, PRS_Edge_TypeDef edge)
Set a source and signal for a channel.
[in] | ch | A channel to define the signal and source for. |
[in] | source | A source to select for the channel. Use one of PRS_CH_CTRL_SOURCESEL_x defines. |
[in] | signal | A signal (for selected |
[in] | edge | An edge (for selected source/signal) to generate the pulse for. |
323
of file platform/emlib/src/em_prs.c
PRS_SourceAsyncSignalSet#
void PRS_SourceAsyncSignalSet (unsigned int ch, uint32_t source, uint32_t signal)
Set the source and asynchronous signal for a channel.
[in] | ch | A channel to define the source and asynchronous signal for. |
[in] | source | A source to select for the channel. Use one of PRS_CH_CTRL_SOURCESEL_x defines. |
[in] | signal | An asynchronous signal (for selected |
Asynchronous reflexes are not clocked on HFPERCLK and can be used even in EM2/EM3. There is a limitation to reflexes operating in asynchronous mode in that they can only be used by a subset of the reflex consumers. See the PRS chapter in the reference manual for the complete list of supported asynchronous signals and consumers.
Note
This function is not supported on EFM32GxxxFyyy parts. In asynchronous mode, the edge detector only works in EM0 and should not be used. The EDSEL parameter in PRS_CHx_CTRL register is set to 0 (OFF) by default.
370
of file platform/emlib/src/em_prs.c
PRS_GpioOutputLocation#
void PRS_GpioOutputLocation (unsigned int ch, unsigned int location)
Send the output of a PRS channel to a GPIO pin.
[in] | ch | PRS channel number. |
[in] | location | PRS routing location. |
This function is used to send the output of a PRS channel to a GPIO pin. Note that there are certain restrictions to where a PRS channel can be routed. Consult the datasheet of the device to see if a channel can be routed to the requested GPIO pin.
395
of file platform/emlib/src/em_prs.c
PRS_GetFreeChannel#
int PRS_GetFreeChannel (PRS_ChType_t type)
Search for the first free PRS channel.
[in] | type | PRS channel type. This can be either prsTypeAsync or prsTypeSync. |
Returns
Channel number >= 0 if an unused PRS channel was found. If no free PRS channel was found then -1 is returned.
428
of file platform/emlib/src/em_prs.c
PRS_Reset#
void PRS_Reset (void )
Reset all PRS channels.
N/A |
This function will reset all the PRS channel configuration.
457
of file platform/emlib/src/em_prs.c
PRS_ConnectSignal#
void PRS_ConnectSignal (unsigned int ch, PRS_ChType_t type, PRS_Signal_t signal)
Connect a PRS signal to a channel.
[in] | ch | PRS channel number. |
[in] | type | PRS channel type. This can be either prsTypeAsync or prsTypeSync. |
[in] | signal | This is the PRS signal that should be placed on the channel. |
This function will make the PRS signal available on the specific channel. Only a single PRS signal can be connected to any given channel.
495
of file platform/emlib/src/em_prs.c
Macro Definition Documentation#
PRS_SYNC_CHAN_COUNT#
#define PRS_SYNC_CHAN_COUNTValue:
PRS_CHAN_COUNT
PRS Synchronous channel count.
67
of file platform/emlib/inc/em_prs.h
PRS_ASYNC_CHAN_COUNT#
#define PRS_ASYNC_CHAN_COUNTValue:
PRS_CHAN_COUNT
PRS Asynchronous channel count.
69
of file platform/emlib/inc/em_prs.h
PRS_ASYNC_SUPPORTED#
#define PRS_ASYNC_SUPPORTEDValue:
1
PRS asynchronous support.
74
of file platform/emlib/inc/em_prs.h