EFM32 Giant Gecko Software Documentation  efm32gg-doc-5.1.2
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 /***************************************************************************/
53 /*******************************************************************************
54  ************************** GLOBAL FUNCTIONS *******************************
55  ******************************************************************************/
56 
57 /***************************************************************************/
74 void PRS_SourceSignalSet(unsigned int ch,
75  uint32_t source,
76  uint32_t signal,
77  PRS_Edge_TypeDef edge)
78 {
79  EFM_ASSERT(ch < PRS_CHAN_COUNT);
80 
81  PRS->CH[ch].CTRL = (source & _PRS_CH_CTRL_SOURCESEL_MASK)
82  | (signal & _PRS_CH_CTRL_SIGSEL_MASK)
83  | (uint32_t)edge;
84 }
85 
86 #if defined( PRS_CH_CTRL_ASYNC )
87 /***************************************************************************/
115 void PRS_SourceAsyncSignalSet(unsigned int ch,
116  uint32_t source,
117  uint32_t signal)
118 {
119  EFM_ASSERT(ch < PRS_CHAN_COUNT);
120 
121  PRS->CH[ch].CTRL = PRS_CH_CTRL_ASYNC
122  | (source & _PRS_CH_CTRL_SOURCESEL_MASK)
123  | (signal & _PRS_CH_CTRL_SIGSEL_MASK)
125 }
126 #endif
127 
130 #endif /* defined(PRS_COUNT) && (PRS_COUNT > 0) */
#define PRS
Emlib peripheral API "assert" implementation.
#define PRS_CHAN_COUNT
#define _PRS_CH_CTRL_SOURCESEL_MASK
Definition: efm32gg_prs.h:386
#define PRS_CH_CTRL_ASYNC
Definition: efm32gg_prs.h:447
#define _PRS_CH_CTRL_SIGSEL_MASK
Definition: efm32gg_prs.h:220
#define PRS_CH_CTRL_EDSEL_OFF
Definition: efm32gg_prs.h:443
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:74
PRS_Edge_TypeDef
Definition: em_prs.h:58
void PRS_SourceAsyncSignalSet(unsigned int ch, uint32_t source, uint32_t signal)
Set source and asynchronous signal to be used for a channel.
Definition: em_prs.c:115
Peripheral Reflex System (PRS) peripheral API.