stm32中1602的头文件 #ifndef __1602_H #define __1602_H #include "sys.h" typedef struct{ u32 weight_value; }smart_balance_para; #define RS GPIO_Pin_11 #define RW GPIO_Pin_2 #define EN GPIO_Pin_10 #define LCD_linght GPIO_Pin_0 #define D0 GPIO_Pin_0 #define D1 GPIO_Pin_1 #define D2 GPIO_Pin_4 #define D3 GPIO_Pin_5 #define D4 GPIO_Pin_6 #define D5 GPIO_Pin_7 #define D6 GPIO_Pin_4 #define D7 GPIO_Pin_5 //#define RS PBout(1) //PB1; //#define RW PBout(2) //PB2; //#define EN PBout(0) //PB0; #define LCD_LED(x) x ? GPIO_SetBits(GPIOA, LCD_linght): GPIO_ResetBits(GPIOA, LCD_linght) #define LCD_RS(x) x ? GPIO_SetBits(GPIOB, RS): GPIO_ResetBits(GPIOB, RS) #define LCD_RW(x) x ? GPIO_SetBits(GPIOB, RW): GPIO_ResetBits(GPIOB, RW) #define LCD_EN(x) x ? GPIO_SetBits(GPIOB, EN): GPIO_ResetBits(GPIOB, EN) #define LCD_D0(x) x ? GPIO_SetBits(GPIOB, D0): GPIO_ResetBits(GPIOB, D0) #define LCD_D1(x) x ? GPIO_SetBits(GPIOB, D1): GPIO_ResetBits(GPIOB, D1) #define LCD_D2(x) x ? GPIO_SetBits(GPIOC, D2): GPIO_ResetBits(GPIOC, D2) #define LCD_D3(x) x ? GPIO_SetBits(GPIOC, D3): GPIO_ResetBits(GPIOC, D3) #define LCD_D4(x) x ? GPIO_SetBits(GPIOA, D4): GPIO_ResetBits(GPIOA, D4) #define LCD_D5(x) x ? GPIO_SetBits(GPIOA, D5): GPIO_ResetBits(GPIOA, D5) #define LCD_D6(x) x ? GPIO_SetBits(GPIOA, D6): GPIO_ResetBits(GPIOA, D6) #define LCD_D7(x) x ? GPIO_SetBits(GPIOA, D7): GPIO_ResetBits(GPIOA, D7) stm32中stm32f10x_gpio.h头文件 /** ****************************************************************************** * @file stm32f10x_gpio.h * @author MCD Application Team * @version V3.5.0 * @date 11-March-2011 * @brief This file contains all the functions prototypes for the GPIO * firmware library. ****************************************************************************** * @attention * * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. * * <h2><center>© COPYRIGHT 2011 STMicroelectronics</center></h2> ****************************************************************************** */ #define GPIO_Pin_0 ((uint16_t)0x0001) /*!< Pin 0 selected */ #define GPIO_Pin_1 ((uint16_t)0x0002) /*!< Pin 1 selected */ #define GPIO_Pin_2 ((uint16_t)0x0004) /*!< Pin 2 selected */ #define GPIO_Pin_3 ((uint16_t)0x0008) /*!< Pin 3 selected */ #define GPIO_Pin_4 ((uint16_t)0x0010) /*!< Pin 4 selected */ #define GPIO_Pin_5 ((uint16_t)0x0020) /*!< Pin 5 selected */ #define GPIO_Pin_6 ((uint16_t)0x0040) /*!< Pin 6 selected */ #define GPIO_Pin_7 ((uint16_t)0x0080) /*!< Pin 7 selected */ #define GPIO_Pin_8 ((uint16_t)0x0100) /*!< Pin 8 selected */ #define GPIO_Pin_9 ((uint16_t)0x0200) /*!< Pin 9 selected */ #define GPIO_Pin_10 ((uint16_t)0x0400) /*!< Pin 10 selected */ #define GPIO_Pin_11 ((uint16_t)0x0800) /*!< Pin 11 selected */ #define GPIO_Pin_12 ((uint16_t)0x1000) /*!< Pin 12 selected */ #define GPIO_Pin_13 ((uint16_t)0x2000) /*!< Pin 13 selected */ #define GPIO_Pin_14 ((uint16_t)0x4000) /*!< Pin 14 selected */ #define GPIO_Pin_15 ((uint16_t)0x8000) /*!< Pin 15 selected */ #define GPIO_Pin_All ((uint16_t)0xFFFF) /*!< All pins selected */ 声明:本站所有内容,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。 收藏 链接