单片机成长之路(51基础篇) - 030 bsp.h

亚博智能mini51板:

 

#ifndef __BSP__H__
#define __BSP__H__

// 数据定义
enum BOOL{false,true};

#define bool enum BOOL;
#define uchar unsigned char 
#define uint unsigned int 
#define ulong unsigned long 

// GOIO 定义
#ifdef bsp

#ifdef bsp_YahBoom_51		// 亚博智能 mini 51 硬件配置
#include <STC89C5xRC.H>

/* --------------------- 通讯部分 --------------------------*/
// 红外发射管
sbit Infrared_emission = P1^5;
// 红外接收管
sbit Infrared_receiver = P3^2;

// uart
sbit uart_TXD = P3^0;
sbit uart_RXD = P3^1;

// wifi
sbit wifi_RST = P1^0;
sbit wifi_SCK = P1^1;
sbit wifi_MIS = P1^2;
sbit wifi_CS  = P1^3;
sbit wifi_MOS = P1^4;
sbit wifi_IRQ = P1^5;
/* --------------------- 显示部分 --------------------------*/
// led灯
sfr	LED_all   = 0x90;
sbit LED_0 = P1^0;
sbit LED_1 = P1^1;
sbit LED_2 = P1^2;
sbit LED_3 = P1^3;
sbit LED_4 = P1^4;
sbit LED_5 = P1^5;
sbit LED_6 = P1^6;
sbit LED_7 = P1^7;

// lcd 数码管
sfr	LED_Digital_all   = 0x80;
sbit LED_Digital_A = P0^0;
sbit LED_Digital_B = P0^1;
sbit LED_Digital_C = P0^2;
sbit LED_Digital_D = P0^3;
sbit LED_Digital_E = P0^4;
sbit LED_Digital_F = P0^5;
sbit LED_Digital_G = P0^6;
sbit LED_Digital_DP = P0^7;

sbit LED_Digital_1 = P2^7;
sbit LED_Digital_2 = P2^6;
sbit LED_Digital_3 = P2^5;
sbit LED_Digital_4 = P2^4;

// 显示模块 -- 1602
sfr LCD_1602_DB  = 0x80;
sbit LCD_1602_DB0 = P0^0;
sbit LCD_1602_DB1 = P0^1;
sbit LCD_1602_DB2 = P0^2;
sbit LCD_1602_DB3 = P0^3;
sbit LCD_1602_DB4 = P0^4;
sbit LCD_1602_DB5 = P0^5;
sbit LCD_1602_DB6 = P0^6;
sbit LCD_1602_DB7 = P0^7;

sbit LCD_1602_RS = P1^0;
sbit LCD_1602_RW = P1^1;
sbit LCD_1602_E  = P2^5;

// 显示模块 -- 12864
sfr LCD_12864_DB  = 0x80;
sbit LCD_12864_DB0 = P0^0;
sbit LCD_12864_DB1 = P0^1;
sbit LCD_12864_DB2 = P0^2;
sbit LCD_12864_DB3 = P0^3;
sbit LCD_12864_DB4 = P0^4;
sbit LCD_12864_DB5 = P0^5;
sbit LCD_12864_DB6 = P0^6;
sbit LCD_12864_DB7 = P0^7;

sbit LCD_12864_RW = P2^5;
sbit LCD_12864_RS = P2^6;
sbit LCD_12864_E  = P2^7;
sbit LCD_12864_PSB = P3^2;
sbit LCD_12864_RES = P3^4;
/* --------------------- 杂项 --------------------------*/
// 温度模块 DS18B20
sbit Temp_DS18B20 = P2^2;

// 蜂鸣器
sbit Active_buzzer = P2^3;

// 独立按键
sbit Alone_button_0	 = P3^4;
sbit Alone_button_1	 = P3^5;
sbit Alone_button_2	 = P3^6;
sbit Alone_button_3	 = P3^7;
#endif		// bsp_YahBoom_51

#endif		// bsp

#endif		// bsp.h

  

 

posted @ 2020-10-12 00:05  极客先锋  阅读(818)  评论(0编辑  收藏  举报