Show2Me control FW, initial shared version

Dependencies:   SDFileSystem_HelloWorld mbed FATFileSystem

Fork of 000_GEO_SHOW2ME_OK_F411RE by Walter Trovo

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ST7565_LCD.h Source File

ST7565_LCD.h

00001 /*******************************************************************************
00002 * File Name          : ST7565_LCD.c
00003 * Author             : Walter Trovò
00004 * Date First Issued  : 20/03/2012
00005 *******************************************************************************/
00006 
00007 // ST7565R LCD module driver
00008 
00009 #ifndef __ST7565_LCD_H
00010 #define __ST7565_LCD_H
00011 
00012 #include "mbed.h"
00013 
00014 // LCD commands and definitions
00015 
00016 #define LCD_WIDTH   128
00017 #define LCD_HEIGHT  64
00018 
00019 #define CMD_DISPLAY_OFF   0xAE
00020 #define CMD_DISPLAY_ON    0xAF
00021 
00022 #define CMD_SET_DISP_START_LINE  0x40
00023 #define CMD_SET_PAGE  0xB0
00024 
00025 #define CMD_SET_COLUMN_UPPER  0x10
00026 #define CMD_SET_COLUMN_LOWER  0x00
00027 
00028 #define CMD_SET_ADC_NORMAL  0xA0
00029 #define CMD_SET_ADC_REVERSE 0xA1
00030 
00031 #define CMD_SET_DISP_NORMAL 0xA6
00032 #define CMD_SET_DISP_REVERSE 0xA7
00033 
00034 #define CMD_SET_ALLPTS_NORMAL 0xA4
00035 #define CMD_SET_ALLPTS_ON  0xA5
00036 #define CMD_SET_BIAS_9 0xA2 
00037 #define CMD_SET_BIAS_7 0xA3
00038 
00039 #define CMD_RMW  0xE0
00040 #define CMD_RMW_CLEAR 0xEE
00041 #define CMD_INTERNAL_RESET  0xE2
00042 #define CMD_SET_COM_NORMAL  0xC0
00043 #define CMD_SET_COM_REVERSE  0xC8
00044 #define CMD_SET_POWER_CONTROL  0x28
00045 #define CMD_SET_RESISTOR_RATIO  0x20
00046 #define CMD_SET_VOLUME_FIRST  0x81
00047 #define CMD_SET_VOLUME_SECOND  0
00048 #define CMD_SET_STATIC_OFF  0xAC
00049 #define CMD_SET_STATIC_ON  0xAD
00050 #define CMD_SET_STATIC_REG  0x0
00051 #define CMD_SET_BOOSTER_FIRST  0xF8
00052 #define CMD_SET_BOOSTER_234  0
00053 #define CMD_SET_BOOSTER_5  1
00054 #define CMD_SET_BOOSTER_6  3
00055 #define CMD_NOP  0xE3
00056 #define CMD_TEST  0xF0
00057 
00058 #define swap(a, b) { unsigned short t = a; a = b; b = t; }
00059 
00060 // ------------- Functions prototype -----------------
00061 
00062 
00063 void SPI_Write(uint8_t data);
00064 void LCD_cmd(uint8_t command);
00065 void LCD_data(uint8_t data);
00066 void LCD_reset(void);
00067 void LCD_set_contrast(unsigned int level);
00068 void LCD_write_buffer(unsigned int *buffer);
00069 void LCD_clear(void);
00070 void LCD_setpixel(unsigned int *buff, uint8_t x, uint8_t y, uint8_t color);
00071 void LCD_clearpixel(unsigned int *buff, uint8_t x, uint8_t y);
00072 void LCD_drawline(unsigned int *buff, uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t color);
00073 void LCD_drawchar(unsigned int *buff, uint8_t x, uint8_t line, char c);
00074 void LCD_drawstring(unsigned int *buff, uint8_t x, uint8_t line, char *c);
00075 void Clear_buffer(unsigned int *buff);
00076 
00077 #endif