gpio_init_type gpio_init_struct; /* enable the clock of gpioa, gpiob, iomux */ crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE); crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE); crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE); /* set default parameter */ gpio_default_para_init(&gpio_init_struct); /* configure pa13 (jtms/swdat), pa14 (jtck/swclk) and pa15 (jtdi) as output push-pull */ gpio_init_struct.gpio_pins = GPIO_PINS_13 | GPIO_PINS_14 | GPIO_PINS_15; gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT; gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL; gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER; gpio_init(GPIOA, &gpio_init_struct); /* configure pb3 (jtdo) and pb4 (jtrst) as output push-pull */ gpio_init_struct.gpio_pins = GPIO_PINS_3 | GPIO_PINS_4; gpio_init(GPIOB, &gpio_init_struct); /* disable the serial wire jtag debug port swj-dp */ gpio_pin_remap_config(SWJTAG_MUX_100, TRUE); |