refractor board and start to add support for SWO retarget

This commit is contained in:
hathach
2013-01-17 01:09:58 +07:00
parent 53739ccd28
commit aae51e985f
8 changed files with 192 additions and 46 deletions

View File

@@ -57,31 +57,38 @@
#include <stdint.h>
#define BSP_TICKS_PER_SECOND 1000
#define BSP_UART_ENABLE 1
#define BSP_UART_BAUDRATE 115200
#define BOARD_AT86RF2XX 0
#define BOARD_LPCXPRESSO1347 1
#define BOARD_NGX4330 2
/// n-th Bit
#ifndef BIT_
#define BIT_(n) (1 << (n))
#endif
#define BOARD_AT86RF2XX 0
#define BOARD_LPCXPRESSO1347 1
#define BOARD_NGX4330 2
#define PRINTF_TARGET_DEBUG_CONSOLE 0 // IDE semihosting console
#define PRINTF_TARGET_UART 1
#define PRINTF_TARGET_SWO 2 // aka SWV, ITM
#if BOARD == BOARD_NGX4330
#include "board_ngx4330.h"
#elif BOARD == BOARD_LPCXPRESSO1347
#include "board_lpcxpresso1347.h"
#elif BOARD == BOARD_AT86RF2XX
#include "board_at86rf2xx.h"
#else
#error BOARD is not defined or supported yet
#endif
/// Init board peripherals : Clock, UART, LEDs, Buttons
//--------------------------------------------------------------------+
// Common Configuration
//--------------------------------------------------------------------+
#define CFG_TICKS_PER_SECOND 1000
#if CFG_PRINTF_TARGET == PRINTF_TARGET_UART
#define CFG_UART_ENABLE 1
#define CFG_UART_BAUDRATE 115200
#endif
//--------------------------------------------------------------------+
// Board Common API
//--------------------------------------------------------------------+
// Init board peripherals : Clock, UART, LEDs, Buttons
void board_init(void);
void board_leds(uint32_t mask, uint32_t state);
uint32_t board_uart_send(uint8_t *buffer, uint32_t length);