/*
*********************************************************************************************************
*
*	模块名称 :  
*	文件名称 :  
*	版    本 :  V0.1
*	说    明 :	.h文件
		              
*	修改记录 :  
*********************************************************************************************************
*/		  	 
#include "sys.h"

 	
/*
*********************************************************************************************************
											宏定义
*********************************************************************************************************
*/
#define OLED_MODE 	0
#define SIZE 		16
#define XLevelL		0x02
#define XLevelH		0x10
#define Max_Column	0x3F  // 256/4-1
#define Max_Row		0x3F  // 64-1
#define	Brightness	0xFF 
#define	Shift		0x1C
	    						  
#define OLED_CS_Clr()  GPIO_ResetBits(GPIOB,GPIO_Pin_0)//CS
#define OLED_CS_Set()  GPIO_SetBits(GPIOB,GPIO_Pin_0)

//#define OLED_RST_Clr() GPIO_ResetBits(GPIOC,GPIO_Pin_4)//RES
//#define OLED_RST_Set() GPIO_SetBits(GPIOC,GPIO_Pin_4)

#define OLED_DC_Clr() GPIO_ResetBits(GPIOB,GPIO_Pin_7)//DC
#define OLED_DC_Set() GPIO_SetBits(GPIOB,GPIO_Pin_7)

#define OLED_SCLK_Clr() GPIO_ResetBits(GPIOB,GPIO_Pin_1)//CLK
#define OLED_SCLK_Set() GPIO_SetBits(GPIOB,GPIO_Pin_1)

#define OLED_SDIN_Clr() GPIO_ResetBits(GPIOB,GPIO_Pin_6)//DIN
#define OLED_SDIN_Set() GPIO_SetBits(GPIOB,GPIO_Pin_6)




 		     
#define OLED_CMD  0	//写命令
#define OLED_DATA 1	//写数据



/*
*********************************************************************************************************
											函数定义
*********************************************************************************************************
*/
void OLED_WR_Byte(u8 dat,u8 cmd);
void OLED_Init(void);
void Set_Column_Address(unsigned char a, unsigned char b);
void Set_Row_Address(unsigned char a, unsigned char b);
void Set_Write_RAM(void);
void Set_Read_RAM(void);
void Fill_RAM(unsigned char Data);
void Draw_Rectangle(unsigned char Data, unsigned char a, unsigned char b, unsigned char c, unsigned char d, unsigned char e);
void Fill_Block(unsigned char Data, unsigned char a, unsigned char b, unsigned char c, unsigned char d);
void Grayscale(void);
void Set_Remap_Format(unsigned char d);
void Show_Pattern(unsigned char *Data_Pointer, unsigned char a, unsigned char b, unsigned char c, unsigned char d);
void Con_4_byte(unsigned char DATA);
void Set_Partial_Display(unsigned char a, unsigned char b, unsigned char c);
void Set_Display_Offset(unsigned char d);
void Set_Start_Line(unsigned char d);
void Set_Master_Current(unsigned char d);
void Vertical_Scroll(unsigned char a, unsigned char b, unsigned char c);
void Set_Gray_Scale_Table(void);
void Set_Linear_Gray_Scale_Table(void); 

void Fill_Part_RAM(unsigned char Data,unsigned char x,unsigned char x1,unsigned char y, unsigned char y1);

//void Show_IP(void);
void Oled_Display_default(void);//开机默认显示

 //以下ASCII程序
void Asc5_8(unsigned char x,unsigned char y,unsigned char ch[]);
void Asc5_8_advant(uint8_t x,uint8_t y,uint8_t ch[], uint8_t Arr);
void Asc5_8_Single( uint8_t x, uint8_t y, uint8_t num, uint8_t Arr);
void Asc12_24_advant(unsigned char x,unsigned char y,unsigned char ch[] , uint8_t Arr);
//void Asc6_12(unsigned char x,unsigned char y,unsigned char ch[], unsigned char n);
//void Asc8_16(unsigned char x,unsigned char y,unsigned char ch[],unsigned char n);
//void Asc12_24(unsigned char x,unsigned char y,unsigned char ch[]);
//void Asc20_40(unsigned char x,unsigned char y,unsigned char ch[]);
//void Show_First_Line(void);


 //以下汉字程序
//void HZ16_16( unsigned char x, unsigned char y, unsigned char num);
//void HZ12_12( unsigned char x, unsigned char y, unsigned char num);
//void HZ24_24( unsigned char x, unsigned char y, unsigned char num);
//void Show_HZ16_16(unsigned char  x,unsigned char  y, unsigned char  d,unsigned char num1,unsigned char num2);
//void Show_HZ12_12(unsigned char  x,unsigned char  y, unsigned char  d,unsigned char num1,unsigned char num2);
//void Show_HZ24_24(unsigned char  x,unsigned char  y, unsigned char  d,unsigned char num1,unsigned char num2);




