em_prs.c
Go to the documentation of this file.00001
00034 #include "em_prs.h"
00035 #if defined(PRS_COUNT) && (PRS_COUNT > 0)
00036
00037 #include "em_assert.h"
00038 #include "em_bitband.h"
00039
00040
00045
00051
00052
00053
00054
00055
00072 void PRS_SourceSignalSet(unsigned int ch,
00073 uint32_t source,
00074 uint32_t signal,
00075 PRS_Edge_TypeDef edge)
00076 {
00077 EFM_ASSERT(ch < PRS_CHAN_COUNT);
00078
00079 PRS->CH[ch].CTRL = (source & _PRS_CH_CTRL_SOURCESEL_MASK) |
00080 (signal & _PRS_CH_CTRL_SIGSEL_MASK) |
00081 (uint32_t)edge;
00082 }
00083
00084 #if defined( PRS_CH_CTRL_ASYNC )
00085
00118 void PRS_SourceAsyncSignalSet(unsigned int ch,
00119 uint32_t source,
00120 uint32_t signal)
00121 {
00122 EFM_ASSERT(ch < PRS_CHAN_COUNT);
00123
00124 PRS->CH[ch].CTRL = PRS_CH_CTRL_ASYNC |
00125 (source & _PRS_CH_CTRL_SOURCESEL_MASK) |
00126 (signal & _PRS_CH_CTRL_SIGSEL_MASK) |
00127 PRS_CH_CTRL_EDSEL_OFF;
00128 }
00129 #endif
00130
00133 #endif