em_dbg.c
Go to the documentation of this file.00001
00034 #include "em_dbg.h"
00035
00036 #if defined ( CoreDebug_DHCSR_C_DEBUGEN_Msk )
00037
00038 #include "em_assert.h"
00039 #include "em_cmu.h"
00040 #include "em_gpio.h"
00041
00042
00047
00053
00054
00055
00056
00057
00088 void DBG_SWOEnable(unsigned int location)
00089 {
00090 int port;
00091 int pin;
00092
00093 EFM_ASSERT(location < AFCHANLOC_MAX);
00094
00095 port = AF_DBG_SWO_PORT(location);
00096 pin = AF_DBG_SWO_PIN(location);
00097
00098
00099 if ((pin < 0) || (port < 0))
00100 {
00101 EFM_ASSERT(0);
00102 return;
00103 }
00104
00105
00106 CMU_OscillatorEnable(cmuOsc_AUXHFRCO, true, false);
00107
00108
00109 GPIO_DbgLocationSet(location);
00110 GPIO_DbgSWOEnable(true);
00111
00112
00113 GPIO_PinModeSet((GPIO_Port_TypeDef)port, pin, gpioModePushPull, 0);
00114 }
00115
00118 #endif