app_specific/arch/cortex-m3/gcc/include/debug_user.h File Reference

Debug configuration. More...

Defines

#define DEBUG_PORTa   GPIOA
 1st port used for events signalling on output microcontroller pins
#define DEBUG_PORTb   GPIOB
 2nd port used for events signalling on output microcontroller pins
#define DEBUG_PORTc   GPIOC
 3rd port used for events signalling on output microcontroller pins
#define DEBUG_PORTd   GPIOD
 4th port used for events signalling on output microcontroller pins
#define D_RLED1_PORT   DEBUG_PORTc
 D_RLED1 port.
#define D_RLED1_PIN   11
 D_RLED1 pin.
#define D_RLED2_PORT   DEBUG_PORTc
 D_RLED2 port.
#define D_RLED2_PIN   10
 D_RLED2 pin.
#define D_GLED2_PORT   DEBUG_PORTc
 D_GLED1 port.
#define D_GLED2_PIN   12
 D_GLED1 pin.
#define D_GLED1_PORT   DEBUG_PORTd
 D_GLED1 port.
#define D_GLED1_PIN   2
 D_GLED1 pin.
#define D_USART3_RX_PORT   DEBUG_PORTb
 D_USART3_RX port.
#define D_USART3_RX_PIN   11
 D_USART3_RX pin.
#define D_USART3_TX_PORT   DEBUG_PORTb
 D_USART3_TX port.
#define D_USART3_TX_PIN   10
 D_USART3_TX pin.

Functions

static void debug_pin_init (void)
 Initialization of pins as outputs.

Detailed Description

Debug configuration.

Author:
Piotr Romaniuk, (c) ELESOFTROM
Version:
1.1 Nov 8, 2013

Example of debug pins definition and initialization. For more information refer to debug.h.


Function Documentation

static void debug_pin_init ( void  ) [inline, static]

Initialization of pins as outputs.

Provide custom initialization of pin outputs (enable clock to port module and configure its mode).

{
    GPIO_InitTypeDef    gpio_in;

/* Enable the SYSCFG module clock */
//    RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
/* Enable GPIO clock */
    RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOC|RCC_AHBPeriph_GPIOB|RCC_AHBPeriph_GPIOD, ENABLE);
        
    gpio_in.GPIO_Speed  = GPIO_Speed_10MHz;
    gpio_in.GPIO_OType  = GPIO_OType_PP;
    gpio_in.GPIO_Mode   = GPIO_Mode_OUT;    
    gpio_in.GPIO_Pin    = (1<<D_USART3_RX_PIN)|(1<<D_USART3_TX_PIN);
    GPIO_Init(DEBUG_PORTb, &gpio_in);
         
    gpio_in.GPIO_Mode   = GPIO_Mode_OUT;    

    gpio_in.GPIO_Pin    = (1<<D_GLED1_PIN);
    GPIO_Init(DEBUG_PORTd, &gpio_in);
    
    gpio_in.GPIO_Pin    = (1<<D_GLED2_PIN)|(1<<D_RLED1_PIN)|(1<<D_RLED2_PIN);
    GPIO_Init(DEBUG_PORTc, &gpio_in);

}