EFM32 Gecko Software Documentation  efm32g-doc-5.1.2
em_prs.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef EM_PRS_H
34 #define EM_PRS_H
35 
36 #include "em_device.h"
37 #if defined(PRS_COUNT) && (PRS_COUNT > 0)
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 /***************************************************************************/
48 /***************************************************************************/
53 /*******************************************************************************
54  ******************************** ENUMS ************************************
55  ******************************************************************************/
56 
58 typedef enum
59 {
65 
66 /*******************************************************************************
67  ***************************** PROTOTYPES **********************************
68  ******************************************************************************/
69 
70 /***************************************************************************/
86 __STATIC_INLINE void PRS_LevelSet(uint32_t level, uint32_t mask)
87 {
88  PRS->SWLEVEL = (PRS->SWLEVEL & ~mask) | (level & mask);
89 }
90 
91 
92 /***************************************************************************/
106 __STATIC_INLINE void PRS_PulseTrigger(uint32_t channels)
107 {
108  PRS->SWPULSE = channels & _PRS_SWPULSE_MASK;
109 }
110 
111 void PRS_SourceSignalSet(unsigned int ch,
112  uint32_t source,
113  uint32_t signal,
114  PRS_Edge_TypeDef edge);
115 
116 #if defined( PRS_CH_CTRL_ASYNC )
117 void PRS_SourceAsyncSignalSet(unsigned int ch,
118  uint32_t source,
119  uint32_t signal);
120 #endif
121 
125 #ifdef __cplusplus
126 }
127 #endif
128 
129 #endif /* defined(PRS_COUNT) && (PRS_COUNT > 0) */
130 #endif /* EM_PRS_H */
#define PRS
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
#define PRS_CH_CTRL_EDSEL_BOTHEDGES
Definition: efm32g_prs.h:294
#define PRS_CH_CTRL_EDSEL_NEGEDGE
Definition: efm32g_prs.h:293
#define PRS_CH_CTRL_EDSEL_OFF
Definition: efm32g_prs.h:291
__STATIC_INLINE void PRS_LevelSet(uint32_t level, uint32_t mask)
Set level control bit for one or more channels.
Definition: em_prs.h:86
#define _PRS_SWPULSE_MASK
Definition: efm32g_prs.h:58
__STATIC_INLINE void PRS_PulseTrigger(uint32_t channels)
Trigger a high pulse (one HFPERCLK) for one or more channels.
Definition: em_prs.h:106
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
#define PRS_CH_CTRL_EDSEL_POSEDGE
Definition: efm32g_prs.h:292