MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / DBG_SWOEnable

Function DBG_SWOEnable

bsp/efm32/Libraries/emlib/src/em_dbg.c:84–110  ·  view source on GitHub ↗

/ * @brief * Enable Serial Wire Output (SWO) pin. * * @details * The SWO pin (sometimes denoted SWV, serial wire viewer) allows for * miscellaneous output to be passed from the Cortex-M3 debug trace module to * an external debug probe. By default, the debug trace module and pin output * may be disabled. * * Since the SWO pin is only useful when using a debugger, a suggested us

Source from the content-addressed store, hash-verified

82 * Pin location used for SWO pin on the application in use.
83 ******************************************************************************/
84void DBG_SWOEnable(unsigned int location)
85{
86 int port;
87 int pin;
88
89 EFM_ASSERT(location < AFCHANLOC_MAX);
90
91 port = AF_DBG_SWO_PORT(location);
92 pin = AF_DBG_SWO_PIN(location);
93
94 /* Port/pin location not defined for device? */
95 if ((pin < 0) || (port < 0))
96 {
97 EFM_ASSERT(0);
98 return;
99 }
100
101 /* Ensure auxiliary clock going to the Cortex debug trace module is enabled */
102 CMU_OscillatorEnable(cmuOsc_AUXHFRCO, true, false);
103
104 /* Set selected pin location for SWO pin and enable it */
105 GPIO_DbgLocationSet(location);
106 GPIO_DbgSWOEnable(true);
107
108 /* Configure SWO pin for output */
109 GPIO_PinModeSet((GPIO_Port_TypeDef)port, pin, gpioModePushPull, 0);
110}
111
112/** @} (end addtogroup DBG) */
113/** @} (end addtogroup EM_Library) */

Callers

nothing calls this directly

Calls 4

CMU_OscillatorEnableFunction · 0.85
GPIO_DbgLocationSetFunction · 0.85
GPIO_DbgSWOEnableFunction · 0.85
GPIO_PinModeSetFunction · 0.85

Tested by

no test coverage detected