PRS
[EM_Library]

Peripheral Reflex System (PRS) Peripheral API. More...

Collaboration diagram for PRS:

Enumerations

enum  PRS_Edge_TypeDef {
  prsEdgeOff = PRS_CH_CTRL_EDSEL_OFF,
  prsEdgePos = PRS_CH_CTRL_EDSEL_POSEDGE,
  prsEdgeNeg = PRS_CH_CTRL_EDSEL_NEGEDGE,
  prsEdgeBoth = PRS_CH_CTRL_EDSEL_BOTHEDGES
}

Functions

__STATIC_INLINE void PRS_LevelSet (uint32_t level, uint32_t mask)
 Set level control bit for one or more channels.
__STATIC_INLINE void PRS_PulseTrigger (uint32_t channels)
 Trigger a high pulse (one HFPERCLK) for one or more channels.
void PRS_SourceSignalSet (unsigned int ch, uint32_t source, uint32_t signal, PRS_Edge_TypeDef edge)
 Set source and signal to be used for a channel.
void PRS_SourceAsyncSignalSet (unsigned int ch, uint32_t source, uint32_t signal)
 Set source and asynchronous signal to be used for a channel.

Detailed Description

Peripheral Reflex System (PRS) Peripheral API.


Enumeration Type Documentation

Edge detection type.

Enumerator:
prsEdgeOff 

Leave signal as is.

prsEdgePos 

Generate pules on positive edge.

prsEdgeNeg 

Generate pules on negative edge.

prsEdgeBoth 

Generate pules on both edges.

Definition at line 59 of file em_prs.h.


Function Documentation

__STATIC_INLINE void PRS_LevelSet ( uint32_t  level,
uint32_t  mask 
)

Set level control bit for one or more channels.

The level value for a channel is XORed with both the pulse possible issued by PRS_PulseTrigger() and the PRS input signal selected for the channel(s).

Parameters:
[in] level Level to use for channels indicated by mask. Use logical OR combination of PRS_SWLEVEL_CHnLEVEL defines for channels to set high level, otherwise 0.
[in] mask Mask indicating which channels to set level for. Use logical OR combination of PRS_SWLEVEL_CHnLEVEL defines.

Definition at line 87 of file em_prs.h.

__STATIC_INLINE void PRS_PulseTrigger ( uint32_t  channels  ) 

Trigger a high pulse (one HFPERCLK) for one or more channels.

Setting a bit for a channel causes the bit in the register to remain high for one HFPERCLK cycle. The pulse is XORed with both the corresponding bit in PRS SWLEVEL register and the PRS input signal selected for the channel(s).

Parameters:
[in] channels Logical ORed combination of channels to trigger a pulse for. Use PRS_SWPULSE_CHnPULSE defines.

Definition at line 107 of file em_prs.h.

void PRS_SourceAsyncSignalSet ( unsigned int  ch,
uint32_t  source,
uint32_t  signal 
)

Set source and asynchronous signal to be used for a channel.

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: they can only be used by a subset of the reflex consumers. Please refer to PRS chapter in the reference manual for the complete list of supported asynchronous signals and consumers.

Note:
This function is supported on the following device families:
  • Giant Gecko (EFM32GGxxxFxxx)
  • Leopard Gecko (EFM32LGxxxFxxx)
  • Tiny Gecko (EFM32TGxxxFxxx)
  • Wonder Gecko (EFM32WGxxxFxxx)
  • Zero Gecko (EFM32ZGxxxFxxx) In asynchronous mode, the edge detector only works in EM0, hence it shall not be used. The EDSEL parameter in PRS_CHx_CTRL register is set to 0 (OFF) by default.
Parameters:
[in] ch Channel to define source and asynchronous signal for.
[in] source Source to select for channel. Use one of PRS_CH_CTRL_SOURCESEL_x defines.
[in] signal Asynchronous signal (for selected source) to use. Use one of the PRS_CH_CTRL_SIGSEL_x defines that support asynchronous operation.

Definition at line 118 of file em_prs.c.

void PRS_SourceSignalSet ( unsigned int  ch,
uint32_t  source,
uint32_t  signal,
PRS_Edge_TypeDef  edge 
)

Set source and signal to be used for a channel.

Parameters:
[in] ch Channel to define signal and source for.
[in] source Source to select for channel. Use one of PRS_CH_CTRL_SOURCESEL_x defines.
[in] signal Signal (for selected source) to use. Use one of PRS_CH_CTRL_SIGSEL_x defines.
[in] edge Edge (for selected source/signal) to generate pulse for.

Definition at line 72 of file em_prs.c.