📄 bsp.h
字号:
/*********************************************************************
*
* IAR PowerPac - RTOS
*
* (c) Copyright IAR Systems 2006. All rights reserved.
*
**********************************************************************
----------------------------------------------------------------------
File : BSP.h
Purpose : BSP (Board support package)
-------- END-OF-HEADER ---------------------------------------------
*/
#ifndef BSP_H /* avoid multiple inclusion */
#define BSP_H
#define BOARD_REV 1 // must be 1 or 2 (rev 2 have a withe mask near battery holder)
/****** Enhanced interrupt controller interrupt sources *************/
#define WAKEUP_VECT_ID 0 // IRQ0 External WKP_STDBY pin
#define T2_OC2_VECT_ID 1 // IRQ1 TIM2 Timer Output Compare 2
#define T2_OC1_VECT_ID 2 // IRQ2 TIM2 Timer Output Compare 1
#define T2_IC_VECT_ID 3 // IRQ3 TIM2 Timer Input Capture 1 & 2
#define T2_U_VECT_ID 4 // IRQ4 TIM2 Timer Update
#define T1_OC2_VECT_ID 5 // IRQ5 TIM1 Timer Output Compare 2
#define T1_OC1_VECT_ID 6 // IRQ6 TIM1 Timer Output Compare 1
#define T1_IC_VECT_ID 7 // IRQ7 TIM1 Timer Input Capture 1 & 2
#define T1_U_VECT_ID 8 // IRQ8 TIM1 Timer Update
#define T0_OC2_VECT_ID 9 // IRQ9 TIM0 Timer Output Compare 2
#define T0_OC1_VECT_ID 10 // IRQ10 TIM0 Timer Output Compare 1
#define T0_IC_VECT_ID 11 // IRQ11 TIM0 Timer Input Capture 1 & 2
#define T0_U_VECT_ID 12 // IRQ12 TIM0 Timer Update
#define PWM_OC_VECT_ID 13 // IRQ13 PWM Timer Output Compare 1, 2 & 3
#define PWM_E_VECT_ID 14 // IRQ14 PWM Timer Emergency
#define PWM_U_VECT_ID 15 // IRQ15 PWM Timer Update
#define I2C_VECT_ID 16 // IRQ16 I2C Global interrupt
#define SPI1_VECT_ID 17 // IRQ17 SSP1 Interrupt
#define SPI0_VECT_ID 18 // IRQ18 SSP0 Interrupt
#define UART2_VECT_ID 19 // IRQ19 UART2 Global interrupt
#define UART1_VECT_ID 20 // IRQ20 UART1 Global interrupt
#define UART0_VECT_ID 21 // IRQ21 UART0 Global interrupt
#define CAN_VECT_ID 22 // IRQ22 CAN Global interrupt
#define USB_LP_VECT_ID 23 // IRQ23 USB Low Priority Event Interrupt
#define USB_HP_VECT_ID 24 // IRQ24 USB High Priority Event Interrupt
#define ADC_VECT_ID 25 // IRQ25 ADC Global interrupt
#define DMA_VECT_ID 26 // IRQ26 DMA Global Interrupt
#define EXTIT_VECT_ID 27 // IRQ27 External Interrupt lines INT14 to INT1
#define MRCC_VECT_ID 28 // IRQ28 MRCC Clock Controller Global interrupt
#define FLASH_VECT_ID 29 // IRQ29 Flash Global interrupt
#define RTC_VECT_ID 30 // IRQ30 RTC Global interrupt
#define TB_VECT_ID 31 // IRQ31 TB Timer Global Interrupt
/****** LEDs ********************************************/
#define _LEDS_NUMB 16
/****** LED intensity control ***************************/
#define _LED_INTENSITY_CTRL
#define _LED_INTENSITY_MIN 0x00
#define _LED_INTENSITY_MAX 0xFF
#define _LED_INTENSITY_DEFAULT 0xFF
/****** LEDs IDs ****************************************/
#define _LED1_ID (1UL << 0)
#define _LED2_ID (1UL << 1)
#define _LED3_ID (1UL << 2)
#define _LED4_ID (1UL << 3)
#define _LED5_ID (1UL << 4)
#define _LED6_ID (1UL << 5)
#define _LED7_ID (1UL << 6)
#define _LED8_ID (1UL << 7)
#define _LED9_ID (1UL << 8)
#define _LED10_ID (1UL << 9)
#define _LED11_ID (1UL << 10)
#define _LED12_ID (1UL << 11)
#define _LED13_ID (1UL << 12)
#define _LED14_ID (1UL << 13)
#define _LED15_ID (1UL << 14)
#define _LED16_ID (1UL << 15)
#define _LED_ALL_ID (0x0000FFFF)
/****** Buttons ****************************************/
#define _CAP_BUTTONS_NUMB 2
/****** Buttons IDs ****************************************/
#define _BUT1_ID (0)
#define _BUT2_ID (1)
typedef enum _ButtonError_t
{
BUTT_OK = 0, BUTT_TO_ERROR, BUTT_SHORT_ERROR
} ButtonError_t;
/*********************************************************************
*
* Functions
*
**********************************************************************/
void BSP_Init(void);
void BSP_IntensityLED(unsigned int Intensity);
void BSP_SetLED(unsigned int Mask);
void BSP_ClrLED(unsigned int Mask);
void BSP_ToggleLED(unsigned int Mask);
ButtonError_t BSP_GetButton(unsigned int Id, unsigned int * pCount);
/********************************************************************/
#endif /* avoid multiple inclusion */
/****** EOF *********************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -