#include "Debug.h" #include "stm32f0xx_gpio.h" void Debug_Init(void) { /* Enable clock for key gpio ports */ RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE); GPIO_InitTypeDef gpioInit; GPIO_StructInit(&gpioInit); /* Init Debug gpios */ gpioInit.GPIO_Mode = GPIO_Mode_OUT; gpioInit.GPIO_OType = GPIO_OType_PP; gpioInit.GPIO_Speed = GPIO_Speed_50MHz; gpioInit.GPIO_PuPd = GPIO_PuPd_NOPULL; gpioInit.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_3 | GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15; GPIO_Init(GPIOB, &gpioInit); } void Debug_Set(debug_t task) { GPIO_WriteBit(GPIOB, task, Bit_SET); } void Debug_Unset(debug_t task) { GPIO_WriteBit(GPIOB, task, Bit_RESET); }