/* set JTAG mode */
#define JTAG_SWD_DISABLE 0x01
#define SWD_ENABLE 0x02
#define JTAG_SWD_ENABLE 0x04
void JTAG_Set(u8 mode)
{
u32 temp;
temp=mode;
temp<<=25;
RCC->APB2ENR |= 1<<0; //开启辅助时钟
AFIO->MAPR &= 0XF8FFFFFF; //清除MAPR的[26:24]
AFIO->MAPR |= temp; //设置jtag模式
}
阅读(1081) | 评论(0) | 转发(0) |