1 /************************************************************************ 2 Filename: hal_board.h 3 4 Copyright 2008 Texas Instruments, Inc. 5 ***************************************************************************/ 6 #ifndef HAL_BOARD_H 7 #define HAL_BOARD_H 8 9 // LED 1 = P1.0 10 #define LED1_DIR P1DIR 11 #define LED1_OUT P1OUT 12 #define LED1_PIN BIT0 13 14 // LED 2 = P1.1 15 #define LED2_DIR P1DIR 16 #define LED2_OUT P1OUT 17 #define LED2_PIN BIT1 18 19 #define CLK_PORT_DIR P11DIR 20 #define CLK_PORT_OUT P11OUT 21 #define CLK_PORT_SEL P11SEL 22 23 #define ACLK_PIN BIT0 24 #define MCLK_PIN BIT1 25 #define SMCLK_PIN BIT2 26 27 #define XT1_XTAL_DIR P7DIR 28 #define XT1_XTAL_SEL P7SEL 29 #define XT1_XTAL_OUT P7OUT 30 31 #define SYSCLK_1MHZ 0 32 #define SYSCLK_4MHZ 1 33 #define SYSCLK_8MHZ 2 34 #define SYSCLK_12MHZ 3 35 #define SYSCLK_16MHZ 4 36 #define SYSCLK_20MHZ 5 37 #define SYSCLK_25MHZ 6 38 39 #define DCO_MULT_1MHZ 30 40 #define DCO_MULT_4MHZ 122 41 #define DCO_MULT_8MHZ 244 42 #define DCO_MULT_12MHZ 366 43 #define DCO_MULT_16MHZ 488 44 #define DCO_MULT_20MHZ 610 45 #define DCO_MULT_25MHZ 763 46 47 #define DCORSEL_1MHZ DCORSEL_2 48 #define DCORSEL_4MHZ DCORSEL_4 49 #define DCORSEL_8MHZ DCORSEL_4 50 #define DCORSEL_12MHZ DCORSEL_5 51 #define DCORSEL_16MHZ DCORSEL_5 52 #define DCORSEL_20MHZ DCORSEL_6 53 #define DCORSEL_25MHZ DCORSEL_7 54 55 // Due to erratum FLASH28 the expected VCORE settings, as follows, 56 // cannot be achieved. The Vcore setting should not be changed. 57 //#define VCORE_1MHZ PMMCOREV_0 58 //#define VCORE_4MHZ PMMCOREV_0 59 //#define VCORE_8MHZ PMMCOREV_0 60 //#define VCORE_12MHZ PMMCOREV_0 61 //#define VCORE_16MHZ PMMCOREV_1 62 //#define VCORE_20MHZ PMMCOREV_2 63 //#define VCORE_25MHZ PMMCOREV_3 64 #define VCORE_1MHZ PMMCOREV_2 65 #define VCORE_4MHZ PMMCOREV_2 66 #define VCORE_8MHZ PMMCOREV_2 67 #define VCORE_12MHZ PMMCOREV_2 68 #define VCORE_16MHZ PMMCOREV_2 69 70 // Due to erratum FLASH28 the expected VCORE settings, as follows, 71 // cannot be achieved. The Vcore setting should not be changed. 72 //#define VCORE_1_35V PMMCOREV_0 73 //#define VCORE_1_55V PMMCOREV_1 74 #define VCORE_1_75V PMMCOREV_2 75 //#define VCORE_1_85V PMMCOREV_3 76 77 /*---------------------------------------------------------------- 78 * Function Prototypes 79 *---------------------------------------------------------------- 80 */ 81 82 void halBoardSetVCore(unsigned char level); 83 void halBoardDisableSVS(void); 84 void halBoardEnableSVS(void); 85 void halBoardStartXT1(void); 86 void halBoardSetSystemClock(unsigned char systemClockSpeed); 87 void halBoardOutputSystemClock(void); 88 void halBoardStopOutputSystemClock(void); 89 void halBoardInit(void); 90 91 #endif 92