adding keil mcb4300 support

- implement board_leds & board_uart routines
This commit is contained in:
hathach
2013-05-06 15:06:08 +07:00
parent 120db28a17
commit 4fa7f77ee2
8 changed files with 1360 additions and 35 deletions
@@ -40,15 +40,16 @@
#if BOARD == BOARD_EA4357
#include "common/assertion.h" // TODO there is hal_debugger_ in assertion
#define UART_PORT LPC_USART0
#define BOARD_UART_PORT LPC_USART0
#define BOARD_UART_PIN_PORT 0x0f
#define BOARD_UART_PIN_TX 10 // PF.10 : UART0_TXD
#define BOARD_UART_PIN_RX 11 // PF.11 : UART0_RXD
void board_init(void)
{
SystemInit();
CGU_Init();
SysTick_Config(CGU_GetPCLKFrequency(CGU_PERIPHERAL_M4CORE) / CFG_TICKS_PER_SECOND); // 1 msec tick timer
// USB0 Power: EA4357 channel B U20 GPIO26 active low (base board), P2_3 on LPC4357
@@ -68,16 +69,16 @@ void board_init(void)
#if CFG_UART_ENABLE
//------------- UART init -------------//
scu_pinmux(0xF ,10 , MD_PDN, FUNC1); // PF.10 : UART0_TXD
scu_pinmux(0xF ,11 , MD_PLN|MD_EZI|MD_ZI, FUNC1); // PF.11 : UART0_RXD
scu_pinmux(BOARD_UART_PIN_PORT, BOARD_UART_PIN_TX, MD_PDN , FUNC1);
scu_pinmux(BOARD_UART_PIN_PORT, BOARD_UART_PIN_RX, MD_PLN|MD_EZI|MD_ZI, FUNC1);
UART_CFG_Type UARTConfigStruct;
UART_ConfigStructInit(&UARTConfigStruct);
UARTConfigStruct.Baud_rate = CFG_UART_BAUDRATE;
UARTConfigStruct.Clock_Speed = 0;
UART_Init(UART_PORT, &UARTConfigStruct);
UART_TxCmd(UART_PORT, ENABLE); // Enable UART Transmit
UART_Init(BOARD_UART_PORT, &UARTConfigStruct);
UART_TxCmd(BOARD_UART_PORT, ENABLE); // Enable UART Transmit
#endif
#if CFG_PRINTF_TARGET == PRINTF_TARGET_SWO
@@ -98,12 +99,12 @@ void board_leds(uint32_t on_mask, uint32_t off_mask)
#if CFG_UART_ENABLE
uint32_t board_uart_send(uint8_t *buffer, uint32_t length)
{
return UART_Send(UART_PORT, buffer, length, BLOCKING);
return UART_Send(BOARD_UART_PORT, buffer, length, BLOCKING);
}
uint32_t board_uart_recv(uint8_t *buffer, uint32_t length)
{
return UART_Receive(UART_PORT, buffer, length, BLOCKING);
return UART_Receive(BOARD_UART_PORT, buffer, length, BLOCKING);
}
#endif
@@ -65,10 +65,6 @@
#include "oem_base_board/pca9532.h" // LEDs
#define CFG_LED_NUMBER 0
#define CFG_LED_ON (1)
#define CFG_LED_OFF (0)
#define CFG_PRINTF_TARGET PRINTF_TARGET_UART
#ifdef __cplusplus