📄 am12864.h
字号:
#ifndef __AM12864_H__
#define __AM12864_H__
/****************************************************************************************/
//AM12864
/****************************************************************************************/
// 总线及控制口定义
//P1.21
#define AM12864_PO (0x01 << 21)
#define AM12864_PO_GPIO() PINSEL2 &= ~(0x03 <<4)
#define AM12864_PO_OUT() IO1DIR |= AM12864_PO
#define AM12864_PO_SET() IO1SET |= AM12864_PO
#define AM12864_PO_CLR() IO1CLR |= AM12864_PO
//P1.20
#define AM12864_CS (0x01 << 20)
#define AM12864_CS_GPIO() PINSEL2 &= ~(0x03 <<4)
#define AM12864_CS_OUT() IO1DIR |= AM12864_CS
#define AM12864_CS_SET() IO1SET |= AM12864_CS
#define AM12864_CS_CLR() IO1CLR |= AM12864_CS
//P0.23
#define AM12864_RST (0x01 << 23)
#define AM12864_RST_GPIO() PINSEL1 &= ~(0x03 <<14)
#define AM12864_RST_OUT() IO0DIR |= AM12864_RST
#define AM12864_RST_SET() IO0SET |= AM12864_RST
#define AM12864_RST_CLR() IO0CLR |= AM12864_RST
//P0.21
#define AM12864_RS (0x01 << 21)
#define AM12864_RS_GPIO() PINSEL1 &= ~(0x03 <<10)
#define AM12864_RS_OUT() IO0DIR |= AM12864_RS
#define AM12864_RS_SET() IO0SET |= AM12864_RS
#define AM12864_RS_CLR() IO0CLR |= AM12864_RS
//P1.19
#define AM12864_DI (0x01 << 19)
#define AM12864_DI_GPIO() PINSEL2 &= ~(0x03 <<4)
#define AM12864_DI_OUT() IO1DIR |= AM12864_DI
#define AM12864_DI_SET() IO1SET |= AM12864_DI
#define AM12864_DI_CLR() IO1CLR |= AM12864_DI
//P0.22
#define AM12864_SCK (0x01 << 22)
#define AM12864_SCK_GPIO() PINSEL1 &= ~(0x03 <<10)
#define AM12864_SCK_OUT() IO0DIR |= AM12864_SCK
#define AM12864_SCK_SET() IO0SET |= AM12864_SCK
#define AM12864_SCK_CLR() IO0CLR = AM12864_SCK
//P0.12
#define AM12864_BL (0x01 << 12)
#define AM12864_BL_GPIO() PINSEL0 &= ~(0x03 <<24)
#define AM12864_BL_OUT() IO0DIR |= AM12864_BL
#define AM12864_BL_SET() IO0SET |= AM12864_BL
#define AM12864_BL_CLR() IO0CLR |= AM12864_BL
// 操作设置常数宏定义
#define AM12864_Cmd 0 // 向AM12864 写显示命令
#define AM12864_Dat 1 // 向AM12864 写显示数据
#define AM12864_Natural 0 // 向AM12864 写正常显示数据
#define AM12864_Block 1 // 向AM12864 写显示数据
void AM12864_Bl(uint8 state);
void AM12864_SendByte(uint8 Dat);
void AM12864_Reset(void);
void AM12864_SendData(uint8 Value, uint8 OrderMode, uint8 DisplayMode);
void AM12864_Clear(void);
void AM12864_Init(void);
void AM12864_8x8_Display(uint8 Col, uint8 Row, uint8 Str, uint8 Mode);
void AM12864_8x16_Display(uint8 Col, uint8 Row, uint8 Str, uint8 Mode);
void AM12864_16x16_Display(uint8 Col, uint8 Row, uint8 Str, uint8 Mode);
void AM12864_16x32_Display(uint8 Col, uint8 Row, uint8 Str, uint8 Mode);
void AM12864_Graphics_Display(const uint8 *ucGraphics, uint8 ucRow,uint8 ucCol, uint8 ucColSum, uint8 ucRowSum, uint8 ucMode);
void AM12864_8x8_Text(uint8 ucCol, uint8 ucRow, uint8 *ucStr, uint8 ucStrLen, uint8 ucMode);
void AM12864_8x16_Text(uint8 ucCol, uint8 ucRow, uint8 *ucStr, uint8 ucStrLen, uint8 ucMode);
void AM12864_16x16_Text(uint8 ucCol, uint8 ucRow, uint8 *ucStr, uint8 ucStrLen, uint8 ucMode);
void AM12864_English_Text(uint8 ucRow, uint8 *ucStr, uint8 ucStrLen, uint8 ucMode);
void AM12864_Chinese_Text(uint8 ucRow, uint8 *ucStr, uint8 ucStrLen, uint8 ucMode);
void AM12864_Decimalist_8x16_Display(uint8 ucCol, uint8 ucRow, uint16 ulData, uint8 ucMode);
void AM12864_Power_Display(void);
void AM12864_Rtc_Display(void);
void AM12864_Rtc_Display(void);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -