EFR32 Blue Gecko 1 Software Documentation  efr32bg1-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_CH_CTRL_EDSEL_OFF
Emlib peripheral API "assert" implementation.
#define PRS
#define _PRS_CH_CTRL_SOURCESEL_MASK
#define _PRS_CH_CTRL_SIGSEL_MASK
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
#define PRS_CHAN_COUNT
#define PRS_CH_CTRL_ASYNC
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.