1 /* 2 * File : board.h 3 * This file is part of RT-Thread RTOS 4 * COPYRIGHT (C) 2006, RT-Thread Develop Team 5 * 6 * The license and distribution terms for this file may be 7 * found in the file LICENSE in this distribution or at 8 * http://openlab.rt-thread.com/license/LICENSE 9 * 10 * Change Logs: 11 * Date Author Notes 12 * 2008-12-11 xuxinming first version 13 */ 14 15 #ifndef __BOARD_H__ 16 #define __BOARD_H__ 17 18 /* RT_USING_UART */ 19 #define RT_USING_UART1 20 #define RT_USING_UART2 21 #define RT_UART_RX_BUFFER_SIZE 64 22 void rt_hw_board_init(void); 23 void rt_hw_led_set(int led); 24 void rt_hw_led_flash(void); 25 26 #ifdef RT_USING_FINSH 27 void rt_hw_finsh_init(void); 28 #endif 29 30 #define USE_USB 0 31 32 #if USE_USB /* 1 is USB, 0 is non-USB related */ 33 #define PLL_MValue 11 34 #define PLL_NValue 0 35 #define CCLKDivValue 4 36 #define USBCLKDivValue 5 37 38 #define Fosc 12000000 39 #define Fcclk 57600000 40 #define Fcco 288000000 41 #else 42 43 #define PLL_MValue 12 44 #define PLL_NValue 1 45 #define CCLKDivValue 5 46 47 #define Fosc 12000000 48 #define Fcclk 72000000 49 #define Fcco 360000000 50 51 #endif 52 53 #if USE_USB 54 #define Fpclk (Fcclk / 2) 55 #else 56 #define Fpclk (Fcclk / 4) 57 #endif 58 59 /* IRQ define */ 60 #define SYS32Mode 0x1F 61 #define IRQ32Mode 0x12 62 #define FIQ32Mode 0x11 63 64 #define HIGHEST_PRIORITY 0x01 65 #define LOWEST_PRIORITY 0x0F 66 67 #define WDT_INT 0 68 #define SWI_INT 1 69 #define ARM_CORE0_INT 2 70 #define ARM_CORE1_INT 3 71 #define TIMER0_INT 4 72 #define TIMER1_INT 5 73 #define UART0_INT 6 74 #define UART1_INT 7 75 #define PWM0_1_INT 8 76 #define I2C0_INT 9 77 #define SPI0_INT 10 /* SPI and SSP0 share VIC slot */ 78 #define SSP0_INT 10 79 #define SSP1_INT 11 80 #define PLL_INT 12 81 #define RTC_INT 13 82 #define EINT0_INT 14 83 #define EINT1_INT 15 84 #define EINT2_INT 16 85 #define EINT3_INT 17 86 #define ADC0_INT 18 87 #define I2C1_INT 19 88 #define BOD_INT 20 89 #define EMAC_INT 21 90 #define USB_INT 22 91 #define CAN_INT 23 92 #define MCI_INT 24 93 #define GPDMA_INT 25 94 #define TIMER2_INT 26 95 #define TIMER3_INT 27 96 #define UART2_INT 28 97 #define UART3_INT 29 98 #define I2C2_INT 30 99 #define I2S_INT 31 100 101 #define VIC_SIZE 32 102 103 #define VECT_ADDR_INDEX 0x100 104 #define VECT_CNTL_INDEX 0x200 105 106 #define CCLK 60000000 /* Fosc = 12MHz, M = 5 */ 107 #define PCLK 15000000 /* CCLK/4, use default */ 108 109 /****************************************************************************** 110 ** Function name: TargetInit 111 ** 112 ** Descriptions: Initialize the target board; it is called in a 113 ** necessary place, change it as needed 114 ** 115 ** parameters: None 116 ** Returned value: None 117 ** 118 ******************************************************************************/ 119 extern void TargetInit(void); 120 extern void ConfigurePLL( void ); 121 extern void TargetResetInit(void); 122 123 #endif 124