/***************************************************************************** * * File Name: SKP16C62P Board Support Package * skp_bsp.h * * Content: This header file contains useful macros for use with the * RTA SKP's. *===========================================================================*/ #include "sfr62p.h" // M16C/62P special function register definitions #include "skp_lcd.h" // SKP LCD function definitions /* Xin Freq */ #define XIN_FREQ 12e6 // 12MHz /* Switches */ #define S1 p8_3 #define S2 p8_2 #define S3 p8_1 #define S1_DDR pd8_3 #define S2_DDR pd8_2 #define S3_DDR pd8_1 /* LEDs */ #define RED_LED p8_0 #define YLW_LED p7_4 #define GRN_LED p7_2 #define RED_DDR pd8_0 // LED port direction register #define YLW_DDR pd7_4 #define GRN_DDR pd7_2 /********************************************************************************/ /* Macro Definitions */ /********************************************************************************/ #define LED_ON 0 #define LED_OFF 1 #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif #define ENABLE_IRQ {_asm(" FSET I");} #define DISABLE_IRQ {_asm(" FCLR I");} // Use these macros for switch inputs. #define ENABLE_SWITCHES {S1_DDR = 0; S2_DDR = 0; S3_DDR = 0;} // Use these macros to control the LEDs. #define LED(led, state) ((led) = !state) #define ENABLE_LEDS {RED_LED = LED_OFF; YLW_LED = LED_OFF; GRN_LED = LED_OFF; RED_DDR = 1; YLW_DDR = 1; GRN_DDR = 1; }