EFM32 Gecko Software Documentation  efm32g-doc-4.2.1
em_prs.c
Go to the documentation of this file.
1 /***************************************************************************/
33 #include "em_prs.h"
34 #if defined(PRS_COUNT) && (PRS_COUNT > 0)
35 
36 #include "em_assert.h"
37 
38 /***************************************************************************/
43 /***************************************************************************/
49 /*******************************************************************************
50  ************************** GLOBAL FUNCTIONS *******************************
51  ******************************************************************************/
52 
53 /***************************************************************************/
70 void PRS_SourceSignalSet(unsigned int ch,
71  uint32_t source,
72  uint32_t signal,
73  PRS_Edge_TypeDef edge)
74 {
75  EFM_ASSERT(ch < PRS_CHAN_COUNT);
76 
77  PRS->CH[ch].CTRL = (source & _PRS_CH_CTRL_SOURCESEL_MASK)
78  | (signal & _PRS_CH_CTRL_SIGSEL_MASK)
79  | (uint32_t)edge;
80 }
81 
82 #if defined( PRS_CH_CTRL_ASYNC )
83 /***************************************************************************/
111 void PRS_SourceAsyncSignalSet(unsigned int ch,
112  uint32_t source,
113  uint32_t signal)
114 {
115  EFM_ASSERT(ch < PRS_CHAN_COUNT);
116 
117  PRS->CH[ch].CTRL = PRS_CH_CTRL_ASYNC
118  | (source & _PRS_CH_CTRL_SOURCESEL_MASK)
119  | (signal & _PRS_CH_CTRL_SIGSEL_MASK)
121 }
122 #endif
123 
126 #endif /* defined(PRS_COUNT) && (PRS_COUNT > 0) */
#define _PRS_CH_CTRL_SOURCESEL_MASK
Definition: efm32g_prs.h:250
#define _PRS_CH_CTRL_SIGSEL_MASK
Definition: efm32g_prs.h:148
Emlib peripheral API "assert" implementation.
#define PRS
#define PRS_CH_CTRL_EDSEL_OFF
Definition: efm32g_prs.h:291
#define PRS_CHAN_COUNT
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.
Definition: em_prs.c:70
PRS_Edge_TypeDef
Definition: em_prs.h:58
Peripheral Reflex System (PRS) peripheral API.