hal_gpio.h
来自「最新版IAR FOR ARM(EWARM)5.11中的代码例子」· C头文件 代码 · 共 51 行
H
51 行
//-----------------------------------------------------------------------------
// HAL_GPIO
//-----------------------------------------------------------------------------
#ifndef HAL_GPIO_H
#define HAL_GPIO_H
//-----------------------------------------------------------------------------
#include "hal_map.h"
//-----------------------------------------------------------------------------
//GPIO_Init
//-----------------------------------------------------------------------------
#define GPIO_D0_AS_OUT 0x00
#define GPIO_D1_AS_OUT 0x00
#define GPIO_D2_AS_OUT 0x00
#define GPIO_D3_AS_OUT 0x00
#define GPIO_D4_AS_OUT 0x00
#define GPIO_D5_AS_OUT 0x00
#define GPIO_ALL_AS_OUTs 0x00
#define GPIO_D0_AS_IN 0x01
#define GPIO_D1_AS_IN 0x02
#define GPIO_D2_AS_IN 0x04
#define GPIO_D3_AS_IN 0x08
#define GPIO_D4_AS_IN 0x10
#define GPIO_D5_AS_IN 0x20
#define GPIO_ALL_AS_INs 0x3F
//-----------------------------------------------------------------------------
//LEDs & LEDs_Toggle
//-----------------------------------------------------------------------------
#define LED0 0x01
#define LED1 0x02
#define LED2 0x04
#define LED3 0x08
#define LED4 0x10
#define LED5 0x20
#define ALL_LEDs 0x3F
//-----------------------------------------------------------------------------
#define LED0_Toggle() {LEDs_Toggle (LED0);}
#define LED1_Toggle() {LEDs_Toggle (LED1);}
//-----------------------------------------------------------------------------
void GPIO_Init (u8 dir);
void LEDs (u8 value);
void LEDs_Toggle (u8 mask);
//-----------------------------------------------------------------------------
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?