This commit is contained in:
BIN
trunk/workspace/00_Lib/10 Atmel - Datasheets.lnk
Normal file
BIN
trunk/workspace/00_Lib/10 Atmel - Datasheets.lnk
Normal file
Binary file not shown.
220
trunk/workspace/00_Lib/Disp_Digole/DigoleSerial.cpp
Normal file
220
trunk/workspace/00_Lib/Disp_Digole/DigoleSerial.cpp
Normal file
@@ -0,0 +1,220 @@
|
||||
//Digole Digital Solutions: www.digole.com
|
||||
#include "DigoleSerial.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
#include "Arduino.h"
|
||||
|
||||
/*
|
||||
// Communication set up command
|
||||
* "SB":Baud (ascII bytes end with 0x00/0x0A/0x0D) -- set UART Baud Rate
|
||||
* "SI2CA":Address(1 byte <127) -- Set I2C address, default address is:0x27
|
||||
* "DC":1/0(1byte) -- set config display on/off, if set to 1, displayer will display current commucation setting when power on
|
||||
// Text Function command
|
||||
* "CL": -- Clear screen--OK
|
||||
* "CS":1/0 (1 byte)-- Cursor on/off
|
||||
* "TP":x(1 byte) y(1 byte) -- set text position
|
||||
* "TT":string(bytes) end with 0x00/0x0A/0x0D -- display string under regular mode
|
||||
// Graphic function command
|
||||
* "GP":x(1byte) y(1byte) -- set current graphic position
|
||||
* "DM":"C/!/~/&/|/^"(ASCII 1byte) -- set drawing mode--C="Copy",! and ~ = "Not", & = "And", | = "Or", ^ = "Xor"
|
||||
* "SC":1/0 (1byte) -- set draw color--only 1 and 0
|
||||
* "LN":x0(1byte) y0(1byte) x1(1byte) y2(1byte)--draw line from x0,y0 to x1,y1,set new pot to x1,y1
|
||||
* "LT":x(1byte) y(1byte) -- draw line from current pos to x,y
|
||||
* "CC":x(1byte) y(1byte) ratio(byte) -- draw circle at x,y with ratio
|
||||
* "DP":x(1byte) y(1byte) Color(1byte) -- draw a pixel--OK
|
||||
* "DR":x0(1byte) y0(1byte) x1(1byte) y2(1byte)--draw rectangle, top-left:x0,y0; right-bottom:x1,y1
|
||||
* "FR":x0(1byte) y0(1byte) x1(1byte) y2(1byte)--draw filled rectangle, top-left:x0,y0; right-bottom:x1,y1
|
||||
*/
|
||||
|
||||
// that resetting the Arduino doesn't reset the LCD, so we
|
||||
// can't assume that its in that state when a sketch starts (and the
|
||||
// LiquidCrystal constructor is called).
|
||||
|
||||
//UART function
|
||||
|
||||
void DigoleSerialDisp::preprint(void) {
|
||||
//write((uint8_t)0);
|
||||
Print::print("TT");
|
||||
}
|
||||
|
||||
/*----------Functions for Graphic LCD/OLED adapters only---------*/
|
||||
void DigoleSerialDisp::drawBitmap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *bitmap) {
|
||||
uint8_t i = 0;
|
||||
if ((w & 7) != 0)
|
||||
i = 1;
|
||||
Print::print("DIM");
|
||||
write(x); //x;
|
||||
write(y);
|
||||
write(w);
|
||||
write(h);
|
||||
for (int j = 0; j < h * ((w >> 3) + i); j++) {
|
||||
write(pgm_read_byte_near(bitmap + j));
|
||||
delay(5);
|
||||
}
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::setRot90(void) {
|
||||
Print::print("SD1");
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::setRot180(void) {
|
||||
Print::print("SD2");
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::setRot270(void) {
|
||||
Print::print("SD3");
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::undoRotation(void) {
|
||||
Print::print("SD0");
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::setRotation(uint8_t d) {
|
||||
Print::print("SD");
|
||||
write(d);
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::setContrast(uint8_t c) {
|
||||
Print::print("CT");
|
||||
write(c);
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::drawBox(uint8_t x, uint8_t y, uint8_t w, uint8_t h) {
|
||||
Print::print("FR");
|
||||
write(x);
|
||||
write(y);
|
||||
write(x + w);
|
||||
write(y + h);
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::drawCircle(uint8_t x, uint8_t y, uint8_t r, uint8_t f) {
|
||||
Print::print("CC");
|
||||
write(x);
|
||||
write(y);
|
||||
write(r);
|
||||
write(f);
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::drawDisc(uint8_t x, uint8_t y, uint8_t r) {
|
||||
drawCircle(x, y, r, 1);
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::drawFrame(uint8_t x, uint8_t y, uint8_t w, uint8_t h) {
|
||||
Print::print("DR");
|
||||
write(x);
|
||||
write(y);
|
||||
write(x + w);
|
||||
write(y + h);
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::drawPixel(uint8_t x, uint8_t y, uint8_t color) {
|
||||
Print::print("DP");
|
||||
write(x);
|
||||
write(y);
|
||||
write(color);
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::drawLine(uint8_t x, uint8_t y, uint8_t x1, uint8_t y1) {
|
||||
Print::print("LN");
|
||||
write(x);
|
||||
write(y);
|
||||
write(x1);
|
||||
write(y1);
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::drawLineTo(uint8_t x, uint8_t y) {
|
||||
Print::print("LT");
|
||||
write(x);
|
||||
write(y);
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::drawHLine(uint8_t x, uint8_t y, uint8_t w) {
|
||||
drawLine(x, y, x + w, y);
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::drawVLine(uint8_t x, uint8_t y, uint8_t h) {
|
||||
drawLine(x, y, x, y + h);
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::nextTextLine(void) {
|
||||
write((uint8_t) 0);
|
||||
Print::print("TRT");
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::setFont(uint8_t font) {
|
||||
Print::print("SF");
|
||||
write(font);
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::setColor(uint8_t color) {
|
||||
Print::print("SC");
|
||||
write(color);
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::backLightOn(void) {
|
||||
Print::print("BL");
|
||||
write((uint8_t) 1);
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::backLightOff(void) {
|
||||
Print::print("BL");
|
||||
write((uint8_t) 0);
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::directCommand(uint8_t d) {
|
||||
Print::print("MCD");
|
||||
write(d);
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::directData(uint8_t d) {
|
||||
Print::print("MDT");
|
||||
write(d);
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::moveArea(uint8_t x0, uint8_t y0, uint8_t w, uint8_t h, char xoffset, char yoffset) {
|
||||
Print::print("MA");
|
||||
write(x0);
|
||||
write(y0);
|
||||
write(w);
|
||||
write(h);
|
||||
write(xoffset);
|
||||
write(yoffset);
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::uploadStartScreen(int lon, const unsigned char *data) {
|
||||
int j;
|
||||
uint8_t c;
|
||||
Print::print("SSS");
|
||||
write((uint8_t) (lon % 256));
|
||||
write((uint8_t) (lon / 256));
|
||||
for (j = 0; j < lon;j++) {
|
||||
if((j%32)==0)
|
||||
delay(50);
|
||||
delay(_Comdelay);
|
||||
c=pgm_read_byte_near(data+j);
|
||||
write(c);
|
||||
}
|
||||
}
|
||||
|
||||
void DigoleSerialDisp::uploadUserFont(int lon, const unsigned char *data, uint8_t sect) {
|
||||
uint8_t c;
|
||||
Print::print("SUF");
|
||||
write(sect);
|
||||
write((uint8_t) (lon % 256));
|
||||
write((uint8_t) (lon / 256));
|
||||
for (int j = 0; j < lon; j++) {
|
||||
if((j%32)==0)
|
||||
delay(50);
|
||||
delay(_Comdelay);
|
||||
c=pgm_read_byte_near(data+j);
|
||||
write(c);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
336
trunk/workspace/00_Lib/Disp_Digole/DigoleSerial.h
Normal file
336
trunk/workspace/00_Lib/Disp_Digole/DigoleSerial.h
Normal file
@@ -0,0 +1,336 @@
|
||||
//Digole Digital Solutions: www.digole.com
|
||||
#ifndef DigoleSerialDisp_h
|
||||
#define DigoleSerialDisp_h
|
||||
|
||||
#include <inttypes.h>
|
||||
#include "Print.h"
|
||||
#include "../Wire/Wire.h"
|
||||
#include "Arduino.h"
|
||||
|
||||
// Communication set up command
|
||||
// Text function command
|
||||
// Graph function command
|
||||
|
||||
#define Serial_UART 0;
|
||||
#define Serial_I2C 1;
|
||||
#define Serial_SPI 2;
|
||||
#define _TEXT_ 0
|
||||
#define _GRAPH_ 1
|
||||
|
||||
class DigoleSerialDisp : public Print {
|
||||
public:
|
||||
#if defined(_Digole_Serial_UART_)
|
||||
|
||||
DigoleSerialDisp(HardwareSerial *s, unsigned long baud) //UART set up
|
||||
{
|
||||
_mySerial = s;
|
||||
_Baud = baud;
|
||||
_Comdelay=2;
|
||||
}
|
||||
|
||||
size_t write(uint8_t value) {
|
||||
_mySerial->write(value);
|
||||
return 1; // assume sucess
|
||||
}
|
||||
|
||||
void begin(void) {
|
||||
_mySerial->begin(9600);
|
||||
_mySerial->print("SB");
|
||||
_mySerial->println(_Baud);
|
||||
delay(100);
|
||||
_mySerial->begin(_Baud);
|
||||
}
|
||||
#endif
|
||||
#if defined(_Digole_Serial_I2C_)
|
||||
|
||||
void begin(void) {
|
||||
_myWire->begin();
|
||||
}
|
||||
|
||||
DigoleSerialDisp(TwoWire *s, uint8_t add) //U2C set up
|
||||
{
|
||||
_myWire = s;
|
||||
_I2Caddress = add;
|
||||
_Comdelay=6;
|
||||
}
|
||||
|
||||
size_t write(uint8_t value) {
|
||||
_myWire->beginTransmission(_I2Caddress);
|
||||
_myWire->write(value);
|
||||
_myWire->endTransmission();
|
||||
return 1; // assume sucess
|
||||
}
|
||||
#endif
|
||||
#if defined(_Digole_Serial_SPI_)
|
||||
|
||||
void begin(void) {
|
||||
}
|
||||
|
||||
DigoleSerialDisp(uint8_t pin_data, uint8_t pin_clock, uint8_t SS) //spi set up
|
||||
{
|
||||
_Clockpin = pin_clock;
|
||||
_Datapin = pin_data;
|
||||
_SSpin = SS;
|
||||
pinMode(_Clockpin, OUTPUT);
|
||||
pinMode(_Datapin, OUTPUT);
|
||||
pinMode(_SSpin, OUTPUT);
|
||||
digitalWrite(_SSpin, HIGH);
|
||||
digitalWrite(_Clockpin, LOW);
|
||||
digitalWrite(_Datapin, LOW);
|
||||
_Comdelay=6;
|
||||
}
|
||||
|
||||
size_t write(uint8_t value) {
|
||||
digitalWrite(_SSpin, LOW);
|
||||
digitalWrite(_SSpin, LOW);
|
||||
digitalWrite(_SSpin, LOW);
|
||||
shiftOut(_Datapin, _Clockpin, MSBFIRST, value);
|
||||
digitalWrite(_SSpin, HIGH);
|
||||
return 1; // assume sucess
|
||||
}
|
||||
#endif
|
||||
// virtual size_t write(uint8_t);
|
||||
// void begin(void);
|
||||
|
||||
/*---------fucntions for Text and Graphic LCD adapters---------*/
|
||||
void disableCursor(void) {
|
||||
Print::print("CS0");
|
||||
}
|
||||
|
||||
void enableCursor(void) {
|
||||
Print::print("CS1");
|
||||
}
|
||||
|
||||
void drawStr(uint8_t x, uint8_t y, const char *s) {
|
||||
Print::print("TP");
|
||||
write(x);
|
||||
write(y);
|
||||
Print::print("TT");
|
||||
Print::println(s);
|
||||
}
|
||||
|
||||
void setPrintPos(uint8_t x, uint8_t y, uint8_t graph = _TEXT_) {
|
||||
if (graph == _TEXT_) {
|
||||
Print::print("TP");
|
||||
write(x);
|
||||
write(y);
|
||||
} else {
|
||||
Print::print("GP");
|
||||
write(x);
|
||||
write(y);
|
||||
}
|
||||
}
|
||||
|
||||
void clearScreen(void) {
|
||||
Print::print("CL");
|
||||
}
|
||||
|
||||
void setLCDColRow(uint8_t col, uint8_t row) {
|
||||
Print::print("STCR");
|
||||
write(col);
|
||||
write(row);
|
||||
Print::print("\x80\xC0\x94\xD4");
|
||||
}
|
||||
|
||||
void setI2CAddress(uint8_t add) {
|
||||
Print::print("SI2CA");
|
||||
write(add);
|
||||
_I2Caddress = add;
|
||||
}
|
||||
|
||||
void displayConfig(uint8_t v) {
|
||||
Print::print("DC");
|
||||
write(v);
|
||||
}
|
||||
//print function
|
||||
|
||||
size_t println(const __FlashStringHelper *v) {
|
||||
preprint();
|
||||
Print::println(v);
|
||||
}
|
||||
|
||||
size_t println(const String &v) {
|
||||
preprint();
|
||||
Print::println(v);
|
||||
}
|
||||
|
||||
size_t println(const char v[]) {
|
||||
preprint();
|
||||
Print::println(v);
|
||||
}
|
||||
|
||||
size_t println(char v) {
|
||||
preprint();
|
||||
Print::println(v);
|
||||
}
|
||||
|
||||
size_t println(unsigned char v, int base = DEC) {
|
||||
preprint();
|
||||
Print::println(v, base);
|
||||
}
|
||||
|
||||
size_t println(int v, int base = DEC) {
|
||||
preprint();
|
||||
Print::println(v, base);
|
||||
}
|
||||
|
||||
size_t println(unsigned int v, int base = DEC) {
|
||||
preprint();
|
||||
Print::println(v, base);
|
||||
}
|
||||
|
||||
size_t println(long v, int base = DEC) {
|
||||
preprint();
|
||||
Print::println(v, base);
|
||||
}
|
||||
|
||||
size_t println(unsigned long v, int base = DEC) {
|
||||
preprint();
|
||||
Print::println(v, base);
|
||||
}
|
||||
|
||||
size_t println(double v, int base = 2) {
|
||||
preprint();
|
||||
Print::println(v, base);
|
||||
}
|
||||
|
||||
size_t println(const Printable& v) {
|
||||
preprint();
|
||||
Print::println(v);
|
||||
}
|
||||
|
||||
size_t println(void) {
|
||||
}
|
||||
|
||||
size_t print(const __FlashStringHelper *v) {
|
||||
preprint();
|
||||
Print::println(v);
|
||||
}
|
||||
|
||||
size_t print(const String &v) {
|
||||
preprint();
|
||||
Print::println(v);
|
||||
}
|
||||
|
||||
size_t print(const char v[]) {
|
||||
preprint();
|
||||
Print::println(v);
|
||||
}
|
||||
|
||||
size_t print(char v) {
|
||||
preprint();
|
||||
Print::println(v);
|
||||
}
|
||||
|
||||
size_t print(unsigned char v, int base = DEC) {
|
||||
preprint();
|
||||
Print::println(v, base);
|
||||
}
|
||||
|
||||
size_t print(int v, int base = DEC) {
|
||||
preprint();
|
||||
Print::println(v, base);
|
||||
}
|
||||
|
||||
size_t print(unsigned int v, int base = DEC) {
|
||||
preprint();
|
||||
Print::println(v, base);
|
||||
}
|
||||
|
||||
size_t print(long v, int base = DEC) {
|
||||
preprint();
|
||||
Print::println(v, base);
|
||||
}
|
||||
|
||||
size_t print(unsigned long v, int base = DEC) {
|
||||
preprint();
|
||||
Print::println(v, base);
|
||||
}
|
||||
|
||||
size_t print(double v, int base = 2) {
|
||||
preprint();
|
||||
Print::println(v, base);
|
||||
}
|
||||
|
||||
size_t print(const Printable& v) {
|
||||
preprint();
|
||||
Print::println(v);
|
||||
}
|
||||
void preprint(void);
|
||||
/*----------Functions for Graphic LCD/OLED adapters only---------*/
|
||||
//the functions in this section compatible with u8glib
|
||||
void drawBitmap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *bitmap);
|
||||
void setRot90(void);
|
||||
void setRot180(void);
|
||||
void setRot270(void);
|
||||
void undoRotation(void);
|
||||
void setRotation(uint8_t);
|
||||
void setContrast(uint8_t);
|
||||
void drawBox(uint8_t x, uint8_t y, uint8_t w, uint8_t h);
|
||||
void drawCircle(uint8_t x, uint8_t y, uint8_t r, uint8_t = 0);
|
||||
void drawDisc(uint8_t x, uint8_t y, uint8_t r);
|
||||
void drawFrame(uint8_t x, uint8_t y, uint8_t w, uint8_t h);
|
||||
void drawPixel(uint8_t x, uint8_t y, uint8_t = 1);
|
||||
void drawLine(uint8_t x, uint8_t y, uint8_t x1, uint8_t y1);
|
||||
void drawLineTo(uint8_t x, uint8_t y);
|
||||
void drawHLine(uint8_t x, uint8_t y, uint8_t w);
|
||||
void drawVLine(uint8_t x, uint8_t y, uint8_t h);
|
||||
//-------------------------------
|
||||
//special functions for our adapters
|
||||
void setFont(uint8_t font); //set font, availale: 6,10,18,51,120,123, user font: 200-203
|
||||
void nextTextLine(void); //got to next text line, depending on the font size
|
||||
void setColor(uint8_t); //set color for graphic function
|
||||
void backLightOn(void); //Turn on back light
|
||||
void backLightOff(void); //Turn off back light
|
||||
void directCommand(uint8_t d); //send command to LCD drectly
|
||||
void directData(uint8_t d); //send data to LCD drectly
|
||||
void moveArea(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, char xoffset, char yoffset); //move a area of screen to another place
|
||||
|
||||
void displayStartScreen(uint8_t m) {
|
||||
Print::print("DSS");
|
||||
write(m);
|
||||
} //display start screen
|
||||
|
||||
void setMode(uint8_t m) {
|
||||
Print::print("DM");
|
||||
write(m);
|
||||
} //set display mode
|
||||
|
||||
void setTextPosBack(void) {
|
||||
Print::print("ETB");
|
||||
} //set text position back to previous, only one back allowed
|
||||
|
||||
void setTextPosOffset(char xoffset, char yoffset) {
|
||||
Print::print("ETO");
|
||||
write(xoffset);
|
||||
write(yoffset);
|
||||
}
|
||||
|
||||
void setTextPosAbs(uint8_t x, uint8_t y) {
|
||||
Print::print("ETP");
|
||||
write(x);
|
||||
write(y);
|
||||
}
|
||||
void setLinePattern(uint8_t pattern) {
|
||||
Print::print("SLP");
|
||||
write(pattern);
|
||||
}
|
||||
void setLCDChip(uint8_t chip) { //only for universal LCD adapter
|
||||
Print::print("SLCD");
|
||||
write(chip);
|
||||
}
|
||||
void uploadStartScreen(int lon, const unsigned char *data); //upload start screen
|
||||
void uploadUserFont(int lon, const unsigned char *data, uint8_t sect); //upload user font
|
||||
void digitalOutput(uint8_t x) {Print::print("DOUT");write(x);}
|
||||
private:
|
||||
unsigned long _Baud;
|
||||
HardwareSerial *_mySerial;
|
||||
uint8_t _I2Caddress;
|
||||
TwoWire *_myWire;
|
||||
uint8_t _Clockpin;
|
||||
uint8_t _Datapin;
|
||||
uint8_t _SSpin;
|
||||
uint8_t _Comdelay;
|
||||
};
|
||||
|
||||
#endif
|
||||
Binary file not shown.
7
trunk/workspace/00_Lib/Disp_Digole/Note.txt
Normal file
7
trunk/workspace/00_Lib/Disp_Digole/Note.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
Modification History:
|
||||
|
||||
Dec 10, 2012
|
||||
Fixed the Startscreen and user font uploading problem in I2C and SPI mode, Thanks for Ryuuzaki Julio to point out these Bugs
|
||||
|
||||
Dec 2, 2012
|
||||
Fixed displayStartScreen() function
|
||||
19
trunk/workspace/00_Lib/Disp_Digole/keywords.txt
Normal file
19
trunk/workspace/00_Lib/Disp_Digole/keywords.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
###########################################
|
||||
# Syntax Coloring Map For DigoleSerialDisp
|
||||
###########################################
|
||||
|
||||
###########################################
|
||||
# Datatypes (KEYWORD1)
|
||||
###########################################
|
||||
|
||||
DigoleSerial KEYWORD1
|
||||
###########################################
|
||||
# Methods and Functions (KEYWORD2)
|
||||
###########################################
|
||||
DigoleSerialDisp KEYWORD2
|
||||
write KEYWORD2
|
||||
begin KEYWORD2
|
||||
|
||||
###########################################
|
||||
# Constants (LITERAL1)
|
||||
###########################################
|
||||
649
trunk/workspace/00_Lib/Disp_Digole/sampledata.h
Normal file
649
trunk/workspace/00_Lib/Disp_Digole/sampledata.h
Normal file
@@ -0,0 +1,649 @@
|
||||
prog_uchar startscreenLV[1024] PROGMEM={
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
,0,0,0,0,0,0,0,0,0,0,0,0,0,192,192,192,0,56,124,124,60,24,0,0,252,252,12,12,12,12,28,24,56,112,112,224,192,128,0,0,0,0,0,0,0,0,0,128,128,192,192,64,64,64,192,192,192,192,192,128,128,0,0,0,0,0,0,0,0,0,224,224,96,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,224,240,56,24,24,24,24,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
,0,0,0,0,0,0,0,0,0,192,248,126,15,3,1,0,0,0,0,0,0,0,0,0,255,255,0,0,0,0,0,0,0,0,0,0,3,7,63,252,240,128,224,120,14,6,3,1,0,128,246,255,254,31,0,0,0,1,1,7,127,255,254,252,64,64,112,176,240,248,120,0,0,0,128,128,192,96,112,48,112,240,240,240,0,0,0,192,224,112,48,24,56,112,240,240,224,0,0,0,224,254,255,63,1,0,0,0,192,224,48,48,24,248,248,240,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
,0,0,0,0,0,0,0,0,0,15,255,253,192,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,128,240,255,63,0,15,31,28,24,0,128,248,255,255,15,0,128,128,128,128,192,224,120,127,63,15,3,0,192,248,255,191,207,96,32,248,254,255,199,128,192,224,248,255,255,15,0,0,252,255,255,195,128,128,128,192,240,127,63,7,0,224,254,255,191,195,96,32,56,254,255,255,143,198,198,195,99,49,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
,0,0,0,0,0,0,0,0,0,0,0,3,7,15,28,56,112,112,224,192,192,128,128,128,255,255,0,0,0,224,240,240,224,64,8,28,30,15,3,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,3,1,1,240,248,252,142,135,3,131,129,224,250,127,63,7,0,0,0,0,1,1,3,3,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,240,248,248,24,120,112,0,0,240,248,248,24,248,248,240,0,0,248,248,248,16,248,248,240,16,248,248,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,56,56,0,31,63,63,48,62,14,0,0,31,63,63,48,63,63,31,0,0,63,63,63,0,63,63,63,0,63,63,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
prog_uchar startscreenMV[1024] PROGMEM={
|
||||
1,0,0,0,0,1,1,1,3,1,1,1,1,1,1,1,1,1,1,1,15,15,15,7,7,7,3,9,14,3,31,29,31,63,63,62,58,51,59,57,57,56,24,60,62,63,63,63,63,63,63,63,63,63,63,62,28,16,32,0,0,0,0,0,0,0,0,0,16,24,25,25,17,3,1,1,1,1,0,0,0,0,3,7,5,5,9,9,3,3,3,3,3,7,7,7,7,15,15,15,15,15,15,15,7,7,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,1,1,1,1,1
|
||||
,128,128,128,0,128,224,224,240,240,224,224,224,224,224,224,224,240,248,252,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,127,127,255,255,223,223,157,12,14,2,128,192,224,224,192,128,128,0,0,0,0,192,192,128,0,4,12,30,15,3,7,103,103,255,255,207,207,255,255,255,255,255,255,255,255,254,252,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,230,224,224,224,224,252,220,248,224,224,224,192,192,192
|
||||
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,224,240,248,254,252,254,255,255,255,252,248,248,248,248,248,240,224,192,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,15,255,255,255,223,159,191,255,143,207,135,239,207,239,103,103,127,127,255,255,255,127,157,255,255,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,196,192,240,128,144,16,48,224,128,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,192,192,224,96,96,240,56,24,9,143,15,79,15,15,15,7,7,3,3,0,0,0,0,0,0,0,0,0,0,0,0,240,248,252,254,252,252,252,252,254,255,255,255,255,255,255,255,255,255,255,127,191,255,238,236,224,192,128,0,0,0,0,128,240,248,244,192,128,0,0,192,226,255,243,240,240,129,3,7,32,96,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,15,15,29,27,31,30,30,30,31,27,15,7,3,0,4,239,255,255,254,255,255,255,255,255,255,255,255,255,127,127,126,32,0,1,1,1,1,1,0,0,0,3,15,13,31,31,12,128,238,255,255,255,255,255,255,255,255,252,140,3,7,14,0,0,0,1,1,1,1,1,0,0,0,0,1,1,1,1,1,0,192,64,32,160,161,129,193,195,7,7,15,143,199,195,111,103,49,1,0,0,0,0,0,0,0,0,0,0
|
||||
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,63,248,206,63,255,227,135,15,31,127,254,254,249,255,254,123,255,190,249,255,127,255,255,255,255,255,255,254,252,248,255,63,126,255,255,243,231,255,255,255,255,62,123,223,127,248,239,63,118,255,255,255,255,255,255,255,243,198,135,3,0,128,143,63,126,255,255,243,231,247,247,255,255,126,255,255,243,231,255,255,254,253,39,30,123,239,254,248,247,255,249,255,255,252,243,255,253,255,255,252,240,0,0,0,0,0,1,3,6,0
|
||||
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,192,192,192,192,192,192,128,128,0,0,0,128,192,192,192,156,62,246,254,254,254,255,255,254,254,222,252,120,0,128,192,192,192,192,192,192,128,0,0,192,192,192,128,0,0,128,192,224,224,224,192,192,192,128,192,192,224,192,192,0,0,0,193,193,225,225,192,192,128,128,128,192,192,192,193,193,193,129,1,1,129,193,192,192,128,0,0,192,192,192,192,0,1,193,192,192,192,128,0,0,0,0,0,0,128,128,0,0,0
|
||||
,7,7,3,3,3,3,3,3,3,3,7,23,23,23,55,55,55,23,23,55,55,51,39,3,3,7,15,15,15,31,31,31,31,31,31,63,103,103,103,247,231,231,103,7,7,7,7,7,7,15,15,31,31,31,31,31,63,63,63,127,127,127,127,127,127,127,127,127,127,255,127,127,127,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,127,255,255,255,255,255,255,255,255,255,255,255,127,127,127,127,255,255,255,255,255,127,127,127,127,127,127,127,127,127,255,255,87,7,7,7,7,7,7
|
||||
};
|
||||
prog_uchar userfont1[1423] PROGMEM={0,9,15,0,253,10,1,232,3,214,32,127,253,12,253,11,
|
||||
253,0,0,0,9,0,12,2,10,10,9,3,0,192,192,192,
|
||||
192,192,192,192,192,0,192,5,3,3,9,2,7,216,216,216,
|
||||
7,8,8,9,1,1,108,108,254,108,108,254,108,108,7,11,
|
||||
11,9,1,255,16,124,214,208,240,124,30,22,214,124,16,8,
|
||||
10,10,9,0,0,67,230,230,76,24,24,50,103,103,194,8,
|
||||
10,10,9,0,0,56,108,108,120,48,121,207,198,206,123,2,
|
||||
4,4,9,3,6,192,192,192,192,5,12,12,9,2,255,24,
|
||||
48,96,96,192,192,192,192,96,96,48,24,5,12,12,9,2,
|
||||
255,192,96,48,48,24,24,24,24,48,48,96,192,7,5,5,
|
||||
9,1,2,108,56,254,56,108,8,7,7,9,0,1,24,24,
|
||||
24,255,24,24,24,3,5,5,9,3,253,224,224,96,96,192,
|
||||
8,1,1,9,0,4,255,4,3,3,9,2,255,96,240,96,
|
||||
8,10,10,9,0,0,3,6,6,12,24,24,48,96,96,192,
|
||||
8,10,10,9,0,0,24,60,102,195,195,195,195,102,60,24,
|
||||
6,10,10,9,1,0,48,112,240,48,48,48,48,48,48,252,
|
||||
8,10,10,9,0,0,60,102,195,3,6,12,24,48,96,255,
|
||||
8,10,10,9,0,0,124,198,3,6,28,6,3,3,198,124,
|
||||
8,10,10,9,0,0,6,14,30,54,102,198,255,6,6,6,
|
||||
8,10,10,9,0,0,254,192,192,220,230,3,3,195,102,60,
|
||||
8,10,10,9,0,0,60,102,194,192,220,230,195,195,102,60,
|
||||
8,10,10,9,0,0,255,3,3,6,12,12,24,24,24,24,
|
||||
8,10,10,9,0,0,60,102,195,102,60,102,195,195,102,60,
|
||||
8,10,10,9,0,0,60,102,195,195,103,59,3,67,102,60,
|
||||
4,8,8,9,2,255,96,240,96,0,0,96,240,96,4,10,
|
||||
10,9,2,253,96,240,96,0,0,112,112,48,48,96,6,10,
|
||||
10,9,1,0,12,24,48,96,192,192,96,48,24,12,8,4,
|
||||
4,9,0,2,255,0,0,255,6,10,10,9,1,0,192,96,
|
||||
48,24,12,12,24,48,96,192,7,10,10,9,1,0,124,198,
|
||||
198,6,12,24,48,0,48,48,8,10,10,9,0,0,60,102,
|
||||
195,207,219,219,206,192,99,62,8,10,10,9,0,0,24,60,
|
||||
102,195,195,195,255,195,195,195,8,10,10,9,0,0,252,198,
|
||||
195,198,252,198,195,195,198,252,8,10,10,9,0,0,62,99,
|
||||
193,192,192,192,192,193,99,62,8,10,10,9,0,0,252,198,
|
||||
195,195,195,195,195,195,198,252,7,10,10,9,1,0,254,192,
|
||||
192,192,252,192,192,192,192,254,8,10,10,9,0,0,255,192,
|
||||
192,192,252,192,192,192,192,192,8,10,10,9,0,0,62,99,
|
||||
192,192,192,199,195,195,99,62,8,10,10,9,0,0,195,195,
|
||||
195,195,255,195,195,195,195,195,6,10,10,9,1,0,252,48,
|
||||
48,48,48,48,48,48,48,252,6,10,10,9,1,0,60,12,
|
||||
12,12,12,12,12,140,216,112,8,10,10,9,0,0,195,198,
|
||||
204,216,240,240,216,204,198,195,7,10,10,9,1,0,192,192,
|
||||
192,192,192,192,192,192,192,254,8,10,10,9,0,0,195,231,
|
||||
255,219,219,219,195,195,195,195,8,10,10,9,0,0,195,227,
|
||||
243,243,219,219,207,199,199,195,8,10,10,9,0,0,60,102,
|
||||
195,195,195,195,195,195,102,60,8,10,10,9,0,0,254,195,
|
||||
195,195,254,192,192,192,192,192,8,10,10,9,0,0,60,102,
|
||||
195,195,195,195,219,207,102,61,8,10,10,9,0,0,254,195,
|
||||
195,195,254,248,204,198,195,195,8,10,10,9,0,0,126,195,
|
||||
192,192,126,3,3,3,195,126,8,10,10,9,0,0,255,24,
|
||||
24,24,24,24,24,24,24,24,8,10,10,9,0,0,195,195,
|
||||
195,195,195,195,195,195,102,60,8,10,10,9,0,0,195,195,
|
||||
195,102,102,102,60,60,24,24,8,10,10,9,0,0,195,195,
|
||||
195,195,219,219,219,255,231,195,8,10,10,9,0,0,195,195,
|
||||
102,60,24,24,60,102,195,195,8,10,10,9,0,0,195,195,
|
||||
102,60,24,24,24,24,24,24,7,10,10,9,1,0,254,6,
|
||||
6,12,24,48,96,192,192,254,5,12,12,9,2,255,248,192,
|
||||
192,192,192,192,192,192,192,192,192,248,8,10,10,9,0,0,
|
||||
192,96,96,48,24,24,12,6,6,3,5,12,12,9,2,255,
|
||||
248,24,24,24,24,24,24,24,24,24,24,248,6,4,4,9,
|
||||
1,6,48,120,204,132,8,1,1,9,0,255,255,4,3,3,
|
||||
9,2,8,192,96,48,8,7,7,9,0,0,62,99,3,127,
|
||||
195,199,123,8,10,10,9,0,0,192,192,192,220,230,195,195,
|
||||
195,230,220,8,7,7,9,0,0,62,99,192,192,192,99,62,
|
||||
8,10,10,9,0,0,3,3,3,59,103,195,195,195,103,59,
|
||||
8,7,7,9,0,0,60,102,195,255,192,99,62,8,10,10,
|
||||
9,0,0,30,51,51,48,48,252,48,48,48,48,8,10,10,
|
||||
9,0,253,125,199,198,198,124,192,126,195,195,126,8,10,10,
|
||||
9,0,0,192,192,192,220,230,195,195,195,195,195,6,10,10,
|
||||
9,1,0,48,48,0,112,48,48,48,48,48,252,7,13,13,
|
||||
9,1,253,6,6,0,30,6,6,6,6,6,198,198,198,124,
|
||||
7,10,10,9,1,0,192,192,192,204,216,240,240,216,204,198,
|
||||
6,10,10,9,1,0,112,48,48,48,48,48,48,48,48,252,
|
||||
8,7,7,9,0,0,182,219,219,219,219,219,219,8,7,7,
|
||||
9,0,0,220,230,195,195,195,195,195,8,7,7,9,0,0,
|
||||
60,102,195,195,195,102,60,8,10,10,9,0,253,220,230,195,
|
||||
195,195,230,220,192,192,192,8,10,10,9,0,253,59,103,195,
|
||||
195,195,103,59,3,3,3,8,7,7,9,0,0,222,115,96,
|
||||
96,96,96,96,8,7,7,9,0,0,126,195,192,126,3,195,
|
||||
126,8,9,9,9,0,0,48,48,252,48,48,48,48,51,30,
|
||||
8,7,7,9,0,0,195,195,195,195,195,103,59,8,7,7,
|
||||
9,0,0,195,195,102,102,60,60,24,8,7,7,9,0,0,
|
||||
195,195,219,219,219,255,102,8,7,7,9,0,0,195,102,60,
|
||||
24,60,102,195,8,10,10,9,0,253,195,195,195,195,195,103,
|
||||
59,3,198,124,6,7,7,9,1,0,252,12,24,48,96,192,
|
||||
252,5,12,12,9,2,255,56,96,96,96,96,192,192,96,96,
|
||||
96,96,56,2,10,10,9,3,0,192,192,192,192,192,192,192,
|
||||
192,192,192,5,12,12,9,2,255,224,48,48,48,48,24,24,
|
||||
48,48,48,48,224,8,3,3,9,0,7,115,219,206,255
|
||||
};
|
||||
prog_uchar userfont3[] PROGMEM={
|
||||
0,71,68,232,239,30,9,231,23,124,32,127,245,39,245,38,
|
||||
245,0,0,0,11,0,0,6,36,36,13,3,255,12,60,124,
|
||||
124,124,124,120,120,120,120,120,120,120,120,56,56,56,56,56,
|
||||
56,56,56,48,48,48,48,0,0,0,0,56,124,252,252,248,
|
||||
112,13,16,32,20,4,19,48,56,240,248,240,248,240,240,240,
|
||||
240,240,240,240,112,240,112,240,112,240,112,112,112,112,112,96,
|
||||
112,96,112,96,112,96,112,21,27,81,23,2,3,0,48,96,
|
||||
0,112,224,0,96,192,0,96,192,0,225,192,0,225,192,0,
|
||||
193,128,1,195,128,31,255,248,31,255,248,3,135,0,3,135,
|
||||
0,3,6,0,3,6,0,7,14,0,7,14,0,6,12,0,
|
||||
255,255,192,255,255,192,12,28,0,12,24,0,28,56,0,28,
|
||||
56,0,24,48,0,56,112,0,56,112,0,48,96,0,20,36,
|
||||
108,23,1,252,0,96,0,0,96,0,0,96,0,0,96,0,
|
||||
3,254,0,15,255,128,62,127,192,120,103,128,112,99,128,240,
|
||||
96,0,240,96,0,240,96,0,248,96,0,126,96,0,127,224,
|
||||
0,63,240,0,15,254,0,1,255,0,0,127,192,0,111,224,
|
||||
0,99,224,0,97,240,0,96,240,0,96,240,64,96,240,96,
|
||||
96,240,112,96,224,120,97,224,124,99,192,127,255,128,31,255,
|
||||
0,7,248,0,0,96,0,0,96,0,0,96,0,0,96,0,
|
||||
31,30,120,34,1,255,7,192,0,96,31,224,0,240,60,240,
|
||||
1,192,120,120,3,192,112,120,3,128,240,60,7,0,240,60,
|
||||
14,0,240,60,14,0,240,60,28,0,240,60,56,0,240,60,
|
||||
120,0,120,56,112,0,120,120,224,0,60,241,192,0,31,227,
|
||||
195,224,15,131,143,240,0,7,30,120,0,15,60,60,0,30,
|
||||
56,60,0,28,120,30,0,56,120,30,0,120,120,30,0,112,
|
||||
120,30,0,224,120,30,1,192,120,30,3,192,60,28,3,128,
|
||||
60,60,7,0,30,120,15,0,15,240,12,0,7,192,30,34,
|
||||
136,32,2,0,0,63,0,0,0,255,128,0,1,199,192,0,
|
||||
3,131,224,0,7,1,224,0,7,1,224,0,15,1,224,0,
|
||||
15,1,224,0,15,3,224,0,15,3,192,0,15,135,192,0,
|
||||
15,143,128,0,7,191,0,0,7,254,0,0,7,248,0,0,
|
||||
7,240,0,0,15,240,63,248,31,240,127,252,62,120,30,48,
|
||||
60,124,15,0,124,60,15,0,120,30,7,0,240,31,7,0,
|
||||
240,15,135,0,240,7,198,0,240,3,198,0,240,3,236,0,
|
||||
240,1,252,0,248,0,252,0,120,0,126,0,60,0,255,0,
|
||||
63,3,143,200,15,255,7,240,3,248,3,192,4,16,16,12,
|
||||
4,19,48,240,240,240,240,240,240,240,240,240,112,112,96,96,
|
||||
96,96,11,45,90,15,3,249,0,32,0,224,1,192,3,128,
|
||||
3,128,7,0,14,0,14,0,28,0,28,0,60,0,56,0,
|
||||
56,0,120,0,120,0,120,0,112,0,240,0,240,0,240,0,
|
||||
240,0,240,0,240,0,240,0,240,0,240,0,240,0,240,0,
|
||||
240,0,120,0,120,0,120,0,120,0,56,0,60,0,60,0,
|
||||
28,0,30,0,14,0,15,0,7,0,3,128,1,192,0,224,
|
||||
0,32,11,45,90,15,1,249,128,0,224,0,112,0,56,0,
|
||||
28,0,30,0,14,0,15,0,7,0,7,128,7,128,3,128,
|
||||
3,192,3,192,3,192,3,192,1,224,1,224,1,224,1,224,
|
||||
1,224,1,224,1,224,1,224,1,224,1,224,1,224,1,224,
|
||||
1,192,3,192,3,192,3,192,3,128,3,128,7,128,7,0,
|
||||
15,0,14,0,14,0,28,0,56,0,56,0,112,0,224,0,
|
||||
128,0,18,20,60,21,2,17,0,192,0,1,192,0,1,192,
|
||||
0,1,192,0,193,193,0,240,195,192,248,207,192,124,223,0,
|
||||
15,252,0,3,224,0,3,224,0,15,252,0,60,223,0,248,
|
||||
207,128,240,195,128,64,193,128,1,192,0,1,192,0,1,192,
|
||||
0,1,128,0,17,17,51,20,1,5,0,192,0,1,192,0,
|
||||
1,192,0,1,192,0,1,192,0,1,192,0,1,192,0,1,
|
||||
192,0,255,255,128,255,255,128,1,192,0,1,192,0,1,192,
|
||||
0,1,192,0,1,192,0,1,192,0,1,128,0,7,13,13,
|
||||
11,2,249,8,60,254,254,30,30,30,28,28,56,48,96,64,
|
||||
14,2,4,16,1,11,127,252,255,248,6,6,6,11,3,255,
|
||||
56,124,252,252,248,112,20,46,138,23,1,248,0,0,48,0,
|
||||
0,112,0,0,112,0,0,224,0,0,224,0,0,192,0,1,
|
||||
192,0,1,192,0,3,128,0,3,128,0,3,128,0,7,0,
|
||||
0,7,0,0,14,0,0,14,0,0,14,0,0,28,0,0,
|
||||
28,0,0,24,0,0,56,0,0,56,0,0,112,0,0,112,
|
||||
0,0,96,0,0,224,0,0,224,0,1,192,0,1,192,0,
|
||||
1,192,0,3,128,0,3,128,0,3,0,0,7,0,0,7,
|
||||
0,0,14,0,0,14,0,0,12,0,0,28,0,0,28,0,
|
||||
0,56,0,0,56,0,0,56,0,0,112,0,0,112,0,0,
|
||||
224,0,0,192,0,0,19,29,87,23,2,0,1,248,0,7,
|
||||
252,0,14,30,0,28,15,0,24,7,128,56,7,128,56,3,
|
||||
192,112,3,192,112,3,192,112,3,224,240,1,224,240,1,224,
|
||||
240,1,224,240,1,224,240,1,224,240,1,224,240,1,224,240,
|
||||
1,224,240,1,224,240,1,192,120,1,192,120,3,192,120,3,
|
||||
128,60,3,128,60,3,0,30,7,0,15,14,0,7,252,0,
|
||||
3,240,0,17,29,87,23,3,0,0,96,0,1,224,0,15,
|
||||
224,0,127,224,0,255,224,0,1,224,0,1,224,0,1,224,
|
||||
0,1,224,0,1,224,0,1,224,0,1,224,0,1,224,0,
|
||||
1,224,0,1,224,0,1,224,0,1,224,0,1,224,0,1,
|
||||
224,0,1,224,0,1,224,0,1,224,0,1,224,0,1,224,
|
||||
0,1,224,0,1,224,0,3,240,0,63,254,0,127,255,128,
|
||||
17,29,87,22,2,0,1,248,0,7,254,0,28,31,0,56,
|
||||
15,0,120,15,128,112,7,128,240,7,128,224,7,128,0,7,
|
||||
128,0,7,128,0,15,0,0,15,0,0,30,0,0,30,0,
|
||||
0,60,0,0,120,0,0,240,0,0,240,0,1,224,0,3,
|
||||
192,0,7,128,0,15,0,0,15,0,0,30,0,128,60,0,
|
||||
128,120,0,128,240,1,128,255,255,128,255,255,128,18,29,87,
|
||||
22,1,0,1,248,0,7,254,0,30,31,0,60,15,0,56,
|
||||
7,128,120,7,128,112,7,128,0,7,128,0,7,0,0,15,
|
||||
0,0,30,0,0,60,0,0,248,0,3,254,0,0,63,0,
|
||||
0,15,128,0,7,128,0,3,192,0,3,192,0,3,192,0,
|
||||
3,192,0,3,192,0,3,192,0,7,128,128,7,128,224,15,
|
||||
0,120,62,0,63,252,0,7,224,0,19,29,87,23,1,0,
|
||||
0,3,0,0,15,0,0,31,0,0,63,0,0,127,0,0,
|
||||
127,0,0,239,0,0,207,0,1,207,0,3,143,0,3,143,
|
||||
0,7,15,0,14,15,0,14,15,0,28,15,0,24,15,0,
|
||||
56,15,0,112,15,0,112,15,0,255,255,224,255,255,192,0,
|
||||
15,0,0,15,0,0,15,0,0,15,0,0,15,0,0,15,
|
||||
0,0,63,128,1,255,224,18,29,87,23,2,0,0,0,128,
|
||||
0,1,128,31,255,0,31,254,0,24,0,0,24,0,0,24,
|
||||
0,0,24,0,0,56,0,0,56,0,0,56,0,0,63,240,
|
||||
0,63,252,0,120,63,0,32,15,0,0,7,128,0,7,192,
|
||||
0,3,192,0,3,192,0,3,192,0,3,192,0,3,192,0,
|
||||
3,128,0,7,128,128,7,128,224,15,0,120,62,0,63,252,
|
||||
0,7,240,0,18,29,87,23,3,0,0,7,0,0,63,0,
|
||||
0,248,0,1,224,0,3,192,0,15,0,0,14,0,0,30,
|
||||
0,0,60,0,0,56,0,0,120,0,0,120,248,0,119,254,
|
||||
0,254,31,0,248,15,128,240,7,128,240,7,192,240,3,192,
|
||||
240,3,192,240,3,192,240,3,192,248,3,192,120,3,128,120,
|
||||
3,128,60,7,128,60,7,0,31,14,0,15,252,0,3,240,
|
||||
0,19,27,81,23,2,0,127,255,192,127,255,224,96,1,192,
|
||||
64,3,192,192,3,128,0,3,128,0,7,0,0,7,0,0,
|
||||
14,0,0,14,0,0,28,0,0,28,0,0,56,0,0,56,
|
||||
0,0,56,0,0,112,0,0,112,0,0,224,0,0,224,0,
|
||||
1,192,0,1,192,0,3,192,0,7,128,0,7,128,0,15,
|
||||
0,0,15,0,0,28,0,0,18,29,87,22,2,0,3,248,
|
||||
0,15,254,0,28,31,0,56,15,0,48,7,128,112,7,128,
|
||||
112,7,128,112,7,128,112,7,0,120,15,0,62,30,0,31,
|
||||
188,0,15,240,0,3,252,0,7,254,0,30,63,0,60,15,
|
||||
128,120,7,192,112,7,192,240,3,192,240,3,192,240,3,192,
|
||||
240,3,192,240,3,128,120,7,128,124,7,0,62,14,0,31,
|
||||
252,0,7,224,0,19,30,90,23,2,255,1,248,0,7,254,
|
||||
0,14,31,0,28,15,128,56,7,128,120,3,192,112,3,192,
|
||||
240,3,224,240,1,224,240,1,224,240,1,224,240,1,224,248,
|
||||
1,224,120,3,224,124,7,224,62,13,224,31,249,224,7,225,
|
||||
192,0,3,192,0,3,192,0,7,128,0,7,128,0,15,0,
|
||||
0,30,0,0,60,0,0,120,0,0,240,0,3,224,0,31,
|
||||
128,0,56,0,0,6,23,23,11,3,255,56,124,252,252,248,
|
||||
112,0,0,0,0,0,0,0,0,0,0,0,56,124,252,252,
|
||||
248,112,7,29,29,11,2,249,28,62,126,126,124,56,0,0,
|
||||
0,0,0,0,0,0,0,0,8,60,254,254,30,30,30,28,
|
||||
28,56,48,96,64,19,15,45,21,1,6,0,0,96,0,3,
|
||||
192,0,31,192,0,127,0,3,252,0,31,224,0,127,0,0,
|
||||
124,0,0,254,0,0,63,192,0,7,240,0,1,254,0,0,
|
||||
63,192,0,7,224,0,1,128,19,9,27,21,1,9,127,255,
|
||||
224,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,127,255,224,255,255,192,19,15,45,21,1,6,48,
|
||||
0,0,252,0,0,127,128,0,15,240,0,3,254,0,0,127,
|
||||
128,0,15,224,0,3,192,0,31,192,0,255,0,3,248,0,
|
||||
31,192,0,127,0,0,120,0,0,192,0,0,17,36,108,21,
|
||||
2,255,3,248,0,15,254,0,60,63,0,120,15,0,120,15,
|
||||
128,240,7,128,240,7,128,240,7,128,224,7,128,0,7,128,
|
||||
0,15,0,0,15,0,0,30,0,0,30,0,0,60,0,0,
|
||||
120,0,0,112,0,0,224,0,1,224,0,1,192,0,3,192,
|
||||
0,3,128,0,3,128,0,3,128,0,3,128,0,3,128,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,1,192,0,3,
|
||||
224,0,7,224,0,7,224,0,7,192,0,3,128,0,36,39,
|
||||
195,39,1,248,0,0,255,128,0,0,7,255,224,0,0,31,
|
||||
1,248,0,0,120,0,62,0,0,224,0,31,0,1,192,0,
|
||||
15,0,7,128,0,7,128,7,0,0,3,192,14,0,0,1,
|
||||
192,28,0,124,33,224,28,1,255,96,224,56,3,135,224,224,
|
||||
56,7,3,224,224,120,14,1,224,240,112,14,1,224,112,112,
|
||||
30,1,224,112,240,28,1,224,112,240,60,1,224,112,240,60,
|
||||
1,224,112,240,60,1,224,112,240,60,1,224,112,240,60,1,
|
||||
224,112,240,60,1,224,96,248,60,1,224,224,248,62,1,224,
|
||||
192,120,30,1,224,192,120,31,3,225,128,124,15,5,225,0,
|
||||
60,15,141,242,0,62,7,248,252,0,31,1,224,112,0,31,
|
||||
0,0,0,0,15,128,0,0,0,7,192,0,1,0,3,240,
|
||||
0,3,128,1,248,0,14,0,0,127,0,252,0,0,31,255,
|
||||
240,0,0,3,255,0,0,28,30,120,29,0,0,0,2,0,
|
||||
0,0,7,0,0,0,7,0,0,0,15,0,0,0,15,128,
|
||||
0,0,31,128,0,0,27,192,0,0,27,192,0,0,59,192,
|
||||
0,0,49,224,0,0,49,224,0,0,113,224,0,0,96,240,
|
||||
0,0,96,240,0,0,224,120,0,0,192,120,0,0,192,120,
|
||||
0,1,192,60,0,1,255,252,0,1,255,252,0,3,128,30,
|
||||
0,3,0,30,0,7,0,31,0,7,0,15,0,6,0,15,
|
||||
0,14,0,15,128,14,0,7,128,12,0,7,128,62,0,7,
|
||||
192,255,192,63,240,24,30,90,27,0,0,7,254,0,255,255,
|
||||
192,111,7,224,15,1,240,15,0,248,15,0,120,15,0,120,
|
||||
15,0,120,15,0,120,15,0,112,15,0,240,15,1,224,15,
|
||||
7,192,15,255,192,15,255,240,15,1,248,15,0,124,15,0,
|
||||
62,15,0,30,15,0,31,15,0,15,15,0,15,15,0,15,
|
||||
15,0,15,15,0,14,15,0,30,15,0,60,15,0,248,63,
|
||||
255,240,127,255,128,23,30,90,26,1,0,0,31,224,0,255,
|
||||
252,1,192,252,7,128,56,14,0,16,14,0,0,28,0,0,
|
||||
56,0,0,56,0,0,120,0,0,112,0,0,112,0,0,240,
|
||||
0,0,240,0,0,240,0,0,240,0,0,240,0,0,240,0,
|
||||
0,240,0,0,240,0,0,120,0,0,120,0,0,124,0,0,
|
||||
60,0,0,30,0,4,31,0,14,15,128,56,7,224,240,1,
|
||||
255,192,0,127,0,25,30,120,28,1,0,7,254,0,0,255,
|
||||
255,192,0,111,3,240,0,15,0,248,0,15,0,124,0,15,
|
||||
0,62,0,15,0,30,0,15,0,31,0,15,0,15,0,15,
|
||||
0,15,0,15,0,15,128,15,0,7,128,15,0,7,128,15,
|
||||
0,7,128,15,0,7,128,15,0,7,128,15,0,7,128,15,
|
||||
0,7,128,15,0,7,128,15,0,7,0,15,0,15,0,15,
|
||||
0,15,0,15,0,30,0,15,0,30,0,15,0,60,0,15,
|
||||
0,124,0,15,0,248,0,15,3,224,0,63,255,192,0,127,
|
||||
254,0,0,21,30,90,24,1,0,255,255,224,127,255,240,30,
|
||||
0,96,30,0,96,30,0,96,30,0,96,30,0,0,30,0,
|
||||
0,30,0,0,30,0,0,30,0,0,30,0,0,30,0,0,
|
||||
31,255,128,31,255,128,30,3,0,30,0,0,30,0,0,30,
|
||||
0,0,30,0,0,30,0,0,30,0,0,30,0,0,30,0,
|
||||
0,30,0,8,30,0,24,30,0,24,31,0,56,127,255,240,
|
||||
255,255,240,20,30,90,23,1,0,255,255,240,127,255,240,30,
|
||||
0,96,30,0,96,30,0,32,30,0,32,30,0,0,30,0,
|
||||
0,30,0,0,30,0,0,30,0,0,30,0,0,30,0,0,
|
||||
31,255,0,31,255,0,30,6,0,30,0,0,30,0,0,30,
|
||||
0,0,30,0,0,30,0,0,30,0,0,30,0,0,30,0,
|
||||
0,30,0,0,30,0,0,30,0,0,30,0,0,127,128,0,
|
||||
255,224,0,24,30,90,28,2,0,0,31,224,0,255,248,1,
|
||||
192,252,7,128,56,15,0,16,30,0,0,28,0,0,56,0,
|
||||
0,56,0,0,120,0,0,112,0,0,240,0,0,240,0,0,
|
||||
240,0,0,240,0,0,240,0,0,240,7,255,240,0,254,240,
|
||||
0,60,240,0,60,248,0,60,120,0,60,120,0,60,60,0,
|
||||
60,62,0,60,30,0,60,15,0,60,7,192,248,3,255,224,
|
||||
0,127,0,27,30,120,31,2,0,255,192,127,224,127,128,63,
|
||||
192,30,0,15,0,30,0,15,0,30,0,15,0,30,0,15,
|
||||
0,30,0,15,0,30,0,15,0,30,0,15,0,30,0,15,
|
||||
0,30,0,15,0,30,0,15,0,30,0,15,0,30,0,15,
|
||||
0,31,255,255,0,31,255,255,0,30,0,15,0,30,0,15,
|
||||
0,30,0,15,0,30,0,15,0,30,0,15,0,30,0,15,
|
||||
0,30,0,15,0,30,0,15,0,30,0,15,0,30,0,15,
|
||||
0,30,0,15,0,30,0,15,0,127,0,31,192,255,192,127,
|
||||
224,10,30,60,14,2,0,255,192,127,128,30,0,30,0,30,
|
||||
0,30,0,30,0,30,0,30,0,30,0,30,0,30,0,30,
|
||||
0,30,0,30,0,30,0,30,0,30,0,30,0,30,0,30,
|
||||
0,30,0,30,0,30,0,30,0,30,0,30,0,30,0,127,
|
||||
128,255,192,17,38,114,15,252,248,7,255,128,0,255,0,0,
|
||||
60,0,0,60,0,0,60,0,0,60,0,0,60,0,0,60,
|
||||
0,0,60,0,0,60,0,0,60,0,0,60,0,0,60,0,
|
||||
0,60,0,0,60,0,0,60,0,0,60,0,0,60,0,0,
|
||||
60,0,0,60,0,0,60,0,0,60,0,0,60,0,0,60,
|
||||
0,0,60,0,0,60,0,0,60,0,0,60,0,0,60,0,
|
||||
0,56,0,0,56,0,0,56,0,0,112,0,0,112,0,0,
|
||||
224,0,112,192,0,255,0,0,124,0,0,26,30,120,28,1,
|
||||
0,255,193,255,128,127,128,124,0,30,0,120,0,30,0,240,
|
||||
0,30,1,224,0,30,1,192,0,30,3,128,0,30,7,0,
|
||||
0,30,14,0,0,30,28,0,0,30,56,0,0,30,112,0,
|
||||
0,30,112,0,0,30,224,0,0,31,224,0,0,30,240,0,
|
||||
0,30,120,0,0,30,124,0,0,30,62,0,0,30,30,0,
|
||||
0,30,15,0,0,30,7,128,0,30,7,192,0,30,3,224,
|
||||
0,30,1,240,0,30,0,248,0,30,0,124,0,30,0,126,
|
||||
0,127,128,63,192,255,192,31,0,21,30,90,23,1,0,255,
|
||||
192,0,127,128,0,30,0,0,30,0,0,30,0,0,30,0,
|
||||
0,30,0,0,30,0,0,30,0,0,30,0,0,30,0,0,
|
||||
30,0,0,30,0,0,30,0,0,30,0,0,30,0,0,30,
|
||||
0,0,30,0,0,30,0,0,30,0,0,30,0,0,30,0,
|
||||
0,30,0,0,30,0,0,30,0,8,30,0,24,30,0,24,
|
||||
31,0,48,127,255,240,255,255,240,36,30,150,39,1,0,127,
|
||||
0,0,15,224,31,128,0,31,128,15,128,0,31,0,15,192,
|
||||
0,31,0,15,192,0,63,0,15,192,0,63,0,15,224,0,
|
||||
127,0,14,224,0,127,0,14,240,0,111,0,14,240,0,239,
|
||||
0,14,120,0,207,0,14,120,1,207,0,14,60,1,143,0,
|
||||
14,60,3,143,0,14,28,3,143,0,12,30,3,15,0,12,
|
||||
30,7,15,128,12,15,6,7,128,12,15,14,7,128,12,7,
|
||||
140,7,128,12,7,156,7,128,12,3,220,7,128,12,3,216,
|
||||
7,128,12,3,248,7,128,12,1,240,7,128,12,1,240,7,
|
||||
128,12,0,224,7,128,12,0,224,7,128,63,0,224,31,192,
|
||||
255,192,64,127,240,27,30,120,31,2,0,252,0,63,224,124,
|
||||
0,15,128,30,0,7,0,31,0,7,0,31,0,7,0,31,
|
||||
128,7,0,31,192,7,0,29,224,7,0,28,224,7,0,28,
|
||||
240,7,0,28,120,7,0,28,56,7,0,28,60,7,0,28,
|
||||
30,7,0,28,14,7,0,28,15,7,0,28,7,135,0,28,
|
||||
7,199,0,28,3,199,0,28,1,231,0,28,1,247,0,28,
|
||||
0,247,0,28,0,127,0,28,0,127,0,28,0,63,0,28,
|
||||
0,31,0,28,0,31,0,28,0,15,0,62,0,7,0,255,
|
||||
128,3,0,25,30,120,29,2,0,0,63,0,0,0,255,224,
|
||||
0,3,193,240,0,7,0,248,0,14,0,124,0,28,0,62,
|
||||
0,60,0,30,0,56,0,31,0,120,0,15,0,120,0,15,
|
||||
0,112,0,15,128,240,0,7,128,240,0,7,128,240,0,7,
|
||||
128,240,0,7,128,240,0,7,128,240,0,7,128,240,0,7,
|
||||
128,240,0,7,128,248,0,7,0,120,0,15,0,120,0,15,
|
||||
0,124,0,14,0,60,0,28,0,62,0,28,0,31,0,56,
|
||||
0,15,128,112,0,7,193,224,0,3,255,128,0,0,254,0,
|
||||
0,22,30,90,25,1,0,7,254,0,255,255,192,111,7,224,
|
||||
15,1,240,15,0,248,15,0,124,15,0,60,15,0,60,15,
|
||||
0,60,15,0,60,15,0,60,15,0,60,15,0,120,15,0,
|
||||
120,15,0,240,15,131,224,15,127,192,15,62,0,15,0,0,
|
||||
15,0,0,15,0,0,15,0,0,15,0,0,15,0,0,15,
|
||||
0,0,15,0,0,15,0,0,15,0,0,63,192,0,127,240,
|
||||
0,28,37,148,29,2,249,0,63,0,0,0,255,224,0,3,
|
||||
193,240,0,7,0,248,0,14,0,124,0,28,0,62,0,60,
|
||||
0,30,0,56,0,31,0,120,0,15,0,120,0,15,0,112,
|
||||
0,15,128,240,0,7,128,240,0,7,128,240,0,7,128,240,
|
||||
0,7,128,240,0,7,128,240,0,7,128,240,0,7,128,240,
|
||||
0,7,128,248,0,7,0,120,0,15,0,120,0,15,0,124,
|
||||
0,14,0,60,0,30,0,62,0,28,0,31,0,56,0,15,
|
||||
128,112,0,7,193,224,0,3,255,192,0,0,127,128,0,0,
|
||||
3,192,0,0,1,224,0,0,0,248,16,0,0,124,48,0,
|
||||
0,31,224,0,0,15,224,0,0,3,128,26,30,120,27,1,
|
||||
0,7,254,0,0,255,255,192,0,111,7,224,0,15,1,240,
|
||||
0,15,0,240,0,15,0,120,0,15,0,120,0,15,0,120,
|
||||
0,15,0,120,0,15,0,120,0,15,0,112,0,15,0,240,
|
||||
0,15,1,224,0,15,3,192,0,15,255,0,0,15,254,0,
|
||||
0,15,14,0,0,15,7,0,0,15,7,128,0,15,3,128,
|
||||
0,15,3,192,0,15,1,224,0,15,1,224,0,15,0,240,
|
||||
0,15,0,248,0,15,0,120,0,15,0,124,0,15,0,62,
|
||||
0,63,192,63,192,127,224,31,0,18,30,90,23,3,0,3,
|
||||
248,0,31,254,0,60,63,0,120,14,0,112,4,0,240,0,
|
||||
0,240,0,0,240,0,0,248,0,0,252,0,0,127,0,0,
|
||||
127,192,0,63,240,0,31,248,0,7,254,0,1,255,0,0,
|
||||
127,128,0,31,128,0,15,192,0,7,192,0,3,192,0,3,
|
||||
192,0,3,192,128,3,128,192,3,128,224,7,0,240,15,0,
|
||||
252,62,0,255,248,0,15,224,0,26,30,120,26,0,0,127,
|
||||
255,255,192,127,255,255,192,96,30,1,128,192,30,1,128,192,
|
||||
30,1,128,128,30,0,128,0,30,0,0,0,30,0,0,0,
|
||||
30,0,0,0,30,0,0,0,30,0,0,0,30,0,0,0,
|
||||
30,0,0,0,30,0,0,0,30,0,0,0,30,0,0,0,
|
||||
30,0,0,0,30,0,0,0,30,0,0,0,30,0,0,0,
|
||||
30,0,0,0,30,0,0,0,30,0,0,0,30,0,0,0,
|
||||
30,0,0,0,30,0,0,0,30,0,0,0,30,0,0,0,
|
||||
127,128,0,1,255,224,0,27,30,120,31,2,0,255,192,127,
|
||||
224,127,128,63,192,30,0,15,0,30,0,15,0,30,0,15,
|
||||
0,30,0,15,0,30,0,15,0,30,0,15,0,30,0,15,
|
||||
0,30,0,15,0,30,0,15,0,30,0,15,0,30,0,15,
|
||||
0,30,0,15,0,30,0,15,0,30,0,15,0,30,0,15,
|
||||
0,30,0,15,0,30,0,15,0,30,0,15,0,30,0,15,
|
||||
0,30,0,15,0,30,0,30,0,15,0,30,0,15,0,30,
|
||||
0,7,128,60,0,7,192,120,0,3,224,240,0,1,255,224,
|
||||
0,0,63,128,0,30,30,120,31,0,0,255,224,15,252,31,
|
||||
0,1,240,15,0,0,224,15,0,0,192,7,0,1,192,7,
|
||||
128,1,192,7,128,1,128,3,192,3,128,3,192,3,0,3,
|
||||
192,3,0,1,224,7,0,1,224,6,0,0,240,14,0,0,
|
||||
240,14,0,0,240,12,0,0,120,28,0,0,120,24,0,0,
|
||||
124,24,0,0,60,56,0,0,60,48,0,0,30,112,0,0,
|
||||
30,112,0,0,30,96,0,0,15,224,0,0,15,224,0,0,
|
||||
15,192,0,0,7,192,0,0,7,128,0,0,3,128,0,0,
|
||||
3,0,0,40,30,150,41,0,0,255,224,8,3,255,63,0,
|
||||
24,0,252,14,0,28,0,48,15,0,28,0,112,15,0,62,
|
||||
0,112,15,0,62,0,112,7,0,62,0,96,7,0,127,0,
|
||||
224,7,128,127,0,224,7,128,111,0,224,7,128,231,128,224,
|
||||
3,128,231,128,192,3,192,195,129,192,3,193,195,193,192,3,
|
||||
193,195,193,192,1,193,129,225,192,1,195,129,225,128,1,227,
|
||||
129,227,128,1,227,0,243,128,1,231,0,243,128,0,231,0,
|
||||
243,128,0,246,0,123,0,0,254,0,127,0,0,254,0,127,
|
||||
0,0,124,0,63,0,0,124,0,62,0,0,124,0,62,0,
|
||||
0,120,0,30,0,0,120,0,30,0,0,48,0,8,0,28,
|
||||
30,120,30,1,0,255,224,255,224,255,224,255,224,63,0,31,
|
||||
0,31,0,30,0,15,128,28,0,7,128,56,0,3,192,120,
|
||||
0,3,224,112,0,1,224,224,0,0,241,224,0,0,249,192,
|
||||
0,0,127,128,0,0,63,128,0,0,31,0,0,0,31,0,
|
||||
0,0,31,0,0,0,63,128,0,0,63,192,0,0,115,224,
|
||||
0,0,241,224,0,0,224,240,0,1,192,248,0,3,192,120,
|
||||
0,3,128,60,0,7,0,62,0,15,0,31,0,14,0,15,
|
||||
0,62,0,15,192,255,192,127,240,255,192,127,240,28,30,120,
|
||||
29,0,0,252,0,63,240,254,0,63,240,31,0,15,128,15,
|
||||
0,7,0,15,128,14,0,7,192,14,0,3,192,28,0,3,
|
||||
224,60,0,1,224,56,0,0,240,112,0,0,248,112,0,0,
|
||||
120,224,0,0,125,224,0,0,61,192,0,0,63,192,0,0,
|
||||
31,128,0,0,31,0,0,0,15,0,0,0,15,0,0,0,
|
||||
15,0,0,0,15,0,0,0,15,0,0,0,15,0,0,0,
|
||||
15,0,0,0,15,0,0,0,15,0,0,0,15,0,0,0,
|
||||
15,0,0,0,63,192,0,0,255,240,0,22,30,90,25,1,
|
||||
0,31,255,252,63,255,252,56,0,120,48,0,248,48,0,240,
|
||||
32,1,224,32,1,224,0,3,192,0,7,128,0,7,128,0,
|
||||
15,0,0,31,0,0,30,0,0,60,0,0,60,0,0,120,
|
||||
0,0,248,0,0,240,0,1,224,0,3,224,0,3,192,0,
|
||||
7,128,0,15,128,0,15,0,4,31,0,12,30,0,12,60,
|
||||
0,12,124,0,28,127,255,252,255,255,252,11,45,90,15,3,
|
||||
248,255,224,255,224,240,0,240,0,240,0,240,0,240,0,240,
|
||||
0,240,0,240,0,240,0,240,0,240,0,240,0,240,0,240,
|
||||
0,240,0,240,0,240,0,240,0,240,0,240,0,240,0,240,
|
||||
0,240,0,240,0,240,0,240,0,240,0,240,0,240,0,240,
|
||||
0,240,0,240,0,240,0,240,0,240,0,240,0,240,0,240,
|
||||
0,240,0,240,0,240,0,255,224,255,224,21,46,138,23,1,
|
||||
248,224,0,0,240,0,0,240,0,0,120,0,0,120,0,0,
|
||||
56,0,0,60,0,0,60,0,0,30,0,0,30,0,0,30,
|
||||
0,0,15,0,0,15,0,0,7,128,0,7,128,0,7,128,
|
||||
0,3,192,0,3,192,0,1,224,0,1,224,0,1,224,0,
|
||||
0,240,0,0,240,0,0,240,0,0,120,0,0,120,0,0,
|
||||
60,0,0,60,0,0,60,0,0,30,0,0,30,0,0,15,
|
||||
0,0,15,0,0,15,0,0,7,128,0,7,128,0,3,128,
|
||||
0,3,192,0,3,192,0,1,224,0,1,224,0,1,224,0,
|
||||
0,240,0,0,240,0,0,120,0,0,48,11,45,90,15,1,
|
||||
248,255,224,255,224,1,224,1,224,1,224,1,224,1,224,1,
|
||||
224,1,224,1,224,1,224,1,224,1,224,1,224,1,224,1,
|
||||
224,1,224,1,224,1,224,1,224,1,224,1,224,1,224,1,
|
||||
224,1,224,1,224,1,224,1,224,1,224,1,224,1,224,1,
|
||||
224,1,224,1,224,1,224,1,224,1,224,1,224,1,224,1,
|
||||
224,1,224,1,224,1,224,255,224,255,224,19,23,69,24,2,
|
||||
13,0,32,0,0,112,0,0,240,0,0,240,0,1,248,0,
|
||||
1,248,0,3,188,0,3,188,0,3,60,0,7,30,0,6,
|
||||
30,0,6,15,0,14,15,0,12,15,0,28,7,128,24,7,
|
||||
128,24,3,192,56,3,192,48,3,192,112,1,224,112,1,224,
|
||||
96,0,224,192,0,192,20,2,6,23,1,251,127,255,240,255,
|
||||
255,240,9,10,20,15,1,25,240,0,248,0,120,0,60,0,
|
||||
28,0,14,0,7,0,3,0,3,128,1,128,20,22,66,22,
|
||||
2,0,1,248,0,15,254,0,28,30,0,120,15,0,112,15,
|
||||
0,240,15,0,128,15,0,0,15,0,0,15,0,0,255,0,
|
||||
7,255,0,31,143,0,62,15,0,120,15,0,248,15,0,240,
|
||||
15,0,240,15,0,240,31,0,240,63,0,120,239,32,127,143,
|
||||
240,30,7,128,22,36,108,24,0,0,6,0,0,126,0,0,
|
||||
254,0,0,30,0,0,30,0,0,30,0,0,30,0,0,30,
|
||||
0,0,30,0,0,30,0,0,30,0,0,30,0,0,30,0,
|
||||
0,28,0,0,28,15,128,28,63,224,28,127,240,28,227,240,
|
||||
29,192,248,31,128,248,31,0,124,30,0,124,30,0,60,30,
|
||||
0,60,30,0,60,30,0,60,30,0,60,30,0,60,30,0,
|
||||
56,30,0,56,30,0,112,30,0,96,31,0,224,15,193,192,
|
||||
3,255,0,0,252,0,18,22,66,21,2,0,0,127,0,3,
|
||||
255,192,7,7,192,14,1,128,28,0,128,56,0,0,120,0,
|
||||
0,112,0,0,240,0,0,240,0,0,240,0,0,240,0,0,
|
||||
240,0,0,240,0,0,248,0,0,120,0,0,120,0,0,60,
|
||||
0,64,62,1,192,31,131,128,7,254,0,1,248,0,23,36,
|
||||
108,25,2,0,0,0,224,0,15,224,0,15,224,0,1,224,
|
||||
0,1,224,0,1,224,0,1,224,0,1,224,0,1,224,0,
|
||||
1,224,0,1,224,0,1,224,0,1,224,0,1,224,0,253,
|
||||
224,3,255,224,15,15,224,28,3,224,60,1,224,56,1,224,
|
||||
120,1,224,112,1,224,240,1,224,240,1,224,240,1,224,240,
|
||||
1,224,240,1,224,240,1,224,240,1,224,120,1,224,120,1,
|
||||
224,124,3,224,62,5,228,31,25,254,15,240,248,7,192,224,
|
||||
18,22,66,22,2,0,0,248,0,7,254,0,14,15,0,28,
|
||||
7,128,56,7,128,56,3,192,112,3,192,112,3,192,255,255,
|
||||
192,255,255,128,240,0,0,240,0,0,240,0,0,240,0,0,
|
||||
248,0,0,120,0,0,120,0,0,124,0,192,62,1,128,31,
|
||||
7,0,15,254,0,3,248,0,19,36,108,15,0,0,0,15,
|
||||
128,0,63,224,0,99,192,1,193,128,3,128,0,3,128,0,
|
||||
7,128,0,7,0,0,15,0,0,15,0,0,15,0,0,15,
|
||||
0,0,15,0,0,15,0,0,63,254,0,255,252,0,15,8,
|
||||
0,15,0,0,15,0,0,15,0,0,15,0,0,15,0,0,
|
||||
15,0,0,15,0,0,15,0,0,15,0,0,15,0,0,15,
|
||||
0,0,15,0,0,15,0,0,15,0,0,15,0,0,15,0,
|
||||
0,15,0,0,31,224,0,127,248,0,24,33,99,24,0,245,
|
||||
0,252,2,3,255,126,7,7,252,14,3,224,30,1,224,28,
|
||||
1,240,60,0,240,60,0,240,60,0,240,60,0,240,62,0,
|
||||
224,31,1,192,15,131,128,7,255,0,1,252,0,3,192,0,
|
||||
7,128,0,15,128,0,15,224,0,7,255,128,3,255,240,7,
|
||||
191,252,14,0,254,60,0,31,120,0,15,240,0,15,240,0,
|
||||
15,240,0,14,248,0,28,124,0,56,63,128,240,15,255,192,
|
||||
1,254,0,23,36,108,26,2,0,6,0,0,126,0,0,254,
|
||||
0,0,62,0,0,30,0,0,30,0,0,30,0,0,30,0,
|
||||
0,30,0,0,30,0,0,30,0,0,30,0,0,30,0,0,
|
||||
30,0,0,30,7,128,28,31,224,28,49,224,28,96,240,28,
|
||||
192,240,29,128,240,31,0,240,31,0,240,30,0,240,30,0,
|
||||
240,30,0,240,30,0,240,30,0,240,30,0,240,30,0,240,
|
||||
30,0,240,30,0,240,30,0,240,30,0,240,30,0,240,127,
|
||||
131,248,255,199,254,10,32,64,13,2,0,28,0,30,0,62,
|
||||
0,62,0,28,0,0,0,0,0,0,0,0,0,0,0,6,
|
||||
0,126,0,254,0,62,0,30,0,30,0,30,0,30,0,30,
|
||||
0,30,0,30,0,30,0,30,0,30,0,30,0,30,0,30,
|
||||
0,30,0,30,0,30,0,63,0,255,192,14,43,86,12,251,
|
||||
245,0,56,0,60,0,124,0,124,0,56,0,0,0,0,0,
|
||||
0,0,0,0,0,0,12,0,252,1,252,0,124,0,60,0,
|
||||
60,0,60,0,60,0,60,0,60,0,60,0,60,0,60,0,
|
||||
60,0,60,0,60,0,60,0,60,0,60,0,60,0,60,0,
|
||||
60,0,60,0,60,0,56,0,56,0,120,0,112,0,112,48,
|
||||
224,127,128,255,0,124,0,23,36,108,24,1,0,6,0,0,
|
||||
126,0,0,254,0,0,62,0,0,30,0,0,30,0,0,30,
|
||||
0,0,30,0,0,30,0,0,30,0,0,30,0,0,30,0,
|
||||
0,30,0,0,30,0,0,30,7,252,30,1,240,30,1,192,
|
||||
30,3,128,30,7,0,30,14,0,30,56,0,30,112,0,30,
|
||||
224,0,31,224,0,31,240,0,30,248,0,30,124,0,30,60,
|
||||
0,30,30,0,30,15,0,30,15,128,30,7,192,30,3,224,
|
||||
30,1,224,63,0,254,255,192,124,12,36,72,13,1,0,3,
|
||||
0,63,0,127,0,31,0,15,0,15,0,15,0,15,0,15,
|
||||
0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,
|
||||
0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,
|
||||
0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,
|
||||
0,15,0,31,128,255,240,36,22,110,39,2,0,12,7,192,
|
||||
124,0,254,31,224,255,0,62,49,227,143,0,30,96,247,7,
|
||||
128,30,192,254,7,128,31,128,252,7,128,31,0,248,7,128,
|
||||
31,0,248,7,128,30,0,240,7,128,30,0,240,7,128,30,
|
||||
0,240,7,128,30,0,240,7,128,30,0,240,7,128,30,0,
|
||||
240,7,128,30,0,240,7,128,30,0,240,7,128,30,0,240,
|
||||
7,128,30,0,240,7,128,30,0,240,7,128,30,0,240,7,
|
||||
128,127,131,252,31,192,255,199,254,63,240,23,22,66,26,2,
|
||||
0,12,7,192,254,15,224,62,49,224,30,96,240,30,192,240,
|
||||
30,128,240,31,0,240,31,0,240,30,0,240,30,0,240,30,
|
||||
0,240,30,0,240,30,0,240,30,0,240,30,0,240,30,0,
|
||||
240,30,0,240,30,0,240,30,0,240,30,0,240,127,131,248,
|
||||
255,199,254,20,22,66,24,2,0,0,252,0,7,255,0,14,
|
||||
15,128,28,7,192,56,3,192,56,3,224,112,1,224,112,1,
|
||||
240,240,0,240,240,0,240,240,0,240,240,0,240,240,0,240,
|
||||
240,0,240,248,0,224,120,1,224,124,1,192,60,1,192,62,
|
||||
3,128,31,7,0,15,254,0,3,240,0,21,33,99,25,2,
|
||||
245,12,7,128,254,31,192,62,35,224,30,65,240,30,129,240,
|
||||
31,0,240,31,0,248,30,0,248,30,0,120,30,0,120,30,
|
||||
0,120,30,0,120,30,0,120,30,0,120,30,0,112,30,0,
|
||||
112,30,0,224,30,0,224,31,1,192,31,195,128,30,255,0,
|
||||
30,62,0,30,0,0,30,0,0,30,0,0,30,0,0,30,
|
||||
0,0,30,0,0,30,0,0,30,0,0,30,0,0,127,0,
|
||||
0,255,224,0,22,33,99,25,2,245,0,252,48,3,255,96,
|
||||
7,15,224,30,3,224,28,1,224,56,1,224,120,1,224,112,
|
||||
1,224,240,1,224,240,1,224,240,1,224,240,1,224,240,1,
|
||||
224,240,1,224,240,1,224,120,1,224,120,1,224,124,3,224,
|
||||
62,6,224,31,28,224,15,248,224,3,225,224,0,1,224,0,
|
||||
1,224,0,1,224,0,1,224,0,1,224,0,1,224,0,1,
|
||||
224,0,1,224,0,1,224,0,3,240,0,31,252,17,22,66,
|
||||
19,1,0,4,15,0,126,63,128,254,127,128,30,227,128,30,
|
||||
195,128,31,129,0,31,128,0,31,0,0,31,0,0,30,0,
|
||||
0,30,0,0,30,0,0,30,0,0,30,0,0,30,0,0,
|
||||
30,0,0,30,0,0,30,0,0,30,0,0,30,0,0,63,
|
||||
128,0,255,224,0,15,22,44,19,2,0,15,192,63,248,120,
|
||||
120,240,56,240,16,240,0,248,0,252,0,127,0,63,192,31,
|
||||
240,7,248,1,252,0,126,0,62,128,30,128,30,192,30,224,
|
||||
60,240,120,255,240,31,192,16,30,60,17,0,0,3,0,7,
|
||||
0,15,0,15,0,15,0,15,0,15,0,15,0,63,255,255,
|
||||
255,15,4,15,0,15,0,15,0,15,0,15,0,15,0,15,
|
||||
0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,
|
||||
0,15,1,7,135,7,254,3,240,24,22,66,25,1,0,6,
|
||||
0,112,254,7,240,126,7,240,30,0,240,30,0,240,30,0,
|
||||
240,30,0,240,30,0,240,30,0,240,30,0,240,30,0,240,
|
||||
30,0,240,30,0,240,30,0,240,30,0,240,30,0,240,30,
|
||||
0,240,30,1,240,31,2,240,15,12,255,15,248,252,3,224,
|
||||
112,23,22,66,24,0,0,255,192,254,62,0,60,30,0,56,
|
||||
30,0,48,15,0,112,15,0,112,7,0,96,7,128,224,7,
|
||||
128,192,3,192,192,3,193,192,1,193,128,1,227,128,1,227,
|
||||
0,0,243,0,0,247,0,0,118,0,0,126,0,0,126,0,
|
||||
0,60,0,0,60,0,0,16,0,33,22,110,34,0,0,255,
|
||||
192,96,63,128,62,0,224,15,0,30,0,224,6,0,30,0,
|
||||
240,14,0,14,1,240,12,0,15,1,240,12,0,15,1,248,
|
||||
12,0,7,3,248,24,0,7,3,56,24,0,7,131,60,24,
|
||||
0,3,135,60,56,0,3,134,30,48,0,3,198,30,48,0,
|
||||
1,204,14,112,0,1,204,15,96,0,1,252,15,96,0,1,
|
||||
248,7,96,0,0,248,7,192,0,0,248,7,192,0,0,240,
|
||||
3,192,0,0,112,3,192,0,0,96,3,0,0,24,22,66,
|
||||
24,0,0,127,227,254,127,227,254,31,128,248,15,128,224,7,
|
||||
128,192,3,193,192,1,227,128,0,247,0,0,254,0,0,124,
|
||||
0,0,60,0,0,62,0,0,127,0,0,239,0,1,199,128,
|
||||
3,131,192,3,1,224,7,0,240,14,0,248,62,0,252,255,
|
||||
131,255,255,131,255,24,33,99,24,255,245,127,224,255,31,0,
|
||||
62,15,0,28,15,0,24,7,128,24,7,128,56,3,128,48,
|
||||
3,192,112,3,192,96,1,224,96,1,224,224,0,224,192,0,
|
||||
241,192,0,241,192,0,121,128,0,123,128,0,59,0,0,63,
|
||||
0,0,63,0,0,30,0,0,30,0,0,12,0,0,12,0,
|
||||
0,28,0,0,24,0,0,56,0,0,112,0,0,112,0,0,
|
||||
224,0,63,192,0,127,128,0,255,0,0,124,0,0,17,22,
|
||||
66,21,2,0,127,255,128,127,255,128,96,15,0,96,15,0,
|
||||
64,30,0,64,60,0,0,60,0,0,120,0,0,240,0,0,
|
||||
240,0,1,224,0,3,192,0,3,192,0,7,128,0,15,0,
|
||||
0,14,0,0,30,0,128,60,0,128,120,0,128,120,1,128,
|
||||
255,255,128,255,255,128,13,45,90,16,2,249,0,8,0,56,
|
||||
0,112,1,224,1,192,3,128,3,128,7,128,7,128,7,128,
|
||||
7,128,7,128,7,192,3,192,3,192,3,192,3,192,3,192,
|
||||
3,128,7,128,7,0,30,0,126,0,255,0,7,128,3,192,
|
||||
3,192,3,192,3,192,3,192,3,192,3,192,7,192,7,128,
|
||||
7,128,7,128,7,128,7,128,7,128,3,128,3,192,1,192,
|
||||
0,224,0,120,0,24,4,49,49,11,4,246,112,240,240,240,
|
||||
240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,
|
||||
240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,
|
||||
240,240,240,240,240,240,240,240,240,240,240,240,224,13,45,90,
|
||||
16,1,249,192,0,240,0,56,0,28,0,30,0,14,0,15,
|
||||
0,15,0,15,0,15,0,15,0,15,0,31,0,30,0,30,
|
||||
0,30,0,30,0,30,0,30,0,30,0,15,0,7,240,3,
|
||||
248,3,192,7,0,15,0,14,0,30,0,30,0,30,0,30,
|
||||
0,30,0,31,0,15,0,15,0,15,0,15,0,15,0,14,
|
||||
0,30,0,28,0,56,0,112,0,224,0,128,0,21,8,24,
|
||||
23,1,11,7,128,8,15,224,24,31,240,16,63,252,48,49,
|
||||
255,224,96,127,192,64,31,128,192,15,0,255
|
||||
};
|
||||
49
trunk/workspace/00_Lib/Disp_HD44780/doxygen.css
Normal file
49
trunk/workspace/00_Lib/Disp_HD44780/doxygen.css
Normal file
@@ -0,0 +1,49 @@
|
||||
H1 { text-align: center; }
|
||||
CAPTION { font-weight: bold }
|
||||
A.qindex {}
|
||||
A.qindexRef {}
|
||||
A.el { text-decoration: none; font-weight: bold }
|
||||
A.elRef { font-weight: bold }
|
||||
A.code { text-decoration: none; font-weight: normal; color: #4444ee }
|
||||
A.codeRef { font-weight: normal; color: #4444ee }
|
||||
A:hover { text-decoration: none; background-color: #f2f2ff }
|
||||
DL.el { margin-left: -1cm }
|
||||
DIV.fragment { width: 100%; border: none; background-color: #eeeeee }
|
||||
DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }
|
||||
TD.md { background-color: #f2f2ff; font-weight: bold; }
|
||||
TD.mdname1 { background-color: #f2f2ff; font-weight: bold; color: #602020; }
|
||||
TD.mdname { background-color: #f2f2ff; font-weight: bold; color: #602020; width: 600px; }
|
||||
DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold }
|
||||
DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller }
|
||||
BODY { background: white; color: black }
|
||||
TD.indexkey {
|
||||
background-color: #eeeeff;
|
||||
font-weight: bold;
|
||||
padding-right : 10px;
|
||||
padding-top : 2px;
|
||||
padding-left : 10px;
|
||||
padding-bottom : 2px;
|
||||
margin-left : 0px;
|
||||
margin-right : 0px;
|
||||
margin-top : 2px;
|
||||
margin-bottom : 2px
|
||||
}
|
||||
TD.indexvalue {
|
||||
background-color: #eeeeff;
|
||||
font-style: italic;
|
||||
padding-right : 10px;
|
||||
padding-top : 2px;
|
||||
padding-left : 10px;
|
||||
padding-bottom : 2px;
|
||||
margin-left : 0px;
|
||||
margin-right : 0px;
|
||||
margin-top : 2px;
|
||||
margin-bottom : 2px
|
||||
}
|
||||
span.keyword { color: #008000 }
|
||||
span.keywordtype { color: #604020 }
|
||||
span.keywordflow { color: #e08000 }
|
||||
span.comment { color: #800000 }
|
||||
span.preprocessor { color: #806020 }
|
||||
span.stringliteral { color: #002080 }
|
||||
span.charliteral { color: #008080 }
|
||||
BIN
trunk/workspace/00_Lib/Disp_HD44780/doxygen.png
Normal file
BIN
trunk/workspace/00_Lib/Disp_HD44780/doxygen.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
1174
trunk/workspace/00_Lib/Disp_HD44780/group__pfleury__lcd.html
Normal file
1174
trunk/workspace/00_Lib/Disp_HD44780/group__pfleury__lcd.html
Normal file
File diff suppressed because it is too large
Load Diff
609
trunk/workspace/00_Lib/Disp_HD44780/lcd.c
Normal file
609
trunk/workspace/00_Lib/Disp_HD44780/lcd.c
Normal file
@@ -0,0 +1,609 @@
|
||||
/****************************************************************************
|
||||
Title : HD44780U LCD library
|
||||
Author: Peter Fleury <pfleury@gmx.ch> http://jump.to/fleury
|
||||
File: $Id: lcd.c,v 1.14.2.2 2012/02/12 07:51:00 peter Exp $
|
||||
Software: AVR-GCC 3.3
|
||||
Target: any AVR device, memory mapped mode only for AT90S4414/8515/Mega
|
||||
|
||||
DESCRIPTION
|
||||
Basic routines for interfacing a HD44780U-based text lcd display
|
||||
|
||||
Originally based on Volker Oth's lcd library,
|
||||
changed lcd_init(), added additional constants for lcd_command(),
|
||||
added 4-bit I/O mode, improved and optimized code.
|
||||
|
||||
Library can be operated in memory mapped mode (LCD_IO_MODE=0) or in
|
||||
4-bit IO port mode (LCD_IO_MODE=1). 8-bit IO port mode not supported.
|
||||
|
||||
Memory mapped mode compatible with Kanda STK200, but supports also
|
||||
generation of R/W signal through A8 address line.
|
||||
|
||||
USAGE
|
||||
See the C include lcd.h file for a description of each function
|
||||
|
||||
*****************************************************************************/
|
||||
#include <inttypes.h>
|
||||
#include <avr/io.h>
|
||||
#include <avr/pgmspace.h>
|
||||
#include "lcd.h"
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** constants/macros
|
||||
*/
|
||||
#define DDR(x) (*(&x - 1)) /* address of data direction register of port x */
|
||||
#if defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__)
|
||||
/* on ATmega64/128 PINF is on port 0x00 and not 0x60 */
|
||||
#define PIN(x) ( &PORTF==&(x) ? _SFR_IO8(0x00) : (*(&x - 2)) )
|
||||
#else
|
||||
#define PIN(x) (*(&x - 2)) /* address of input register of port x */
|
||||
#endif
|
||||
|
||||
|
||||
#if LCD_IO_MODE
|
||||
#define lcd_e_delay() __asm__ __volatile__( "rjmp 1f\n 1:" ); //#define lcd_e_delay() __asm__ __volatile__( "rjmp 1f\n 1: rjmp 2f\n 2:" );
|
||||
#define lcd_e_high() LCD_E_PORT |= _BV(LCD_E_PIN);
|
||||
#define lcd_e_low() LCD_E_PORT &= ~_BV(LCD_E_PIN);
|
||||
#define lcd_e_toggle() toggle_e()
|
||||
#define lcd_rw_high() LCD_RW_PORT |= _BV(LCD_RW_PIN)
|
||||
#define lcd_rw_low() LCD_RW_PORT &= ~_BV(LCD_RW_PIN)
|
||||
#define lcd_rs_high() LCD_RS_PORT |= _BV(LCD_RS_PIN)
|
||||
#define lcd_rs_low() LCD_RS_PORT &= ~_BV(LCD_RS_PIN)
|
||||
#endif
|
||||
|
||||
#if LCD_IO_MODE
|
||||
#if LCD_LINES==1
|
||||
#define LCD_FUNCTION_DEFAULT LCD_FUNCTION_4BIT_1LINE
|
||||
#else
|
||||
#define LCD_FUNCTION_DEFAULT LCD_FUNCTION_4BIT_2LINES
|
||||
#endif
|
||||
#else
|
||||
#if LCD_LINES==1
|
||||
#define LCD_FUNCTION_DEFAULT LCD_FUNCTION_8BIT_1LINE
|
||||
#else
|
||||
#define LCD_FUNCTION_DEFAULT LCD_FUNCTION_8BIT_2LINES
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if LCD_CONTROLLER_KS0073
|
||||
#if LCD_LINES==4
|
||||
|
||||
#define KS0073_EXTENDED_FUNCTION_REGISTER_ON 0x2C /* |0|010|1100 4-bit mode, extension-bit RE = 1 */
|
||||
#define KS0073_EXTENDED_FUNCTION_REGISTER_OFF 0x28 /* |0|010|1000 4-bit mode, extension-bit RE = 0 */
|
||||
#define KS0073_4LINES_MODE 0x09 /* |0|000|1001 4 lines mode */
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
** function prototypes
|
||||
*/
|
||||
#if LCD_IO_MODE
|
||||
static void toggle_e(void);
|
||||
#endif
|
||||
|
||||
/*
|
||||
** local functions
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
delay loop for small accurate delays: 16-bit counter, 4 cycles/loop
|
||||
*************************************************************************/
|
||||
static inline void _delayFourCycles(unsigned int __count)
|
||||
{
|
||||
if ( __count == 0 )
|
||||
__asm__ __volatile__( "rjmp 1f\n 1:" ); // 2 cycles
|
||||
else
|
||||
__asm__ __volatile__ (
|
||||
"1: sbiw %0,1" "\n\t"
|
||||
"brne 1b" // 4 cycles/loop
|
||||
: "=w" (__count)
|
||||
: "0" (__count)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
delay for a minimum of <us> microseconds
|
||||
the number of loops is calculated at compile-time from MCU clock frequency
|
||||
*************************************************************************/
|
||||
#define delay(us) _delayFourCycles( ( ( 1*(XTAL/4000) )*us)/1000 )
|
||||
|
||||
|
||||
#if LCD_IO_MODE
|
||||
/* toggle Enable Pin to initiate write */
|
||||
static void toggle_e(void)
|
||||
{
|
||||
lcd_e_high();
|
||||
lcd_e_delay();
|
||||
lcd_e_low();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Low-level function to write byte to LCD controller
|
||||
Input: data byte to write to LCD
|
||||
rs 1: write data
|
||||
0: write instruction
|
||||
Returns: none
|
||||
*************************************************************************/
|
||||
#if LCD_IO_MODE
|
||||
static void lcd_write(uint8_t data,uint8_t rs)
|
||||
{
|
||||
unsigned char dataBits ;
|
||||
|
||||
|
||||
if (rs) { /* write data (RS=1, RW=0) */
|
||||
lcd_rs_high();
|
||||
} else { /* write instruction (RS=0, RW=0) */
|
||||
lcd_rs_low();
|
||||
}
|
||||
lcd_rw_low();
|
||||
|
||||
if ( ( &LCD_DATA0_PORT == &LCD_DATA1_PORT) && ( &LCD_DATA1_PORT == &LCD_DATA2_PORT ) && ( &LCD_DATA2_PORT == &LCD_DATA3_PORT )
|
||||
&& (LCD_DATA0_PIN == 0) && (LCD_DATA1_PIN == 1) && (LCD_DATA2_PIN == 2) && (LCD_DATA3_PIN == 3) )
|
||||
{
|
||||
/* configure data pins as output */
|
||||
DDR(LCD_DATA0_PORT) |= 0x0F;
|
||||
|
||||
/* output high nibble first */
|
||||
dataBits = LCD_DATA0_PORT & 0xF0;
|
||||
LCD_DATA0_PORT = dataBits |((data>>4)&0x0F);
|
||||
lcd_e_toggle();
|
||||
|
||||
/* output low nibble */
|
||||
LCD_DATA0_PORT = dataBits | (data&0x0F);
|
||||
lcd_e_toggle();
|
||||
|
||||
/* all data pins high (inactive) */
|
||||
LCD_DATA0_PORT = dataBits | 0x0F;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* configure data pins as output */
|
||||
DDR(LCD_DATA0_PORT) |= _BV(LCD_DATA0_PIN);
|
||||
DDR(LCD_DATA1_PORT) |= _BV(LCD_DATA1_PIN);
|
||||
DDR(LCD_DATA2_PORT) |= _BV(LCD_DATA2_PIN);
|
||||
DDR(LCD_DATA3_PORT) |= _BV(LCD_DATA3_PIN);
|
||||
|
||||
/* output high nibble first */
|
||||
LCD_DATA3_PORT &= ~_BV(LCD_DATA3_PIN);
|
||||
LCD_DATA2_PORT &= ~_BV(LCD_DATA2_PIN);
|
||||
LCD_DATA1_PORT &= ~_BV(LCD_DATA1_PIN);
|
||||
LCD_DATA0_PORT &= ~_BV(LCD_DATA0_PIN);
|
||||
if(data & 0x80) LCD_DATA3_PORT |= _BV(LCD_DATA3_PIN);
|
||||
if(data & 0x40) LCD_DATA2_PORT |= _BV(LCD_DATA2_PIN);
|
||||
if(data & 0x20) LCD_DATA1_PORT |= _BV(LCD_DATA1_PIN);
|
||||
if(data & 0x10) LCD_DATA0_PORT |= _BV(LCD_DATA0_PIN);
|
||||
lcd_e_toggle();
|
||||
|
||||
/* output low nibble */
|
||||
LCD_DATA3_PORT &= ~_BV(LCD_DATA3_PIN);
|
||||
LCD_DATA2_PORT &= ~_BV(LCD_DATA2_PIN);
|
||||
LCD_DATA1_PORT &= ~_BV(LCD_DATA1_PIN);
|
||||
LCD_DATA0_PORT &= ~_BV(LCD_DATA0_PIN);
|
||||
if(data & 0x08) LCD_DATA3_PORT |= _BV(LCD_DATA3_PIN);
|
||||
if(data & 0x04) LCD_DATA2_PORT |= _BV(LCD_DATA2_PIN);
|
||||
if(data & 0x02) LCD_DATA1_PORT |= _BV(LCD_DATA1_PIN);
|
||||
if(data & 0x01) LCD_DATA0_PORT |= _BV(LCD_DATA0_PIN);
|
||||
lcd_e_toggle();
|
||||
|
||||
/* all data pins high (inactive) */
|
||||
LCD_DATA0_PORT |= _BV(LCD_DATA0_PIN);
|
||||
LCD_DATA1_PORT |= _BV(LCD_DATA1_PIN);
|
||||
LCD_DATA2_PORT |= _BV(LCD_DATA2_PIN);
|
||||
LCD_DATA3_PORT |= _BV(LCD_DATA3_PIN);
|
||||
}
|
||||
}
|
||||
#else
|
||||
#define lcd_write(d,rs) if (rs) *(volatile uint8_t*)(LCD_IO_DATA) = d; else *(volatile uint8_t*)(LCD_IO_FUNCTION) = d;
|
||||
/* rs==0 -> write instruction to LCD_IO_FUNCTION */
|
||||
/* rs==1 -> write data to LCD_IO_DATA */
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Low-level function to read byte from LCD controller
|
||||
Input: rs 1: read data
|
||||
0: read busy flag / address counter
|
||||
Returns: byte read from LCD controller
|
||||
*************************************************************************/
|
||||
#if LCD_IO_MODE
|
||||
static uint8_t lcd_read(uint8_t rs)
|
||||
{
|
||||
uint8_t data;
|
||||
|
||||
|
||||
if (rs)
|
||||
lcd_rs_high(); /* RS=1: read data */
|
||||
else
|
||||
lcd_rs_low(); /* RS=0: read busy flag */
|
||||
lcd_rw_high(); /* RW=1 read mode */
|
||||
|
||||
if ( ( &LCD_DATA0_PORT == &LCD_DATA1_PORT) && ( &LCD_DATA1_PORT == &LCD_DATA2_PORT ) && ( &LCD_DATA2_PORT == &LCD_DATA3_PORT )
|
||||
&& ( LCD_DATA0_PIN == 0 )&& (LCD_DATA1_PIN == 1) && (LCD_DATA2_PIN == 2) && (LCD_DATA3_PIN == 3) )
|
||||
{
|
||||
DDR(LCD_DATA0_PORT) &= 0xF0; /* configure data pins as input */
|
||||
|
||||
lcd_e_high();
|
||||
lcd_e_delay();
|
||||
data = PIN(LCD_DATA0_PORT) << 4; /* read high nibble first */
|
||||
lcd_e_low();
|
||||
|
||||
lcd_e_delay(); /* Enable 500ns low */
|
||||
|
||||
lcd_e_high();
|
||||
lcd_e_delay();
|
||||
data |= PIN(LCD_DATA0_PORT)&0x0F; /* read low nibble */
|
||||
lcd_e_low();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* configure data pins as input */
|
||||
DDR(LCD_DATA0_PORT) &= ~_BV(LCD_DATA0_PIN);
|
||||
DDR(LCD_DATA1_PORT) &= ~_BV(LCD_DATA1_PIN);
|
||||
DDR(LCD_DATA2_PORT) &= ~_BV(LCD_DATA2_PIN);
|
||||
DDR(LCD_DATA3_PORT) &= ~_BV(LCD_DATA3_PIN);
|
||||
|
||||
/* read high nibble first */
|
||||
lcd_e_high();
|
||||
lcd_e_delay();
|
||||
data = 0;
|
||||
if ( PIN(LCD_DATA0_PORT) & _BV(LCD_DATA0_PIN) ) data |= 0x10;
|
||||
if ( PIN(LCD_DATA1_PORT) & _BV(LCD_DATA1_PIN) ) data |= 0x20;
|
||||
if ( PIN(LCD_DATA2_PORT) & _BV(LCD_DATA2_PIN) ) data |= 0x40;
|
||||
if ( PIN(LCD_DATA3_PORT) & _BV(LCD_DATA3_PIN) ) data |= 0x80;
|
||||
lcd_e_low();
|
||||
|
||||
lcd_e_delay(); /* Enable 500ns low */
|
||||
|
||||
/* read low nibble */
|
||||
lcd_e_high();
|
||||
lcd_e_delay();
|
||||
if ( PIN(LCD_DATA0_PORT) & _BV(LCD_DATA0_PIN) ) data |= 0x01;
|
||||
if ( PIN(LCD_DATA1_PORT) & _BV(LCD_DATA1_PIN) ) data |= 0x02;
|
||||
if ( PIN(LCD_DATA2_PORT) & _BV(LCD_DATA2_PIN) ) data |= 0x04;
|
||||
if ( PIN(LCD_DATA3_PORT) & _BV(LCD_DATA3_PIN) ) data |= 0x08;
|
||||
lcd_e_low();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
#else
|
||||
#define lcd_read(rs) (rs) ? *(volatile uint8_t*)(LCD_IO_DATA+LCD_IO_READ) : *(volatile uint8_t*)(LCD_IO_FUNCTION+LCD_IO_READ)
|
||||
/* rs==0 -> read instruction from LCD_IO_FUNCTION */
|
||||
/* rs==1 -> read data from LCD_IO_DATA */
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
loops while lcd is busy, returns address counter
|
||||
*************************************************************************/
|
||||
static uint8_t lcd_waitbusy(void)
|
||||
|
||||
{
|
||||
register uint8_t c;
|
||||
|
||||
/* wait until busy flag is cleared */
|
||||
while ( (c=lcd_read(0)) & (1<<LCD_BUSY)) {}
|
||||
|
||||
/* the address counter is updated 4us after the busy flag is cleared */
|
||||
delay(2);
|
||||
|
||||
/* now read the address counter */
|
||||
return (lcd_read(0)); // return address counter
|
||||
|
||||
}/* lcd_waitbusy */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Move cursor to the start of next line or to the first line if the cursor
|
||||
is already on the last line.
|
||||
*************************************************************************/
|
||||
static inline void lcd_newline(uint8_t pos)
|
||||
{
|
||||
register uint8_t addressCounter;
|
||||
|
||||
|
||||
#if LCD_LINES==1
|
||||
addressCounter = 0;
|
||||
#endif
|
||||
#if LCD_LINES==2
|
||||
if ( pos < (LCD_START_LINE2) )
|
||||
addressCounter = LCD_START_LINE2;
|
||||
else
|
||||
addressCounter = LCD_START_LINE1;
|
||||
#endif
|
||||
#if LCD_LINES==4
|
||||
#if KS0073_4LINES_MODE
|
||||
if ( pos < LCD_START_LINE2 )
|
||||
addressCounter = LCD_START_LINE2;
|
||||
else if ( (pos >= LCD_START_LINE2) && (pos < LCD_START_LINE3) )
|
||||
addressCounter = LCD_START_LINE3;
|
||||
else if ( (pos >= LCD_START_LINE3) && (pos < LCD_START_LINE4) )
|
||||
addressCounter = LCD_START_LINE4;
|
||||
else
|
||||
addressCounter = LCD_START_LINE1;
|
||||
#else
|
||||
if ( pos < LCD_START_LINE3 )
|
||||
addressCounter = LCD_START_LINE2;
|
||||
else if ( (pos >= LCD_START_LINE2) && (pos < LCD_START_LINE4) )
|
||||
addressCounter = LCD_START_LINE3;
|
||||
else if ( (pos >= LCD_START_LINE3) && (pos < LCD_START_LINE2) )
|
||||
addressCounter = LCD_START_LINE4;
|
||||
else
|
||||
addressCounter = LCD_START_LINE1;
|
||||
#endif
|
||||
#endif
|
||||
lcd_command((1<<LCD_DDRAM)+addressCounter);
|
||||
|
||||
}/* lcd_newline */
|
||||
|
||||
|
||||
/*
|
||||
** PUBLIC FUNCTIONS
|
||||
*/
|
||||
|
||||
/*************************************************************************
|
||||
Send LCD controller instruction command
|
||||
Input: instruction to send to LCD controller, see HD44780 data sheet
|
||||
Returns: none
|
||||
*************************************************************************/
|
||||
void lcd_command(uint8_t cmd)
|
||||
{
|
||||
lcd_waitbusy();
|
||||
lcd_write(cmd,0);
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Send data byte to LCD controller
|
||||
Input: data to send to LCD controller, see HD44780 data sheet
|
||||
Returns: none
|
||||
*************************************************************************/
|
||||
void lcd_data(uint8_t data)
|
||||
{
|
||||
lcd_waitbusy();
|
||||
lcd_write(data,1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Set cursor to specified position
|
||||
Input: x horizontal position (0: left most position)
|
||||
y vertical position (0: first line)
|
||||
Returns: none
|
||||
*************************************************************************/
|
||||
void lcd_gotoxy(uint8_t x, uint8_t y)
|
||||
{
|
||||
#if LCD_LINES==1
|
||||
lcd_command((1<<LCD_DDRAM)+LCD_START_LINE1+x);
|
||||
#endif
|
||||
#if LCD_LINES==2
|
||||
if ( y==0 )
|
||||
lcd_command((1<<LCD_DDRAM)+LCD_START_LINE1+x);
|
||||
else
|
||||
lcd_command((1<<LCD_DDRAM)+LCD_START_LINE2+x);
|
||||
#endif
|
||||
#if LCD_LINES==4
|
||||
if ( y==0 )
|
||||
lcd_command((1<<LCD_DDRAM)+LCD_START_LINE1+x);
|
||||
else if ( y==1)
|
||||
lcd_command((1<<LCD_DDRAM)+LCD_START_LINE2+x);
|
||||
else if ( y==2)
|
||||
lcd_command((1<<LCD_DDRAM)+LCD_START_LINE3+x);
|
||||
else /* y==3 */
|
||||
lcd_command((1<<LCD_DDRAM)+LCD_START_LINE4+x);
|
||||
#endif
|
||||
|
||||
}/* lcd_gotoxy */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*************************************************************************/
|
||||
int lcd_getxy(void)
|
||||
{
|
||||
return lcd_waitbusy();
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Clear display and set cursor to home position
|
||||
*************************************************************************/
|
||||
void lcd_clrscr(void)
|
||||
{
|
||||
lcd_command(1<<LCD_CLR);
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Set cursor to home position
|
||||
*************************************************************************/
|
||||
void lcd_home(void)
|
||||
{
|
||||
lcd_command(1<<LCD_HOME);
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Display character at current cursor position
|
||||
Input: character to be displayed
|
||||
Returns: none
|
||||
*************************************************************************/
|
||||
void lcd_putc(char c)
|
||||
{
|
||||
uint8_t pos;
|
||||
|
||||
|
||||
pos = lcd_waitbusy(); // read busy-flag and address counter
|
||||
if (c=='\n')
|
||||
{
|
||||
lcd_newline(pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
#if LCD_WRAP_LINES==1
|
||||
#if LCD_LINES==1
|
||||
if ( pos == LCD_START_LINE1+LCD_DISP_LENGTH ) {
|
||||
lcd_write((1<<LCD_DDRAM)+LCD_START_LINE1,0);
|
||||
}
|
||||
#elif LCD_LINES==2
|
||||
if ( pos == LCD_START_LINE1+LCD_DISP_LENGTH ) {
|
||||
lcd_write((1<<LCD_DDRAM)+LCD_START_LINE2,0);
|
||||
}else if ( pos == LCD_START_LINE2+LCD_DISP_LENGTH ){
|
||||
lcd_write((1<<LCD_DDRAM)+LCD_START_LINE1,0);
|
||||
}
|
||||
#elif LCD_LINES==4
|
||||
if ( pos == LCD_START_LINE1+LCD_DISP_LENGTH ) {
|
||||
lcd_write((1<<LCD_DDRAM)+LCD_START_LINE2,0);
|
||||
}else if ( pos == LCD_START_LINE2+LCD_DISP_LENGTH ) {
|
||||
lcd_write((1<<LCD_DDRAM)+LCD_START_LINE3,0);
|
||||
}else if ( pos == LCD_START_LINE3+LCD_DISP_LENGTH ) {
|
||||
lcd_write((1<<LCD_DDRAM)+LCD_START_LINE4,0);
|
||||
}else if ( pos == LCD_START_LINE4+LCD_DISP_LENGTH ) {
|
||||
lcd_write((1<<LCD_DDRAM)+LCD_START_LINE1,0);
|
||||
}
|
||||
#endif
|
||||
lcd_waitbusy();
|
||||
#endif
|
||||
lcd_write(c, 1);
|
||||
}
|
||||
|
||||
}/* lcd_putc */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Display string without auto linefeed
|
||||
Input: string to be displayed
|
||||
Returns: none
|
||||
*************************************************************************/
|
||||
void lcd_puts(const char *s)
|
||||
/* print string on lcd (no auto linefeed) */
|
||||
{
|
||||
register char c;
|
||||
|
||||
while ( (c = *s++) ) {
|
||||
lcd_putc(c);
|
||||
}
|
||||
|
||||
}/* lcd_puts */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Display string from program memory without auto linefeed
|
||||
Input: string from program memory be be displayed
|
||||
Returns: none
|
||||
*************************************************************************/
|
||||
void lcd_puts_p(const char *progmem_s)
|
||||
/* print string from program memory on lcd (no auto linefeed) */
|
||||
{
|
||||
register char c;
|
||||
|
||||
while ( (c = pgm_read_byte(progmem_s++)) ) {
|
||||
lcd_putc(c);
|
||||
}
|
||||
|
||||
}/* lcd_puts_p */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Initialize display and select type of cursor
|
||||
Input: dispAttr LCD_DISP_OFF display off
|
||||
LCD_DISP_ON display on, cursor off
|
||||
LCD_DISP_ON_CURSOR display on, cursor on
|
||||
LCD_DISP_CURSOR_BLINK display on, cursor on flashing
|
||||
Returns: none
|
||||
*************************************************************************/
|
||||
void lcd_init(uint8_t dispAttr)
|
||||
{
|
||||
#if LCD_IO_MODE
|
||||
/*
|
||||
* Initialize LCD to 4 bit I/O mode
|
||||
*/
|
||||
|
||||
if ( ( &LCD_DATA0_PORT == &LCD_DATA1_PORT) && ( &LCD_DATA1_PORT == &LCD_DATA2_PORT ) && ( &LCD_DATA2_PORT == &LCD_DATA3_PORT )
|
||||
&& ( &LCD_RS_PORT == &LCD_DATA0_PORT) && ( &LCD_RW_PORT == &LCD_DATA0_PORT) && (&LCD_E_PORT == &LCD_DATA0_PORT)
|
||||
&& (LCD_DATA0_PIN == 0 ) && (LCD_DATA1_PIN == 1) && (LCD_DATA2_PIN == 2) && (LCD_DATA3_PIN == 3)
|
||||
&& (LCD_RS_PIN == 4 ) && (LCD_RW_PIN == 5) && (LCD_E_PIN == 6 ) )
|
||||
{
|
||||
/* configure all port bits as output (all LCD lines on same port) */
|
||||
DDR(LCD_DATA0_PORT) |= 0x7F;
|
||||
}
|
||||
else if ( ( &LCD_DATA0_PORT == &LCD_DATA1_PORT) && ( &LCD_DATA1_PORT == &LCD_DATA2_PORT ) && ( &LCD_DATA2_PORT == &LCD_DATA3_PORT )
|
||||
&& (LCD_DATA0_PIN == 0 ) && (LCD_DATA1_PIN == 1) && (LCD_DATA2_PIN == 2) && (LCD_DATA3_PIN == 3) )
|
||||
{
|
||||
/* configure all port bits as output (all LCD data lines on same port, but control lines on different ports) */
|
||||
DDR(LCD_DATA0_PORT) |= 0x0F;
|
||||
DDR(LCD_RS_PORT) |= _BV(LCD_RS_PIN);
|
||||
DDR(LCD_RW_PORT) |= _BV(LCD_RW_PIN);
|
||||
DDR(LCD_E_PORT) |= _BV(LCD_E_PIN);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* configure all port bits as output (LCD data and control lines on different ports */
|
||||
DDR(LCD_RS_PORT) |= _BV(LCD_RS_PIN);
|
||||
DDR(LCD_RW_PORT) |= _BV(LCD_RW_PIN);
|
||||
DDR(LCD_E_PORT) |= _BV(LCD_E_PIN);
|
||||
DDR(LCD_DATA0_PORT) |= _BV(LCD_DATA0_PIN);
|
||||
DDR(LCD_DATA1_PORT) |= _BV(LCD_DATA1_PIN);
|
||||
DDR(LCD_DATA2_PORT) |= _BV(LCD_DATA2_PIN);
|
||||
DDR(LCD_DATA3_PORT) |= _BV(LCD_DATA3_PIN);
|
||||
}
|
||||
delay(16000); /* wait 16ms or more after power-on */
|
||||
|
||||
/* initial write to lcd is 8bit */
|
||||
LCD_DATA1_PORT |= _BV(LCD_DATA1_PIN); // _BV(LCD_FUNCTION)>>4;
|
||||
LCD_DATA0_PORT |= _BV(LCD_DATA0_PIN); // _BV(LCD_FUNCTION_8BIT)>>4;
|
||||
lcd_e_toggle();
|
||||
delay(4992); /* delay, busy flag can't be checked here */
|
||||
|
||||
/* repeat last command */
|
||||
lcd_e_toggle();
|
||||
delay(64); /* delay, busy flag can't be checked here */
|
||||
|
||||
/* repeat last command a third time */
|
||||
lcd_e_toggle();
|
||||
delay(64); /* delay, busy flag can't be checked here */
|
||||
|
||||
/* now configure for 4bit mode */
|
||||
LCD_DATA0_PORT &= ~_BV(LCD_DATA0_PIN); // LCD_FUNCTION_4BIT_1LINE>>4
|
||||
lcd_e_toggle();
|
||||
delay(64); /* some displays need this additional delay */
|
||||
|
||||
/* from now the LCD only accepts 4 bit I/O, we can use lcd_command() */
|
||||
#else
|
||||
/*
|
||||
* Initialize LCD to 8 bit memory mapped mode
|
||||
*/
|
||||
|
||||
/* enable external SRAM (memory mapped lcd) and one wait state */
|
||||
MCUCR = _BV(SRE) | _BV(SRW);
|
||||
|
||||
/* reset LCD */
|
||||
delay(16000); /* wait 16ms after power-on */
|
||||
lcd_write(LCD_FUNCTION_8BIT_1LINE,0); /* function set: 8bit interface */
|
||||
delay(4992); /* wait 5ms */
|
||||
lcd_write(LCD_FUNCTION_8BIT_1LINE,0); /* function set: 8bit interface */
|
||||
delay(64); /* wait 64us */
|
||||
lcd_write(LCD_FUNCTION_8BIT_1LINE,0); /* function set: 8bit interface */
|
||||
delay(64); /* wait 64us */
|
||||
#endif
|
||||
|
||||
#if KS0073_4LINES_MODE
|
||||
/* Display with KS0073 controller requires special commands for enabling 4 line mode */
|
||||
lcd_command(KS0073_EXTENDED_FUNCTION_REGISTER_ON);
|
||||
lcd_command(KS0073_4LINES_MODE);
|
||||
lcd_command(KS0073_EXTENDED_FUNCTION_REGISTER_OFF);
|
||||
#else
|
||||
lcd_command(LCD_FUNCTION_DEFAULT); /* function set: display lines */
|
||||
#endif
|
||||
lcd_command(LCD_DISP_OFF); /* display off */
|
||||
lcd_clrscr(); /* display clear */
|
||||
lcd_command(LCD_MODE_DEFAULT); /* set entry mode */
|
||||
lcd_command(dispAttr); /* display/cursor control */
|
||||
|
||||
}/* lcd_init */
|
||||
265
trunk/workspace/00_Lib/Disp_HD44780/lcd.h
Normal file
265
trunk/workspace/00_Lib/Disp_HD44780/lcd.h
Normal file
@@ -0,0 +1,265 @@
|
||||
#ifndef LCD_H
|
||||
#define LCD_H
|
||||
/*************************************************************************
|
||||
Title : C include file for the HD44780U LCD library (lcd.c)
|
||||
Author: Peter Fleury <pfleury@gmx.ch> http://jump.to/fleury
|
||||
File: $Id: lcd.h,v 1.13.2.2 2006/01/30 19:51:33 peter Exp $
|
||||
Software: AVR-GCC 3.3
|
||||
Hardware: any AVR device, memory mapped mode only for AT90S4414/8515/Mega
|
||||
***************************************************************************/
|
||||
|
||||
/**
|
||||
@defgroup pfleury_lcd LCD library
|
||||
@code #include <lcd.h> @endcode
|
||||
|
||||
@brief Basic routines for interfacing a HD44780U-based text LCD display
|
||||
|
||||
Originally based on Volker Oth's LCD library,
|
||||
changed lcd_init(), added additional constants for lcd_command(),
|
||||
added 4-bit I/O mode, improved and optimized code.
|
||||
|
||||
Library can be operated in memory mapped mode (LCD_IO_MODE=0) or in
|
||||
4-bit IO port mode (LCD_IO_MODE=1). 8-bit IO port mode not supported.
|
||||
|
||||
Memory mapped mode compatible with Kanda STK200, but supports also
|
||||
generation of R/W signal through A8 address line.
|
||||
|
||||
@author Peter Fleury pfleury@gmx.ch http://jump.to/fleury
|
||||
|
||||
@see The chapter <a href="http://homepage.sunrise.ch/mysunrise/peterfleury/avr-lcd44780.html" target="_blank">Interfacing a HD44780 Based LCD to an AVR</a>
|
||||
on my home page.
|
||||
|
||||
*/
|
||||
|
||||
/*@{*/
|
||||
|
||||
#if (__GNUC__ * 100 + __GNUC_MINOR__) < 303
|
||||
#error "This library requires AVR-GCC 3.3 or later, update to newer AVR-GCC compiler !"
|
||||
#endif
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <avr/pgmspace.h>
|
||||
|
||||
/**
|
||||
* @name Definitions for MCU Clock Frequency
|
||||
* Adapt the MCU clock frequency in Hz to your target.
|
||||
*/
|
||||
#define XTAL 4000000 /**< clock frequency in Hz, used to calculate delay timer */
|
||||
|
||||
|
||||
/**
|
||||
* @name Definition for LCD controller type
|
||||
* Use 0 for HD44780 controller, change to 1 for displays with KS0073 controller.
|
||||
*/
|
||||
#define LCD_CONTROLLER_KS0073 0 /**< Use 0 for HD44780 controller, 1 for KS0073 controller */
|
||||
|
||||
/**
|
||||
* @name Definitions for Display Size
|
||||
* Change these definitions to adapt setting to your display
|
||||
*/
|
||||
#define LCD_LINES 2 /**< number of visible lines of the display */
|
||||
#define LCD_DISP_LENGTH 16 /**< visibles characters per line of the display */
|
||||
#define LCD_LINE_LENGTH 0x40 /**< internal line length of the display */
|
||||
#define LCD_START_LINE1 0x00 /**< DDRAM address of first char of line 1 */
|
||||
#define LCD_START_LINE2 0x40 /**< DDRAM address of first char of line 2 */
|
||||
#define LCD_START_LINE3 0x14 /**< DDRAM address of first char of line 3 */
|
||||
#define LCD_START_LINE4 0x54 /**< DDRAM address of first char of line 4 */
|
||||
#define LCD_WRAP_LINES 0 /**< 0: no wrap, 1: wrap at end of visibile line */
|
||||
|
||||
|
||||
#define LCD_IO_MODE 1 /**< 0: memory mapped mode, 1: IO port mode */
|
||||
#if LCD_IO_MODE
|
||||
/**
|
||||
* @name Definitions for 4-bit IO mode
|
||||
* Change LCD_PORT if you want to use a different port for the LCD pins.
|
||||
*
|
||||
* The four LCD data lines and the three control lines RS, RW, E can be on the
|
||||
* same port or on different ports.
|
||||
* Change LCD_RS_PORT, LCD_RW_PORT, LCD_E_PORT if you want the control lines on
|
||||
* different ports.
|
||||
*
|
||||
* Normally the four data lines should be mapped to bit 0..3 on one port, but it
|
||||
* is possible to connect these data lines in different order or even on different
|
||||
* ports by adapting the LCD_DATAx_PORT and LCD_DATAx_PIN definitions.
|
||||
*
|
||||
*/
|
||||
#define LCD_PORT PORTA /**< port for the LCD lines */
|
||||
#define LCD_DATA0_PORT LCD_PORT /**< port for 4bit data bit 0 */
|
||||
#define LCD_DATA1_PORT LCD_PORT /**< port for 4bit data bit 1 */
|
||||
#define LCD_DATA2_PORT LCD_PORT /**< port for 4bit data bit 2 */
|
||||
#define LCD_DATA3_PORT LCD_PORT /**< port for 4bit data bit 3 */
|
||||
#define LCD_DATA0_PIN 0 /**< pin for 4bit data bit 0 */
|
||||
#define LCD_DATA1_PIN 1 /**< pin for 4bit data bit 1 */
|
||||
#define LCD_DATA2_PIN 2 /**< pin for 4bit data bit 2 */
|
||||
#define LCD_DATA3_PIN 3 /**< pin for 4bit data bit 3 */
|
||||
#define LCD_RS_PORT LCD_PORT /**< port for RS line */
|
||||
#define LCD_RS_PIN 4 /**< pin for RS line */
|
||||
#define LCD_RW_PORT LCD_PORT /**< port for RW line */
|
||||
#define LCD_RW_PIN 5 /**< pin for RW line */
|
||||
#define LCD_E_PORT LCD_PORT /**< port for Enable line */
|
||||
#define LCD_E_PIN 6 /**< pin for Enable line */
|
||||
|
||||
#elif defined(__AVR_AT90S4414__) || defined(__AVR_AT90S8515__) || defined(__AVR_ATmega64__) || \
|
||||
defined(__AVR_ATmega8515__)|| defined(__AVR_ATmega103__) || defined(__AVR_ATmega128__) || \
|
||||
defined(__AVR_ATmega161__) || defined(__AVR_ATmega162__)
|
||||
/*
|
||||
* memory mapped mode is only supported when the device has an external data memory interface
|
||||
*/
|
||||
#define LCD_IO_DATA 0xC000 /* A15=E=1, A14=RS=1 */
|
||||
#define LCD_IO_FUNCTION 0x8000 /* A15=E=1, A14=RS=0 */
|
||||
#define LCD_IO_READ 0x0100 /* A8 =R/W=1 (R/W: 1=Read, 0=Write */
|
||||
#else
|
||||
#error "external data memory interface not available for this device, use 4-bit IO port mode"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* @name Definitions for LCD command instructions
|
||||
* The constants define the various LCD controller instructions which can be passed to the
|
||||
* function lcd_command(), see HD44780 data sheet for a complete description.
|
||||
*/
|
||||
|
||||
/* instruction register bit positions, see HD44780U data sheet */
|
||||
#define LCD_CLR 0 /* DB0: clear display */
|
||||
#define LCD_HOME 1 /* DB1: return to home position */
|
||||
#define LCD_ENTRY_MODE 2 /* DB2: set entry mode */
|
||||
#define LCD_ENTRY_INC 1 /* DB1: 1=increment, 0=decrement */
|
||||
#define LCD_ENTRY_SHIFT 0 /* DB2: 1=display shift on */
|
||||
#define LCD_ON 3 /* DB3: turn lcd/cursor on */
|
||||
#define LCD_ON_DISPLAY 2 /* DB2: turn display on */
|
||||
#define LCD_ON_CURSOR 1 /* DB1: turn cursor on */
|
||||
#define LCD_ON_BLINK 0 /* DB0: blinking cursor ? */
|
||||
#define LCD_MOVE 4 /* DB4: move cursor/display */
|
||||
#define LCD_MOVE_DISP 3 /* DB3: move display (0-> cursor) ? */
|
||||
#define LCD_MOVE_RIGHT 2 /* DB2: move right (0-> left) ? */
|
||||
#define LCD_FUNCTION 5 /* DB5: function set */
|
||||
#define LCD_FUNCTION_8BIT 4 /* DB4: set 8BIT mode (0->4BIT mode) */
|
||||
#define LCD_FUNCTION_2LINES 3 /* DB3: two lines (0->one line) */
|
||||
#define LCD_FUNCTION_10DOTS 2 /* DB2: 5x10 font (0->5x7 font) */
|
||||
#define LCD_CGRAM 6 /* DB6: set CG RAM address */
|
||||
#define LCD_DDRAM 7 /* DB7: set DD RAM address */
|
||||
#define LCD_BUSY 7 /* DB7: LCD is busy */
|
||||
|
||||
/* set entry mode: display shift on/off, dec/inc cursor move direction */
|
||||
#define LCD_ENTRY_DEC 0x04 /* display shift off, dec cursor move dir */
|
||||
#define LCD_ENTRY_DEC_SHIFT 0x05 /* display shift on, dec cursor move dir */
|
||||
#define LCD_ENTRY_INC_ 0x06 /* display shift off, inc cursor move dir */
|
||||
#define LCD_ENTRY_INC_SHIFT 0x07 /* display shift on, inc cursor move dir */
|
||||
|
||||
/* display on/off, cursor on/off, blinking char at cursor position */
|
||||
#define LCD_DISP_OFF 0x08 /* display off */
|
||||
#define LCD_DISP_ON 0x0C /* display on, cursor off */
|
||||
#define LCD_DISP_ON_BLINK 0x0D /* display on, cursor off, blink char */
|
||||
#define LCD_DISP_ON_CURSOR 0x0E /* display on, cursor on */
|
||||
#define LCD_DISP_ON_CURSOR_BLINK 0x0F /* display on, cursor on, blink char */
|
||||
|
||||
/* move cursor/shift display */
|
||||
#define LCD_MOVE_CURSOR_LEFT 0x10 /* move cursor left (decrement) */
|
||||
#define LCD_MOVE_CURSOR_RIGHT 0x14 /* move cursor right (increment) */
|
||||
#define LCD_MOVE_DISP_LEFT 0x18 /* shift display left */
|
||||
#define LCD_MOVE_DISP_RIGHT 0x1C /* shift display right */
|
||||
|
||||
/* function set: set interface data length and number of display lines */
|
||||
#define LCD_FUNCTION_4BIT_1LINE 0x20 /* 4-bit interface, single line, 5x7 dots */
|
||||
#define LCD_FUNCTION_4BIT_2LINES 0x28 /* 4-bit interface, dual line, 5x7 dots */
|
||||
#define LCD_FUNCTION_8BIT_1LINE 0x30 /* 8-bit interface, single line, 5x7 dots */
|
||||
#define LCD_FUNCTION_8BIT_2LINES 0x38 /* 8-bit interface, dual line, 5x7 dots */
|
||||
|
||||
|
||||
#define LCD_MODE_DEFAULT ((1<<LCD_ENTRY_MODE) | (1<<LCD_ENTRY_INC) )
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @name Functions
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
@brief Initialize display and select type of cursor
|
||||
@param dispAttr \b LCD_DISP_OFF display off\n
|
||||
\b LCD_DISP_ON display on, cursor off\n
|
||||
\b LCD_DISP_ON_CURSOR display on, cursor on\n
|
||||
\b LCD_DISP_ON_CURSOR_BLINK display on, cursor on flashing
|
||||
@return none
|
||||
*/
|
||||
extern void lcd_init(uint8_t dispAttr);
|
||||
|
||||
|
||||
/**
|
||||
@brief Clear display and set cursor to home position
|
||||
@param void
|
||||
@return none
|
||||
*/
|
||||
extern void lcd_clrscr(void);
|
||||
|
||||
|
||||
/**
|
||||
@brief Set cursor to home position
|
||||
@param void
|
||||
@return none
|
||||
*/
|
||||
extern void lcd_home(void);
|
||||
|
||||
|
||||
/**
|
||||
@brief Set cursor to specified position
|
||||
|
||||
@param x horizontal position\n (0: left most position)
|
||||
@param y vertical position\n (0: first line)
|
||||
@return none
|
||||
*/
|
||||
extern void lcd_gotoxy(uint8_t x, uint8_t y);
|
||||
|
||||
|
||||
/**
|
||||
@brief Display character at current cursor position
|
||||
@param c character to be displayed
|
||||
@return none
|
||||
*/
|
||||
extern void lcd_putc(char c);
|
||||
|
||||
|
||||
/**
|
||||
@brief Display string without auto linefeed
|
||||
@param s string to be displayed
|
||||
@return none
|
||||
*/
|
||||
extern void lcd_puts(const char *s);
|
||||
|
||||
|
||||
/**
|
||||
@brief Display string from program memory without auto linefeed
|
||||
@param s string from program memory be be displayed
|
||||
@return none
|
||||
@see lcd_puts_P
|
||||
*/
|
||||
extern void lcd_puts_p(const char *progmem_s);
|
||||
|
||||
|
||||
/**
|
||||
@brief Send LCD controller instruction command
|
||||
@param cmd instruction to send to LCD controller, see HD44780 data sheet
|
||||
@return none
|
||||
*/
|
||||
extern void lcd_command(uint8_t cmd);
|
||||
|
||||
|
||||
/**
|
||||
@brief Send data byte to LCD controller
|
||||
|
||||
Similar to lcd_putc(), but without interpreting LF
|
||||
@param data byte to send to LCD controller, see HD44780 data sheet
|
||||
@return none
|
||||
*/
|
||||
extern void lcd_data(uint8_t data);
|
||||
|
||||
|
||||
/**
|
||||
@brief macros for automatically storing string constant in program memory
|
||||
*/
|
||||
#define lcd_puts_P(__s) lcd_puts_p(PSTR(__s))
|
||||
|
||||
/*@}*/
|
||||
#endif //LCD_H
|
||||
BIN
trunk/workspace/00_Lib/Disp_HD44780/lcdlibrary.zip
Normal file
BIN
trunk/workspace/00_Lib/Disp_HD44780/lcdlibrary.zip
Normal file
Binary file not shown.
425
trunk/workspace/00_Lib/Disp_HD44780/makefile
Normal file
425
trunk/workspace/00_Lib/Disp_HD44780/makefile
Normal file
@@ -0,0 +1,425 @@
|
||||
# Hey Emacs, this is a -*- makefile -*-
|
||||
#
|
||||
# WinAVR Sample makefile written by Eric B. Weddington, Jörg Wunsch, et al.
|
||||
# Released to the Public Domain
|
||||
# Please read the make user manual!
|
||||
#
|
||||
# Additional material for this makefile was submitted by:
|
||||
# Tim Henigan
|
||||
# Peter Fleury
|
||||
# Reiner Patommel
|
||||
# Sander Pool
|
||||
# Frederik Rouleau
|
||||
# Markus Pfaff
|
||||
#
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF (for use with AVR Studio 3.x or VMLAB).
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF (for use with AVR Studio
|
||||
# 4.07 or greater).
|
||||
#
|
||||
# make program = Download the hex file to the device, using avrdude. Please
|
||||
# customize the avrdude settings below first!
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#
|
||||
|
||||
|
||||
# MCU name
|
||||
MCU = at90s8515
|
||||
|
||||
# Output format. (can be srec, ihex, binary)
|
||||
FORMAT = ihex
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = test_lcd
|
||||
|
||||
|
||||
# List C source files here. (C dependencies are automatically generated.)
|
||||
SRC = $(TARGET).c lcd.c
|
||||
|
||||
|
||||
# List Assembler source files here.
|
||||
# Make them always end in a capital .S. Files ending in a lowercase .s
|
||||
# will not be considered source files but generated files (assembler
|
||||
# output from the compiler), and will be deleted upon "make clean"!
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC =
|
||||
|
||||
|
||||
|
||||
# Optimization level, can be [0, 1, 2, 3, s].
|
||||
# 0 = turn off optimization. s = optimize for size.
|
||||
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
||||
OPT = s
|
||||
|
||||
# Debugging format.
|
||||
# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.
|
||||
# AVR (extended) COFF requires stabs, plus an avr-objcopy run.
|
||||
DEBUG = dwarf-2
|
||||
|
||||
# List any extra directories to look for include files here.
|
||||
# Each directory must be seperated by a space.
|
||||
EXTRAINCDIRS =
|
||||
|
||||
|
||||
# Compiler flag to set the C Standard level.
|
||||
# c89 - "ANSI" C
|
||||
# gnu89 - c89 plus GCC extensions
|
||||
# c99 - ISO C99 standard (not yet fully implemented)
|
||||
# gnu99 - c99 plus GCC extensions
|
||||
CSTANDARD = -std=gnu99
|
||||
|
||||
# Place -D or -U options here
|
||||
CDEFS =
|
||||
|
||||
# Place -I options here
|
||||
CINCS =
|
||||
|
||||
|
||||
# Compiler flags.
|
||||
# -g*: generate debugging information
|
||||
# -O*: optimization level
|
||||
# -f...: tuning, see GCC manual and avr-libc documentation
|
||||
# -Wall...: warning level
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -adhlns...: create assembler listing
|
||||
CFLAGS = -g$(DEBUG)
|
||||
CFLAGS += $(CDEFS) $(CINCS)
|
||||
CFLAGS += -O$(OPT)
|
||||
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
|
||||
CFLAGS += -Wall -Wstrict-prototypes
|
||||
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
|
||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||
CFLAGS += $(CSTANDARD)
|
||||
|
||||
|
||||
|
||||
# Assembler flags.
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -ahlms: create listing
|
||||
# -gstabs: have the assembler create line number information; note that
|
||||
# for use in COFF files, additional information about filenames
|
||||
# and function names needs to be present in the assembler source
|
||||
# files -- see avr-libc docs [FIXME: not yet described there]
|
||||
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
|
||||
|
||||
|
||||
|
||||
#Additional libraries.
|
||||
|
||||
# Minimalistic printf version
|
||||
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
|
||||
|
||||
# Floating point printf version (requires MATH_LIB = -lm below)
|
||||
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
|
||||
|
||||
PRINTF_LIB =
|
||||
|
||||
# Minimalistic scanf version
|
||||
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
|
||||
|
||||
# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
|
||||
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
|
||||
|
||||
SCANF_LIB =
|
||||
|
||||
MATH_LIB = -lm
|
||||
|
||||
# External memory options
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# used for variables (.data/.bss) and heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# only used for heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
EXTMEMOPTS =
|
||||
|
||||
# Linker flags.
|
||||
# -Wl,...: tell GCC to pass this to linker.
|
||||
# -Map: create map file
|
||||
# --cref: add cross reference to map file
|
||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
|
||||
LDFLAGS += $(EXTMEMOPTS)
|
||||
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
|
||||
|
||||
|
||||
|
||||
|
||||
# Programming support using avrdude. Settings and variables.
|
||||
|
||||
# Programming hardware: alf avr910 avrisp bascom bsd
|
||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
|
||||
#
|
||||
# Type: avrdude -c ?
|
||||
# to get a full listing.
|
||||
#
|
||||
AVRDUDE_PROGRAMMER = stk500
|
||||
|
||||
# com1 = serial port. Use lpt1 to connect to parallel port.
|
||||
AVRDUDE_PORT = com1 # programmer connected to serial device
|
||||
|
||||
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
|
||||
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
|
||||
|
||||
|
||||
# Uncomment the following if you want avrdude's erase cycle counter.
|
||||
# Note that this counter needs to be initialized first using -Yn,
|
||||
# see avrdude manual.
|
||||
#AVRDUDE_ERASE_COUNTER = -y
|
||||
|
||||
# Uncomment the following if you do /not/ wish a verification to be
|
||||
# performed after programming the device.
|
||||
#AVRDUDE_NO_VERIFY = -V
|
||||
|
||||
# Increase verbosity level. Please use this when submitting bug
|
||||
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
|
||||
# to submit bug reports.
|
||||
#AVRDUDE_VERBOSE = -v -v
|
||||
|
||||
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
|
||||
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Define directories, if needed.
|
||||
DIRAVR = c:/winavr
|
||||
DIRAVRBIN = $(DIRAVR)/bin
|
||||
DIRAVRUTILS = $(DIRAVR)/utils/bin
|
||||
DIRINC = .
|
||||
DIRLIB = $(DIRAVR)/avr/lib
|
||||
|
||||
|
||||
# Define programs and commands.
|
||||
SHELL = sh
|
||||
CC = avr-gcc
|
||||
OBJCOPY = avr-objcopy
|
||||
OBJDUMP = avr-objdump
|
||||
SIZE = avr-size
|
||||
NM = avr-nm
|
||||
AVRDUDE = avrdude
|
||||
REMOVE = rm -f
|
||||
COPY = cp
|
||||
|
||||
|
||||
|
||||
|
||||
# Define Messages
|
||||
# English
|
||||
MSG_ERRORS_NONE = Errors: none
|
||||
MSG_BEGIN = -------- begin --------
|
||||
MSG_END = -------- end --------
|
||||
MSG_SIZE_BEFORE = Size before:
|
||||
MSG_SIZE_AFTER = Size after:
|
||||
MSG_COFF = Converting to AVR COFF:
|
||||
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
|
||||
MSG_FLASH = Creating load file for Flash:
|
||||
MSG_EEPROM = Creating load file for EEPROM:
|
||||
MSG_EXTENDED_LISTING = Creating Extended Listing:
|
||||
MSG_SYMBOL_TABLE = Creating Symbol Table:
|
||||
MSG_LINKING = Linking:
|
||||
MSG_COMPILING = Compiling:
|
||||
MSG_ASSEMBLING = Assembling:
|
||||
MSG_CLEANING = Cleaning project:
|
||||
|
||||
|
||||
|
||||
|
||||
# Define all object files.
|
||||
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)
|
||||
|
||||
# Define all listing files.
|
||||
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst)
|
||||
|
||||
|
||||
# Compiler flags to generate dependency files.
|
||||
GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,.dep/$(@F).d
|
||||
|
||||
|
||||
# Combine all necessary flags and optional flags.
|
||||
# Add target processor to flags.
|
||||
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
|
||||
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Default target.
|
||||
all: begin gccversion sizebefore build sizeafter finished end
|
||||
|
||||
build: elf hex eep lss sym
|
||||
|
||||
elf: $(TARGET).elf
|
||||
hex: $(TARGET).hex
|
||||
eep: $(TARGET).eep
|
||||
lss: $(TARGET).lss
|
||||
sym: $(TARGET).sym
|
||||
|
||||
|
||||
|
||||
# Eye candy.
|
||||
# AVR Studio 3.x does not check make's exit code but relies on
|
||||
# the following magic strings to be generated by the compile job.
|
||||
begin:
|
||||
@echo
|
||||
@echo $(MSG_BEGIN)
|
||||
|
||||
finished:
|
||||
@echo $(MSG_ERRORS_NONE)
|
||||
|
||||
end:
|
||||
@echo $(MSG_END)
|
||||
@echo
|
||||
|
||||
|
||||
# Display size of file.
|
||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
|
||||
ELFSIZE = $(SIZE) -A $(TARGET).elf
|
||||
sizebefore:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi
|
||||
|
||||
sizeafter:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
|
||||
|
||||
|
||||
|
||||
# Display compiler version information.
|
||||
gccversion :
|
||||
@$(CC) --version
|
||||
|
||||
|
||||
|
||||
# Program the device.
|
||||
program: $(TARGET).hex $(TARGET).eep
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
|
||||
|
||||
|
||||
|
||||
|
||||
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
|
||||
COFFCONVERT=$(OBJCOPY) --debugging \
|
||||
--change-section-address .data-0x800000 \
|
||||
--change-section-address .bss-0x800000 \
|
||||
--change-section-address .noinit-0x800000 \
|
||||
--change-section-address .eeprom-0x810000
|
||||
|
||||
|
||||
coff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
extcoff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
|
||||
# Create final output files (.hex, .eep) from ELF output file.
|
||||
%.hex: %.elf
|
||||
@echo
|
||||
@echo $(MSG_FLASH) $@
|
||||
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
|
||||
|
||||
%.eep: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EEPROM) $@
|
||||
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
||||
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
|
||||
|
||||
# Create extended listing file from ELF output file.
|
||||
%.lss: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_LISTING) $@
|
||||
$(OBJDUMP) -h -S $< > $@
|
||||
|
||||
# Create a symbol table from ELF output file.
|
||||
%.sym: %.elf
|
||||
@echo
|
||||
@echo $(MSG_SYMBOL_TABLE) $@
|
||||
$(NM) -n $< > $@
|
||||
|
||||
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
.SECONDARY : $(TARGET).elf
|
||||
.PRECIOUS : $(OBJ)
|
||||
%.elf: $(OBJ)
|
||||
@echo
|
||||
@echo $(MSG_LINKING) $@
|
||||
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS)
|
||||
|
||||
|
||||
# Compile: create object files from C source files.
|
||||
%.o : %.c
|
||||
@echo
|
||||
@echo $(MSG_COMPILING) $<
|
||||
$(CC) -c $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Compile: create assembler files from C source files.
|
||||
%.s : %.c
|
||||
$(CC) -S $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Assemble: create object files from assembler source files.
|
||||
%.o : %.S
|
||||
@echo
|
||||
@echo $(MSG_ASSEMBLING) $<
|
||||
$(CC) -c $(ALL_ASFLAGS) $< -o $@
|
||||
|
||||
|
||||
|
||||
# Target: clean project.
|
||||
clean: begin clean_list finished end
|
||||
|
||||
clean_list :
|
||||
@echo
|
||||
@echo $(MSG_CLEANING)
|
||||
$(REMOVE) $(TARGET).hex
|
||||
$(REMOVE) $(TARGET).eep
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).cof
|
||||
$(REMOVE) $(TARGET).elf
|
||||
$(REMOVE) $(TARGET).map
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).a90
|
||||
$(REMOVE) $(TARGET).sym
|
||||
$(REMOVE) $(TARGET).lnk
|
||||
$(REMOVE) $(TARGET).lss
|
||||
$(REMOVE) $(OBJ)
|
||||
$(REMOVE) $(LST)
|
||||
$(REMOVE) $(SRC:.c=.s)
|
||||
$(REMOVE) $(SRC:.c=.d)
|
||||
$(REMOVE) .dep/*
|
||||
|
||||
|
||||
|
||||
# Include the dependency files.
|
||||
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
|
||||
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
|
||||
build elf hex eep lss sym coff extcoff \
|
||||
clean clean_list program
|
||||
|
||||
167
trunk/workspace/00_Lib/Disp_HD44780/test_lcd.c
Normal file
167
trunk/workspace/00_Lib/Disp_HD44780/test_lcd.c
Normal file
@@ -0,0 +1,167 @@
|
||||
/*************************************************************************
|
||||
Title: testing output to a HD44780 based LCD display.
|
||||
Author: Peter Fleury <pfleury@gmx.ch> http://jump.to/fleury
|
||||
File: $Id: test_lcd.c,v 1.6 2004/12/10 13:53:59 peter Exp $
|
||||
Software: AVR-GCC 3.3
|
||||
Hardware: HD44780 compatible LCD text display
|
||||
ATS90S8515/ATmega if memory-mapped LCD interface is used
|
||||
any AVR with 7 free I/O pins if 4-bit IO port mode is used
|
||||
**************************************************************************/
|
||||
#include <stdlib.h>
|
||||
#include <avr/io.h>
|
||||
#include <avr/pgmspace.h>
|
||||
#include "lcd.h"
|
||||
|
||||
|
||||
/*
|
||||
** constant definitions
|
||||
*/
|
||||
static const PROGMEM unsigned char copyRightChar[] =
|
||||
{
|
||||
0x07, 0x08, 0x13, 0x14, 0x14, 0x13, 0x08, 0x07,
|
||||
0x00, 0x10, 0x08, 0x08, 0x08, 0x08, 0x10, 0x00
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
** function prototypes
|
||||
*/
|
||||
void wait_until_key_pressed(void);
|
||||
|
||||
|
||||
void wait_until_key_pressed(void)
|
||||
{
|
||||
unsigned char temp1, temp2;
|
||||
unsigned int i;
|
||||
|
||||
do {
|
||||
temp1 = PIND; // read input
|
||||
for(i=0;i<65535;i++);
|
||||
temp2 = PIND; // read input
|
||||
temp1 = (temp1 & temp2); // debounce input
|
||||
} while ( temp1 & _BV(PIND2) );
|
||||
|
||||
loop_until_bit_is_set(PIND,PIND2); /* wait until key is released */
|
||||
}
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char buffer[7];
|
||||
int num=134;
|
||||
unsigned char i;
|
||||
|
||||
|
||||
DDRD &=~ (1 << PD2); /* Pin PD2 input */
|
||||
PORTD |= (1 << PD2); /* Pin PD2 pull-up enabled */
|
||||
|
||||
|
||||
/* initialize display, cursor off */
|
||||
lcd_init(LCD_DISP_ON);
|
||||
|
||||
for (;;) { /* loop forever */
|
||||
/*
|
||||
* Test 1: write text to display
|
||||
*/
|
||||
|
||||
/* clear display and home cursor */
|
||||
lcd_clrscr();
|
||||
|
||||
/* put string to display (line 1) with linefeed */
|
||||
lcd_puts("LCD Test Line 1\n");
|
||||
|
||||
/* cursor is now on second line, write second line */
|
||||
lcd_puts("Line 2");
|
||||
|
||||
/* move cursor to position 8 on line 2 */
|
||||
lcd_gotoxy(7,1);
|
||||
|
||||
/* write single char to display */
|
||||
lcd_putc(':');
|
||||
|
||||
/* wait until push button PD2 (INT0) is pressed */
|
||||
wait_until_key_pressed();
|
||||
|
||||
|
||||
/*
|
||||
* Test 2: use lcd_command() to turn on cursor
|
||||
*/
|
||||
|
||||
/* turn on cursor */
|
||||
lcd_command(LCD_DISP_ON_CURSOR);
|
||||
|
||||
/* put string */
|
||||
lcd_puts( "CurOn");
|
||||
|
||||
/* wait until push button PD2 (INT0) is pressed */
|
||||
wait_until_key_pressed();
|
||||
|
||||
|
||||
/*
|
||||
* Test 3: display shift
|
||||
*/
|
||||
|
||||
lcd_clrscr(); /* clear display home cursor */
|
||||
|
||||
/* put string from program memory to display */
|
||||
lcd_puts_P( "Line 1 longer than 14 characters\n" );
|
||||
lcd_puts_P( "Line 2 longer than 14 characters" );
|
||||
|
||||
/* move BOTH lines one position to the left */
|
||||
lcd_command(LCD_MOVE_DISP_LEFT);
|
||||
|
||||
/* wait until push button PD2 (INT0) is pressed */
|
||||
wait_until_key_pressed();
|
||||
|
||||
/* turn off cursor */
|
||||
lcd_command(LCD_DISP_ON);
|
||||
|
||||
|
||||
/*
|
||||
* Test: Display integer values
|
||||
*/
|
||||
|
||||
lcd_clrscr(); /* clear display home cursor */
|
||||
|
||||
/* convert interger into string */
|
||||
itoa( num , buffer, 10);
|
||||
|
||||
/* put converted string to display */
|
||||
lcd_puts(buffer);
|
||||
|
||||
/* wait until push button PD2 (INT0) is pressed */
|
||||
wait_until_key_pressed();
|
||||
|
||||
|
||||
/*
|
||||
* Test: Display userdefined characters
|
||||
*/
|
||||
|
||||
lcd_clrscr(); /* clear display home cursor */
|
||||
|
||||
lcd_puts("Copyright: ");
|
||||
|
||||
/*
|
||||
* load two userdefined characters from program memory
|
||||
* into LCD controller CG RAM location 0 and 1
|
||||
*/
|
||||
lcd_command(_BV(LCD_CGRAM)); /* set CG RAM start address 0 */
|
||||
for(i=0; i<16; i++)
|
||||
{
|
||||
lcd_data(pgm_read_byte_near(©RightChar[i]));
|
||||
}
|
||||
|
||||
/* move cursor to position 0 on line 2 */
|
||||
/* Note: this switched back to DD RAM adresses */
|
||||
lcd_gotoxy(0,1);
|
||||
|
||||
/* display user defined (c), built using two user defined chars */
|
||||
lcd_putc(0);
|
||||
lcd_putc(1);
|
||||
|
||||
|
||||
/* wait until push button PD2 (INT0) is pressed */
|
||||
wait_until_key_pressed();
|
||||
|
||||
}
|
||||
}
|
||||
BIN
trunk/workspace/00_Lib/Disp_Nokia5110/AVR-Nokia/Nokia5110LCD.pdf
Normal file
BIN
trunk/workspace/00_Lib/Disp_Nokia5110/AVR-Nokia/Nokia5110LCD.pdf
Normal file
Binary file not shown.
@@ -0,0 +1,32 @@
|
||||
/*------------------------------------------------------------------------------
|
||||
; MCU : AVR
|
||||
; width。チhighth: 40。チ24
|
||||
; type matrix set: Single color dot matrix LCD type」ャmocking up through lengthways
|
||||
; date: 2013-4-25
|
||||
------------------------------------------------------------------------------*/
|
||||
const unsigned char AVR_bmp[]=
|
||||
{
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0x40,
|
||||
0x20,0x00,0x10,0x10,0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x10,0x10,0x00,
|
||||
0x20,0x40,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x0C,0x02,0x01,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x0C,0x70,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,
|
||||
0x80,0xC0,0xE0,0xE0,0xF0,0xF0,0xF0,0xF0,0xE0,0xC0,0x00,0x00,0x00,0x00,0x00,0xC0,
|
||||
0xE0,0xF0,0xF0,0xF0,0xF0,0xE0,0xE0,0xC0,0x80,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,
|
||||
0x18,0x60,0x83,0x87,0x87,0x87,0x07,0x03,0x03,0x03,0x01,0x40,0xF0,0xF0,0xF0,0xF0,
|
||||
0xF0,0x40,0x01,0x03,0x03,0x03,0x07,0x87,0x87,0x87,0x83,0x60,0x18,0x00,0x07,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x1F,0x27,0x48,0x88,0x88,0x88,0x88,0x88,0x48,
|
||||
0x48,0x48,0x88,0x88,0x88,0x88,0x88,0x48,0x27,0x1F,0x00,0xFF,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x02,0x04,0x04,0x08,0x00,0x10,0x10,
|
||||
0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x08,0x04,0x04,0x02,0x03,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
###############################################################################
|
||||
# Makefile for the project nokia
|
||||
###############################################################################
|
||||
|
||||
## General Flags
|
||||
PROJECT = nokia
|
||||
MCU = atmega32
|
||||
TARGET = nokia.elf
|
||||
CC = avr-gcc.exe
|
||||
|
||||
## Options common to compile, link and assembly rules
|
||||
COMMON = -mmcu=$(MCU)
|
||||
|
||||
## Compile options common for all C compilation units.
|
||||
CFLAGS = $(COMMON)
|
||||
CFLAGS += -Wall -gdwarf-2 -DF_CPU=8000000UL -O0 -fsigned-char
|
||||
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d
|
||||
|
||||
## Assembly specific flags
|
||||
ASMFLAGS = $(COMMON)
|
||||
ASMFLAGS += $(CFLAGS)
|
||||
ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2
|
||||
|
||||
## Linker flags
|
||||
LDFLAGS = $(COMMON)
|
||||
LDFLAGS +=
|
||||
|
||||
|
||||
## Intel Hex file production flags
|
||||
HEX_FLASH_FLAGS = -R .eeprom
|
||||
|
||||
HEX_EEPROM_FLAGS = -j .eeprom
|
||||
HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load"
|
||||
HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 --no-change-warnings
|
||||
|
||||
|
||||
## Objects that must be built in order to link
|
||||
OBJECTS = main.o
|
||||
|
||||
## Objects explicitly added by the user
|
||||
LINKONLYOBJECTS =
|
||||
|
||||
## Build
|
||||
all: $(TARGET) nokia.hex nokia.eep size
|
||||
|
||||
## Compile
|
||||
main.o: ../main.c
|
||||
$(CC) $(INCLUDES) $(CFLAGS) -c $<
|
||||
|
||||
##Link
|
||||
$(TARGET): $(OBJECTS)
|
||||
$(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)
|
||||
|
||||
%.hex: $(TARGET)
|
||||
avr-objcopy -O ihex $(HEX_FLASH_FLAGS) $< $@
|
||||
|
||||
%.eep: $(TARGET)
|
||||
-avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@ || exit 0
|
||||
|
||||
%.lss: $(TARGET)
|
||||
avr-objdump -h -S $< > $@
|
||||
|
||||
size: ${TARGET}
|
||||
@echo
|
||||
@avr-size -C --mcu=${MCU} ${TARGET}
|
||||
|
||||
## Clean target
|
||||
.PHONY: clean
|
||||
clean:
|
||||
-rm -rf $(OBJECTS) nokia.elf dep/* nokia.hex nokia.eep
|
||||
|
||||
## Other dependencies
|
||||
-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
main.o: ../main.c c:/winavr-20100110/lib/gcc/../../avr/include/avr/io.h \
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/avr/sfr_defs.h \
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/inttypes.h \
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/stdint.h \
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/avr/iom32.h \
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/avr/portpins.h \
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/avr/common.h \
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/avr/version.h \
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/avr/fuse.h \
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/avr/lock.h \
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/avr/delay.h \
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/util/delay.h \
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/util/delay_basic.h \
|
||||
../nokia_5110.h ../english_6x8_pixel.h ../write_chinese_string_pixel.h \
|
||||
../bmp_pixel.h
|
||||
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/avr/io.h:
|
||||
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/avr/sfr_defs.h:
|
||||
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/inttypes.h:
|
||||
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/stdint.h:
|
||||
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/avr/iom32.h:
|
||||
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/avr/portpins.h:
|
||||
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/avr/common.h:
|
||||
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/avr/version.h:
|
||||
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/avr/fuse.h:
|
||||
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/avr/lock.h:
|
||||
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/avr/delay.h:
|
||||
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/util/delay.h:
|
||||
|
||||
c:/winavr-20100110/lib/gcc/../../avr/include/util/delay_basic.h:
|
||||
|
||||
../nokia_5110.h:
|
||||
|
||||
../english_6x8_pixel.h:
|
||||
|
||||
../write_chinese_string_pixel.h:
|
||||
|
||||
../bmp_pixel.h:
|
||||
@@ -0,0 +1 @@
|
||||
:00000001FF
|
||||
Binary file not shown.
@@ -0,0 +1,471 @@
|
||||
:100000000C942A000C943F000C943F000C943F0089
|
||||
:100010000C943F000C943F000C943F000C943F0064
|
||||
:100020000C943F000C943F000C943F000C943F0054
|
||||
:100030000C943F000C943F000C943F000C943F0044
|
||||
:100040000C943F000C943F000C943F000C943F0034
|
||||
:100050000C943F0011241FBECFE5D8E0DEBFCDBF1A
|
||||
:1000600016E0A0E6B0E0EAE8F7E102C005900D92E4
|
||||
:10007000A033B107D9F70E948C040C94C30B0C94E5
|
||||
:100080000000DF93CF93CDB7DEB768970FB6F89433
|
||||
:10009000DEBF0FBECDBF80E090E0A0E8BFE38D8B58
|
||||
:1000A0009E8BAF8BB88F6D897E898F89988D2BEA57
|
||||
:1000B0003AEA4AE250E40E949406DC01CB01898BC3
|
||||
:1000C0009A8BAB8BBC8B69897A898B899C8920E060
|
||||
:1000D00030E040E85FE30E949A0888231CF481E046
|
||||
:1000E000888B91C069897A898B899C8920E030E06E
|
||||
:1000F0004FE753E40E943A0818160CF07BC06D8954
|
||||
:100100007E898F89988D20E030E04AE754E40E9490
|
||||
:100110008E07DC01CB018C879D87AE87BF876C85FE
|
||||
:100120007D858E859F8520E030E04AEF54E40E9473
|
||||
:100130009406DC01CB0188879987AA87BB876885ED
|
||||
:1001400079858A859B8520E030E040E85FE30E9466
|
||||
:100150009A0888232CF481E090E09F838E833FC02F
|
||||
:10016000688579858A859B8520E03FEF4FE757E4D6
|
||||
:100170000E943A0818164CF56C857D858E859F8502
|
||||
:1001800020E030E040E251E40E949406DC01CB0123
|
||||
:10019000BC01CD010E94BE04DC01CB019F838E8394
|
||||
:1001A0000FC088EC90E09D838C838C819D810197AA
|
||||
:1001B000F1F79D838C838E819F8101979F838E832E
|
||||
:1001C0008E819F81009769F724C0688579858A852B
|
||||
:1001D0009B850E94BE04DC01CB019F838E838E81B0
|
||||
:1001E0009F819B838A838A819B810197F1F79B83FF
|
||||
:1001F0008A830FC069897A898B899C890E94BE0491
|
||||
:10020000DC01CB01888B8889898389818A95F1F704
|
||||
:10021000898368960FB6F894DEBF0FBECDBFCF912D
|
||||
:10022000DF910895DF93CF93CDB7DEB72E970FB64A
|
||||
:10023000F894DEBF0FBECDBF80E090E0A0E8BFE342
|
||||
:100240008B879C87AD87BE876B857C858D859E85DA
|
||||
:1002500020E030E04AEF54E40E949406DC01CB0138
|
||||
:100260008F839887A987BA876F81788589859A85D2
|
||||
:1002700020E030E040E85FE30E949A0888232CF4F5
|
||||
:1002800081E090E09E838D833FC06F817885898572
|
||||
:100290009A8520E03FEF4FE757E40E943A0818168E
|
||||
:1002A0004CF56B857C858D859E8520E030E040E2B5
|
||||
:1002B00051E40E949406DC01CB01BC01CD010E94F7
|
||||
:1002C000BE04DC01CB019E838D830FC088EC90E0DF
|
||||
:1002D0009C838B838B819C810197F1F79C838B831B
|
||||
:1002E0008D819E8101979E838D838D819E81009754
|
||||
:1002F00069F714C06F81788589859A850E94BE044C
|
||||
:10030000DC01CB019E838D838D819E819A838983BD
|
||||
:1003100089819A810197F1F79A8389832E960FB686
|
||||
:10032000F894DEBF0FBECDBFCF91DF910895DF936C
|
||||
:10033000CF93CDB7DEB760970FB6F894DEBF0FBE90
|
||||
:10034000CDBF988B8F878F859889CC01A0E0B0E0D6
|
||||
:10035000BC01CD010E941E09DC01CB018B879C876B
|
||||
:10036000AD87BE876B857C858D859E8520E030E0DE
|
||||
:100370004AEF54E40E949406DC01CB018F839887F6
|
||||
:10038000A987BA876F81788589859A8520E030E0D2
|
||||
:1003900040E85FE30E949A0888232CF481E090E013
|
||||
:1003A0009E838D833FC06F81788589859A8520E003
|
||||
:1003B0003FEF4FE757E40E943A0818164CF56B855B
|
||||
:1003C0007C858D859E8520E030E040E251E40E94EE
|
||||
:1003D0009406DC01CB01BC01CD010E94BE04DC010E
|
||||
:1003E000CB019E838D830FC088EC90E09C838B8330
|
||||
:1003F0008B819C810197F1F79C838B838D819E81FA
|
||||
:1004000001979E838D838D819E81009769F714C02B
|
||||
:100410006F81788589859A850E94BE04DC01CB01B5
|
||||
:100420009E838D838D819E819A83898389819A8120
|
||||
:100430000197F1F79A83898360960FB6F894DEBF2F
|
||||
:100440000FBECDBFCF91DF910895DF93CF93CDB78E
|
||||
:10045000DEB7AAE3B0E0EAE3F0E080818F618C933D
|
||||
:10046000ABE3B0E0EBE3F0E080818F7E8C930E9401
|
||||
:100470004100ABE3B0E0EBE3F0E0808180618C937E
|
||||
:10048000ABE3B0E0EBE3F0E08081877F8C930E94E8
|
||||
:100490004100ABE3B0E0EBE3F0E0808188608C9357
|
||||
:1004A0000E94410081E290E060E070E00E9433042D
|
||||
:1004B00088EC90E060E070E00E94330486E090E019
|
||||
:1004C00060E070E00E94330483E190E060E070E05F
|
||||
:1004D0000E94330480E290E060E070E00E94330408
|
||||
:1004E0000E9482028CE090E060E070E00E943304A1
|
||||
:1004F000ABE3B0E0EBE3F0E08081877F8C93CF91BA
|
||||
:10050000DF910895DF93CF9300D0CDB7DEB78CE0B5
|
||||
:1005100090E060E070E00E94330480E890E060E0EA
|
||||
:1005200070E00E9433041A8219820BC080E090E0D0
|
||||
:1005300061E070E00E94330489819A8101969A8378
|
||||
:10054000898389819A8121E0883F920778F30F900F
|
||||
:100550000F90CF91DF910895DF93CF9300D0CDB767
|
||||
:10056000DEB789836A838A818064882F90E060E0A7
|
||||
:1005700070E00E94330489818068882F90E060E0F9
|
||||
:1005800070E00E9433040F900F90CF91DF91089597
|
||||
:10059000DF93CF9300D0CDB7DEB78A838A818052B4
|
||||
:1005A0008A8319821CC08A81282F30E08981482FD4
|
||||
:1005B00050E0C901880F991F820F931F880F991F60
|
||||
:1005C000840F951FFC01E05AFF4F8081882F90E037
|
||||
:1005D00061E070E00E94330489818F5F89838981A3
|
||||
:1005E000863008F30F900F90CF91DF910895DF933D
|
||||
:1005F000CF9300D000D0CDB7DEB789836A835C8308
|
||||
:100600004B8389816A810E94AC020AC0EB81FC8124
|
||||
:1006100080810E94C8028B819C8101969C838B8380
|
||||
:10062000EB81FC818081882389F70F900F900F90D8
|
||||
:100630000F90CF91DF910895EF920F93DF93CF93B7
|
||||
:10064000CDB7DEB728970FB6F894DEBF0FBECDBF8B
|
||||
:100650008B836C834D832E830F83E8868B816C8123
|
||||
:100660000E94AC021A827CC0198252C099818D818D
|
||||
:10067000981749F58A81882341F48C81982F9F5FD0
|
||||
:100680008B81692F0E94AC021EC08D81282F30E023
|
||||
:100690008885882F90E0280F391F8A81882F90E065
|
||||
:1006A000AC01249FC001259F900D349F900D112413
|
||||
:1006B000982F8B81292F280F8C81982F9F5F822F55
|
||||
:1006C000692F0E94AC028F81282F30E08A81882F09
|
||||
:1006D00090E0280F391F8981482F50E0C901880F09
|
||||
:1006E000991F820F931F880F991F880F991F880FDA
|
||||
:1006F000991F840F951FFC01E857FD4F8081882FBB
|
||||
:1007000090E061E070E00E94330489818F5F89830B
|
||||
:100710008981282F30E08D81882F90E0880F991FE4
|
||||
:10072000281739070CF4A2CF8A818F5F8A838D81C5
|
||||
:10073000282F30E08885882F90E0280F391F8A8184
|
||||
:10074000882F90E0AC01249FC001259F900D349F1D
|
||||
:10075000900D1124982F8B81890F6C810E94AC021F
|
||||
:100760009A818E81981708F47FCF28960FB6F89457
|
||||
:10077000DEBF0FBECDBFCF91DF910F91EF900895F7
|
||||
:100780000F93DF93CF93CDB7DEB72B970FB6F894C7
|
||||
:10079000DEBF0FBECDBF8E836F83598748872A8700
|
||||
:1007A0000B878B85882F90E087709070009731F4CD
|
||||
:1007B0008B85869586958695898306C08B858695DB
|
||||
:1007C000869586958F5F89831B821A8239C08E81B8
|
||||
:1007D0006F810E94AC021D821C8222C08A85282F54
|
||||
:1007E00030E08A819B81A901489F9001499F300D8B
|
||||
:1007F000589F300D11248C819D81280F391F8885C9
|
||||
:100800009985FC01E20FF31F8081882F90E061E061
|
||||
:1008100070E00E9433048C819D8101969D838C83BE
|
||||
:100820008A85282F30E08C819D8182179307B0F252
|
||||
:100830008F818F5F8F838A819B8101969B838A83BF
|
||||
:100840008981282F30E08A819B818217930708F4E1
|
||||
:10085000BECF2B960FB6F894DEBF0FBECDBFCF91A3
|
||||
:10086000DF910F910895DF93CF9300D00F92CDB712
|
||||
:10087000DEB78A836B83ABE3B0E0EBE3F0E080812B
|
||||
:10088000877F8C938B81882341F4ABE3B0E0EBE36B
|
||||
:10089000F0E080818B7F8C9307C0ABE3B0E0EBE3AB
|
||||
:1008A000F0E0808184608C93198226C08A8188233D
|
||||
:1008B00044F4ABE3B0E0EBE3F0E0808182608C9342
|
||||
:1008C00007C0ABE3B0E0EBE3F0E080818D7F8C9379
|
||||
:1008D000ABE3B0E0EBE3F0E080818E7F8C938A8124
|
||||
:1008E000880F8A83ABE3B0E0EBE3F0E080818160C6
|
||||
:1008F0008C9389818F5F898389818830B8F2ABE3DB
|
||||
:10090000B0E0EBE3F0E0808188608C930F900F9073
|
||||
:100910000F90CF91DF910895EF920F93DF93CF93D4
|
||||
:10092000CDB7DEB70E9425020E9482022EEE34E08F
|
||||
:1009300080E060E0A9010E94F7022CEF34E080E043
|
||||
:1009400061E0A9010E94F7022AE035E080E062E060
|
||||
:10095000A9010E94F70229E135E080E063E0A901E6
|
||||
:100960000E94F7028CE064E04CE024E000E00F2EEF
|
||||
:10097000F5E0EF2EF02D0E941C03D8CFEF92FF92EE
|
||||
:100980000F931F937B018C0120E030E040E05FE497
|
||||
:100990000E946A0888238CF0C801B70120E030E08B
|
||||
:1009A00040E05FE40E9436060E94CA089B01AC0149
|
||||
:1009B000205030404040504806C0C801B7010E9456
|
||||
:1009C000CA089B01AC01B901CA011F910F91FF90A8
|
||||
:1009D000EF900895A0E0B0E0E0EFF4E00C948C0B11
|
||||
:1009E000DC012B01FA019C91923008F439C1EB0132
|
||||
:1009F0008881823008F433C1943069F4843009F07E
|
||||
:100A00002FC111969C9111978981981709F428C1DB
|
||||
:100A1000A8E2B5E025C1843009F421C18230A9F4EF
|
||||
:100A2000923009F01DC19A01AD0188E0EA010990F8
|
||||
:100A3000AE01E90109929E018150C1F7E20189816D
|
||||
:100A400011969C918923818308C1923009F407C1D2
|
||||
:100A500012962D903C901397EB018A819B811496FE
|
||||
:100A6000AD90BD90CD90DC901797EC80FD800E810D
|
||||
:100A70001F819101281B390BB90137FF04C066277C
|
||||
:100A80007727621B730B603271050CF061C0121680
|
||||
:100A900013066CF537014801062E04C0969487941E
|
||||
:100AA000779467940A94D2F721E030E040E050E078
|
||||
:100AB00004C0220F331F441F551F6A95D2F72150DF
|
||||
:100AC0003040404050402E213F21402351232115EA
|
||||
:100AD00031054105510521F021E030E040E050E0D2
|
||||
:100AE00079018A01E628F728082919293CC0232B17
|
||||
:100AF000D1F1260E371E35014601062E04C096940C
|
||||
:100B00008794779467940A94D2F721E030E040E02C
|
||||
:100B100050E004C0220F331F441F551F6A95D2F7BF
|
||||
:100B200021503040404050402A213B214C215D2142
|
||||
:100B3000211531054105510521F021E030E040E06B
|
||||
:100B400050E059016A01A628B728C828D9280BC047
|
||||
:100B5000821593052CF01C01AA24BB24650103C057
|
||||
:100B6000EE24FF24870111969C91D20111968C915D
|
||||
:100B7000981709F445C0992339F0A80197012A195B
|
||||
:100B80003B094C095D0906C0A60195012E193F09D4
|
||||
:100B9000400B510B57FD08C01182338222822483FF
|
||||
:100BA0003583468357831DC081E08183338222824F
|
||||
:100BB00088279927DC01821B930BA40BB50B848338
|
||||
:100BC0009583A683B7830DC0220F331F441F551F83
|
||||
:100BD000248335834683578382819381019793834E
|
||||
:100BE00082832481358146815781DA01C9010197C9
|
||||
:100BF000A109B1098F5F9F4FAF4FBF4328F30BC0CF
|
||||
:100C0000918333822282EA0CFB1C0C1D1D1DE482A1
|
||||
:100C1000F5820683178383E08083248135814681B2
|
||||
:100C2000578157FF1AC0C901AA2797FDA095BA2F6F
|
||||
:100C300081709070A070B070569547953795279544
|
||||
:100C4000822B932BA42BB52B84839583A683B78308
|
||||
:100C500082819381019693838283DF0101C0D20157
|
||||
:100C6000CD01CDB7DEB7E2E10C94A80BA0E2B0E075
|
||||
:100C7000ECE3F6E00C94980B69837A838B839C8376
|
||||
:100C80002D833E834F835887E9E0EE2EF12CEC0E46
|
||||
:100C9000FD1ECE010196B7010E94BB0A8E010F5EB8
|
||||
:100CA0001F4FCE010596B8010E94BB0A8A8991E0C8
|
||||
:100CB00089278A8BC701B801AE01475E5F4F0E944A
|
||||
:100CC000EA040E94E609A096E6E00C94B40BA0E2C8
|
||||
:100CD000B0E0EDE6F6E00C94980B69837A838B83A1
|
||||
:100CE0009C832D833E834F835887F9E0EF2EF12CB0
|
||||
:100CF000EC0EFD1ECE010196B7010E94BB0A8E01CB
|
||||
:100D00000F5E1F4FCE010596B8010E94BB0AC701B6
|
||||
:100D1000B801AE01475E5F4F0E94EA040E94E609F7
|
||||
:100D2000A096E6E00C94B40BA0E2B0E0EAE9F6E0AD
|
||||
:100D30000C948C0B69837A838B839C832D833E83F5
|
||||
:100D40004F835887CE010196BE01675F7F4F0E9497
|
||||
:100D5000BB0ACE010596BE016F5E7F4F0E94BB0AA3
|
||||
:100D60009985923088F089898230C8F0943019F4DE
|
||||
:100D7000823051F404C0843029F4923081F488E246
|
||||
:100D800095E0C6C0923049F420E09A858A8998138C
|
||||
:100D900021E02A87CE010996BBC0823049F420E0C9
|
||||
:100DA0009A858A89981321E02A8BCE014196B0C09A
|
||||
:100DB0002D843E844F8458886D887E888F88988CD7
|
||||
:100DC000EE24FF248701AA24BB24650140E050E003
|
||||
:100DD00060E070E0E0E0F0E0C10181709070892B8C
|
||||
:100DE000E9F0E60CF71C081D191D9A01AB012A0D4C
|
||||
:100DF0003B1D4C1D5D1D80E090E0A0E0B0E0E614DE
|
||||
:100E0000F7040805190520F481E090E0A0E0B0E0C7
|
||||
:100E1000BA01A901480F591F6A1F7B1FAA0CBB1CEE
|
||||
:100E2000CC1CDD1C97FE08C081E090E0A0E0B0E0A3
|
||||
:100E3000A82AB92ACA2ADB2A3196E032F10549F0FC
|
||||
:100E4000660C771C881C991C5694479437942794F9
|
||||
:100E5000C3CFFA85EA892B893C898B859C85280F2D
|
||||
:100E6000391F2E5F3F4F17C0CA0181709070892BC8
|
||||
:100E700061F016950795F794E79480E090E0A0E084
|
||||
:100E8000B0E8E82AF92A0A2B1B2B76956795579527
|
||||
:100E900047952F5F3F4F77FDE7CF0CC0440F551F9D
|
||||
:100EA000661F771F17FD4160EE0CFF1C001F111F0E
|
||||
:100EB00021503040403090E0590790E0690790E4BD
|
||||
:100EC000790760F32B8F3C8FDB01CA018F7790701D
|
||||
:100ED000A070B07080349105A105B10561F447FDA3
|
||||
:100EE0000AC0E114F1040105110529F0405C5F4FCF
|
||||
:100EF0006F4F7F4F40781A8EFE1711F081E08A8F76
|
||||
:100F00004D8F5E8F6F8F78A383E0898FCE014996D6
|
||||
:100F10000E94E609A096E2E10C94A80BA8E1B0E0DB
|
||||
:100F2000E4E9F7E00C94940B69837A838B839C83C8
|
||||
:100F30002D833E834F835887B9E0EB2EF12CEC0EC6
|
||||
:100F4000FD1ECE010196B7010E94BB0A8E010F5E05
|
||||
:100F50001F4FCE010596B8010E94BB0A2985223099
|
||||
:100F600008F47EC03989323010F4B8017CC08A851B
|
||||
:100F70009A8989278A87243011F0223031F4231787
|
||||
:100F800009F06EC068E275E06EC0343039F41D8639
|
||||
:100F90001E861F86188A1C861B8604C0323021F4E8
|
||||
:100FA00084E08987B7015FC02B853C858B899C894C
|
||||
:100FB000281B390B3C872B87ED84FE840F8518890D
|
||||
:100FC000AD88BE88CF88D88CEA14FB040C051D05BB
|
||||
:100FD00040F4EE0CFF1C001F111F215030403C87D5
|
||||
:100FE0002B8720E030E040E050E080E090E0A0E09F
|
||||
:100FF000B0E460E070E0EA14FB040C051D0540F06D
|
||||
:10100000282B392B4A2B5B2BEA18FB080C091D09EE
|
||||
:10101000B695A79597958795EE0CFF1C001F111F9D
|
||||
:101020006F5F7F4F6F31710531F7DA01C9018F773B
|
||||
:101030009070A070B07080349105A105B10561F485
|
||||
:1010400027FD0AC0E114F1040105110529F0205C17
|
||||
:101050003F4F4F4F5F4F20782D873E874F87588BEC
|
||||
:10106000BE01675F7F4FCB010E94E6096896EAE008
|
||||
:101070000C94B00BA8E1B0E0E0E4F8E00C94980B1D
|
||||
:1010800069837A838B839C832D833E834F83588728
|
||||
:1010900089E0E82EF12CEC0EFD1ECE010196B70181
|
||||
:1010A0000E94BB0A8E010F5E1F4FCE010596B8014C
|
||||
:1010B0000E94BB0A8985823040F08989823028F0FD
|
||||
:1010C000C701B8010E94330B01C08FEF6896E6E0BC
|
||||
:1010D0000C94B40BA8E1B0E0E0E7F8E00C94980BB6
|
||||
:1010E00069837A838B839C832D833E834F835887C8
|
||||
:1010F00089E0E82EF12CEC0EFD1ECE010196B70121
|
||||
:101100000E94BB0A8E010F5E1F4FCE010596B801EB
|
||||
:101110000E94BB0A8985823040F08989823028F09C
|
||||
:10112000C701B8010E94330B01C08FEF6896E6E05B
|
||||
:101130000C94B40BA8E1B0E0E0EAF8E00C94980B52
|
||||
:1011400069837A838B839C832D833E834F83588767
|
||||
:1011500089E0E82EF12CEC0EFD1ECE010196B701C0
|
||||
:101160000E94BB0A8E010F5E1F4FCE010596B8018B
|
||||
:101170000E94BB0A8985823040F08989823028F03C
|
||||
:10118000C701B8010E94330B01C081E06896E6E018
|
||||
:101190000C94B40BACE0B0E0E0EDF8E00C949C0BE8
|
||||
:1011A00069837A838B839C83CE010196BE016B5F3A
|
||||
:1011B0007F4F0E94BB0A8D81823061F1823050F1F5
|
||||
:1011C000843021F48E81882351F12EC02F813885FF
|
||||
:1011D00037FD20C06E812F3131051CF06623F9F0F8
|
||||
:1011E00023C08EE190E0821B930B29853A854B85C5
|
||||
:1011F0005C8504C056954795379527958A95D2F713
|
||||
:101200006623B1F050954095309521953F4F4F4F53
|
||||
:101210005F4F0EC020E030E040E050E009C02FEF0B
|
||||
:101220003FEF4FEF5FE704C020E030E040E050E8E0
|
||||
:10123000B901CA012C96E2E00C94B80BA8E0B0E02A
|
||||
:10124000E4E2F9E00C94940B7B018C0161157105CB
|
||||
:101250008105910519F482E0898360C083E0898368
|
||||
:101260008EE1C82ED12CDC82CB82ED82FE820F83F0
|
||||
:101270001887C801B7010E949709FC013197F7FF51
|
||||
:101280003BC0222733272E1B3F0B57016801022E3C
|
||||
:1012900004C0D694C794B794A7940A94D2F740E0B8
|
||||
:1012A00050E060E070E081E090E0A0E0B0E004C0D9
|
||||
:1012B000880F991FAA1FBB1F2A95D2F70197A10972
|
||||
:1012C000B1098E219F21A023B1230097A105B1056B
|
||||
:1012D00021F041E050E060E070E04A295B296C2990
|
||||
:1012E0007D294D835E836F8378878EE190E08E1B2E
|
||||
:1012F0009F0B9C838B8312C0309781F00E2E04C00D
|
||||
:10130000EE0CFF1C001F111F0A94D2F7ED82FE8223
|
||||
:101310000F831887CE1ADF0ADC82CB821A82CE01B5
|
||||
:1013200001960E94E6092896EAE00C94B00BEF9231
|
||||
:10133000FF920F931F937B018C0180E0E81680E001
|
||||
:10134000F80681E0080780E0180788F48FEFE816B8
|
||||
:10135000F1040105110531F028F088E090E0A0E0EB
|
||||
:10136000B0E017C080E090E0A0E0B0E012C080E004
|
||||
:10137000E81680E0F80680E0080781E0180728F00A
|
||||
:1013800088E190E0A0E0B0E004C080E190E0A0E05F
|
||||
:10139000B0E020E230E040E050E0281B390B4A0B7F
|
||||
:1013A0005B0B04C016950795F794E7948A95D2F7DE
|
||||
:1013B000F701E05DFA4F8081281B3109410951098D
|
||||
:1013C000C9011F910F91FF90EF900895DF92EF9266
|
||||
:1013D000FF920F931F93FC01E480F5800681178133
|
||||
:1013E000D1808081823048F480E090E0A0E1B0E0DC
|
||||
:1013F000E82AF92A0A2B1B2BA5C0843009F49FC0C8
|
||||
:10140000823021F4EE24FF24870105C0E114F104A9
|
||||
:101410000105110519F4E0E0F0E096C062817381E6
|
||||
:101420009FEF623879070CF05BC022E83FEF261B84
|
||||
:10143000370B2A3131052CF020E030E040E050E05D
|
||||
:101440002AC0B801A701022E04C07695679557956A
|
||||
:1014500047950A94D2F781E090E0A0E0B0E004C0A4
|
||||
:10146000880F991FAA1FBB1F2A95D2F70197A109C0
|
||||
:10147000B1098E219F21A023B1230097A105B105B9
|
||||
:1014800021F081E090E0A0E0B0E09A01AB01282BD0
|
||||
:10149000392B4A2B5B2BDA01C9018F779070A07032
|
||||
:1014A000B07080349105A105B10539F427FF09C05A
|
||||
:1014B000205C3F4F4F4F5F4F04C0215C3F4F4F4F69
|
||||
:1014C0005F4FE0E0F0E02030A0E03A07A0E04A07FC
|
||||
:1014D000A0E45A0710F0E1E0F0E079018A0127C0AA
|
||||
:1014E0006038710564F5FB01E158FF4FD801C70171
|
||||
:1014F0008F779070A070B07080349105A105B10510
|
||||
:1015000039F4E7FE0DC080E490E0A0E0B0E004C054
|
||||
:101510008FE390E0A0E0B0E0E80EF91E0A1F1B1F69
|
||||
:1015200017FF05C016950795F794E794319687E065
|
||||
:1015300016950795F794E7948A95D1F705C0EE24A0
|
||||
:10154000FF248701EFEFF0E06E2F67956627679520
|
||||
:10155000902F9F77D794DD24D7948E2F8695492F8F
|
||||
:10156000462B582F5D29B701CA011F910F91FF909B
|
||||
:10157000EF90DF900895FC01DB01408151812281D1
|
||||
:10158000622F6F7770E0221F2227221F9381892FFD
|
||||
:10159000880F822B282F30E0991F9927991F1196C9
|
||||
:1015A0009C93119721153105A9F541155105610548
|
||||
:1015B000710511F482E037C082E89FEF13969C9387
|
||||
:1015C0008E9312979A01AB0167E0220F331F441FDD
|
||||
:1015D000551F6A95D1F783E08C930DC0220F331FFE
|
||||
:1015E000441F551F12968D919C9113970197139646
|
||||
:1015F0009C938E931297203080E0380780E0480754
|
||||
:1016000080E4580758F314962D933D934D935C93C3
|
||||
:10161000179708952F3F310579F44115510561055C
|
||||
:10162000710519F484E08C93089564FF03C081E090
|
||||
:101630008C9312C01C9210C02F57304013963C93CD
|
||||
:101640002E93129783E08C9387E0440F551F661FFB
|
||||
:10165000771F8A95D1F7706414964D935D936D93BF
|
||||
:101660007C93179708951F93DC01FB019C919230A6
|
||||
:1016700008F447C08081823008F443C0943051F4AC
|
||||
:1016800011961C91843099F58181682F70E0611B5F
|
||||
:1016900071093FC0843021F0923031F48230B9F1C9
|
||||
:1016A0008181882389F12DC011961C911197823078
|
||||
:1016B000F1F081811817D9F412962D913C9113976E
|
||||
:1016C000828193818217930794F028173907BCF021
|
||||
:1016D00014968D919D910D90BC91A02D2481358102
|
||||
:1016E00046815781281739074A075B0718F41123E9
|
||||
:1016F00041F00AC082179307A407B50740F41123ED
|
||||
:1017000019F061E070E005C06FEF7FEF02C060E0AC
|
||||
:1017100070E0CB011F9108952F923F924F925F92FC
|
||||
:101720006F927F928F929F92AF92BF92CF92DF92F1
|
||||
:10173000EF92FF920F931F93CF93DF93CDB7DEB756
|
||||
:10174000CA1BDB0B0FB6F894DEBF0FBECDBF0994EA
|
||||
:101750002A88398848885F846E847D848C849B8441
|
||||
:10176000AA84B984C884DF80EE80FD800C811B814F
|
||||
:10177000AA81B981CE0FD11D0FB6F894DEBF0FBE7E
|
||||
:0A178000CDBFED010895F894FFCFEE
|
||||
:10178A000000000000000000002F00000000070019
|
||||
:10179A00070000147F147F1400242A7F2A12006293
|
||||
:1017AA00640813230036495522500000050300003F
|
||||
:1017BA0000001C224100000041221C000014083EC7
|
||||
:1017CA0008140008083E0808000000A0600000088D
|
||||
:1017DA0008080808000060600000002010080402E1
|
||||
:1017EA00003E5149453E0000427F4000004261519F
|
||||
:1017FA004946002141454B31001814127F10002739
|
||||
:10180A0045454539003C4A494930000171090503FB
|
||||
:10181A0000364949493600064949291E000036362C
|
||||
:10182A00000000005636000000081422410000148F
|
||||
:10183A00141414140000412214080002015109066C
|
||||
:10184A0000324959513E007C1211127C007F4949ED
|
||||
:10185A004936003E41414122007F4141221C007F1E
|
||||
:10186A0049494941007F09090901003E4149497A2C
|
||||
:10187A00007F0808087F0000417F410000204041A6
|
||||
:10188A003F01007F08142241007F40404040007F12
|
||||
:10189A00020C027F007F0408107F003E4141413E56
|
||||
:1018AA00007F09090906003E4151215E007F09199E
|
||||
:1018BA0029460046494949310001017F0101003F9B
|
||||
:1018CA004040403F001F2040201F003F4038403F1B
|
||||
:1018DA00006314081463000708700807006151497F
|
||||
:1018EA00454300007F41410000552A552A55000012
|
||||
:1018FA0041417F0000040201020400404040404090
|
||||
:10190A00000001020400002054545478007F484427
|
||||
:10191A00443800384444442000384444487F00385E
|
||||
:10192A005454541800087E0901020018A4A4A47C87
|
||||
:10193A00007F080404780000447D40000040808451
|
||||
:10194A007D00007F102844000000417F4000007C99
|
||||
:10195A0004180478007C08040478003844444438A5
|
||||
:10196A0000FC242424180018242418FC007C0804F1
|
||||
:10197A00040800485454542000043F444020003CCA
|
||||
:10198A004040207C001C2040201C003C4030403C51
|
||||
:10199A00004428102844001CA0A0A07C00446454E1
|
||||
:1019AA004C4414141414141489F200FF01F9FF00B2
|
||||
:1019BA00FC00FF00000704040201020401040700FE
|
||||
:1019CA0011F6000424E42424FF050600000702019E
|
||||
:1019DA0002030101010207008A6AFF4920AFA9E94F
|
||||
:1019EA00A9AF20000100070004040407040404004E
|
||||
:1019FA0000FE424A4A5BEA5A4AC242000601000015
|
||||
:101A0A00040407000000000000FC949494FF9494DE
|
||||
:101A1A0094FE04000001000000030404040406000C
|
||||
:101A2A002021212121F92925233120000000000449
|
||||
:101A3A00040700000000000018D654FF5456D400D2
|
||||
:101A4A00FC00FF0000030007000203000404070073
|
||||
:101A5A001008FC130804FF242424040000000700D3
|
||||
:101A6A000000070101010100406252CA47E242DE5A
|
||||
:101A7A005050580004020104040700000102040047
|
||||
:101A8A0004A424A424BF242424A6040002010007D9
|
||||
:101A9A0004040504060003008444F52E401010FFD8
|
||||
:101AAA0010101000000007000404040704040400D6
|
||||
:101ABA000000000000000000000000000080C0409C
|
||||
:101ACA002000101000080808080808080010100074
|
||||
:101ADA002040C0800000000000000000000000005C
|
||||
:101AEA000000000000000000000000700C0201006D
|
||||
:101AFA0000000000000000000000000000000000DC
|
||||
:101B0A0000000000000001020C700000000000004C
|
||||
:101B1A000000000000000000000000007F0000003C
|
||||
:101B2A0080C0E0E0F0F0F0F0E0C00000000000C08B
|
||||
:101B3A00E0F0F0F0F0E0E0C0800000007F0000007C
|
||||
:101B4A000000000000000000000000000000070084
|
||||
:101B5A00186083878787070303030140F0F0F0F0DA
|
||||
:101B6A00F040010303030787878783601800070093
|
||||
:101B7A00000000000000000000000000000000005B
|
||||
:101B8A000000000000FF001F2748888888888848CE
|
||||
:101B9A004848888888888848271F00FF0000000076
|
||||
:101BAA00000000000000000000000000000000002B
|
||||
:101BBA0000000000000000000302040408001010E6
|
||||
:101BCA001010101010101000080404020300000086
|
||||
:101BDA0000000000000000000000000000000000FB
|
||||
:101BEA0000000000000000000000000000000000EB
|
||||
:101BFA0000000000000000000000000000000000DB
|
||||
:101C0A000000000000000000000000000000205753
|
||||
:101C1A00656C636F6D6520746F20200020416D79BB
|
||||
:101C2A00202073747564696F2000616D792D737457
|
||||
:101C3A007564696F2E636F6D00204E6F6B69613535
|
||||
:101C4A00313130204C434400000000000000000005
|
||||
:101C5A000001020203030303040404040404040449
|
||||
:101C6A00050505050505050505050505050505051A
|
||||
:101C7A0006060606060606060606060606060606FA
|
||||
:101C8A0006060606060606060606060606060606EA
|
||||
:101C9A0007070707070707070707070707070707CA
|
||||
:101CAA0007070707070707070707070707070707BA
|
||||
:101CBA0007070707070707070707070707070707AA
|
||||
:101CCA00070707070707070707070707070707079A
|
||||
:101CDA00080808080808080808080808080808087A
|
||||
:101CEA00080808080808080808080808080808086A
|
||||
:101CFA00080808080808080808080808080808085A
|
||||
:101D0A000808080808080808080808080808080849
|
||||
:101D1A000808080808080808080808080808080839
|
||||
:101D2A000808080808080808080808080808080829
|
||||
:101D3A000808080808080808080808080808080819
|
||||
:101D4A000808080808080808080808080808080809
|
||||
:00000001FF
|
||||
@@ -0,0 +1,98 @@
|
||||
// 6 x 8 font
|
||||
// 1 pixel space at left and bottom
|
||||
// index = ASCII - 32
|
||||
const unsigned char font6x8[][6] =
|
||||
{
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // sp
|
||||
{ 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00 }, // !
|
||||
{ 0x00, 0x00, 0x07, 0x00, 0x07, 0x00 }, // "
|
||||
{ 0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14 }, // #
|
||||
{ 0x00, 0x24, 0x2a, 0x7f, 0x2a, 0x12 }, // $
|
||||
{ 0x00, 0x62, 0x64, 0x08, 0x13, 0x23 }, // %
|
||||
{ 0x00, 0x36, 0x49, 0x55, 0x22, 0x50 }, // &
|
||||
{ 0x00, 0x00, 0x05, 0x03, 0x00, 0x00 }, // '
|
||||
{ 0x00, 0x00, 0x1c, 0x22, 0x41, 0x00 }, // (
|
||||
{ 0x00, 0x00, 0x41, 0x22, 0x1c, 0x00 }, // )
|
||||
{ 0x00, 0x14, 0x08, 0x3E, 0x08, 0x14 }, // *
|
||||
{ 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08 }, // +
|
||||
{ 0x00, 0x00, 0x00, 0xA0, 0x60, 0x00 }, // ,
|
||||
{ 0x00, 0x08, 0x08, 0x08, 0x08, 0x08 }, // -
|
||||
{ 0x00, 0x00, 0x60, 0x60, 0x00, 0x00 }, // .
|
||||
{ 0x00, 0x20, 0x10, 0x08, 0x04, 0x02 }, // /
|
||||
{ 0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0
|
||||
{ 0x00, 0x00, 0x42, 0x7F, 0x40, 0x00 }, // 1
|
||||
{ 0x00, 0x42, 0x61, 0x51, 0x49, 0x46 }, // 2
|
||||
{ 0x00, 0x21, 0x41, 0x45, 0x4B, 0x31 }, // 3
|
||||
{ 0x00, 0x18, 0x14, 0x12, 0x7F, 0x10 }, // 4
|
||||
{ 0x00, 0x27, 0x45, 0x45, 0x45, 0x39 }, // 5
|
||||
{ 0x00, 0x3C, 0x4A, 0x49, 0x49, 0x30 }, // 6
|
||||
{ 0x00, 0x01, 0x71, 0x09, 0x05, 0x03 }, // 7
|
||||
{ 0x00, 0x36, 0x49, 0x49, 0x49, 0x36 }, // 8
|
||||
{ 0x00, 0x06, 0x49, 0x49, 0x29, 0x1E }, // 9
|
||||
{ 0x00, 0x00, 0x36, 0x36, 0x00, 0x00 }, // :
|
||||
{ 0x00, 0x00, 0x56, 0x36, 0x00, 0x00 }, // ;
|
||||
{ 0x00, 0x08, 0x14, 0x22, 0x41, 0x00 }, // <
|
||||
{ 0x00, 0x14, 0x14, 0x14, 0x14, 0x14 }, // =
|
||||
{ 0x00, 0x00, 0x41, 0x22, 0x14, 0x08 }, // >
|
||||
{ 0x00, 0x02, 0x01, 0x51, 0x09, 0x06 }, // ?
|
||||
{ 0x00, 0x32, 0x49, 0x59, 0x51, 0x3E }, // @
|
||||
{ 0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C }, // A
|
||||
{ 0x00, 0x7F, 0x49, 0x49, 0x49, 0x36 }, // B
|
||||
{ 0x00, 0x3E, 0x41, 0x41, 0x41, 0x22 }, // C
|
||||
{ 0x00, 0x7F, 0x41, 0x41, 0x22, 0x1C }, // D
|
||||
{ 0x00, 0x7F, 0x49, 0x49, 0x49, 0x41 }, // E
|
||||
{ 0x00, 0x7F, 0x09, 0x09, 0x09, 0x01 }, // F
|
||||
{ 0x00, 0x3E, 0x41, 0x49, 0x49, 0x7A }, // G
|
||||
{ 0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F }, // H
|
||||
{ 0x00, 0x00, 0x41, 0x7F, 0x41, 0x00 }, // I
|
||||
{ 0x00, 0x20, 0x40, 0x41, 0x3F, 0x01 }, // J
|
||||
{ 0x00, 0x7F, 0x08, 0x14, 0x22, 0x41 }, // K
|
||||
{ 0x00, 0x7F, 0x40, 0x40, 0x40, 0x40 }, // L
|
||||
{ 0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F }, // M
|
||||
{ 0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F }, // N
|
||||
{ 0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E }, // O
|
||||
{ 0x00, 0x7F, 0x09, 0x09, 0x09, 0x06 }, // P
|
||||
{ 0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E }, // Q
|
||||
{ 0x00, 0x7F, 0x09, 0x19, 0x29, 0x46 }, // R
|
||||
{ 0x00, 0x46, 0x49, 0x49, 0x49, 0x31 }, // S
|
||||
{ 0x00, 0x01, 0x01, 0x7F, 0x01, 0x01 }, // T
|
||||
{ 0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F }, // U
|
||||
{ 0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F }, // V
|
||||
{ 0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F }, // W
|
||||
{ 0x00, 0x63, 0x14, 0x08, 0x14, 0x63 }, // X
|
||||
{ 0x00, 0x07, 0x08, 0x70, 0x08, 0x07 }, // Y
|
||||
{ 0x00, 0x61, 0x51, 0x49, 0x45, 0x43 }, // Z
|
||||
{ 0x00, 0x00, 0x7F, 0x41, 0x41, 0x00 }, // [
|
||||
{ 0x00, 0x55, 0x2A, 0x55, 0x2A, 0x55 }, // 55
|
||||
{ 0x00, 0x00, 0x41, 0x41, 0x7F, 0x00 }, // ]
|
||||
{ 0x00, 0x04, 0x02, 0x01, 0x02, 0x04 }, // ^
|
||||
{ 0x00, 0x40, 0x40, 0x40, 0x40, 0x40 }, // _
|
||||
{ 0x00, 0x00, 0x01, 0x02, 0x04, 0x00 }, // '
|
||||
{ 0x00, 0x20, 0x54, 0x54, 0x54, 0x78 }, // a
|
||||
{ 0x00, 0x7F, 0x48, 0x44, 0x44, 0x38 }, // b
|
||||
{ 0x00, 0x38, 0x44, 0x44, 0x44, 0x20 }, // c
|
||||
{ 0x00, 0x38, 0x44, 0x44, 0x48, 0x7F }, // d
|
||||
{ 0x00, 0x38, 0x54, 0x54, 0x54, 0x18 }, // e
|
||||
{ 0x00, 0x08, 0x7E, 0x09, 0x01, 0x02 }, // f
|
||||
{ 0x00, 0x18, 0xA4, 0xA4, 0xA4, 0x7C }, // g
|
||||
{ 0x00, 0x7F, 0x08, 0x04, 0x04, 0x78 }, // h
|
||||
{ 0x00, 0x00, 0x44, 0x7D, 0x40, 0x00 }, // i
|
||||
{ 0x00, 0x40, 0x80, 0x84, 0x7D, 0x00 }, // j
|
||||
{ 0x00, 0x7F, 0x10, 0x28, 0x44, 0x00 }, // k
|
||||
{ 0x00, 0x00, 0x41, 0x7F, 0x40, 0x00 }, // l
|
||||
{ 0x00, 0x7C, 0x04, 0x18, 0x04, 0x78 }, // m
|
||||
{ 0x00, 0x7C, 0x08, 0x04, 0x04, 0x78 }, // n
|
||||
{ 0x00, 0x38, 0x44, 0x44, 0x44, 0x38 }, // o
|
||||
{ 0x00, 0xFC, 0x24, 0x24, 0x24, 0x18 }, // p
|
||||
{ 0x00, 0x18, 0x24, 0x24, 0x18, 0xFC }, // q
|
||||
{ 0x00, 0x7C, 0x08, 0x04, 0x04, 0x08 }, // r
|
||||
{ 0x00, 0x48, 0x54, 0x54, 0x54, 0x20 }, // s
|
||||
{ 0x00, 0x04, 0x3F, 0x44, 0x40, 0x20 }, // t
|
||||
{ 0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C }, // u
|
||||
{ 0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C }, // v
|
||||
{ 0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C }, // w
|
||||
{ 0x00, 0x44, 0x28, 0x10, 0x28, 0x44 }, // x
|
||||
{ 0x00, 0x1C, 0xA0, 0xA0, 0xA0, 0x7C }, // y
|
||||
{ 0x00, 0x44, 0x64, 0x54, 0x4C, 0x44 }, // z
|
||||
{ 0x14, 0x14, 0x14, 0x14, 0x14, 0x14 } // horiz lines
|
||||
};
|
||||
39
trunk/workspace/00_Lib/Disp_Nokia5110/AVR-Nokia/nokia/main.c
Normal file
39
trunk/workspace/00_Lib/Disp_Nokia5110/AVR-Nokia/nokia/main.c
Normal file
@@ -0,0 +1,39 @@
|
||||
//Function: This procedure is used based on the AVR microcontroller ATMEGA32A-PU to control the Nokia5110LCD
|
||||
//Editing environment: the AVR Studio 4.0
|
||||
//Figure wiring according to the principle of
|
||||
//fuse bytes:
|
||||
//Low byte: 0xc1
|
||||
//High byt: 0xd9
|
||||
//Extend: 0x00
|
||||
//Lock byte: 0xff
|
||||
//Crystal: internal RC oscillator 8MHz
|
||||
//Time: April 25, 2013
|
||||
#include<avr/io.h>
|
||||
#include <avr/delay.h>
|
||||
|
||||
#define uint unsigned int
|
||||
#define uchar unsigned char
|
||||
|
||||
#include "nokia_5110.h"
|
||||
#include "bmp_pixel.h"
|
||||
|
||||
/******************************************************************************/
|
||||
void main(void)
|
||||
{
|
||||
LCD_init(); //LCD initialization
|
||||
LCD_clear(); //clear the LCD
|
||||
while(1)
|
||||
{
|
||||
LCD_write_english_string(0,0," Welcome to "); //x=0,y=0 write from the start in the first row
|
||||
LCD_write_english_string(0,1," Amy studio "); //x=0,y=1 write from the start in the second row
|
||||
LCD_write_english_string(0,2,"amy-studio.com");
|
||||
LCD_write_english_string(0,3," Nokia5110 LCD");
|
||||
LCD_write_chinese_string(12,4,12,4,0,5);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<AVRStudio><MANAGEMENT><ProjectName>nokia</ProjectName><Created>25-Apr-2013 10:02:21</Created><LastEdit>25-Apr-2013 11:26:14</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>25-Apr-2013 10:02:21</Created><Version>4</Version><Build>4, 13, 0, 528</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>default\nokia.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>D:\my_project\AVR\nokia\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>AVR Simulator</CURRENT_TARGET><CURRENT_PART>ATmega32.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>main.c</SOURCEFILE><HEADERFILE>write_chinese_string_pixel.h</HEADERFILE><HEADERFILE>bmp_pixel.h</HEADERFILE><HEADERFILE>english_6x8_pixel.h</HEADERFILE><HEADERFILE>nokia_5110.h</HEADERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>NO</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE></EXTERNALMAKEFILE><PART>atmega32</PART><HEX>1</HEX><LIST>0</LIST><MAP>0</MAP><OUTPUTFILENAME>nokia.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>0</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -DF_CPU=8000000UL -O0 -fsigned-char</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20100110\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20100110\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/></IOView><Files><File00000><FileId>00000</FileId><FileName>main.c</FileName><Status>1</Status></File00000><File00001><FileId>00001</FileId><FileName>english_6x8_pixel.h</FileName><Status>1</Status></File00001><File00002><FileId>00002</FileId><FileName>bmp_pixel.h</FileName><Status>1</Status></File00002><File00003><FileId>00003</FileId><FileName>nokia_5110.h</FileName><Status>1</Status></File00003><File00004><FileId>00004</FileId><FileName>write_chinese_string_pixel.h</FileName><Status>1</Status></File00004></Files><Workspace><File00000><Position>192 131 1280 424</Position><LineCol>25 2</LineCol></File00000><File00001><Position>214 160 1320 456</Position><LineCol>15 50</LineCol></File00001><File00002><Position>236 189 1342 485</Position><LineCol>32 0</LineCol></File00002><File00003><Position>166 72 1368 518</Position><LineCol>21 0</LineCol><State>Maximized</State></File00003><File00004><Position>170 102 1276 398</Position><LineCol>12 4</LineCol></File00004></Workspace><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
|
||||
@@ -0,0 +1 @@
|
||||
<AVRWorkspace><IOSettings><CurrentRegisters/></IOSettings><part name="ATMEGA32"/><Files><File00000 Name="D:\my_project\AVR\nokia\main.c" Position="192 131 1280 424" LineCol="25 2" State="Maximized"/><File00001 Name="D:\my_project\AVR\nokia\english_6x8_pixel.h" Position="214 160 1320 456" LineCol="15 50" State="Maximized"/><File00002 Name="D:\my_project\AVR\nokia\bmp_pixel.h" Position="236 189 1342 485" LineCol="32 0" State="Maximized"/><File00003 Name="D:\my_project\AVR\nokia\nokia_5110.h" Position="166 72 1368 518" LineCol="21 0" State="Maximized"/><File00004 Name="D:\my_project\AVR\nokia\write_chinese_string_pixel.h" Position="170 102 1276 398" LineCol="12 4" State="Maximized"/></Files></AVRWorkspace>
|
||||
@@ -0,0 +1,224 @@
|
||||
|
||||
#include "english_6x8_pixel.h"
|
||||
#include "write_chinese_string_pixel.h"
|
||||
|
||||
//
|
||||
#define BIT(i) (1<<i)
|
||||
|
||||
#define SCLK_set PORTA|=BIT(0) //serial clock input
|
||||
#define SCLK_clr PORTA&=~BIT(0)
|
||||
|
||||
#define SDIN_set PORTA|=BIT(1) //serial data input
|
||||
#define SDIN_clr PORTA&=~BIT(1)
|
||||
|
||||
#define LCD_DC_set PORTA|=BIT(2) //data/commande
|
||||
#define LCD_DC_clr PORTA&=~BIT(2)
|
||||
|
||||
#define LCD_CE_set PORTA|=BIT(3) //chip enable
|
||||
#define LCD_CE_clr PORTA&=~BIT(3)
|
||||
|
||||
#define LCD_RST_set PORTA|=BIT(4) //external reset input
|
||||
#define LCD_RST_clr PORTA&=~BIT(4)
|
||||
|
||||
|
||||
void delay_1us(void) //delay 1us
|
||||
{
|
||||
_delay_us(1);
|
||||
}
|
||||
|
||||
void delay_1ms(void) //delay 1ms
|
||||
{
|
||||
_delay_ms(1);
|
||||
}
|
||||
|
||||
void delay_nms(unsigned int n) //delay nms
|
||||
{
|
||||
_delay_ms(n);
|
||||
}
|
||||
|
||||
|
||||
void LCD_init(void) //LCD initialization
|
||||
{
|
||||
DDRA|=0X1F;
|
||||
|
||||
LCD_RST_clr;
|
||||
delay_1us();
|
||||
LCD_RST_set;
|
||||
|
||||
LCD_CE_clr;
|
||||
|
||||
delay_1us();
|
||||
LCD_CE_set;
|
||||
|
||||
delay_1us();
|
||||
|
||||
LCD_write_byte(0x21, 0); // set LCD mode
|
||||
LCD_write_byte(0xc8, 0); // set bias voltage
|
||||
LCD_write_byte(0x06, 0); // temperature correction
|
||||
LCD_write_byte(0x13, 0); // 1:48
|
||||
LCD_write_byte(0x20, 0); // use bias command
|
||||
LCD_clear(); // clear the LCD
|
||||
LCD_write_byte(0x0c, 0); // set LCD mode,display normally
|
||||
|
||||
LCD_CE_clr;
|
||||
}
|
||||
|
||||
|
||||
void LCD_clear(void) // clear the LCD
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
LCD_write_byte(0x0c, 0);
|
||||
LCD_write_byte(0x80, 0);
|
||||
|
||||
for (i=0; i<504; i++)
|
||||
{
|
||||
LCD_write_byte(0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
LCD_set_XY : Set the LCD coordinate functions
|
||||
|
||||
input parameter:X :0-83
|
||||
Y :0-5
|
||||
|
||||
created date :2013-4-25
|
||||
-----------------------------------------------------------------------*/
|
||||
void LCD_set_XY(unsigned char X, unsigned char Y)
|
||||
{
|
||||
LCD_write_byte(0x40 | Y, 0); // column
|
||||
LCD_write_byte(0x80 | X, 0); // row
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
LCD_write_char : Display English characters
|
||||
|
||||
input parameter:c :char to display
|
||||
|
||||
created date :2013-4-25
|
||||
-----------------------------------------------------------------------*/
|
||||
void LCD_write_char(unsigned char c)
|
||||
{
|
||||
unsigned char line;
|
||||
|
||||
c -= 32;
|
||||
|
||||
for (line=0; line<6; line++)
|
||||
LCD_write_byte(font6x8[c][line], 1);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
LCD_write_english_String : Display English strings
|
||||
|
||||
input parameter:X :0-83
|
||||
Y :0-5
|
||||
|
||||
created date :2013-4-25
|
||||
-----------------------------------------------------------------------*/
|
||||
void LCD_write_english_string(unsigned char X,unsigned char Y,char *s)
|
||||
{
|
||||
LCD_set_XY(X,Y);
|
||||
while (*s)
|
||||
{
|
||||
LCD_write_char(*s);
|
||||
s++;
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------------------
|
||||
LCD_write_chinese_string: Display Chinese strings
|
||||
|
||||
LCD_write_chi(0,0,12,7,0,0);
|
||||
LCD_write_chi(0,2,12,7,0,0);
|
||||
LCD_write_chi(0,4,12,7,0,0);
|
||||
-----------------------------------------------------------------------*/
|
||||
void LCD_write_chinese_string(unsigned char X, unsigned char Y,
|
||||
unsigned char ch_with,unsigned char num,
|
||||
unsigned char line,unsigned char row)
|
||||
{
|
||||
unsigned char i,n;
|
||||
|
||||
LCD_set_XY(X,Y); //scale settings
|
||||
|
||||
for (i=0;i<num;)
|
||||
{
|
||||
for (n=0; n<ch_with*2; n++) //write a chinese
|
||||
{
|
||||
if (n==ch_with)
|
||||
{
|
||||
if (i==0) LCD_set_XY(X,Y+1);
|
||||
else
|
||||
LCD_set_XY((X+(ch_with+row)*i),Y+1);
|
||||
}
|
||||
LCD_write_byte(write_chinese[line+i][n],1);
|
||||
}
|
||||
i++;
|
||||
LCD_set_XY((X+(ch_with+row)*i),Y);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
LCD_draw_map : Bitmap drawing function
|
||||
|
||||
input parmenter:X、Y :starting point X,Y;
|
||||
*map :bitmap data
|
||||
Pix_x :highth
|
||||
Pix_y :width
|
||||
|
||||
created date :2013-4-25
|
||||
-----------------------------------------------------------------------*/
|
||||
void LCD_draw_bmp_pixel(unsigned char X,unsigned char Y,unsigned char *map,
|
||||
unsigned char Pix_x,unsigned char Pix_y)
|
||||
{
|
||||
unsigned int i,n;
|
||||
unsigned char row;
|
||||
|
||||
if (Pix_y%8==0) row=Pix_y/8; //calculate how many line is needed
|
||||
else
|
||||
row=Pix_y/8+1;
|
||||
|
||||
for (n=0;n<row;n++)
|
||||
{
|
||||
LCD_set_XY(X,Y);
|
||||
for(i=0; i<Pix_x; i++)
|
||||
{
|
||||
LCD_write_byte(map[i+n*Pix_x], 1);
|
||||
}
|
||||
Y++; //chang line
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
LCD_write_byte : write data to LCD
|
||||
|
||||
input parmenter:data :data
|
||||
command :command
|
||||
|
||||
created date :2013-4-25
|
||||
-----------------------------------------------------------------------*/
|
||||
void LCD_write_byte(unsigned char dat, unsigned char command)
|
||||
{
|
||||
unsigned char i;
|
||||
LCD_CE_clr;
|
||||
|
||||
if (command == 0)
|
||||
LCD_DC_clr;
|
||||
else
|
||||
LCD_DC_set;
|
||||
|
||||
for(i=0;i<8;i++)
|
||||
{
|
||||
if(dat&0x80)
|
||||
SDIN_set;
|
||||
else
|
||||
SDIN_clr;
|
||||
SCLK_clr;
|
||||
dat = dat << 1;
|
||||
SCLK_set;
|
||||
}
|
||||
LCD_CE_set;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
const unsigned char write_chinese[][24]={
|
||||
|
||||
//测
|
||||
{0x89,0xF2,0x00,0xFF,0x01,0xF9,0xFF,0x00,0xFC,0x00,0xFF,0x00,0x00,0x07,0x04,0x04,0x02,0x01,0x02,0x04,0x01,0x04,0x07,0x00},
|
||||
//试
|
||||
{0x11,0xF6,0x00,0x04,0x24,0xE4,0x24,0x24,0xFF,0x05,0x06,0x00,0x00,0x07,0x02,0x01,0x02,0x03,0x01,0x01,0x01,0x02,0x07,0x00},
|
||||
//程
|
||||
{0x8A,0x6A,0xFF,0x49,0x20,0xAF,0xA9,0xE9,0xA9,0xAF,0x20,0x00,0x01,0x00,0x07,0x00,0x04,0x04,0x04,0x07,0x04,0x04,0x04,0x00},
|
||||
//序
|
||||
{0x00,0xFE,0x42,0x4A,0x4A,0x5B,0xEA,0x5A,0x4A,0xC2,0x42,0x00,0x06,0x01,0x00,0x00,0x04,0x04,0x07,0x00,0x00,0x00,0x00,0x00},
|
||||
|
||||
|
||||
//电
|
||||
{0x00,0xFC,0x94,0x94,0x94,0xFF,0x94,0x94,0x94,0xFE,0x04,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x04,0x04,0x04,0x04,0x06,0x00},
|
||||
//子
|
||||
{0x20,0x21,0x21,0x21,0x21,0xF9,0x29,0x25,0x23,0x31,0x20,0x00,0x00,0x00,0x00,0x04,0x04,0x07,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
//制
|
||||
{0x18,0xD6,0x54,0xFF,0x54,0x56,0xD4,0x00,0xFC,0x00,0xFF,0x00,0x00,0x03,0x00,0x07,0x00,0x02,0x03,0x00,0x04,0x04,0x07,0x00},
|
||||
//作
|
||||
{0x10,0x08,0xFC,0x13,0x08,0x04,0xFF,0x24,0x24,0x24,0x04,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x07,0x01,0x01,0x01,0x01,0x00},
|
||||
//杂
|
||||
{0x40,0x62,0x52,0xCA,0x47,0xE2,0x42,0xDE,0x50,0x50,0x58,0x00,0x04,0x02,0x01,0x04,0x04,0x07,0x00,0x00,0x01,0x02,0x04,0x00},
|
||||
//志
|
||||
{0x04,0xA4,0x24,0xA4,0x24,0xBF,0x24,0x24,0x24,0xA6,0x04,0x00,0x02,0x01,0x00,0x07,0x04,0x04,0x05,0x04,0x06,0x00,0x03,0x00},
|
||||
//社
|
||||
{0x84,0x44,0xF5,0x2E,0x40,0x10,0x10,0xFF,0x10,0x10,0x10,0x00,0x00,0x00,0x07,0x00,0x04,0x04,0x04,0x07,0x04,0x04,0x04,0x00},
|
||||
};
|
||||
|
||||
|
||||
|
||||
315
trunk/workspace/00_Lib/Disp_Nokia5110/AdaFruit/PCD8544.cpp
Normal file
315
trunk/workspace/00_Lib/Disp_Nokia5110/AdaFruit/PCD8544.cpp
Normal file
@@ -0,0 +1,315 @@
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
This is a library for our Monochrome Nokia 5110 LCD Displays
|
||||
|
||||
Pick one up today in the adafruit shop!
|
||||
------> http://www.adafruit.com/products/338
|
||||
|
||||
These displays use SPI to communicate, 4 or 5 pins are required to
|
||||
interface
|
||||
|
||||
Adafruit invests time and resources providing this open source code,
|
||||
please support Adafruit and open-source hardware by purchasing
|
||||
products from Adafruit!
|
||||
|
||||
Written by Limor Fried/Ladyada for Adafruit Industries.
|
||||
BSD license, check license.txt for more information
|
||||
All text above, and the splash screen below must be included in any redistribution
|
||||
*********************************************************************/
|
||||
|
||||
//#include <Wire.h>
|
||||
#include <avr/pgmspace.h>
|
||||
#if defined(ARDUINO) && ARDUINO >= 100
|
||||
#include "Arduino.h"
|
||||
#else
|
||||
#include "WProgram.h"
|
||||
#endif
|
||||
#include <util/delay.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <Adafruit_GFX.h>
|
||||
#include "Adafruit_PCD8544.h"
|
||||
|
||||
// the memory buffer for the LCD
|
||||
uint8_t pcd8544_buffer[LCDWIDTH * LCDHEIGHT / 8] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFC, 0xFE, 0xFF, 0xFC, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8,
|
||||
0xF8, 0xF0, 0xF0, 0xE0, 0xE0, 0xC0, 0x80, 0xC0, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, 0x7F,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0xC7, 0xC7, 0x87, 0x8F, 0x9F, 0x9F, 0xFF, 0xFF, 0xFF,
|
||||
0xC1, 0xC0, 0xE0, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFC, 0xFC, 0xFC, 0xFE, 0xFE, 0xFE,
|
||||
0xFC, 0xFC, 0xF8, 0xF8, 0xF0, 0xE0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x80, 0xC0, 0xE0, 0xF1, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x1F, 0x0F, 0x0F, 0x87,
|
||||
0xE7, 0xFF, 0xFF, 0xFF, 0x1F, 0x1F, 0x3F, 0xF9, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xFD, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, 0x0F, 0x07, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0xF0, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
|
||||
0x7E, 0x3F, 0x3F, 0x0F, 0x1F, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xE0, 0xF1, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFC, 0xF0, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01,
|
||||
0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0F, 0x1F, 0x3F, 0x7F, 0x7F,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x7F, 0x1F, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
|
||||
// reduces how much is refreshed, which speeds it up!
|
||||
// originally derived from Steve Evans/JCW's mod but cleaned up and
|
||||
// optimized
|
||||
//#define enablePartialUpdate
|
||||
|
||||
#ifdef enablePartialUpdate
|
||||
static uint8_t xUpdateMin, xUpdateMax, yUpdateMin, yUpdateMax;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
static void updateBoundingBox(uint8_t xmin, uint8_t ymin, uint8_t xmax, uint8_t ymax) {
|
||||
#ifdef enablePartialUpdate
|
||||
if (xmin < xUpdateMin) xUpdateMin = xmin;
|
||||
if (xmax > xUpdateMax) xUpdateMax = xmax;
|
||||
if (ymin < yUpdateMin) yUpdateMin = ymin;
|
||||
if (ymax > yUpdateMax) yUpdateMax = ymax;
|
||||
#endif
|
||||
}
|
||||
|
||||
Adafruit_PCD8544::Adafruit_PCD8544(int8_t SCLK, int8_t DIN, int8_t DC,
|
||||
int8_t CS, int8_t RST) : Adafruit_GFX(LCDWIDTH, LCDHEIGHT) {
|
||||
_din = DIN;
|
||||
_sclk = SCLK;
|
||||
_dc = DC;
|
||||
_rst = RST;
|
||||
_cs = CS;
|
||||
}
|
||||
|
||||
Adafruit_PCD8544::Adafruit_PCD8544(int8_t SCLK, int8_t DIN, int8_t DC,
|
||||
int8_t RST) : Adafruit_GFX(LCDWIDTH, LCDHEIGHT) {
|
||||
_din = DIN;
|
||||
_sclk = SCLK;
|
||||
_dc = DC;
|
||||
_rst = RST;
|
||||
_cs = -1;
|
||||
}
|
||||
|
||||
|
||||
// the most basic function, set a single pixel
|
||||
void Adafruit_PCD8544::drawPixel(int16_t x, int16_t y, uint16_t color) {
|
||||
if ((x < 0) || (x >= LCDWIDTH) || (y < 0) || (y >= LCDHEIGHT))
|
||||
return;
|
||||
|
||||
// x is which column
|
||||
if (color)
|
||||
pcd8544_buffer[x+ (y/8)*LCDWIDTH] |= _BV(y%8);
|
||||
else
|
||||
pcd8544_buffer[x+ (y/8)*LCDWIDTH] &= ~_BV(y%8);
|
||||
|
||||
updateBoundingBox(x,y,x,y);
|
||||
}
|
||||
|
||||
|
||||
// the most basic function, get a single pixel
|
||||
uint8_t Adafruit_PCD8544::getPixel(int8_t x, int8_t y) {
|
||||
if ((x < 0) || (x >= LCDWIDTH) || (y < 0) || (y >= LCDHEIGHT))
|
||||
return 0;
|
||||
|
||||
return (pcd8544_buffer[x+ (y/8)*LCDWIDTH] >> (y%8)) & 0x1;
|
||||
}
|
||||
|
||||
|
||||
void Adafruit_PCD8544::begin(uint8_t contrast) {
|
||||
// set pin directions
|
||||
pinMode(_din, OUTPUT);
|
||||
pinMode(_sclk, OUTPUT);
|
||||
pinMode(_dc, OUTPUT);
|
||||
if (_rst > 0)
|
||||
pinMode(_rst, OUTPUT);
|
||||
if (_cs > 0)
|
||||
pinMode(_cs, OUTPUT);
|
||||
|
||||
// toggle RST low to reset
|
||||
if (_rst > 0) {
|
||||
digitalWrite(_rst, LOW);
|
||||
_delay_ms(500);
|
||||
digitalWrite(_rst, HIGH);
|
||||
}
|
||||
|
||||
clkport = portOutputRegister(digitalPinToPort(_sclk));
|
||||
clkpinmask = digitalPinToBitMask(_sclk);
|
||||
mosiport = portOutputRegister(digitalPinToPort(_din));
|
||||
mosipinmask = digitalPinToBitMask(_din);
|
||||
csport = portOutputRegister(digitalPinToPort(_cs));
|
||||
cspinmask = digitalPinToBitMask(_cs);
|
||||
dcport = portOutputRegister(digitalPinToPort(_dc));
|
||||
dcpinmask = digitalPinToBitMask(_dc);
|
||||
|
||||
// get into the EXTENDED mode!
|
||||
command(PCD8544_FUNCTIONSET | PCD8544_EXTENDEDINSTRUCTION );
|
||||
|
||||
// LCD bias select (4 is optimal?)
|
||||
command(PCD8544_SETBIAS | 0x4);
|
||||
|
||||
// set VOP
|
||||
if (contrast > 0x7f)
|
||||
contrast = 0x7f;
|
||||
|
||||
command( PCD8544_SETVOP | contrast); // Experimentally determined
|
||||
|
||||
|
||||
// normal mode
|
||||
command(PCD8544_FUNCTIONSET);
|
||||
|
||||
// Set display to Normal
|
||||
command(PCD8544_DISPLAYCONTROL | PCD8544_DISPLAYNORMAL);
|
||||
|
||||
// initial display line
|
||||
// set page address
|
||||
// set column address
|
||||
// write display data
|
||||
|
||||
// set up a bounding box for screen updates
|
||||
|
||||
updateBoundingBox(0, 0, LCDWIDTH-1, LCDHEIGHT-1);
|
||||
// Push out pcd8544_buffer to the Display (will show the AFI logo)
|
||||
display();
|
||||
}
|
||||
|
||||
|
||||
inline void Adafruit_PCD8544::fastSPIwrite(uint8_t d) {
|
||||
|
||||
for(uint8_t bit = 0x80; bit; bit >>= 1) {
|
||||
*clkport &= ~clkpinmask;
|
||||
if(d & bit) *mosiport |= mosipinmask;
|
||||
else *mosiport &= ~mosipinmask;
|
||||
*clkport |= clkpinmask;
|
||||
}
|
||||
}
|
||||
|
||||
inline void Adafruit_PCD8544::slowSPIwrite(uint8_t c) {
|
||||
shiftOut(_din, _sclk, MSBFIRST, c);
|
||||
}
|
||||
|
||||
void Adafruit_PCD8544::command(uint8_t c) {
|
||||
digitalWrite(_dc, LOW);
|
||||
if (_cs > 0)
|
||||
digitalWrite(_cs, LOW);
|
||||
fastSPIwrite(c);
|
||||
if (_cs > 0)
|
||||
digitalWrite(_cs, HIGH);
|
||||
}
|
||||
|
||||
void Adafruit_PCD8544::data(uint8_t c) {
|
||||
digitalWrite(_dc, HIGH);
|
||||
if (_cs > 0)
|
||||
digitalWrite(_cs, LOW);
|
||||
fastSPIwrite(c);
|
||||
if (_cs > 0)
|
||||
digitalWrite(_cs, HIGH);
|
||||
}
|
||||
|
||||
void Adafruit_PCD8544::setContrast(uint8_t val) {
|
||||
if (val > 0x7f) {
|
||||
val = 0x7f;
|
||||
}
|
||||
command(PCD8544_FUNCTIONSET | PCD8544_EXTENDEDINSTRUCTION );
|
||||
command( PCD8544_SETVOP | val);
|
||||
command(PCD8544_FUNCTIONSET);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Adafruit_PCD8544::display(void) {
|
||||
uint8_t col, maxcol, p;
|
||||
|
||||
for(p = 0; p < 6; p++) {
|
||||
#ifdef enablePartialUpdate
|
||||
// check if this page is part of update
|
||||
if ( yUpdateMin >= ((p+1)*8) ) {
|
||||
continue; // nope, skip it!
|
||||
}
|
||||
if (yUpdateMax < p*8) {
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
command(PCD8544_SETYADDR | p);
|
||||
|
||||
|
||||
#ifdef enablePartialUpdate
|
||||
col = xUpdateMin;
|
||||
maxcol = xUpdateMax;
|
||||
#else
|
||||
// start at the beginning of the row
|
||||
col = 0;
|
||||
maxcol = LCDWIDTH-1;
|
||||
#endif
|
||||
|
||||
command(PCD8544_SETXADDR | col);
|
||||
|
||||
digitalWrite(_dc, HIGH);
|
||||
if (_cs > 0)
|
||||
digitalWrite(_cs, LOW);
|
||||
for(; col <= maxcol; col++) {
|
||||
//uart_putw_dec(col);
|
||||
//uart_putchar(' ');
|
||||
fastSPIwrite(pcd8544_buffer[(LCDWIDTH*p)+col]);
|
||||
}
|
||||
if (_cs > 0)
|
||||
digitalWrite(_cs, HIGH);
|
||||
|
||||
}
|
||||
|
||||
command(PCD8544_SETYADDR ); // no idea why this is necessary but it is to finish the last byte?
|
||||
#ifdef enablePartialUpdate
|
||||
xUpdateMin = LCDWIDTH - 1;
|
||||
xUpdateMax = 0;
|
||||
yUpdateMin = LCDHEIGHT-1;
|
||||
yUpdateMax = 0;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
// clear everything
|
||||
void Adafruit_PCD8544::clearDisplay(void) {
|
||||
memset(pcd8544_buffer, 0, LCDWIDTH*LCDHEIGHT/8);
|
||||
updateBoundingBox(0, 0, LCDWIDTH-1, LCDHEIGHT-1);
|
||||
cursor_y = cursor_x = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
// this doesnt touch the buffer, just clears the display RAM - might be handy
|
||||
void Adafruit_PCD8544::clearDisplay(void) {
|
||||
|
||||
uint8_t p, c;
|
||||
|
||||
for(p = 0; p < 8; p++) {
|
||||
|
||||
st7565_command(CMD_SET_PAGE | p);
|
||||
for(c = 0; c < 129; c++) {
|
||||
//uart_putw_dec(c);
|
||||
//uart_putchar(' ');
|
||||
st7565_command(CMD_SET_COLUMN_LOWER | (c & 0xf));
|
||||
st7565_command(CMD_SET_COLUMN_UPPER | ((c >> 4) & 0xf));
|
||||
st7565_data(0x0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
79
trunk/workspace/00_Lib/Disp_Nokia5110/AdaFruit/PCD8544.h
Normal file
79
trunk/workspace/00_Lib/Disp_Nokia5110/AdaFruit/PCD8544.h
Normal file
@@ -0,0 +1,79 @@
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
This is a library for our Monochrome Nokia 5110 LCD Displays
|
||||
|
||||
Pick one up today in the adafruit shop!
|
||||
------> http://www.adafruit.com/products/338
|
||||
|
||||
These displays use SPI to communicate, 4 or 5 pins are required to
|
||||
interface
|
||||
|
||||
Adafruit invests time and resources providing this open source code,
|
||||
please support Adafruit and open-source hardware by purchasing
|
||||
products from Adafruit!
|
||||
|
||||
Written by Limor Fried/Ladyada for Adafruit Industries.
|
||||
BSD license, check license.txt for more information
|
||||
All text above, and the splash screen must be included in any redistribution
|
||||
*********************************************************************/
|
||||
|
||||
#if defined(ARDUINO) && ARDUINO >= 100
|
||||
#include "Arduino.h"
|
||||
#else
|
||||
#include "WProgram.h"
|
||||
#include "pins_arduino.h"
|
||||
#endif
|
||||
|
||||
#define BLACK 1
|
||||
#define WHITE 0
|
||||
|
||||
#define LCDWIDTH 84
|
||||
#define LCDHEIGHT 48
|
||||
|
||||
#define PCD8544_POWERDOWN 0x04
|
||||
#define PCD8544_ENTRYMODE 0x02
|
||||
#define PCD8544_EXTENDEDINSTRUCTION 0x01
|
||||
|
||||
#define PCD8544_DISPLAYBLANK 0x0
|
||||
#define PCD8544_DISPLAYNORMAL 0x4
|
||||
#define PCD8544_DISPLAYALLON 0x1
|
||||
#define PCD8544_DISPLAYINVERTED 0x5
|
||||
|
||||
// H = 0
|
||||
#define PCD8544_FUNCTIONSET 0x20
|
||||
#define PCD8544_DISPLAYCONTROL 0x08
|
||||
#define PCD8544_SETYADDR 0x40
|
||||
#define PCD8544_SETXADDR 0x80
|
||||
|
||||
// H = 1
|
||||
#define PCD8544_SETTEMP 0x04
|
||||
#define PCD8544_SETBIAS 0x10
|
||||
#define PCD8544_SETVOP 0x80
|
||||
|
||||
class Adafruit_PCD8544 : public Adafruit_GFX {
|
||||
public:
|
||||
Adafruit_PCD8544(int8_t SCLK, int8_t DIN, int8_t DC, int8_t CS, int8_t RST);
|
||||
Adafruit_PCD8544(int8_t SCLK, int8_t DIN, int8_t DC, int8_t RST);
|
||||
|
||||
void begin(uint8_t contrast = 40);
|
||||
|
||||
void command(uint8_t c);
|
||||
void data(uint8_t c);
|
||||
|
||||
void setContrast(uint8_t val);
|
||||
void clearDisplay(void);
|
||||
void display();
|
||||
|
||||
void drawPixel(int16_t x, int16_t y, uint16_t color);
|
||||
uint8_t getPixel(int8_t x, int8_t y);
|
||||
|
||||
private:
|
||||
int8_t _din, _sclk, _dc, _rst, _cs;
|
||||
volatile uint8_t *mosiport, *clkport, *csport, *dcport;
|
||||
uint8_t mosipinmask, clkpinmask, cspinmask, dcpinmask;
|
||||
|
||||
void slowSPIwrite(uint8_t c);
|
||||
void fastSPIwrite(uint8_t c);
|
||||
};
|
||||
|
||||
157
trunk/workspace/00_Lib/Disp_Nokia5110/C51-nokia5110/STARTUP.A51
Normal file
157
trunk/workspace/00_Lib/Disp_Nokia5110/C51-nokia5110/STARTUP.A51
Normal file
@@ -0,0 +1,157 @@
|
||||
$NOMOD51
|
||||
;------------------------------------------------------------------------------
|
||||
; This file is part of the C51 Compiler package
|
||||
; Copyright (c) 1988-2002 Keil Elektronik GmbH and Keil Software, Inc.
|
||||
;------------------------------------------------------------------------------
|
||||
; STARTUP.A51: This code is executed after processor reset.
|
||||
;
|
||||
; To translate this file use A51 with the following invocation:
|
||||
;
|
||||
; A51 STARTUP.A51
|
||||
;
|
||||
; To link the modified STARTUP.OBJ file to your application use the following
|
||||
; BL51 invocation:
|
||||
;
|
||||
; BL51 <your object file list>, STARTUP.OBJ <controls>
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; User-defined Power-On Initialization of Memory
|
||||
;
|
||||
; With the following EQU statements the initialization of memory
|
||||
; at processor reset can be defined:
|
||||
;
|
||||
; ; the absolute start-address of IDATA memory is always 0
|
||||
IDATALEN EQU 80H ; the length of IDATA memory in bytes.
|
||||
;
|
||||
XDATASTART EQU 0H ; the absolute start-address of XDATA memory
|
||||
XDATALEN EQU 0H ; the length of XDATA memory in bytes.
|
||||
;
|
||||
PDATASTART EQU 0H ; the absolute start-address of PDATA memory
|
||||
PDATALEN EQU 0H ; the length of PDATA memory in bytes.
|
||||
;
|
||||
; Notes: The IDATA space overlaps physically the DATA and BIT areas of the
|
||||
; 8051 CPU. At minimum the memory space occupied from the C51
|
||||
; run-time routines must be set to zero.
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Reentrant Stack Initilization
|
||||
;
|
||||
; The following EQU statements define the stack pointer for reentrant
|
||||
; functions and initialized it:
|
||||
;
|
||||
; Stack Space for reentrant functions in the SMALL model.
|
||||
IBPSTACK EQU 0 ; set to 1 if small reentrant is used.
|
||||
IBPSTACKTOP EQU 0FFH+1 ; set top of stack to highest location+1.
|
||||
;
|
||||
; Stack Space for reentrant functions in the LARGE model.
|
||||
XBPSTACK EQU 0 ; set to 1 if large reentrant is used.
|
||||
XBPSTACKTOP EQU 0FFFFH+1; set top of stack to highest location+1.
|
||||
;
|
||||
; Stack Space for reentrant functions in the COMPACT model.
|
||||
PBPSTACK EQU 0 ; set to 1 if compact reentrant is used.
|
||||
PBPSTACKTOP EQU 0FFFFH+1; set top of stack to highest location+1.
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Page Definition for Using the Compact Model with 64 KByte xdata RAM
|
||||
;
|
||||
; The following EQU statements define the xdata page used for pdata
|
||||
; variables. The EQU PPAGE must conform with the PPAGE control used
|
||||
; in the linker invocation.
|
||||
;
|
||||
PPAGEENABLE EQU 0 ; set to 1 if pdata object are used.
|
||||
;
|
||||
PPAGE EQU 0 ; define PPAGE number.
|
||||
;
|
||||
PPAGE_SFR DATA 0A0H ; SFR that supplies uppermost address byte
|
||||
; (most 8051 variants use P2 as uppermost address byte)
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
; Standard SFR Symbols
|
||||
ACC DATA 0E0H
|
||||
B DATA 0F0H
|
||||
SP DATA 81H
|
||||
DPL DATA 82H
|
||||
DPH DATA 83H
|
||||
|
||||
NAME ?C_STARTUP
|
||||
|
||||
|
||||
?C_C51STARTUP SEGMENT CODE
|
||||
?STACK SEGMENT IDATA
|
||||
|
||||
RSEG ?STACK
|
||||
DS 1
|
||||
|
||||
EXTRN CODE (?C_START)
|
||||
PUBLIC ?C_STARTUP
|
||||
|
||||
CSEG AT 0
|
||||
?C_STARTUP: LJMP STARTUP1
|
||||
|
||||
RSEG ?C_C51STARTUP
|
||||
|
||||
STARTUP1:
|
||||
|
||||
IF IDATALEN <> 0
|
||||
MOV R0,#IDATALEN - 1
|
||||
CLR A
|
||||
IDATALOOP: MOV @R0,A
|
||||
DJNZ R0,IDATALOOP
|
||||
ENDIF
|
||||
|
||||
IF XDATALEN <> 0
|
||||
MOV DPTR,#XDATASTART
|
||||
MOV R7,#LOW (XDATALEN)
|
||||
IF (LOW (XDATALEN)) <> 0
|
||||
MOV R6,#(HIGH (XDATALEN)) +1
|
||||
ELSE
|
||||
MOV R6,#HIGH (XDATALEN)
|
||||
ENDIF
|
||||
CLR A
|
||||
XDATALOOP: MOVX @DPTR,A
|
||||
INC DPTR
|
||||
DJNZ R7,XDATALOOP
|
||||
DJNZ R6,XDATALOOP
|
||||
ENDIF
|
||||
|
||||
IF PPAGEENABLE <> 0
|
||||
MOV PPAGE_SFR,#PPAGE
|
||||
ENDIF
|
||||
|
||||
IF PDATALEN <> 0
|
||||
MOV R0,#LOW (PDATASTART)
|
||||
MOV R7,#LOW (PDATALEN)
|
||||
CLR A
|
||||
PDATALOOP: MOVX @R0,A
|
||||
INC R0
|
||||
DJNZ R7,PDATALOOP
|
||||
ENDIF
|
||||
|
||||
IF IBPSTACK <> 0
|
||||
EXTRN DATA (?C_IBP)
|
||||
|
||||
MOV ?C_IBP,#LOW IBPSTACKTOP
|
||||
ENDIF
|
||||
|
||||
IF XBPSTACK <> 0
|
||||
EXTRN DATA (?C_XBP)
|
||||
|
||||
MOV ?C_XBP,#HIGH XBPSTACKTOP
|
||||
MOV ?C_XBP+1,#LOW XBPSTACKTOP
|
||||
ENDIF
|
||||
|
||||
IF PBPSTACK <> 0
|
||||
EXTRN DATA (?C_PBP)
|
||||
MOV ?C_PBP,#LOW PBPSTACKTOP
|
||||
ENDIF
|
||||
|
||||
MOV SP,#?STACK-1
|
||||
; This code is required if you use L51_BANK.A51 with Banking Mode 4
|
||||
; EXTRN CODE (?B_SWITCH0)
|
||||
; CALL ?B_SWITCH0 ; init bank mechanism to code bank 0
|
||||
LJMP ?C_START
|
||||
|
||||
END
|
||||
@@ -0,0 +1,47 @@
|
||||
/*------------------------------------------------------------------------------
|
||||
; 源文件 / 文字 : AVR
|
||||
; 宽×高(像素): 40×24
|
||||
; 字模格式/大小 : 单色点阵液晶字模,纵向取模,字节倒序/120字节
|
||||
; 数据转换日期 : 2004-8-13
|
||||
------------------------------------------------------------------------------*/
|
||||
code unsigned char AVR_bmp[]=
|
||||
|
||||
|
||||
{
|
||||
/*-- 调入了一幅图像:C:\Documents and Settings\armok\桌面\1.bmp --*/
|
||||
/*-- 宽度x高度=60x47 --*/
|
||||
/*0x00,0x00,0x00,0x00,0x80,0xE0,0xFC,0xFF,0xFF,0xFF,0x7F,0xFF,0xFE,0xFC,0xF0,0xC1,
|
||||
0x0F,0x7F,0xFF,0xFF,0xFE,0xF0,0xC0,0x00,0x00,0x00,0xC0,0xF8,0xFE,0xFF,0xFF,0x3F,
|
||||
0x07,0xC1,0xF0,0xFE,0xFF,0xFF,0xFF,0x1F,0x07,0x8F,0xCF,0xFF,0xFF,0xFF,0xFE,0xFC,
|
||||
0x00,0x80,0xF0,0xFC,0xFF,0xFF,0xFF,0x7F,0x7F,0x78,0x78,0x79,0x7F,0x7F,0xFF,0xFF,
|
||||
0xFC,0xF0,0xC1,0x07,0x1F,0xFF,0xFF,0xFE,0xFC,0xFF,0xFF,0xFF,0x1F,0x07,0xC1,0xF0,
|
||||
0xFE,0xFF,0xFF,0x3F,0x0F,0x0F,0x7F,0xFF,0xFF,0xFF,0xFF,0xE7,0x07,0x03,0x01,0x00,
|
||||
0x02,0x03,0x03,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
|
||||
0x03,0x03,0x03,0x03,0x00,0x00,0x03,0x1F,0x3F,0x1F,0x07,0x00,0x00,0x02,0x03,0x03,
|
||||
0x03,0x03,0x01,0x00,0x00,0x00,0x00,0x03,0x03,0x03,0x03,0x03,0x03,0x00,0x00,0x00
|
||||
*/
|
||||
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0x40,
|
||||
0x20,0x00,0x10,0x10,0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x10,0x10,0x00,
|
||||
0x20,0x40,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x0C,0x02,0x01,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x0C,0x70,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,
|
||||
0x80,0xC0,0xE0,0xE0,0xF0,0xF0,0xF0,0xF0,0xE0,0xC0,0x00,0x00,0x00,0x00,0x00,0xC0,
|
||||
0xE0,0xF0,0xF0,0xF0,0xF0,0xE0,0xE0,0xC0,0x80,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,
|
||||
0x18,0x60,0x83,0x87,0x87,0x87,0x07,0x03,0x03,0x03,0x01,0x40,0xF0,0xF0,0xF0,0xF0,
|
||||
0xF0,0x40,0x01,0x03,0x03,0x03,0x07,0x87,0x87,0x87,0x83,0x60,0x18,0x00,0x07,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x1F,0x27,0x48,0x88,0x88,0x88,0x88,0x88,0x48,
|
||||
0x48,0x48,0x88,0x88,0x88,0x88,0x88,0x48,0x27,0x1F,0x00,0xFF,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x02,0x04,0x04,0x08,0x00,0x10,0x10,
|
||||
0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x08,0x04,0x04,0x02,0x03,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
// 6 x 8 font
|
||||
// 1 pixel space at left and bottom
|
||||
// index = ASCII - 32
|
||||
code unsigned char font6x8[][6] =
|
||||
{
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // sp
|
||||
{ 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00 }, // !
|
||||
{ 0x00, 0x00, 0x07, 0x00, 0x07, 0x00 }, // "
|
||||
{ 0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14 }, // #
|
||||
{ 0x00, 0x24, 0x2a, 0x7f, 0x2a, 0x12 }, // $
|
||||
{ 0x00, 0x62, 0x64, 0x08, 0x13, 0x23 }, // %
|
||||
{ 0x00, 0x36, 0x49, 0x55, 0x22, 0x50 }, // &
|
||||
{ 0x00, 0x00, 0x05, 0x03, 0x00, 0x00 }, // '
|
||||
{ 0x00, 0x00, 0x1c, 0x22, 0x41, 0x00 }, // (
|
||||
{ 0x00, 0x00, 0x41, 0x22, 0x1c, 0x00 }, // )
|
||||
{ 0x00, 0x14, 0x08, 0x3E, 0x08, 0x14 }, // *
|
||||
{ 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08 }, // +
|
||||
{ 0x00, 0x00, 0x00, 0xA0, 0x60, 0x00 }, // ,
|
||||
{ 0x00, 0x08, 0x08, 0x08, 0x08, 0x08 }, // -
|
||||
{ 0x00, 0x00, 0x60, 0x60, 0x00, 0x00 }, // .
|
||||
{ 0x00, 0x20, 0x10, 0x08, 0x04, 0x02 }, // /
|
||||
{ 0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0
|
||||
{ 0x00, 0x00, 0x42, 0x7F, 0x40, 0x00 }, // 1
|
||||
{ 0x00, 0x42, 0x61, 0x51, 0x49, 0x46 }, // 2
|
||||
{ 0x00, 0x21, 0x41, 0x45, 0x4B, 0x31 }, // 3
|
||||
{ 0x00, 0x18, 0x14, 0x12, 0x7F, 0x10 }, // 4
|
||||
{ 0x00, 0x27, 0x45, 0x45, 0x45, 0x39 }, // 5
|
||||
{ 0x00, 0x3C, 0x4A, 0x49, 0x49, 0x30 }, // 6
|
||||
{ 0x00, 0x01, 0x71, 0x09, 0x05, 0x03 }, // 7
|
||||
{ 0x00, 0x36, 0x49, 0x49, 0x49, 0x36 }, // 8
|
||||
{ 0x00, 0x06, 0x49, 0x49, 0x29, 0x1E }, // 9
|
||||
{ 0x00, 0x00, 0x36, 0x36, 0x00, 0x00 }, // :
|
||||
{ 0x00, 0x00, 0x56, 0x36, 0x00, 0x00 }, // ;
|
||||
{ 0x00, 0x08, 0x14, 0x22, 0x41, 0x00 }, // <
|
||||
{ 0x00, 0x14, 0x14, 0x14, 0x14, 0x14 }, // =
|
||||
{ 0x00, 0x00, 0x41, 0x22, 0x14, 0x08 }, // >
|
||||
{ 0x00, 0x02, 0x01, 0x51, 0x09, 0x06 }, // ?
|
||||
{ 0x00, 0x32, 0x49, 0x59, 0x51, 0x3E }, // @
|
||||
{ 0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C }, // A
|
||||
{ 0x00, 0x7F, 0x49, 0x49, 0x49, 0x36 }, // B
|
||||
{ 0x00, 0x3E, 0x41, 0x41, 0x41, 0x22 }, // C
|
||||
{ 0x00, 0x7F, 0x41, 0x41, 0x22, 0x1C }, // D
|
||||
{ 0x00, 0x7F, 0x49, 0x49, 0x49, 0x41 }, // E
|
||||
{ 0x00, 0x7F, 0x09, 0x09, 0x09, 0x01 }, // F
|
||||
{ 0x00, 0x3E, 0x41, 0x49, 0x49, 0x7A }, // G
|
||||
{ 0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F }, // H
|
||||
{ 0x00, 0x00, 0x41, 0x7F, 0x41, 0x00 }, // I
|
||||
{ 0x00, 0x20, 0x40, 0x41, 0x3F, 0x01 }, // J
|
||||
{ 0x00, 0x7F, 0x08, 0x14, 0x22, 0x41 }, // K
|
||||
{ 0x00, 0x7F, 0x40, 0x40, 0x40, 0x40 }, // L
|
||||
{ 0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F }, // M
|
||||
{ 0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F }, // N
|
||||
{ 0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E }, // O
|
||||
{ 0x00, 0x7F, 0x09, 0x09, 0x09, 0x06 }, // P
|
||||
{ 0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E }, // Q
|
||||
{ 0x00, 0x7F, 0x09, 0x19, 0x29, 0x46 }, // R
|
||||
{ 0x00, 0x46, 0x49, 0x49, 0x49, 0x31 }, // S
|
||||
{ 0x00, 0x01, 0x01, 0x7F, 0x01, 0x01 }, // T
|
||||
{ 0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F }, // U
|
||||
{ 0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F }, // V
|
||||
{ 0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F }, // W
|
||||
{ 0x00, 0x63, 0x14, 0x08, 0x14, 0x63 }, // X
|
||||
{ 0x00, 0x07, 0x08, 0x70, 0x08, 0x07 }, // Y
|
||||
{ 0x00, 0x61, 0x51, 0x49, 0x45, 0x43 }, // Z
|
||||
{ 0x00, 0x00, 0x7F, 0x41, 0x41, 0x00 }, // [
|
||||
{ 0x00, 0x55, 0x2A, 0x55, 0x2A, 0x55 }, // 55
|
||||
{ 0x00, 0x00, 0x41, 0x41, 0x7F, 0x00 }, // ]
|
||||
{ 0x00, 0x04, 0x02, 0x01, 0x02, 0x04 }, // ^
|
||||
{ 0x00, 0x40, 0x40, 0x40, 0x40, 0x40 }, // _
|
||||
{ 0x00, 0x00, 0x01, 0x02, 0x04, 0x00 }, // '
|
||||
{ 0x00, 0x20, 0x54, 0x54, 0x54, 0x78 }, // a
|
||||
{ 0x00, 0x7F, 0x48, 0x44, 0x44, 0x38 }, // b
|
||||
{ 0x00, 0x38, 0x44, 0x44, 0x44, 0x20 }, // c
|
||||
{ 0x00, 0x38, 0x44, 0x44, 0x48, 0x7F }, // d
|
||||
{ 0x00, 0x38, 0x54, 0x54, 0x54, 0x18 }, // e
|
||||
{ 0x00, 0x08, 0x7E, 0x09, 0x01, 0x02 }, // f
|
||||
{ 0x00, 0x18, 0xA4, 0xA4, 0xA4, 0x7C }, // g
|
||||
{ 0x00, 0x7F, 0x08, 0x04, 0x04, 0x78 }, // h
|
||||
{ 0x00, 0x00, 0x44, 0x7D, 0x40, 0x00 }, // i
|
||||
{ 0x00, 0x40, 0x80, 0x84, 0x7D, 0x00 }, // j
|
||||
{ 0x00, 0x7F, 0x10, 0x28, 0x44, 0x00 }, // k
|
||||
{ 0x00, 0x00, 0x41, 0x7F, 0x40, 0x00 }, // l
|
||||
{ 0x00, 0x7C, 0x04, 0x18, 0x04, 0x78 }, // m
|
||||
{ 0x00, 0x7C, 0x08, 0x04, 0x04, 0x78 }, // n
|
||||
{ 0x00, 0x38, 0x44, 0x44, 0x44, 0x38 }, // o
|
||||
{ 0x00, 0xFC, 0x24, 0x24, 0x24, 0x18 }, // p
|
||||
{ 0x00, 0x18, 0x24, 0x24, 0x18, 0xFC }, // q
|
||||
{ 0x00, 0x7C, 0x08, 0x04, 0x04, 0x08 }, // r
|
||||
{ 0x00, 0x48, 0x54, 0x54, 0x54, 0x20 }, // s
|
||||
{ 0x00, 0x04, 0x3F, 0x44, 0x40, 0x20 }, // t
|
||||
{ 0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C }, // u
|
||||
{ 0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C }, // v
|
||||
{ 0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C }, // w
|
||||
{ 0x00, 0x44, 0x28, 0x10, 0x28, 0x44 }, // x
|
||||
{ 0x00, 0x1C, 0xA0, 0xA0, 0xA0, 0x7C }, // y
|
||||
{ 0x00, 0x44, 0x64, 0x54, 0x4C, 0x44 }, // z
|
||||
{ 0x14, 0x14, 0x14, 0x14, 0x14, 0x14 } // horiz lines
|
||||
};
|
||||
63
trunk/workspace/00_Lib/Disp_Nokia5110/C51-nokia5110/main.LST
Normal file
63
trunk/workspace/00_Lib/Disp_Nokia5110/C51-nokia5110/main.LST
Normal file
@@ -0,0 +1,63 @@
|
||||
C51 COMPILER V7.02a MAIN 04/19/2009 14:53:28 PAGE 1
|
||||
|
||||
|
||||
C51 COMPILER V7.02a, COMPILATION OF MODULE MAIN
|
||||
OBJECT MODULE PLACED IN main.OBJ
|
||||
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE main.c BROWSE DEBUG OBJECTEXTEND
|
||||
|
||||
stmt level source
|
||||
|
||||
1 /*
|
||||
2 艾米电子工作室
|
||||
3
|
||||
4 实验十六 NOkia5110液晶
|
||||
5 db :zliang
|
||||
6 11/29/2007 8:03PM
|
||||
7 网站:http://www.amy-studio.com/
|
||||
8 */
|
||||
9
|
||||
10 #include "nokia_5110.h"
|
||||
11 #include "bmp_pixel.h"
|
||||
12
|
||||
13 //***********************************
|
||||
14 #define delay_time 25767
|
||||
15
|
||||
16
|
||||
17 /********************************************************************/
|
||||
18
|
||||
19
|
||||
20 /******************************************************************************/
|
||||
21 void main(void)
|
||||
22 {
|
||||
23 1 LCD_init(); //初始化液晶
|
||||
24 1 LCD_clear();
|
||||
25 1
|
||||
26 1 while(1)
|
||||
27 1 {
|
||||
28 2 LCD_write_english_string(0,0," Welcome to ");
|
||||
29 2 LCD_write_english_string(0,1," Amy studio ");
|
||||
30 2 LCD_write_english_string(0,2,"amy-studio.com");
|
||||
31 2 LCD_write_english_string(0,3," Nokia5110 LCD");
|
||||
32 2 LCD_write_chinese_string(12,4,12,4,0,5);
|
||||
33 2
|
||||
34 2 }
|
||||
35 1
|
||||
36 1
|
||||
37 1 }
|
||||
38
|
||||
39
|
||||
40
|
||||
|
||||
|
||||
MODULE INFORMATION: STATIC OVERLAYABLE
|
||||
CODE SIZE = 77 ----
|
||||
CONSTANT SIZE = 408 ----
|
||||
XDATA SIZE = ---- ----
|
||||
PDATA SIZE = ---- ----
|
||||
DATA SIZE = ---- ----
|
||||
IDATA SIZE = ---- ----
|
||||
BIT SIZE = ---- ----
|
||||
END OF MODULE INFORMATION.
|
||||
|
||||
|
||||
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
|
||||
BIN
trunk/workspace/00_Lib/Disp_Nokia5110/C51-nokia5110/main.OBJ
Normal file
BIN
trunk/workspace/00_Lib/Disp_Nokia5110/C51-nokia5110/main.OBJ
Normal file
Binary file not shown.
40
trunk/workspace/00_Lib/Disp_Nokia5110/C51-nokia5110/main.c
Normal file
40
trunk/workspace/00_Lib/Disp_Nokia5110/C51-nokia5110/main.c
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
艾米电子工作室
|
||||
|
||||
实验十六 NOkia5110液晶
|
||||
db :zliang
|
||||
11/29/2007 8:03PM
|
||||
网站:http://www.amy-studio.com/
|
||||
*/
|
||||
|
||||
#include "nokia_5110.h"
|
||||
#include "bmp_pixel.h"
|
||||
|
||||
//***********************************
|
||||
#define delay_time 25767
|
||||
|
||||
|
||||
/********************************************************************/
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
void main(void)
|
||||
{
|
||||
LCD_init(); //初始化液晶
|
||||
LCD_clear();
|
||||
|
||||
while(1)
|
||||
{
|
||||
LCD_write_english_string(0,0," Welcome to ");
|
||||
LCD_write_english_string(0,1," Amy studio ");
|
||||
LCD_write_english_string(0,2,"amy-studio.com");
|
||||
LCD_write_english_string(0,3," Nokia5110 LCD");
|
||||
LCD_write_chinese_string(12,4,12,4,0,5);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
艾米电子工作室
|
||||
|
||||
实验十三 矩阵键盘
|
||||
db :zliang
|
||||
11/29/2007 8:03PM
|
||||
网站:http://www.amy-studio.com/
|
||||
*/
|
||||
|
||||
#include "reg51.h"
|
||||
#include "nokia_5110.h"
|
||||
#include "bmp_pixel.h"
|
||||
|
||||
//***********************************
|
||||
#define delay_time 25767
|
||||
|
||||
|
||||
/********************************************************************/
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
void main(void)
|
||||
{
|
||||
LCD_init(); //初始化液晶
|
||||
LCD_clear();
|
||||
|
||||
while(1)
|
||||
{
|
||||
LCD_write_english_string(0,0," Welcome to ");
|
||||
LCD_write_english_string(0,1," Amy studio ");
|
||||
LCD_write_english_string(0,2,"amy-studio.com");
|
||||
LCD_write_english_string(0,3," Nokia5110 LCD");
|
||||
LCD_write_chinese_string(12,4,12,4,0,5);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,274 @@
|
||||
C51 COMPILER V7.02a NOKIA_5110 04/19/2009 14:53:28 PAGE 1
|
||||
|
||||
|
||||
C51 COMPILER V7.02a, COMPILATION OF MODULE NOKIA_5110
|
||||
OBJECT MODULE PLACED IN nokia_5110.OBJ
|
||||
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE nokia_5110.c BROWSE DEBUG OBJECTEXTEND
|
||||
|
||||
stmt level source
|
||||
|
||||
1
|
||||
2
|
||||
3 #include "nokia_5110.h"
|
||||
4 #include "english_6x8_pixel.h"
|
||||
5 #include "write_chinese_string_pixel.h"
|
||||
6
|
||||
7
|
||||
8 /*-----------------------------------------------------------------------
|
||||
9 LCD_init : 3310LCD初始化
|
||||
10
|
||||
11 编写日期 :2004-8-10
|
||||
12 最后修改日期 :2004-8-10
|
||||
13 -----------------------------------------------------------------------*/
|
||||
14
|
||||
15 void delay_1us(void) //1us延时函数
|
||||
16 {
|
||||
17 1 unsigned int i;
|
||||
18 1 for(i=0;i<1000;i++);
|
||||
19 1 }
|
||||
20
|
||||
21 void delay_1ms(void) //1ms延时函数
|
||||
22 {
|
||||
23 1 unsigned int i;
|
||||
24 1 for (i=0;i<1140;i++);
|
||||
25 1 }
|
||||
26
|
||||
27 void delay_nms(unsigned int n) //N ms延时函数
|
||||
28 {
|
||||
29 1 unsigned int i=0;
|
||||
30 1 for (i=0;i<n;i++)
|
||||
31 1 delay_1ms();
|
||||
32 1 }
|
||||
33
|
||||
34
|
||||
35 void LCD_init(void)
|
||||
36 {
|
||||
37 1 // 产生一个让LCD复位的低电平脉冲
|
||||
38 1 LCD_RST = 0;
|
||||
39 1 delay_1us();
|
||||
40 1
|
||||
41 1 LCD_RST = 1;
|
||||
42 1
|
||||
43 1 // 关闭LCD
|
||||
44 1 LCD_CE = 0;
|
||||
45 1 delay_1us();
|
||||
46 1 // 使能LCD
|
||||
47 1 LCD_CE = 1;
|
||||
48 1 delay_1us();
|
||||
49 1
|
||||
50 1 LCD_write_byte(0x21, 0); // 使用扩展命令设置LCD模式
|
||||
51 1 LCD_write_byte(0xc8, 0); // 设置偏置电压
|
||||
52 1 LCD_write_byte(0x06, 0); // 温度校正
|
||||
53 1 LCD_write_byte(0x13, 0); // 1:48
|
||||
54 1 LCD_write_byte(0x20, 0); // 使用基本命令
|
||||
55 1 LCD_clear(); // 清屏
|
||||
C51 COMPILER V7.02a NOKIA_5110 04/19/2009 14:53:28 PAGE 2
|
||||
|
||||
56 1 LCD_write_byte(0x0c, 0); // 设定显示模式,正常显示
|
||||
57 1
|
||||
58 1 // 关闭LCD
|
||||
59 1 LCD_CE = 0;
|
||||
60 1 }
|
||||
61
|
||||
62 /*-----------------------------------------------------------------------
|
||||
63 LCD_clear : LCD清屏函数
|
||||
64
|
||||
65 编写日期 :2004-8-10
|
||||
66 最后修改日期 :2004-8-10
|
||||
67 -----------------------------------------------------------------------*/
|
||||
68 void LCD_clear(void)
|
||||
69 {
|
||||
70 1 unsigned int i;
|
||||
71 1
|
||||
72 1 LCD_write_byte(0x0c, 0);
|
||||
73 1 LCD_write_byte(0x80, 0);
|
||||
74 1
|
||||
75 1 for (i=0; i<504; i++)
|
||||
76 1 LCD_write_byte(0, 1);
|
||||
77 1 }
|
||||
78
|
||||
79 /*-----------------------------------------------------------------------
|
||||
80 LCD_set_XY : 设置LCD坐标函数
|
||||
81
|
||||
82 输入参数:X :0-83
|
||||
83 Y :0-5
|
||||
84
|
||||
85 编写日期 :2004-8-10
|
||||
86 最后修改日期 :2004-8-10
|
||||
87 -----------------------------------------------------------------------*/
|
||||
88 void LCD_set_XY(unsigned char X, unsigned char Y)
|
||||
89 {
|
||||
90 1 LCD_write_byte(0x40 | Y, 0); // column
|
||||
91 1 LCD_write_byte(0x80 | X, 0); // row
|
||||
92 1 }
|
||||
93
|
||||
94 /*-----------------------------------------------------------------------
|
||||
95 LCD_write_char : 显示英文字符
|
||||
96
|
||||
97 输入参数:c :显示的字符;
|
||||
98
|
||||
99 编写日期 :2004-8-10
|
||||
100 最后修改日期 :2004-8-10
|
||||
101 -----------------------------------------------------------------------*/
|
||||
102 void LCD_write_char(unsigned char c)
|
||||
103 {
|
||||
104 1 unsigned char line;
|
||||
105 1
|
||||
106 1 c -= 32;
|
||||
107 1
|
||||
108 1 for (line=0; line<6; line++)
|
||||
109 1 LCD_write_byte(font6x8[c][line], 1);
|
||||
110 1 }
|
||||
111
|
||||
112 /*-----------------------------------------------------------------------
|
||||
113 LCD_write_english_String : 英文字符串显示函数
|
||||
114
|
||||
115 输入参数:*s :英文字符串指针;
|
||||
116 X、Y : 显示字符串的位置,x 0-83 ,y 0-5
|
||||
117
|
||||
C51 COMPILER V7.02a NOKIA_5110 04/19/2009 14:53:28 PAGE 3
|
||||
|
||||
118 编写日期 :2004-8-10
|
||||
119 最后修改日期 :2004-8-10
|
||||
120 -----------------------------------------------------------------------*/
|
||||
121 void LCD_write_english_string(unsigned char X,unsigned char Y,char *s)
|
||||
122 {
|
||||
123 1 LCD_set_XY(X,Y);
|
||||
124 1 while (*s)
|
||||
125 1 {
|
||||
126 2 LCD_write_char(*s);
|
||||
127 2 s++;
|
||||
128 2 }
|
||||
129 1 }
|
||||
130 /*-----------------------------------------------------------------------
|
||||
131 LCD_write_chinese_string: 在LCD上显示汉字
|
||||
132
|
||||
133 输入参数:X、Y :显示汉字的起始X、Y坐标;
|
||||
134 ch_with :汉字点阵的宽度
|
||||
135 num :显示汉字的个数;
|
||||
136 line :汉字点阵数组中的起始行数
|
||||
137 row :汉字显示的行间距
|
||||
138 编写日期 :2004-8-11
|
||||
139 最后修改日期 :2004-8-12
|
||||
140 测试:
|
||||
141 LCD_write_chi(0,0,12,7,0,0);
|
||||
142 LCD_write_chi(0,2,12,7,0,0);
|
||||
143 LCD_write_chi(0,4,12,7,0,0);
|
||||
144 -----------------------------------------------------------------------*/
|
||||
145 void LCD_write_chinese_string(unsigned char X, unsigned char Y,
|
||||
146 unsigned char ch_with,unsigned char num,
|
||||
147 unsigned char line,unsigned char row)
|
||||
148 {
|
||||
149 1 unsigned char i,n;
|
||||
150 1
|
||||
151 1 LCD_set_XY(X,Y); //设置初始位置
|
||||
152 1
|
||||
153 1 for (i=0;i<num;)
|
||||
154 1 {
|
||||
155 2 for (n=0; n<ch_with*2; n++) //写一个汉字
|
||||
156 2 {
|
||||
157 3 if (n==ch_with) //写汉字的下半部分
|
||||
158 3 {
|
||||
159 4 if (i==0) LCD_set_XY(X,Y+1);
|
||||
160 4 else
|
||||
161 4 LCD_set_XY((X+(ch_with+row)*i),Y+1);
|
||||
162 4 }
|
||||
163 3 LCD_write_byte(write_chinese[line+i][n],1);
|
||||
164 3 }
|
||||
165 2 i++;
|
||||
166 2 LCD_set_XY((X+(ch_with+row)*i),Y);
|
||||
167 2 }
|
||||
168 1 }
|
||||
169
|
||||
170
|
||||
171
|
||||
172 /*-----------------------------------------------------------------------
|
||||
173 LCD_draw_map : 位图绘制函数
|
||||
174
|
||||
175 输入参数:X、Y :位图绘制的起始X、Y坐标;
|
||||
176 *map :位图点阵数据;
|
||||
177 Pix_x :位图像素(长)
|
||||
178 Pix_y :位图像素(宽)
|
||||
179
|
||||
C51 COMPILER V7.02a NOKIA_5110 04/19/2009 14:53:28 PAGE 4
|
||||
|
||||
180 编写日期 :2004-8-13
|
||||
181 最后修改日期 :2004-8-13
|
||||
182 -----------------------------------------------------------------------*/
|
||||
183 void LCD_draw_bmp_pixel(unsigned char X,unsigned char Y,unsigned char *map,
|
||||
184 unsigned char Pix_x,unsigned char Pix_y)
|
||||
185 {
|
||||
186 1 unsigned int i,n;
|
||||
187 1 unsigned char row;
|
||||
188 1
|
||||
189 1 if (Pix_y%8==0) row=Pix_y/8; //计算位图所占行数
|
||||
190 1 else
|
||||
191 1 row=Pix_y/8+1;
|
||||
192 1
|
||||
193 1 for (n=0;n<row;n++)
|
||||
194 1 {
|
||||
195 2 LCD_set_XY(X,Y);
|
||||
196 2 for(i=0; i<Pix_x; i++)
|
||||
197 2 {
|
||||
198 3 LCD_write_byte(map[i+n*Pix_x], 1);
|
||||
199 3 }
|
||||
200 2 Y++; //换行
|
||||
201 2 }
|
||||
202 1 }
|
||||
203
|
||||
204 /*-----------------------------------------------------------------------
|
||||
205 LCD_write_byte : 使用SPI接口写数据到LCD
|
||||
206
|
||||
207 输入参数:data :写入的数据;
|
||||
208 command :写数据/命令选择;
|
||||
209
|
||||
210 编写日期 :2004-8-10
|
||||
211 最后修改日期 :2004-8-13
|
||||
212 -----------------------------------------------------------------------*/
|
||||
213 void LCD_write_byte(unsigned char dat, unsigned char command)
|
||||
214 {
|
||||
215 1 unsigned char i;
|
||||
216 1 //PORTB &= ~LCD_CE ; // 使能LCD
|
||||
217 1 LCD_CE = 0;
|
||||
218 1
|
||||
219 1 if (command == 0)
|
||||
220 1 // PORTB &= ~LCD_DC ; // 传送命令
|
||||
221 1 LCD_DC = 0;
|
||||
222 1 else
|
||||
223 1 // PORTB |= LCD_DC ; // 传送数据
|
||||
224 1 LCD_DC = 1;
|
||||
225 1 for(i=0;i<8;i++)
|
||||
226 1 {
|
||||
227 2 if(dat&0x80)
|
||||
228 2 SDIN = 1;
|
||||
229 2 else
|
||||
230 2 SDIN = 0;
|
||||
231 2 SCLK = 0;
|
||||
232 2 dat = dat << 1;
|
||||
233 2 SCLK = 1;
|
||||
234 2 }
|
||||
235 1 // SPDR = data; // 传送数据到SPI寄存器
|
||||
236 1
|
||||
237 1 //while ((SPSR & 0x80) == 0); // 等待数据传送完毕
|
||||
238 1
|
||||
239 1 //PORTB |= LCD_CE ; // 关闭LCD
|
||||
240 1 LCD_CE = 1;
|
||||
241 1 }
|
||||
C51 COMPILER V7.02a NOKIA_5110 04/19/2009 14:53:28 PAGE 5
|
||||
|
||||
242
|
||||
243
|
||||
|
||||
|
||||
MODULE INFORMATION: STATIC OVERLAYABLE
|
||||
CODE SIZE = 580 ----
|
||||
CONSTANT SIZE = 816 ----
|
||||
XDATA SIZE = ---- ----
|
||||
PDATA SIZE = ---- ----
|
||||
DATA SIZE = ---- 28
|
||||
IDATA SIZE = ---- ----
|
||||
BIT SIZE = ---- ----
|
||||
END OF MODULE INFORMATION.
|
||||
|
||||
|
||||
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
|
||||
Binary file not shown.
243
trunk/workspace/00_Lib/Disp_Nokia5110/C51-nokia5110/nokia_5110.c
Normal file
243
trunk/workspace/00_Lib/Disp_Nokia5110/C51-nokia5110/nokia_5110.c
Normal file
@@ -0,0 +1,243 @@
|
||||
|
||||
|
||||
#include "nokia_5110.h"
|
||||
#include "english_6x8_pixel.h"
|
||||
#include "write_chinese_string_pixel.h"
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
LCD_init : 3310LCD初始化
|
||||
|
||||
编写日期 :2004-8-10
|
||||
最后修改日期 :2004-8-10
|
||||
-----------------------------------------------------------------------*/
|
||||
|
||||
void delay_1us(void) //1us延时函数
|
||||
{
|
||||
unsigned int i;
|
||||
for(i=0;i<1000;i++);
|
||||
}
|
||||
|
||||
void delay_1ms(void) //1ms延时函数
|
||||
{
|
||||
unsigned int i;
|
||||
for (i=0;i<1140;i++);
|
||||
}
|
||||
|
||||
void delay_nms(unsigned int n) //N ms延时函数
|
||||
{
|
||||
unsigned int i=0;
|
||||
for (i=0;i<n;i++)
|
||||
delay_1ms();
|
||||
}
|
||||
|
||||
|
||||
void LCD_init(void)
|
||||
{
|
||||
// 产生一个让LCD复位的低电平脉冲
|
||||
LCD_RST = 0;
|
||||
delay_1us();
|
||||
|
||||
LCD_RST = 1;
|
||||
|
||||
// 关闭LCD
|
||||
LCD_CE = 0;
|
||||
delay_1us();
|
||||
// 使能LCD
|
||||
LCD_CE = 1;
|
||||
delay_1us();
|
||||
|
||||
LCD_write_byte(0x21, 0); // 使用扩展命令设置LCD模式
|
||||
LCD_write_byte(0xc8, 0); // 设置偏置电压
|
||||
LCD_write_byte(0x06, 0); // 温度校正
|
||||
LCD_write_byte(0x13, 0); // 1:48
|
||||
LCD_write_byte(0x20, 0); // 使用基本命令
|
||||
LCD_clear(); // 清屏
|
||||
LCD_write_byte(0x0c, 0); // 设定显示模式,正常显示
|
||||
|
||||
// 关闭LCD
|
||||
LCD_CE = 0;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
LCD_clear : LCD清屏函数
|
||||
|
||||
编写日期 :2004-8-10
|
||||
最后修改日期 :2004-8-10
|
||||
-----------------------------------------------------------------------*/
|
||||
void LCD_clear(void)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
LCD_write_byte(0x0c, 0);
|
||||
LCD_write_byte(0x80, 0);
|
||||
|
||||
for (i=0; i<504; i++)
|
||||
LCD_write_byte(0, 1);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
LCD_set_XY : 设置LCD坐标函数
|
||||
|
||||
输入参数:X :0-83
|
||||
Y :0-5
|
||||
|
||||
编写日期 :2004-8-10
|
||||
最后修改日期 :2004-8-10
|
||||
-----------------------------------------------------------------------*/
|
||||
void LCD_set_XY(unsigned char X, unsigned char Y)
|
||||
{
|
||||
LCD_write_byte(0x40 | Y, 0); // column
|
||||
LCD_write_byte(0x80 | X, 0); // row
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
LCD_write_char : 显示英文字符
|
||||
|
||||
输入参数:c :显示的字符;
|
||||
|
||||
编写日期 :2004-8-10
|
||||
最后修改日期 :2004-8-10
|
||||
-----------------------------------------------------------------------*/
|
||||
void LCD_write_char(unsigned char c)
|
||||
{
|
||||
unsigned char line;
|
||||
|
||||
c -= 32;
|
||||
|
||||
for (line=0; line<6; line++)
|
||||
LCD_write_byte(font6x8[c][line], 1);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
LCD_write_english_String : 英文字符串显示函数
|
||||
|
||||
输入参数:*s :英文字符串指针;
|
||||
X、Y : 显示字符串的位置,x 0-83 ,y 0-5
|
||||
|
||||
编写日期 :2004-8-10
|
||||
最后修改日期 :2004-8-10
|
||||
-----------------------------------------------------------------------*/
|
||||
void LCD_write_english_string(unsigned char X,unsigned char Y,char *s)
|
||||
{
|
||||
LCD_set_XY(X,Y);
|
||||
while (*s)
|
||||
{
|
||||
LCD_write_char(*s);
|
||||
s++;
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------------------
|
||||
LCD_write_chinese_string: 在LCD上显示汉字
|
||||
|
||||
输入参数:X、Y :显示汉字的起始X、Y坐标;
|
||||
ch_with :汉字点阵的宽度
|
||||
num :显示汉字的个数;
|
||||
line :汉字点阵数组中的起始行数
|
||||
row :汉字显示的行间距
|
||||
编写日期 :2004-8-11
|
||||
最后修改日期 :2004-8-12
|
||||
测试:
|
||||
LCD_write_chi(0,0,12,7,0,0);
|
||||
LCD_write_chi(0,2,12,7,0,0);
|
||||
LCD_write_chi(0,4,12,7,0,0);
|
||||
-----------------------------------------------------------------------*/
|
||||
void LCD_write_chinese_string(unsigned char X, unsigned char Y,
|
||||
unsigned char ch_with,unsigned char num,
|
||||
unsigned char line,unsigned char row)
|
||||
{
|
||||
unsigned char i,n;
|
||||
|
||||
LCD_set_XY(X,Y); //设置初始位置
|
||||
|
||||
for (i=0;i<num;)
|
||||
{
|
||||
for (n=0; n<ch_with*2; n++) //写一个汉字
|
||||
{
|
||||
if (n==ch_with) //写汉字的下半部分
|
||||
{
|
||||
if (i==0) LCD_set_XY(X,Y+1);
|
||||
else
|
||||
LCD_set_XY((X+(ch_with+row)*i),Y+1);
|
||||
}
|
||||
LCD_write_byte(write_chinese[line+i][n],1);
|
||||
}
|
||||
i++;
|
||||
LCD_set_XY((X+(ch_with+row)*i),Y);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
LCD_draw_map : 位图绘制函数
|
||||
|
||||
输入参数:X、Y :位图绘制的起始X、Y坐标;
|
||||
*map :位图点阵数据;
|
||||
Pix_x :位图像素(长)
|
||||
Pix_y :位图像素(宽)
|
||||
|
||||
编写日期 :2004-8-13
|
||||
最后修改日期 :2004-8-13
|
||||
-----------------------------------------------------------------------*/
|
||||
void LCD_draw_bmp_pixel(unsigned char X,unsigned char Y,unsigned char *map,
|
||||
unsigned char Pix_x,unsigned char Pix_y)
|
||||
{
|
||||
unsigned int i,n;
|
||||
unsigned char row;
|
||||
|
||||
if (Pix_y%8==0) row=Pix_y/8; //计算位图所占行数
|
||||
else
|
||||
row=Pix_y/8+1;
|
||||
|
||||
for (n=0;n<row;n++)
|
||||
{
|
||||
LCD_set_XY(X,Y);
|
||||
for(i=0; i<Pix_x; i++)
|
||||
{
|
||||
LCD_write_byte(map[i+n*Pix_x], 1);
|
||||
}
|
||||
Y++; //换行
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
LCD_write_byte : 使用SPI接口写数据到LCD
|
||||
|
||||
输入参数:data :写入的数据;
|
||||
command :写数据/命令选择;
|
||||
|
||||
编写日期 :2004-8-10
|
||||
最后修改日期 :2004-8-13
|
||||
-----------------------------------------------------------------------*/
|
||||
void LCD_write_byte(unsigned char dat, unsigned char command)
|
||||
{
|
||||
unsigned char i;
|
||||
//PORTB &= ~LCD_CE ; // 使能LCD
|
||||
LCD_CE = 0;
|
||||
|
||||
if (command == 0)
|
||||
// PORTB &= ~LCD_DC ; // 传送命令
|
||||
LCD_DC = 0;
|
||||
else
|
||||
// PORTB |= LCD_DC ; // 传送数据
|
||||
LCD_DC = 1;
|
||||
for(i=0;i<8;i++)
|
||||
{
|
||||
if(dat&0x80)
|
||||
SDIN = 1;
|
||||
else
|
||||
SDIN = 0;
|
||||
SCLK = 0;
|
||||
dat = dat << 1;
|
||||
SCLK = 1;
|
||||
}
|
||||
// SPDR = data; // 传送数据到SPI寄存器
|
||||
|
||||
//while ((SPSR & 0x80) == 0); // 等待数据传送完毕
|
||||
|
||||
//PORTB |= LCD_CE ; // 关闭LCD
|
||||
LCD_CE = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
2007-2-1 12:06
|
||||
nokia 5110 driver program for 51 mcu
|
||||
by zl0801
|
||||
|
||||
zhaoliang0801@gmail.com
|
||||
|
||||
*/
|
||||
|
||||
#include <reg51.h>
|
||||
|
||||
// pin define for n5110lcd_8key board
|
||||
// change this if your hardware changed!
|
||||
|
||||
sbit SCLK = P2^5; // pin 2 header 5
|
||||
sbit SDIN = P2^4; // pin 3 header 4
|
||||
sbit LCD_DC = P2^3; // pin 4 header 3
|
||||
sbit LCD_CE = P2^2; // pin 5 header 2
|
||||
sbit LCD_RST = P2^1; // pin 9 header 1
|
||||
|
||||
|
||||
void LCD_init(void);
|
||||
void LCD_clear(void);
|
||||
void LCD_move_chinese_string(unsigned char X, unsigned char Y, unsigned char T);
|
||||
void LCD_write_english_string(unsigned char X,unsigned char Y,char *s);
|
||||
void LCD_write_chinese_string(unsigned char X, unsigned char Y,
|
||||
unsigned char ch_with,unsigned char num,
|
||||
unsigned char line,unsigned char row);
|
||||
void chinese_string(unsigned char X, unsigned char Y, unsigned char T);
|
||||
void LCD_write_char(unsigned char c);
|
||||
void LCD_draw_bmp_pixel(unsigned char X,unsigned char Y,unsigned char *map,
|
||||
unsigned char Pix_x,unsigned char Pix_y);
|
||||
void LCD_write_byte(unsigned char dat, unsigned char dc);
|
||||
void LCD_set_XY(unsigned char X, unsigned char Y);
|
||||
void delay_1us(void);
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
code unsigned char write_chinese[][24]={
|
||||
|
||||
//测
|
||||
{0x89,0xF2,0x00,0xFF,0x01,0xF9,0xFF,0x00,0xFC,0x00,0xFF,0x00,0x00,0x07,0x04,0x04,0x02,0x01,0x02,0x04,0x01,0x04,0x07,0x00},
|
||||
//试
|
||||
{0x11,0xF6,0x00,0x04,0x24,0xE4,0x24,0x24,0xFF,0x05,0x06,0x00,0x00,0x07,0x02,0x01,0x02,0x03,0x01,0x01,0x01,0x02,0x07,0x00},
|
||||
//程
|
||||
{0x8A,0x6A,0xFF,0x49,0x20,0xAF,0xA9,0xE9,0xA9,0xAF,0x20,0x00,0x01,0x00,0x07,0x00,0x04,0x04,0x04,0x07,0x04,0x04,0x04,0x00},
|
||||
//序
|
||||
{0x00,0xFE,0x42,0x4A,0x4A,0x5B,0xEA,0x5A,0x4A,0xC2,0x42,0x00,0x06,0x01,0x00,0x00,0x04,0x04,0x07,0x00,0x00,0x00,0x00,0x00},
|
||||
|
||||
|
||||
//电
|
||||
{0x00,0xFC,0x94,0x94,0x94,0xFF,0x94,0x94,0x94,0xFE,0x04,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x04,0x04,0x04,0x04,0x06,0x00},
|
||||
//子
|
||||
{0x20,0x21,0x21,0x21,0x21,0xF9,0x29,0x25,0x23,0x31,0x20,0x00,0x00,0x00,0x00,0x04,0x04,0x07,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
//制
|
||||
{0x18,0xD6,0x54,0xFF,0x54,0x56,0xD4,0x00,0xFC,0x00,0xFF,0x00,0x00,0x03,0x00,0x07,0x00,0x02,0x03,0x00,0x04,0x04,0x07,0x00},
|
||||
//作
|
||||
{0x10,0x08,0xFC,0x13,0x08,0x04,0xFF,0x24,0x24,0x24,0x04,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x07,0x01,0x01,0x01,0x01,0x00},
|
||||
//杂
|
||||
{0x40,0x62,0x52,0xCA,0x47,0xE2,0x42,0xDE,0x50,0x50,0x58,0x00,0x04,0x02,0x01,0x04,0x04,0x07,0x00,0x00,0x01,0x02,0x04,0x00},
|
||||
//志
|
||||
{0x04,0xA4,0x24,0xA4,0x24,0xBF,0x24,0x24,0x24,0xA6,0x04,0x00,0x02,0x01,0x00,0x07,0x04,0x04,0x05,0x04,0x06,0x00,0x03,0x00},
|
||||
//社
|
||||
{0x84,0x44,0xF5,0x2E,0x40,0x10,0x10,0xFF,0x10,0x10,0x10,0x00,0x00,0x00,0x07,0x00,0x04,0x04,0x04,0x07,0x04,0x04,0x04,0x00},
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
|
||||
|
||||
code char write_chinese[][24]={
|
||||
//麦
|
||||
{0X22,0X2A,0XAA,0XEA,0XAA,0XBF,0XAA,0XAA,0XAA,0X2A,0X22,0X00,0X05,0X05,0X04,0X04,0X05,0X02,0X02,0X05,0X04,0X04,0X04,0X00},
|
||||
//王
|
||||
{0X00,0X22,0X22,0X22,0X22,0XFE,0X22,0X22,0X23,0X22,0X00,0X00,0X04,0X04,0X04,0X04,0X04,0X07,0X04,0X04,0X04,0X04,0X04,0X00},
|
||||
//电
|
||||
{0X00,0XFC,0X94,0X94,0X94,0XFF,0X94,0X94,0X94,0XFE,0X04,0X00,0X00,0X01,0X00,0X00,0X00,0X03,0X04,0X04,0X04,0X04,0X06,0X00},
|
||||
//子
|
||||
{0X20,0X21,0X21,0X21,0X21,0XF9,0X29,0X25,0X23,0X31,0X20,0X00,0X00,0X00,0X00,0X04,0X04,0X07,0X00,0X00,0X00,0X00,0X00,0X00},
|
||||
//欢
|
||||
{0X0A,0X92,0X62,0X9E,0X02,0X18,0X87,0X74,0X84,0X14,0X0C,0X00,0X02,0X01,0X00,0X04,0X05,0X02,0X01,0X00,0X01,0X02,0X04,0X00},
|
||||
//迎
|
||||
{0X08,0XF9,0X02,0X00,0XFE,0X42,0X41,0XFE,0X02,0X82,0XFE,0X00,0X06,0X01,0X02,0X02,0X04,0X04,0X04,0X05,0X04,0X04,0X04,0X00},
|
||||
//您
|
||||
{0X08,0X7C,0X03,0X28,0X94,0X4B,0X42,0X7A,0X0A,0X16,0X22,0X00,0X04,0X03,0X00,0X07,0X04,0X05,0X04,0X04,0X07,0X01,0X02,0X00},
|
||||
|
||||
//赵
|
||||
{0X10,0XD2,0X12,0XFF,0X52,0X50,0X82,0X4C,0X30,0XCF,0X00,0X00,0X06,0X01,0X01,0X03,0X02,0X05,0X04,0X04,0X04,0X05,0X04,0X00},
|
||||
//亮
|
||||
{0X62,0X22,0X3A,0XAA,0XAA,0XAB,0XAA,0XAA,0X3A,0X22,0X62,0X00,0X04,0X04,0X02,0X01,0X00,0X00,0X00,0X07,0X04,0X04,0X07,0X00},
|
||||
//,
|
||||
{0X00,0X00,0X00,0X00,0XC0,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X02,0X03,0X01,0X00,0X00,0X00,0X00,0X00,0X00},
|
||||
|
||||
|
||||
//电
|
||||
{0X00,0XFC,0X94,0X94,0X94,0XFF,0X94,0X94,0X94,0XFE,0X04,0X00,0X00,0X01,0X00,0X00,0X00,0X03,0X04,0X04,0X04,0X04,0X06,0X00},
|
||||
//话
|
||||
{0X10,0X11,0XF6,0X00,0X0A,0XCA,0X4A,0X7E,0X49,0X49,0XC9,0X00,0X00,0X00,0X07,0X02,0X01,0X07,0X02,0X02,0X02,0X02,0X07,0X00},
|
||||
//:
|
||||
{0X00,0X00,0X00,0X00,0X8C,0X8C,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X01,0X00,0X00,0X00,0X00,0X00,0X00},
|
||||
};
|
||||
|
||||
|
||||
|
||||
708
trunk/workspace/00_Lib/Disp_Nokia5110/Nokia/NokiaLCD.c
Normal file
708
trunk/workspace/00_Lib/Disp_Nokia5110/Nokia/NokiaLCD.c
Normal file
@@ -0,0 +1,708 @@
|
||||
/*--------------------------------------------------------------------------------------------------
|
||||
|
||||
Name : NokiaLCD.c
|
||||
|
||||
Description : This is a driver for the Nokia 84x48 graphic LCD.
|
||||
|
||||
Author : 2003-03-08 - Sylvain Bissonnette
|
||||
|
||||
History : 2003-02-08 - First release (v0.1) derived from Sylvain Bissonnette code base.
|
||||
2003-03-09 - v0.2, Louis Frigon: 2x fonts support.
|
||||
2003-03-20 - v0.3: Serialization optimized,
|
||||
|
||||
Info : Max RAM - 512 byte
|
||||
: Max Stack - 10 byte
|
||||
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
#include <macros.h>
|
||||
#include <iom8v.h>
|
||||
//#include <stdio.h>
|
||||
|
||||
#include "NokiaLCD.h"
|
||||
|
||||
#define LCD_FIRMWARE_VERSION 0.3
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------
|
||||
Private function prototypes
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
// Function prototypes are mandatory otherwise the compiler generates unreliable code.
|
||||
|
||||
static void LcdSend ( byte data, LcdCmdData cd );
|
||||
static void Delay ( void );
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------
|
||||
Character generator
|
||||
|
||||
This table defines the standard ASCII characters in a 5x7 dot format.
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
static const byte FontLookup [][5] =
|
||||
{
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00 }, // sp
|
||||
{ 0x00, 0x00, 0x2f, 0x00, 0x00 }, // !
|
||||
{ 0x00, 0x07, 0x00, 0x07, 0x00 }, // "
|
||||
{ 0x14, 0x7f, 0x14, 0x7f, 0x14 }, // #
|
||||
{ 0x24, 0x2a, 0x7f, 0x2a, 0x12 }, // $
|
||||
{ 0xc4, 0xc8, 0x10, 0x26, 0x46 }, // %
|
||||
{ 0x36, 0x49, 0x55, 0x22, 0x50 }, // &
|
||||
{ 0x00, 0x05, 0x03, 0x00, 0x00 }, // '
|
||||
{ 0x00, 0x1c, 0x22, 0x41, 0x00 }, // (
|
||||
{ 0x00, 0x41, 0x22, 0x1c, 0x00 }, // )
|
||||
{ 0x14, 0x08, 0x3E, 0x08, 0x14 }, // *
|
||||
{ 0x08, 0x08, 0x3E, 0x08, 0x08 }, // +
|
||||
{ 0x00, 0x00, 0x50, 0x30, 0x00 }, // ,
|
||||
{ 0x10, 0x10, 0x10, 0x10, 0x10 }, // -
|
||||
{ 0x00, 0x60, 0x60, 0x00, 0x00 }, // .
|
||||
{ 0x20, 0x10, 0x08, 0x04, 0x02 }, // /
|
||||
{ 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0
|
||||
{ 0x00, 0x42, 0x7F, 0x40, 0x00 }, // 1
|
||||
{ 0x42, 0x61, 0x51, 0x49, 0x46 }, // 2
|
||||
{ 0x21, 0x41, 0x45, 0x4B, 0x31 }, // 3
|
||||
{ 0x18, 0x14, 0x12, 0x7F, 0x10 }, // 4
|
||||
{ 0x27, 0x45, 0x45, 0x45, 0x39 }, // 5
|
||||
{ 0x3C, 0x4A, 0x49, 0x49, 0x30 }, // 6
|
||||
{ 0x01, 0x71, 0x09, 0x05, 0x03 }, // 7
|
||||
{ 0x36, 0x49, 0x49, 0x49, 0x36 }, // 8
|
||||
{ 0x06, 0x49, 0x49, 0x29, 0x1E }, // 9
|
||||
{ 0x00, 0x36, 0x36, 0x00, 0x00 }, // :
|
||||
{ 0x00, 0x56, 0x36, 0x00, 0x00 }, // ;
|
||||
{ 0x08, 0x14, 0x22, 0x41, 0x00 }, // <
|
||||
{ 0x14, 0x14, 0x14, 0x14, 0x14 }, // =
|
||||
{ 0x00, 0x41, 0x22, 0x14, 0x08 }, // >
|
||||
{ 0x02, 0x01, 0x51, 0x09, 0x06 }, // ?
|
||||
{ 0x32, 0x49, 0x59, 0x51, 0x3E }, // @
|
||||
{ 0x7E, 0x11, 0x11, 0x11, 0x7E }, // A
|
||||
{ 0x7F, 0x49, 0x49, 0x49, 0x36 }, // B
|
||||
{ 0x3E, 0x41, 0x41, 0x41, 0x22 }, // C
|
||||
{ 0x7F, 0x41, 0x41, 0x22, 0x1C }, // D
|
||||
{ 0x7F, 0x49, 0x49, 0x49, 0x41 }, // E
|
||||
{ 0x7F, 0x09, 0x09, 0x09, 0x01 }, // F
|
||||
{ 0x3E, 0x41, 0x49, 0x49, 0x7A }, // G
|
||||
{ 0x7F, 0x08, 0x08, 0x08, 0x7F }, // H
|
||||
{ 0x00, 0x41, 0x7F, 0x41, 0x00 }, // I
|
||||
{ 0x20, 0x40, 0x41, 0x3F, 0x01 }, // J
|
||||
{ 0x7F, 0x08, 0x14, 0x22, 0x41 }, // K
|
||||
{ 0x7F, 0x40, 0x40, 0x40, 0x40 }, // L
|
||||
{ 0x7F, 0x02, 0x0C, 0x02, 0x7F }, // M
|
||||
{ 0x7F, 0x04, 0x08, 0x10, 0x7F }, // N
|
||||
{ 0x3E, 0x41, 0x41, 0x41, 0x3E }, // O
|
||||
{ 0x7F, 0x09, 0x09, 0x09, 0x06 }, // P
|
||||
{ 0x3E, 0x41, 0x51, 0x21, 0x5E }, // Q
|
||||
{ 0x7F, 0x09, 0x19, 0x29, 0x46 }, // R
|
||||
{ 0x46, 0x49, 0x49, 0x49, 0x31 }, // S
|
||||
{ 0x01, 0x01, 0x7F, 0x01, 0x01 }, // T
|
||||
{ 0x3F, 0x40, 0x40, 0x40, 0x3F }, // U
|
||||
{ 0x1F, 0x20, 0x40, 0x20, 0x1F }, // V
|
||||
{ 0x3F, 0x40, 0x38, 0x40, 0x3F }, // W
|
||||
{ 0x63, 0x14, 0x08, 0x14, 0x63 }, // X
|
||||
{ 0x07, 0x08, 0x70, 0x08, 0x07 }, // Y
|
||||
{ 0x61, 0x51, 0x49, 0x45, 0x43 }, // Z
|
||||
{ 0x00, 0x7F, 0x41, 0x41, 0x00 }, // [
|
||||
{ 0x02, 0x04, 0x08, 0x10, 0x20 }, // back slash
|
||||
{ 0x00, 0x41, 0x41, 0x7f, 0x00 }, // ]
|
||||
{ 0x04, 0x02, 0x01, 0x02, 0x04 }, // ^
|
||||
{ 0x40, 0x40, 0x40, 0x40, 0x40 }, // _
|
||||
{ 0x00, 0x01, 0x02, 0x04, 0x00 }, // '
|
||||
{ 0x20, 0x54, 0x54, 0x54, 0x78 }, // a
|
||||
{ 0x7F, 0x48, 0x44, 0x44, 0x38 }, // b
|
||||
{ 0x38, 0x44, 0x44, 0x44, 0x20 }, // c
|
||||
{ 0x38, 0x44, 0x44, 0x48, 0x7F }, // d
|
||||
{ 0x38, 0x54, 0x54, 0x54, 0x18 }, // e
|
||||
{ 0x08, 0x7E, 0x09, 0x01, 0x02 }, // f
|
||||
{ 0x0C, 0x52, 0x52, 0x52, 0x3E }, // g
|
||||
{ 0x7F, 0x08, 0x04, 0x04, 0x78 }, // h
|
||||
{ 0x00, 0x44, 0x7D, 0x40, 0x00 }, // i
|
||||
{ 0x20, 0x40, 0x44, 0x3D, 0x00 }, // j
|
||||
{ 0x7F, 0x10, 0x28, 0x44, 0x00 }, // k
|
||||
{ 0x00, 0x41, 0x7F, 0x40, 0x00 }, // l
|
||||
{ 0x7C, 0x04, 0x18, 0x04, 0x78 }, // m
|
||||
{ 0x7C, 0x08, 0x04, 0x04, 0x78 }, // n
|
||||
{ 0x38, 0x44, 0x44, 0x44, 0x38 }, // o
|
||||
{ 0x7C, 0x14, 0x14, 0x14, 0x08 }, // p
|
||||
{ 0x08, 0x14, 0x14, 0x18, 0x7C }, // q
|
||||
{ 0x7C, 0x08, 0x04, 0x04, 0x08 }, // r
|
||||
{ 0x48, 0x54, 0x54, 0x54, 0x20 }, // s
|
||||
{ 0x04, 0x3F, 0x44, 0x40, 0x20 }, // t
|
||||
{ 0x3C, 0x40, 0x40, 0x20, 0x7C }, // u
|
||||
{ 0x1C, 0x20, 0x40, 0x20, 0x1C }, // v
|
||||
{ 0x3C, 0x40, 0x30, 0x40, 0x3C }, // w
|
||||
{ 0x44, 0x28, 0x10, 0x28, 0x44 }, // x
|
||||
{ 0x0C, 0x50, 0x50, 0x50, 0x3C }, // y
|
||||
{ 0x44, 0x64, 0x54, 0x4C, 0x44 }, // z
|
||||
{ 0x00, 0x08, 0x36, 0x41, 0x00 }, // {
|
||||
{ 0x00, 0x00, 0x7f, 0x00, 0x00 }, // |
|
||||
{ 0x00, 0x41, 0x36, 0x08, 0x00 }, // }
|
||||
{ 0x04, 0x02, 0x04, 0x08, 0x04 }, // ~
|
||||
{ 0x00, 0x00, 0x36, 0x00, 0x00 }, // ¦
|
||||
{ 0x0e, 0x51, 0x31, 0x11, 0x08 }, // Ç
|
||||
{ 0x3c, 0x41, 0x40, 0x21, 0x7c }, // ü
|
||||
{ 0x38, 0x54, 0x56, 0x55, 0x18 }, // é
|
||||
{ 0x20, 0x56, 0x55, 0x56, 0x78 }, // â
|
||||
{ 0x20, 0x55, 0x54, 0x55, 0x78 }, // ä
|
||||
{ 0x20, 0x55, 0x56, 0x54, 0x78 }, // à
|
||||
{ 0x08, 0x08, 0x2a, 0x1c, 0x08 }, // Right Arrow (chr 134)
|
||||
{ 0x0e, 0x51, 0x31, 0x11, 0x08 }, // ç
|
||||
{ 0x38, 0x56, 0x55, 0x56, 0x18 }, // ê
|
||||
{ 0x38, 0x55, 0x54, 0x55, 0x18 }, // ë
|
||||
{ 0x38, 0x55, 0x56, 0x54, 0x18 }, // è
|
||||
{ 0x00, 0x45, 0x7c, 0x41, 0x00 }, // ï
|
||||
{ 0x00, 0x46, 0x7d, 0x42, 0x00 }, // î
|
||||
{ 0x7f, 0x7f, 0x7f, 0x7f, 0x7f }, // free (chr 141)
|
||||
{ 0x7f, 0x7f, 0x7f, 0x7f, 0x7f }, // free (chr 142)
|
||||
{ 0x7f, 0x7f, 0x7f, 0x7f, 0x7f }, // free (chr 143)
|
||||
{ 0x7c, 0x54, 0x56, 0x55, 0x44 }, // É
|
||||
{ 0x7f, 0x7f, 0x7f, 0x7f, 0x7f }, // free (chr 145)
|
||||
{ 0x7f, 0x7f, 0x7f, 0x7f, 0x7f }, // free (chr 146)
|
||||
{ 0x38, 0x46, 0x45, 0x46, 0x38 }, // ô
|
||||
{ 0x7f, 0x7f, 0x7f, 0x7f, 0x7f }, // free (chr 148)
|
||||
{ 0x38, 0x45, 0x46, 0x44, 0x38 }, // ò
|
||||
{ 0x3c, 0x42, 0x41, 0x22, 0x7c }, // û
|
||||
{ 0x3c, 0x41, 0x42, 0x20, 0x7c } // ù
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------
|
||||
Global Variables
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
static byte LcdCache [ LCD_CACHE_SIZE ];
|
||||
|
||||
static int LcdCacheIdx;
|
||||
static int LoWaterMark;
|
||||
static int HiWaterMark;
|
||||
extern unsigned char UpdateLcd;
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------
|
||||
|
||||
Name : LcdPower ( byte stat )
|
||||
|
||||
Description : Performs MCU SPI & LCD controller initialization.
|
||||
|
||||
Argument(s) : stat -> true or false
|
||||
|
||||
Return value : None.
|
||||
|
||||
Notes : Power ON or OFF LCD
|
||||
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
void LcdPower ( byte stat )
|
||||
{
|
||||
if (stat)
|
||||
{
|
||||
LcdInit();
|
||||
}
|
||||
else
|
||||
{
|
||||
PORTB = 0xc0; // All LCD pin at 0
|
||||
SPCR = 0x00; // Disable SPI
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------
|
||||
|
||||
Name : LcdInit
|
||||
|
||||
Description : Performs MCU SPI & LCD controller initialization.
|
||||
|
||||
Argument(s) : None.
|
||||
|
||||
Return value : None.
|
||||
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
void LcdInit ( void )
|
||||
{
|
||||
static byte FirstInit = TRUE;
|
||||
|
||||
// Pull-up on reset pin.
|
||||
PORTB |= LCD_RST_PIN;
|
||||
|
||||
// Set output bits on port B.
|
||||
DDRB |= LCD_RST_PIN | LCD_DC_PIN | LCD_CE_PIN | SPI_MOSI_PIN | SPI_CLK_PIN | LCD_POWER;
|
||||
|
||||
PORTB |= LCD_POWER;
|
||||
|
||||
Delay();
|
||||
|
||||
// Toggle display reset pin.
|
||||
PORTB &= ~LCD_RST_PIN;
|
||||
Delay();
|
||||
PORTB |= LCD_RST_PIN;
|
||||
|
||||
// Enable SPI port: No interrupt, MSBit first, Master mode, CPOL->0, CPHA->0, Clk/4
|
||||
SPCR = 0x50;
|
||||
|
||||
// Disable LCD controller
|
||||
PORTB |= LCD_CE_PIN;
|
||||
|
||||
LcdSend( 0x21, LCD_CMD ); // LCD Extended Commands.
|
||||
LcdSend( 0xC8, LCD_CMD ); // Set LCD Vop (Contrast).
|
||||
LcdSend( 0x06, LCD_CMD ); // Set Temp coefficent.
|
||||
LcdSend( 0x13, LCD_CMD ); // LCD bias mode 1:48.
|
||||
LcdSend( 0x20, LCD_CMD ); // LCD Standard Commands, Horizontal addressing mode.
|
||||
LcdSend( 0x0C, LCD_CMD ); // LCD in normal mode.
|
||||
|
||||
if (FirstInit == TRUE)
|
||||
{
|
||||
LoWaterMark = LCD_CACHE_SIZE;
|
||||
HiWaterMark = 0;
|
||||
LcdClear();
|
||||
FirstInit = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
LoWaterMark = 0;
|
||||
HiWaterMark = LCD_CACHE_SIZE;
|
||||
}
|
||||
LcdUpdate();
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------
|
||||
|
||||
Name : LcdContrast
|
||||
|
||||
Description : Set display contrast.
|
||||
|
||||
Argument(s) : contrast -> Contrast value from 0x00 to 0x7F.
|
||||
|
||||
Return value : None.
|
||||
|
||||
Notes : No change visible at ambient temperature.
|
||||
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
void LcdContrast ( byte contrast )
|
||||
{
|
||||
// LCD Extended Commands.
|
||||
LcdSend( 0x21, LCD_CMD );
|
||||
|
||||
// Set LCD Vop (Contrast).
|
||||
LcdSend( 0x80 | contrast, LCD_CMD );
|
||||
|
||||
// LCD Standard Commands, horizontal addressing mode.
|
||||
LcdSend( 0x20, LCD_CMD );
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------
|
||||
|
||||
Name : LcdClear
|
||||
|
||||
Description : Clears the display. LcdUpdate must be called next.
|
||||
|
||||
Argument(s) : None.
|
||||
|
||||
Return value : None.
|
||||
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
void LcdClear ( void )
|
||||
{
|
||||
int i;
|
||||
|
||||
for ( i = 0; i < LCD_CACHE_SIZE; i++ )
|
||||
{
|
||||
LcdCache[i] = 0x00;
|
||||
}
|
||||
|
||||
// Reset watermark pointers.
|
||||
LoWaterMark = 0;
|
||||
HiWaterMark = LCD_CACHE_SIZE - 1;
|
||||
|
||||
UpdateLcd = TRUE;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------
|
||||
|
||||
Name : LcdGotoXY
|
||||
|
||||
Description : Sets cursor location to xy location corresponding to basic font size.
|
||||
|
||||
Argument(s) : x, y -> Coordinate for new cursor position. Range: 1,1 .. 14,6
|
||||
|
||||
Return value : None.
|
||||
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
void LcdGotoXY ( byte x, byte y )
|
||||
{
|
||||
LcdCacheIdx = (x - 1) * 6 + (y - 1) * 84;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------
|
||||
|
||||
Name : LcdChr
|
||||
|
||||
Description : Displays a character at current cursor location and increment cursor location.
|
||||
|
||||
Argument(s) : size -> Font size. See enum.
|
||||
ch -> Character to write.
|
||||
|
||||
Return value : None.
|
||||
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
void LcdChr ( LcdFontSize size, byte ch )
|
||||
{
|
||||
byte i, c;
|
||||
byte b1, b2;
|
||||
int tmpIdx;
|
||||
|
||||
if ( LcdCacheIdx < LoWaterMark )
|
||||
{
|
||||
// Update low marker.
|
||||
LoWaterMark = LcdCacheIdx;
|
||||
}
|
||||
|
||||
if (ch < 0x20)
|
||||
{
|
||||
ch = 148;
|
||||
}
|
||||
|
||||
if (ch > 151) // Convert ISO8859-1 to ascii
|
||||
{
|
||||
if (ch == 0xc0) ch = 133;
|
||||
else if (ch == 0xc2) ch = 131;
|
||||
else if (ch == 0xc7) ch = 128;
|
||||
else if (ch == 0xc9) ch = 144;
|
||||
else if (ch == 0xca) ch = 136;
|
||||
else if (ch == 0xce) ch = 140;
|
||||
else if (ch == 0xe0) ch = 133;
|
||||
else if (ch == 0xe2) ch = 131;
|
||||
else if (ch == 0xe7) ch = 135;
|
||||
else if (ch == 0xe8) ch = 138;
|
||||
else if (ch == 0xe9) ch = 130;
|
||||
else if (ch == 0xea) ch = 136;
|
||||
else if (ch == 0xeb) ch = 137;
|
||||
else if (ch == 0xee) ch = 140;
|
||||
else if (ch == 0xef) ch = 139;
|
||||
else if (ch == 0xf4) ch = 147;
|
||||
else if (ch == 0xf9) ch = 151;
|
||||
else if (ch == 0xfb) ch = 150;
|
||||
else ch = 148;
|
||||
}
|
||||
|
||||
if ( size == FONT_1X )
|
||||
{
|
||||
for ( i = 0; i < 5; i++ )
|
||||
{
|
||||
LcdCache[LcdCacheIdx++] = FontLookup[ch - 32][i] << 1;
|
||||
}
|
||||
}
|
||||
else if ( size == FONT_2X )
|
||||
{
|
||||
tmpIdx = LcdCacheIdx - 84;
|
||||
|
||||
if ( tmpIdx < LoWaterMark )
|
||||
{
|
||||
LoWaterMark = tmpIdx;
|
||||
}
|
||||
|
||||
if ( tmpIdx < 0 ) return;
|
||||
|
||||
for ( i = 0; i < 5; i++ )
|
||||
{
|
||||
c = FontLookup[ch - 32][i] << 1;
|
||||
b1 = (c & 0x01) * 3;
|
||||
b1 |= (c & 0x02) * 6;
|
||||
b1 |= (c & 0x04) * 12;
|
||||
b1 |= (c & 0x08) * 24;
|
||||
|
||||
c >>= 4;
|
||||
b2 = (c & 0x01) * 3;
|
||||
b2 |= (c & 0x02) * 6;
|
||||
b2 |= (c & 0x04) * 12;
|
||||
b2 |= (c & 0x08) * 24;
|
||||
|
||||
LcdCache[tmpIdx++] = b1;
|
||||
LcdCache[tmpIdx++] = b1;
|
||||
LcdCache[tmpIdx + 82] = b2;
|
||||
LcdCache[tmpIdx + 83] = b2;
|
||||
}
|
||||
|
||||
// Update x cursor position.
|
||||
LcdCacheIdx += 11;
|
||||
}
|
||||
|
||||
if ( LcdCacheIdx > HiWaterMark )
|
||||
{
|
||||
// Update high marker.
|
||||
HiWaterMark = LcdCacheIdx;
|
||||
}
|
||||
|
||||
// Horizontal gap between characters.
|
||||
LcdCache[LcdCacheIdx++] = 0x00;
|
||||
UpdateLcd = TRUE;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------
|
||||
|
||||
Name : LcdStr
|
||||
|
||||
Description : Displays a character at current cursor location and increment cursor location
|
||||
according to font size.
|
||||
|
||||
Argument(s) : size -> Font size. See enum.
|
||||
dataPtr -> Pointer to null terminated ASCII string to display.
|
||||
|
||||
Return value : None.
|
||||
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
void LcdStr ( LcdFontSize size, byte *dataPtr )
|
||||
{
|
||||
while ( *dataPtr )
|
||||
{
|
||||
LcdChr( size, *dataPtr++ );
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------
|
||||
|
||||
Name : LcdStrConst
|
||||
|
||||
Description : Displays a character at current cursor location and increment cursor location
|
||||
according to font size.
|
||||
|
||||
Argument(s) : size -> Font size. See enum.
|
||||
dataPtr -> Pointer to null terminated ASCII string to display.
|
||||
|
||||
Return value : None.
|
||||
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
void LcdStrConst ( LcdFontSize size, const char *dataPtr )
|
||||
{
|
||||
while ( *dataPtr )
|
||||
{
|
||||
LcdChr( size, *dataPtr++ );
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------
|
||||
|
||||
Name : LcdPixel
|
||||
|
||||
Description : Displays a pixel at given absolute (x, y) location.
|
||||
|
||||
Argument(s) : x, y -> Absolute pixel coordinates
|
||||
mode -> Off, On or Xor. See enum.
|
||||
|
||||
Return value : None.
|
||||
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
void LcdPixel ( byte x, byte y, LcdPixelMode mode )
|
||||
{
|
||||
word index;
|
||||
byte offset;
|
||||
byte data;
|
||||
|
||||
if ( x > LCD_X_RES ) return;
|
||||
if ( y > LCD_Y_RES ) return;
|
||||
|
||||
index = ((y / 8) * 84) + x;
|
||||
offset = y - ((y / 8) * 8);
|
||||
|
||||
data = LcdCache[index];
|
||||
|
||||
if ( mode == PIXEL_OFF )
|
||||
{
|
||||
data &= (~(0x01 << offset));
|
||||
}
|
||||
else if ( mode == PIXEL_ON )
|
||||
{
|
||||
data |= (0x01 << offset);
|
||||
}
|
||||
else if ( mode == PIXEL_XOR )
|
||||
{
|
||||
data ^= (0x01 << offset);
|
||||
}
|
||||
|
||||
LcdCache[index] = data;
|
||||
|
||||
if ( index < LoWaterMark )
|
||||
{
|
||||
// Update low marker.
|
||||
LoWaterMark = index;
|
||||
}
|
||||
|
||||
if ( index > HiWaterMark )
|
||||
{
|
||||
// Update high marker.
|
||||
HiWaterMark = index;
|
||||
}
|
||||
UpdateLcd = TRUE;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------
|
||||
|
||||
Name : LcdLine
|
||||
|
||||
Description : Draws a line between two points on the display.
|
||||
|
||||
Argument(s) : x1, y1 -> Absolute pixel coordinates for line origin.
|
||||
x2, y2 -> Absolute pixel coordinates for line end.
|
||||
mode -> Off, On or Xor. See enum.
|
||||
|
||||
Return value : None.
|
||||
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
void LcdLine ( byte x1, byte y1, byte x2, byte y2, LcdPixelMode mode )
|
||||
{
|
||||
int dx, dy, stepx, stepy, fraction;
|
||||
|
||||
dy = y2 - y1;
|
||||
dx = x2 - x1;
|
||||
|
||||
if ( dy < 0 )
|
||||
{
|
||||
dy = -dy;
|
||||
stepy = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
stepy = 1;
|
||||
}
|
||||
|
||||
if ( dx < 0 )
|
||||
{
|
||||
dx = -dx;
|
||||
stepx = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
stepx = 1;
|
||||
}
|
||||
|
||||
dx <<= 1;
|
||||
dy <<= 1;
|
||||
|
||||
LcdPixel( x1, y1, mode );
|
||||
|
||||
if ( dx > dy )
|
||||
{
|
||||
fraction = dy - (dx >> 1);
|
||||
while ( x1 != x2 )
|
||||
{
|
||||
if ( fraction >= 0 )
|
||||
{
|
||||
y1 += stepy;
|
||||
fraction -= dx;
|
||||
}
|
||||
x1 += stepx;
|
||||
fraction += dy;
|
||||
LcdPixel( x1, y1, mode );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fraction = dx - (dy >> 1);
|
||||
while ( y1 != y2 )
|
||||
{
|
||||
if ( fraction >= 0 )
|
||||
{
|
||||
x1 += stepx;
|
||||
fraction -= dy;
|
||||
}
|
||||
y1 += stepy;
|
||||
fraction += dx;
|
||||
LcdPixel( x1, y1, mode );
|
||||
}
|
||||
}
|
||||
|
||||
UpdateLcd = TRUE;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------
|
||||
|
||||
Name : LcdUpdate
|
||||
|
||||
Description : Copies the LCD cache into the device RAM.
|
||||
|
||||
Argument(s) : None.
|
||||
|
||||
Return value : None.
|
||||
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
void LcdUpdate ( void )
|
||||
{
|
||||
int i;
|
||||
|
||||
if ( LoWaterMark < 0 )
|
||||
LoWaterMark = 0;
|
||||
else if ( LoWaterMark >= LCD_CACHE_SIZE )
|
||||
LoWaterMark = LCD_CACHE_SIZE - 1;
|
||||
|
||||
if ( HiWaterMark < 0 )
|
||||
HiWaterMark = 0;
|
||||
else if ( HiWaterMark >= LCD_CACHE_SIZE )
|
||||
HiWaterMark = LCD_CACHE_SIZE - 1;
|
||||
|
||||
// Set base address according to LoWaterMark.
|
||||
LcdSend( 0x80 | (LoWaterMark % LCD_X_RES), LCD_CMD );
|
||||
LcdSend( 0x40 | (LoWaterMark / LCD_X_RES), LCD_CMD );
|
||||
|
||||
// Serialize the video buffer.
|
||||
for ( i = LoWaterMark; i <= HiWaterMark; i++ )
|
||||
{
|
||||
LcdSend( LcdCache[i], LCD_DATA );
|
||||
}
|
||||
|
||||
// Reset watermark pointers.
|
||||
LoWaterMark = LCD_CACHE_SIZE - 1;
|
||||
HiWaterMark = 0;
|
||||
|
||||
UpdateLcd = FALSE;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------
|
||||
|
||||
Name : LcdSend
|
||||
|
||||
Description : Sends data to display controller.
|
||||
|
||||
Argument(s) : data -> Data to be sent
|
||||
cd -> Command or data (see/use enum)
|
||||
|
||||
Return value : None.
|
||||
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
static void LcdSend ( byte data, LcdCmdData cd )
|
||||
{
|
||||
// Enable display controller (active low).
|
||||
PORTB &= ~LCD_CE_PIN;
|
||||
|
||||
if ( cd == LCD_DATA )
|
||||
{
|
||||
PORTB |= LCD_DC_PIN;
|
||||
}
|
||||
else
|
||||
{
|
||||
PORTB &= ~LCD_DC_PIN;
|
||||
}
|
||||
|
||||
// Send data to display controller.
|
||||
SPDR = data;
|
||||
|
||||
// Wait until Tx register empty.
|
||||
while ( (SPSR & 0x80) != 0x80 );
|
||||
|
||||
// Disable display controller.
|
||||
PORTB |= LCD_CE_PIN;
|
||||
|
||||
// Only for 38Khz share pin for remote controle
|
||||
PORTB &= ~LCD_DC_PIN;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------
|
||||
|
||||
Name : Delay
|
||||
|
||||
Description : Uncalibrated delay for LCD init routine.
|
||||
|
||||
Argument(s) : None.
|
||||
|
||||
Return value : None.
|
||||
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
static void Delay ( void )
|
||||
{
|
||||
int i;
|
||||
|
||||
for ( i = -32000; i < 32000; i++ );
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------
|
||||
End of file.
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
|
||||
84
trunk/workspace/00_Lib/Disp_Nokia5110/Nokia/NokiaLCD.h
Normal file
84
trunk/workspace/00_Lib/Disp_Nokia5110/Nokia/NokiaLCD.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/*--------------------------------------------------------------------------------------------------
|
||||
|
||||
Name : NokiaLCD.h
|
||||
|
||||
Description : Header file for Nokia 84x48 graphic LCD driver.
|
||||
|
||||
Author : 2003-03-08 - Louis Frigon.
|
||||
|
||||
History : 2003-03-08 - First release.
|
||||
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
#ifndef _NOKIALCD_H_
|
||||
|
||||
#define _NOKIALCD_H_
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------
|
||||
General purpose constants
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
#define NULL 0
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
#define LCD_X_RES 84
|
||||
#define LCD_Y_RES 48
|
||||
|
||||
// Mega8 port B pinout for LCD.
|
||||
#define LCD_DC_PIN 0x02 // PB1
|
||||
#define LCD_CE_PIN 0x04 // PB2
|
||||
#define SPI_MOSI_PIN 0x08 // PB3
|
||||
#define LCD_RST_PIN 0x10 // PB4
|
||||
#define SPI_CLK_PIN 0x20 // PB5
|
||||
#define LCD_POWER 0x01 // PB0
|
||||
|
||||
#define LCD_CACHE_SIZE ((LCD_X_RES * LCD_Y_RES) / 8)
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------
|
||||
Type definitions
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
typedef char bool;
|
||||
typedef unsigned char byte;
|
||||
typedef unsigned int word;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
LCD_CMD = 0,
|
||||
LCD_DATA = 1
|
||||
|
||||
} LcdCmdData;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PIXEL_OFF = 0,
|
||||
PIXEL_ON = 1,
|
||||
PIXEL_XOR = 2
|
||||
|
||||
} LcdPixelMode;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
FONT_1X = 1,
|
||||
FONT_2X = 2
|
||||
|
||||
} LcdFontSize;
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------
|
||||
Public function prototypes
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
void LcdInit ( void );
|
||||
void LcdPower ( byte stat );
|
||||
void LcdContrast ( byte contrast );
|
||||
void LcdClear ( void );
|
||||
void LcdUpdate ( void );
|
||||
void LcdGotoXY ( byte x, byte y );
|
||||
void LcdChr ( LcdFontSize size, byte ch );
|
||||
void LcdStr ( LcdFontSize size, byte *dataPtr );
|
||||
void LcdStrConst ( LcdFontSize size, const char *dataPtr );
|
||||
void LcdPixel ( byte x, byte y, LcdPixelMode mode );
|
||||
void LcdLine ( byte x1, byte y1, byte x2, byte y2, LcdPixelMode mode );
|
||||
|
||||
#endif // _NOKIALCD_H_
|
||||
/*--------------------------------------------------------------------------------------------------
|
||||
End of file.
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
|
||||
BIN
trunk/workspace/00_Lib/Disp_Nokia5110/User_Manual_ET_LCD5110.pdf
Normal file
BIN
trunk/workspace/00_Lib/Disp_Nokia5110/User_Manual_ET_LCD5110.pdf
Normal file
Binary file not shown.
32
trunk/workspace/00_Lib/Disp_Nokia5110/bmp_pixel.h
Normal file
32
trunk/workspace/00_Lib/Disp_Nokia5110/bmp_pixel.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/*------------------------------------------------------------------------------
|
||||
; MCU : AVR
|
||||
; width x heighth: 40x24
|
||||
; type matrix set: Single color dot matrix LCD type
|
||||
; date: 2013-4-25
|
||||
------------------------------------------------------------------------------*/
|
||||
static const unsigned char AVR_bmp[]=
|
||||
{
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0x40,
|
||||
0x20,0x00,0x10,0x10,0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x10,0x10,0x00,
|
||||
0x20,0x40,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x0C,0x02,0x01,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x0C,0x70,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,
|
||||
0x80,0xC0,0xE0,0xE0,0xF0,0xF0,0xF0,0xF0,0xE0,0xC0,0x00,0x00,0x00,0x00,0x00,0xC0,
|
||||
0xE0,0xF0,0xF0,0xF0,0xF0,0xE0,0xE0,0xC0,0x80,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,
|
||||
0x18,0x60,0x83,0x87,0x87,0x87,0x07,0x03,0x03,0x03,0x01,0x40,0xF0,0xF0,0xF0,0xF0,
|
||||
0xF0,0x40,0x01,0x03,0x03,0x03,0x07,0x87,0x87,0x87,0x83,0x60,0x18,0x00,0x07,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x1F,0x27,0x48,0x88,0x88,0x88,0x88,0x88,0x48,
|
||||
0x48,0x48,0x88,0x88,0x88,0x88,0x88,0x48,0x27,0x1F,0x00,0xFF,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x02,0x04,0x04,0x08,0x00,0x10,0x10,
|
||||
0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x08,0x04,0x04,0x02,0x03,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
2342
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/Doxyfile
Normal file
2342
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/Doxyfile
Normal file
File diff suppressed because it is too large
Load Diff
26
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/LICENSE
Normal file
26
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/LICENSE
Normal file
@@ -0,0 +1,26 @@
|
||||
Modified BSD License
|
||||
|
||||
Copyright (c) 2012, Andy Gock
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL Andy Gock BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
141
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/README.md
Normal file
141
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/README.md
Normal file
@@ -0,0 +1,141 @@
|
||||
glcd - Graphic LCD Library
|
||||
==========================
|
||||
|
||||
by Andy Gock
|
||||
|
||||
Up to date documentation
|
||||
------------------------
|
||||
|
||||
For up to date documentation, please see the doxygen pages under the `doxygen_pages` directory.
|
||||
|
||||
A online version can also be seen at:
|
||||
|
||||
http://s.agock.com/glcd-documentation
|
||||
|
||||
However this site may not always be kept up to date.
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
Welcome to GLCD, an open source graphic LCD library written by Andy Gock.
|
||||
|
||||
Author's web site: http://agock.com/
|
||||
|
||||
GitHub repository: https://github.com/andygock/glcd
|
||||
|
||||
This library has been written cleanly, to allow easy modification for use with different microcontroller devices and controller chipsets. Logic relating to devices and controllers are palced in seperate files and specific implementations can be chosen by the use of special defined symbols.
|
||||
|
||||
It is suitable for monochrome (black and white) LCDs with page by page data and command write style data transfer protocol. It is not suitable for color graphic LCDs.
|
||||
|
||||
Supported controllers and chipsets
|
||||
----------------------------------
|
||||
|
||||
Works with:
|
||||
|
||||
- PCD8544 based LCDs, e.g Nokia 3110 and 5110 LCDs
|
||||
- ST7565R / ST7565P serial interface
|
||||
- NT75451 parallel interface (used on NGX BlueBoards)
|
||||
|
||||
The following Newhaven displays have been physically tested with and confirmed working:
|
||||
|
||||
- NHD-C12864WC-FSW-FBW-3V3-M
|
||||
- NHD-C12864A1Z-FSW-FBW-HTT
|
||||
- NHD-C12832A1Z-FSW-FBW-3V3
|
||||
|
||||
Supported microcontrollers
|
||||
--------------------------
|
||||
|
||||
MCUs supported:
|
||||
|
||||
- Atmel AVR 8-bit
|
||||
- NXP LPC111x ARM Cortex-M0
|
||||
- NXP LPC11Uxx ARM Cortex-M0
|
||||
- ST STM32 F0 ARM Cortex-M0
|
||||
- Microchip PIC24H (and probably other 16-bit MCUs)
|
||||
|
||||
Development boards tested on (with on-board LCD):
|
||||
|
||||
- NGX BlueBoard LPC11U37 (with on-board NT75451 graphic LCD)
|
||||
|
||||
Development boards tested on (without on-board LCD):
|
||||
|
||||
- Microstick II with PIC24H and Nokia 3310/5110 LCD, ST7565R and ST7565P
|
||||
|
||||
### Special note
|
||||
|
||||
Not all combinations of microcontroller platform and LCD controllers are supported out of the box. However you can edit the files `devices/` and `controllers/` and add your desired combination. More information on how to do this can be read in the doxygen documentation.
|
||||
|
||||
Setup of symbols for compiler
|
||||
-----------------------------
|
||||
|
||||
The following symbols need to be defined for the compiler:
|
||||
|
||||
Pick microcontroller type (pick one only):
|
||||
|
||||
GLCD_DEVICE_LPX111X
|
||||
GLCD_DEVICE_LPX11UXX
|
||||
GLCD_DEVICE_AVR8
|
||||
GLCD_DEVICE_STM32F0XX
|
||||
GLCD_DEVICE_PIC24H
|
||||
|
||||
Pick LCD controller type (pick one only):
|
||||
|
||||
GLCD_CONTROLLER_PCD8544
|
||||
GLCD_CONTROLLER_ST7565R
|
||||
GLCD_CONTROLLER_NT75451
|
||||
|
||||
For ST7565P controllers, treat as ST7565R. For most if not all parts here, they behave the same way.
|
||||
|
||||
If using a parallel interface LCD (e.g NT75451 on NGX BlueBoard):
|
||||
|
||||
GLCD_USE_PARALLEL
|
||||
|
||||
When using SPI controllers:
|
||||
|
||||
GLCD_USE_SPI
|
||||
|
||||
Note the SPI symbol isn't actually checked by the source at the moment, and it is fine if it is not used. It is for forward compatibility only. One day I may decide to check for it.
|
||||
|
||||
For the Newhaven displays using ST7565 based controllers listed above which have been tested as working, there
|
||||
are certain initialisation sequences which should be followed, and this may vary
|
||||
from display to display. To force a certain (and tested) initialisation
|
||||
sequence, define one of the following:
|
||||
|
||||
GLCD_INIT_NHD_C12832A1Z_FSW_FBW_3V3
|
||||
GLCD_INIT_NHD_C12864A1Z_FSW_FBW_HTT
|
||||
GLCD_INIT_NHD_C12864WC_FSW_FBW_3V3_M
|
||||
|
||||
If you don't specify a NHD model, ST7565 controller selection will default to `GLCD_INIT_NHD_C12864WC_FSW_FBW_3V3_M` sequence.
|
||||
This however may change in the future.
|
||||
|
||||
To set a reset time, used by the `glcd_reset()` function, set `GLCD_RESET_TIME` to desired duration in milliseconds.
|
||||
|
||||
These symbols need to be set in the configuration options of your IDE, usually
|
||||
in the "defined symbols" section, or they can be defined in a makefile
|
||||
as `-D` options.
|
||||
|
||||
Example:
|
||||
|
||||
-DGLCD_DEVICE_LPC111X
|
||||
|
||||
Delay Timing
|
||||
------------
|
||||
|
||||
Some operations such as sending a reset pulse, requires the use of a delay timer. The library will refer to a
|
||||
external function called `delay_ms(t)` where t is the delay required in milliseconds. Please ensure you have
|
||||
this function elsewhere in your program.
|
||||
|
||||
If you are using avr-gcc with Atmel devices, you can force the library to use the built-in `_delay_ms()` function
|
||||
by setting the compiler symbols:
|
||||
|
||||
GLCD_USE_AVR_DELAY
|
||||
__DELAY_BACKWARD_COMPATIBLE__
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
Refer to Doxygen generated pages for detailed documentation. You'll can generate the documentation yourself,
|
||||
simply install Doxygen and load the doxygen file in the root directory of the library and generate the documents
|
||||
in a file format of your choice (HTML, PDF, TEX etc).
|
||||
|
||||
There is also a online version (link at top of this document)
|
||||
@@ -0,0 +1,133 @@
|
||||
/**
|
||||
\file NT75451.c
|
||||
\author Andy Gock
|
||||
\brief Function specific to NT75451 controller.
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(GLCD_CONTROLLER_NT75451)
|
||||
|
||||
#include "../glcd.h"
|
||||
|
||||
void glcd_command(uint8_t c)
|
||||
{
|
||||
GLCD_RS_LOW();
|
||||
glcd_parallel_write(c);
|
||||
GLCD_RS_HIGH();
|
||||
}
|
||||
|
||||
void glcd_data(uint8_t c)
|
||||
{
|
||||
GLCD_RS_HIGH();
|
||||
glcd_parallel_write(c);
|
||||
GLCD_RS_LOW();
|
||||
}
|
||||
|
||||
void glcd_set_contrast(uint8_t val) {
|
||||
}
|
||||
|
||||
void glcd_power_down(void)
|
||||
{
|
||||
}
|
||||
|
||||
void glcd_power_up(void)
|
||||
{
|
||||
}
|
||||
|
||||
void glcd_set_y_address(uint8_t y)
|
||||
{
|
||||
/** Code by NGX Technologies */
|
||||
glcd_command(0xB0 | (y > GLCD_NUMBER_OF_BANKS ? GLCD_NUMBER_OF_BANKS : y));
|
||||
}
|
||||
|
||||
void glcd_set_x_address(uint8_t x)
|
||||
{
|
||||
/** Code by NGX Technologies */
|
||||
uint8_t lsb, msb;
|
||||
|
||||
msb = (((x & 0xF0) >> 4)| 0x10);
|
||||
lsb = (x & 0x0F);
|
||||
|
||||
glcd_command(lsb);
|
||||
glcd_command(msb);
|
||||
}
|
||||
|
||||
/* Write screen buffer to display, within bounding box only */
|
||||
void glcd_write()
|
||||
{
|
||||
uint8_t bank;
|
||||
|
||||
for (bank = 0; bank < GLCD_NUMBER_OF_BANKS; bank++) {
|
||||
/* Each bank is a single row 8 bits tall */
|
||||
uint8_t column;
|
||||
|
||||
if (glcd_bbox_selected->y_min >= (bank+1)*8) {
|
||||
continue; /* Skip the entire bank */
|
||||
}
|
||||
|
||||
if (glcd_bbox_selected->y_max < bank*8) {
|
||||
break; /* No more banks need updating */
|
||||
}
|
||||
|
||||
glcd_set_y_address(bank);
|
||||
glcd_set_x_address(glcd_bbox_selected->x_min);
|
||||
|
||||
for (column = glcd_bbox_selected->x_min; column <= glcd_bbox_selected->x_max; column++)
|
||||
{
|
||||
glcd_data( glcd_buffer_selected[GLCD_NUMBER_OF_COLS * bank + column] );
|
||||
}
|
||||
}
|
||||
|
||||
/* Display updated, we can reset the bounding box */
|
||||
glcd_reset_bbox();
|
||||
|
||||
}
|
||||
|
||||
void glcd_NT75451_init(void) {
|
||||
/* Initialise sequence - code by NGX Technologies */
|
||||
glcd_command(0xE2); /* S/W RESWT */
|
||||
glcd_command(0xA0); /* ADC select */
|
||||
glcd_command(0xC8); /* SHL Normal */
|
||||
glcd_command(0xA3); /* LCD bias */
|
||||
glcd_command(0x2F); /* Power control */
|
||||
glcd_command(0x22); /* reg resistor select */
|
||||
glcd_command(0x40); /* Initial display line 40 */
|
||||
glcd_command(0xA4); /* Normal display */
|
||||
glcd_command(0xA6); /* Reverce display a7 */
|
||||
glcd_command(0x81); /* Ref vg select mode */
|
||||
glcd_command(0x3f); /* Ref vg reg select */
|
||||
glcd_command(0xB0); /* Set page address */
|
||||
glcd_command(0x10); /* Set coloumn addr MSB */
|
||||
glcd_command(0x00); /* Set coloumn addr LSB */
|
||||
glcd_command(0xAF); /* Display ON */
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
\file NT75451.h
|
||||
\author Andy Gock
|
||||
\brief Constants and definitions for NT75451 controller
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(GLCD_CONTROLLER_NT75451)
|
||||
|
||||
#include "../glcd.h"
|
||||
|
||||
/** Parallel write to NT75451 */
|
||||
void glcd_parallel_write(uint8_t c);
|
||||
|
||||
/** Initialise NT75451 based display */
|
||||
void glcd_NT75451_init(void);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,132 @@
|
||||
/**
|
||||
* \file PCD8544.c
|
||||
* \brief Functions relating to PCD8544 LCD Controller (Nokia 5110 LCD).
|
||||
* \author Andy Gock
|
||||
* \see glcd.h
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(GLCD_CONTROLLER_PCD8544)
|
||||
|
||||
#include "../glcd.h"
|
||||
|
||||
void glcd_command(uint8_t c)
|
||||
{
|
||||
GLCD_DC_LOW();
|
||||
glcd_spi_write(c);
|
||||
}
|
||||
|
||||
void glcd_data(uint8_t c)
|
||||
{
|
||||
GLCD_DC_HIGH();
|
||||
glcd_spi_write(c);
|
||||
}
|
||||
|
||||
void glcd_set_contrast(uint8_t val) {
|
||||
glcd_command(PCD8544_FUNCTION_SET | PCD8544_EXTENDED_INSTRUCTION);
|
||||
glcd_command(PCD8544_SET_VOP | (val&0x7f));
|
||||
glcd_command(PCD8544_FUNCTION_SET);
|
||||
glcd_command(PCD8544_DISPLAY_CONTROL | PCD8544_DISPLAY_NORMAL);
|
||||
}
|
||||
|
||||
void glcd_power_down(void)
|
||||
{
|
||||
/* First, fill RAM with zeroes to ensure minimum specified current consumption */
|
||||
glcd_clear();
|
||||
|
||||
/* Power down */
|
||||
glcd_command(PCD8544_FUNCTION_SET|PCD8544_POWER_DOWN);
|
||||
}
|
||||
|
||||
void glcd_power_up(void)
|
||||
{
|
||||
glcd_command(PCD8544_FUNCTION_SET);
|
||||
}
|
||||
|
||||
void glcd_set_y_address(uint8_t y)
|
||||
{
|
||||
glcd_command(PCD8544_SET_Y_ADDRESS|(y > 5 ? 5 : y));
|
||||
}
|
||||
|
||||
void glcd_set_x_address(uint8_t x)
|
||||
{
|
||||
glcd_command(PCD8544_SET_X_ADDRESS|(x & 0x7f));
|
||||
}
|
||||
|
||||
void glcd_write()
|
||||
{
|
||||
uint8_t bank;
|
||||
|
||||
for (bank = 0; bank < PCD8544_MAX_BANKS; bank++) {
|
||||
/* Each bank is a single row 8 bits tall */
|
||||
uint8_t column;
|
||||
|
||||
if (glcd_bbox_selected->y_min >= (bank+1)*8) {
|
||||
continue; /* Skip the entire bank */
|
||||
}
|
||||
|
||||
if (glcd_bbox_selected->y_max < bank*8) {
|
||||
break; /* No more banks need updating */
|
||||
}
|
||||
|
||||
glcd_command(PCD8544_SET_Y_ADDRESS | bank);
|
||||
glcd_command(PCD8544_SET_X_ADDRESS | glcd_bbox_selected->x_min);
|
||||
|
||||
for (column = glcd_bbox_selected->x_min; column <= glcd_bbox_selected->x_max; column++)
|
||||
{
|
||||
glcd_data( glcd_buffer_selected[PCD8544_MAX_COLS * bank + column] );
|
||||
}
|
||||
}
|
||||
|
||||
glcd_reset_bbox();
|
||||
|
||||
}
|
||||
|
||||
void glcd_PCD8544_init(void) {
|
||||
|
||||
glcd_reset();
|
||||
|
||||
/* Get into the EXTENDED mode! */
|
||||
glcd_command(PCD8544_FUNCTION_SET | PCD8544_EXTENDED_INSTRUCTION);
|
||||
|
||||
/* LCD bias select (4 is optimal?) */
|
||||
glcd_command(PCD8544_SET_BIAS | 0x2);
|
||||
|
||||
/* Set VOP (affects contrast) */
|
||||
glcd_command(PCD8544_SET_VOP | 80); /* Experimentally determined, play with this figure until contrast looks nice */
|
||||
|
||||
/* Back to standard instructions */
|
||||
glcd_command(PCD8544_FUNCTION_SET);
|
||||
|
||||
/* Normal mode */
|
||||
glcd_command(PCD8544_DISPLAY_CONTROL | PCD8544_DISPLAY_NORMAL);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* \file PCD8544.h
|
||||
* \brief Constants relating to PCD8544 LCD Controller (Nokia 5110 LCD).
|
||||
* \author Andy Gock
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef PCD8544_H_
|
||||
#define PCD8544_H_
|
||||
|
||||
/**
|
||||
* \name Function set commands
|
||||
* @{
|
||||
*/
|
||||
#define PCD8544_NOP 0
|
||||
#define PCD8544_FUNCTION_SET (1<<5)
|
||||
#define PCD8544_POWER_DOWN (1<<2)
|
||||
#define PCD8544_HORIZONTAL_ADDRESSING 0
|
||||
#define PCD8544_VERTICAL_ADDRESSING (1<<1)
|
||||
#define PCD8544_EXTENDED_INSTRUCTION (1<<0)
|
||||
/**@}*/
|
||||
|
||||
/**
|
||||
* \name Basic instruction set (H=0)
|
||||
* @{
|
||||
*/
|
||||
#define PCD8544_DISPLAY_CONTROL (1<<3)
|
||||
#define PCD8544_DISPLAY_BLANK 0x0
|
||||
#define PCD8544_DISPLAY_NORMAL (1<<2)
|
||||
#define PCD8544_DISPLAY_ALL_ON (1<<0)
|
||||
#define PCD8544_DISPLAY_INVERTED (1<<2|1<<0)
|
||||
#define PCD8544_SET_Y_ADDRESS 0x40
|
||||
#define PCD8544_SET_X_ADDRESS 0x80
|
||||
/**@}*/
|
||||
|
||||
/**
|
||||
* \name Extended instruction set (H=1)
|
||||
* @{
|
||||
*/
|
||||
#define PCD8544_SET_TEMP (1<<2)
|
||||
#define PCD8544_TEMPCO_0 0b00
|
||||
#define PCD8544_TEMPCO_1 0b01
|
||||
#define PCD8544_TEMPCO_2 0b10
|
||||
#define PCD8544_TEMPCO_3 0b11
|
||||
|
||||
/** \todo Check if these instructions are from this group */
|
||||
#define PCD8544_SET_BIAS (1<<4)
|
||||
#define PCD8544_SET_VOP (1<<7)
|
||||
/**@}*/
|
||||
|
||||
#define PCD8544_MAX_BANKS 6
|
||||
#define PCD8544_MAX_COLS 84
|
||||
|
||||
/** Init PCD8544 controller / display */
|
||||
void glcd_PCD8544_init(void);
|
||||
|
||||
#endif /* PCD8544_H_ */
|
||||
@@ -0,0 +1,209 @@
|
||||
/**
|
||||
* \file ST7565R.c
|
||||
* \brief Functions relating to ST7565R.
|
||||
* \author Andy Gock
|
||||
* \see glcd.h
|
||||
*/
|
||||
#if defined(GLCD_CONTROLLER_ST7565R)
|
||||
|
||||
#include "../glcd.h"
|
||||
|
||||
void glcd_command(uint8_t c)
|
||||
{
|
||||
GLCD_A0_LOW();
|
||||
glcd_spi_write(c);
|
||||
}
|
||||
|
||||
void glcd_data(uint8_t c)
|
||||
{
|
||||
GLCD_A0_HIGH();
|
||||
glcd_spi_write(c);
|
||||
}
|
||||
|
||||
void glcd_set_contrast(uint8_t val) {
|
||||
/* Can set a 6-bit value (0 to 63) */
|
||||
|
||||
/* Must send this command byte before setting the contrast */
|
||||
glcd_command(0x81);
|
||||
|
||||
/* Set the contrat value ("electronic volumne register") */
|
||||
if (val > 63) {
|
||||
glcd_command(63);
|
||||
} else {
|
||||
glcd_command(val);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void glcd_power_down(void)
|
||||
{
|
||||
/* Not applicable */
|
||||
return;
|
||||
//asm("break");
|
||||
}
|
||||
|
||||
void glcd_power_up(void)
|
||||
{
|
||||
/* Not applicable */
|
||||
return;
|
||||
//asm("break");
|
||||
}
|
||||
|
||||
void glcd_set_y_address(uint8_t y)
|
||||
{
|
||||
glcd_command(ST7565R_PAGE_ADDRESS_SET | (0b00001111 & y));
|
||||
}
|
||||
|
||||
void glcd_set_x_address(uint8_t x)
|
||||
{
|
||||
glcd_set_column_upper(x);
|
||||
glcd_set_column_lower(x);
|
||||
}
|
||||
|
||||
void glcd_all_on(void)
|
||||
{
|
||||
glcd_command(ST7565R_DISPLAY_ALL_ON);
|
||||
}
|
||||
|
||||
void glcd_normal(void)
|
||||
{
|
||||
glcd_command(ST7565R_DISPLAY_NORMAL);
|
||||
}
|
||||
|
||||
void glcd_set_column_upper(uint8_t addr)
|
||||
{
|
||||
glcd_command(ST7565R_COLUMN_ADDRESS_SET_UPPER | (addr >> 4));
|
||||
}
|
||||
|
||||
void glcd_set_column_lower(uint8_t addr)
|
||||
{
|
||||
glcd_command(ST7565R_COLUMN_ADDRESS_SET_LOWER | (0x0f & addr));
|
||||
}
|
||||
|
||||
void glcd_set_start_line(uint8_t addr)
|
||||
{
|
||||
glcd_command( ST7565R_SET_START_LINE | (0b00111111 & addr));
|
||||
}
|
||||
|
||||
/** Clear the display immediately, does not buffer */
|
||||
void glcd_clear_now(void)
|
||||
{
|
||||
uint8_t page;
|
||||
for (page = 0; page < GLCD_NUMBER_OF_BANKS; page++) {
|
||||
glcd_set_y_address(page);
|
||||
glcd_set_x_address(0);
|
||||
uint8_t col;
|
||||
for (col = 0; col < GLCD_NUMBER_OF_COLS; col++) {
|
||||
glcd_data(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void glcd_pattern(void)
|
||||
{
|
||||
uint8_t page;
|
||||
for (page = 0; page < GLCD_NUMBER_OF_BANKS; page++) {
|
||||
glcd_set_y_address(page);
|
||||
glcd_set_x_address(0);
|
||||
uint8_t col;
|
||||
for (col = 0; col < GLCD_NUMBER_OF_COLS; col++) {
|
||||
glcd_data( (col / 8 + 2) % 2 == 1 ? 0xff : 0x00 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void glcd_write()
|
||||
{
|
||||
|
||||
uint8_t bank;
|
||||
|
||||
for (bank = 0; bank < GLCD_NUMBER_OF_BANKS; bank++) {
|
||||
/* Each bank is a single row 8 bits tall */
|
||||
uint8_t column;
|
||||
|
||||
if (glcd_bbox_selected->y_min >= (bank+1)*8) {
|
||||
continue; /* Skip the entire bank */
|
||||
}
|
||||
|
||||
if (glcd_bbox_selected->y_max < bank*8) {
|
||||
break; /* No more banks need updating */
|
||||
}
|
||||
|
||||
glcd_set_y_address(bank);
|
||||
glcd_set_x_address(glcd_bbox_selected->x_min);
|
||||
|
||||
for (column = glcd_bbox_selected->x_min; column <= glcd_bbox_selected->x_max; column++)
|
||||
{
|
||||
glcd_data( glcd_buffer_selected[GLCD_NUMBER_OF_COLS * bank + column] );
|
||||
}
|
||||
}
|
||||
|
||||
glcd_reset_bbox();
|
||||
|
||||
}
|
||||
|
||||
void glcd_ST7565R_init(void) {
|
||||
|
||||
#if defined(GLCD_INIT_NHD_C12832A1Z_FSW_FBW_3V3)
|
||||
|
||||
/* Init sequence based on datasheet example code for NHD-C12832A1Z-FSW-FBW-3V3 */
|
||||
/* Datasheet says max SCK frequency 20MHz for this LCD */
|
||||
/* We use "reverse direction" for common output mode, as opposed to datasheet specifying "normal direction" */
|
||||
|
||||
glcd_command(0xa0); /* ADC select in normal mode */
|
||||
glcd_command(0xae); /* Display OFF */
|
||||
glcd_command(0xc8); /* Common output mode select: reverse direction (last 3 bits are ignored) */
|
||||
glcd_command(0xa2); /* LCD bias set at 1/9 */
|
||||
glcd_command(0x2f); /* Power control set to operating mode: 7 */
|
||||
glcd_command(0x21); /* Internal resistor ratio, set to: 1 */
|
||||
glcd_set_contrast(40); /* Set contrast, value experimentally determined, can set to 6-bit value, 0 to 63 */
|
||||
glcd_command(0xaf); /* Display on */
|
||||
|
||||
#elif defined(GLCD_INIT_NHD_C12864A1Z_FSW_FBW_HTT)
|
||||
|
||||
/* Init sequence based on datasheet example code for NHD-C12864A1Z-FSW-FBW-HTT */
|
||||
/* Datasheet says max SCK frequency 2.5MHz for this LCD */
|
||||
/* We use "reverse direction" for common output mode, as opposed to datasheet specifying "normal direction" */
|
||||
|
||||
glcd_command(0xa0); /* ADC select in normal mode */
|
||||
glcd_command(0xae); /* Display OFF */
|
||||
glcd_command(0xc8); /* Common output mode select: reverse direction (last 3 bits are ignored) */
|
||||
glcd_command(0xa2); /* LCD bias set at 1/9 */
|
||||
glcd_command(0x2f); /* Power control set to operating mode: 7 */
|
||||
glcd_command(0x26); /* Internal resistor ratio, set to: 6 */
|
||||
glcd_set_contrast(20); /* Set contrast, value experimentally determined */
|
||||
glcd_command(0xaf); /* Display on */
|
||||
|
||||
#elif defined(GLCD_INIT_NHD_C12864WC_FSW_FBW_3V3_M)
|
||||
|
||||
/* Init sequence for NHD-C12864WC-FSW-FBW-3V3-M */
|
||||
|
||||
glcd_command(ST7565R_RESET); /* Internal reset */
|
||||
glcd_command(0xa2); /* 1/9 bias */
|
||||
glcd_command(0xa0); /* ADC select, normal */
|
||||
glcd_command(0xc8); /* Com output reverse */
|
||||
glcd_command(0xa4); /* Display all points normal */
|
||||
glcd_command(0x40); /* Display start line set */
|
||||
glcd_command(0x25); /* Internal resistor ratio */
|
||||
glcd_set_contrast(45); /* Set contrast value, experimentally determined, value 0 to 63 */
|
||||
glcd_command(0x2f); /* Power controller set */
|
||||
glcd_command(0xaf); /* Display on */
|
||||
|
||||
#else
|
||||
|
||||
/* Default init sequence */
|
||||
/* Currently just set the same as GLCD_INIT_NHD_C12864A1Z_FSW_FBW_HTT */
|
||||
|
||||
glcd_command(0xa0); /* ADC select in normal mode */
|
||||
glcd_command(0xae); /* Display OFF */
|
||||
glcd_command(0xc8); /* Common output mode select: reverse direction (last 3 bits are ignored) */
|
||||
glcd_command(0xa2); /* LCD bias set at 1/9 */
|
||||
glcd_command(0x2f); /* Power control set to operating mode: 7 */
|
||||
glcd_command(0x26); /* Internal resistor ratio, set to: 6 */
|
||||
glcd_set_contrast(20); /* Set contrast, value experimentally determined, value 0 to 63 */
|
||||
glcd_command(0xaf); /* Display on */
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,81 @@
|
||||
/**
|
||||
* \file ST7565R.h
|
||||
* \brief Constants relating to ST7565R LCD controller.
|
||||
* \author Andy Gock
|
||||
*
|
||||
* Constants and functions specific to ST7565R.
|
||||
* Tested with Newhaven Display model NHD-C12864WC-FSW-FBW-3V3-M
|
||||
*
|
||||
* \todo Need to move functions to be controller independent
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef ST7565R_H_
|
||||
#define ST7565R_H_
|
||||
|
||||
/* Commands */
|
||||
#define ST7565R_DISPLAY_ON 0b10101111
|
||||
#define ST7565R_DISPLAY_OFF 0b10101110
|
||||
#define ST7565R_PAGE_ADDRESS_SET 0b10110000
|
||||
#define ST7565R_COLUMN_ADDRESS_SET_LOWER 0x00
|
||||
#define ST7565R_COLUMN_ADDRESS_SET_UPPER 0x10
|
||||
#define ST7565R_DISPLAY_NORMAL 0b10100100
|
||||
#define ST7565R_DISPLAY_ALL_ON 0b10100101
|
||||
#define ST7565R_NORMAL 0b10100000
|
||||
#define ST7565R_REVERSE 0b10100001
|
||||
#define ST7565R_RESET 0b11100010
|
||||
#define ST7565R_SET_START_LINE (1<<6)
|
||||
|
||||
/* These functions only available on ST7565 implementation (for now) */
|
||||
|
||||
/* Private functions */
|
||||
void glcd_set_column_upper(uint8_t addr);
|
||||
void glcd_set_column_lower(uint8_t addr);
|
||||
|
||||
/** All display points on (native) */
|
||||
void glcd_all_on(void);
|
||||
|
||||
/** Set to normal mode */
|
||||
void glcd_normal(void);
|
||||
|
||||
/** Set start line/page */
|
||||
void glcd_set_start_line(uint8_t addr);
|
||||
|
||||
/** Clear the display immediately, does not buffer */
|
||||
void glcd_clear_now(void);
|
||||
|
||||
/** Show a black and white line pattern on the display */
|
||||
void glcd_pattern(void);
|
||||
|
||||
/** Init ST7565R controller / display */
|
||||
void glcd_ST7565R_init(void);
|
||||
|
||||
#endif /* ST7565R_H_ */
|
||||
167
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/devices/AVR8.c
Normal file
167
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/devices/AVR8.c
Normal file
@@ -0,0 +1,167 @@
|
||||
/**
|
||||
\file AVR8.c
|
||||
\brief Functions relating to Atmel AVR 8-bit AVRs.
|
||||
For use with GNU toolchain
|
||||
\author Andy Gock
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "../glcd.h"
|
||||
|
||||
#if defined(GLCD_DEVICE_AVR8)
|
||||
|
||||
void glcd_init(void)
|
||||
{
|
||||
|
||||
#if defined(GLCD_CONTROLLER_PCD8544)
|
||||
|
||||
/* Set pin directions */
|
||||
|
||||
/*
|
||||
* Set up SPI for AVR8
|
||||
* Note: AVR's SS pin must be set to output, regardless of whether we
|
||||
* actually use it. This is a requirement of SPI mster mode.
|
||||
*/
|
||||
sbi(DDR(AVR_SS_PORT),AVR_SS_PIN);
|
||||
|
||||
/*
|
||||
* Set MOSI, Master SS, SCK to output (otherwise SPI won't work)
|
||||
* Must be done even if native SS pin not used
|
||||
*/
|
||||
sbi(DDR(CONTROLLER_MOSI_PORT),CONTROLLER_MOSI_PIN);
|
||||
sbi(DDR(CONTROLLER_SS_PORT),CONTROLLER_SS_PIN);
|
||||
sbi(DDR(CONTROLLER_SCK_PORT),CONTROLLER_SCK_PIN);
|
||||
|
||||
/* Set SS, DC and RST pins to output */
|
||||
sbi( DDR(CONTROLLER_SS_PORT), CONTROLLER_SS_PIN );
|
||||
sbi( DDR(CONTROLLER_DC_PORT), CONTROLLER_DC_PIN );
|
||||
sbi( DDR(CONTROLLER_RST_PORT), CONTROLLER_RST_PIN );
|
||||
|
||||
/* Deselect LCD */
|
||||
GLCD_DESELECT();
|
||||
|
||||
/*
|
||||
* Max allowed SPI clock is 4 MHz from datasheet.
|
||||
* Enable SPI, set master mode and clock rate to /4 (4MHz with F_CPU=8MHz)
|
||||
*/
|
||||
SPCR = (1<<SPE)|(1<<MSTR);
|
||||
SPSR = 0;
|
||||
|
||||
glcd_PCD8544_init();
|
||||
|
||||
/* Select screen buffer */
|
||||
glcd_select_screen(glcd_buffer,&glcd_bbox);
|
||||
|
||||
/* Clear screen, we are now ready to go */
|
||||
glcd_clear();
|
||||
|
||||
#elif defined(GLCD_CONTROLLER_ST7565R)
|
||||
|
||||
/* Set up GPIO directions */
|
||||
|
||||
/*
|
||||
* Set up SPI for AVR8
|
||||
* Note: AVR's SS pin must be set to output, regardless of whether we
|
||||
* actually use it. This is a requirement of SPI mster mode.
|
||||
*/
|
||||
sbi(DDR(AVR_SS_PORT),AVR_SS_PIN);
|
||||
|
||||
/* Set SCK and MOSI as output */
|
||||
sbi(DDR(CONTROLLER_SCK_PORT),CONTROLLER_SCK_PIN);
|
||||
sbi(DDR(CONTROLLER_MOSI_PORT),CONTROLLER_MOSI_PIN);
|
||||
|
||||
/*
|
||||
* Set MISO as input with pullup. This needs to be set for
|
||||
* SPI to work, even though we never use or read it.
|
||||
*/
|
||||
cbi(DDR(CONTROLLER_MISO_PORT),CONTROLLER_MISO_PIN); // B3 MISO as input
|
||||
sbi(CONTROLLER_MISO_PORT,CONTROLLER_MISO_PIN);
|
||||
|
||||
/* Set pin to controller SS as output */
|
||||
sbi(DDR(CONTROLLER_SS_PORT),CONTROLLER_SS_PIN); // A5
|
||||
|
||||
/* Set LCD A0 pin as output */
|
||||
sbi(DDR(CONTROLLER_A0_PORT),CONTROLLER_A0_PIN); // A6
|
||||
|
||||
/* Init SS pin high (i.e LCD deselected) */
|
||||
sbi(CONTROLLER_SS_PORT,CONTROLLER_SS_PIN);
|
||||
|
||||
/* Deselect LCD */
|
||||
GLCD_DESELECT();
|
||||
|
||||
/* MSB first, double speed, SPI mode 0 */
|
||||
SPCR = (1<<SPE) | (1<<MSTR) | (0<<CPOL) | (0<<CPHA);
|
||||
sbi(SPSR,SPI2X);
|
||||
|
||||
/* Enable interrupts */
|
||||
sei();
|
||||
|
||||
delay_ms(30); /* Example in datasheet does this (20ms) */
|
||||
|
||||
glcd_ST7565R_init();
|
||||
|
||||
glcd_all_on();
|
||||
|
||||
delay_ms(500);
|
||||
glcd_normal();
|
||||
|
||||
glcd_set_start_line(0);
|
||||
glcd_clear_now();
|
||||
|
||||
glcd_select_screen(glcd_buffer,&glcd_bbox);
|
||||
|
||||
glcd_clear();
|
||||
|
||||
#else
|
||||
#error "Controller not supported"
|
||||
#endif /* GLCD_CONTROLLER_* */
|
||||
|
||||
}
|
||||
|
||||
void glcd_spi_write(uint8_t c)
|
||||
{
|
||||
GLCD_SELECT();
|
||||
SPDR = c;
|
||||
while(!(SPSR & (1<<SPIF))); /* wait until transmission is complete */
|
||||
GLCD_DESELECT();
|
||||
}
|
||||
|
||||
void glcd_reset(void)
|
||||
{
|
||||
/* Toggle RST low to reset. Minimum pulse 100ns on datasheet. */
|
||||
GLCD_SELECT();
|
||||
GLCD_RESET_LOW();
|
||||
delay_ms(GLCD_RESET_TIME);
|
||||
GLCD_RESET_HIGH();
|
||||
GLCD_DESELECT();
|
||||
}
|
||||
|
||||
#endif /* defined(GLCD_DEVICE_AVR8) */
|
||||
129
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/devices/AVR8.h
Normal file
129
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/devices/AVR8.h
Normal file
@@ -0,0 +1,129 @@
|
||||
/**
|
||||
* \file AVR8.h
|
||||
* \brief Pinouts to Atmel AVR 8-bit AVRs.
|
||||
* \author Andy Gock
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef GLCD_PINOUTS_AVR8_H_
|
||||
#define GLCD_PINOUTS_AVR8_H_
|
||||
|
||||
#if defined(GLCD_DEVICE_AVR8)
|
||||
|
||||
#include <avr/io.h>
|
||||
#include <avr/pgmspace.h>
|
||||
|
||||
#ifndef _BITHELPERS_
|
||||
#define _BITHELPERS_
|
||||
#define sbi(var, mask) ((var) |= _BV(mask))
|
||||
#define cbi(var, mask) ((var) &= ~(_BV(mask)))
|
||||
#define DDR(x) (*(&x - 1))
|
||||
#define PIN(x) (*(&x - 2))
|
||||
#endif
|
||||
|
||||
#define swap(a, b) { uint8_t t = a; a = b; b = t; }
|
||||
|
||||
#if defined(GLCD_CONTROLLER_PCD8544)
|
||||
|
||||
/**
|
||||
* \name SPI port and pins
|
||||
* @{
|
||||
*/
|
||||
#define AVR_SS_PORT PORTB
|
||||
#define AVR_SS_PIN 0
|
||||
#define CONTROLLER_MOSI_PORT PORTB
|
||||
#define CONTROLLER_MOSI_PIN 2
|
||||
#define CONTROLLER_MISO_PORT PORTB
|
||||
#define CONTROLLER_MISO_PIN 3
|
||||
#define CONTROLLER_SCK_PORT PORTB
|
||||
#define CONTROLLER_SCK_PIN 1
|
||||
/**@}*/
|
||||
|
||||
/**
|
||||
* \name Other pins needed for serial LCD controller
|
||||
* @{
|
||||
*/
|
||||
#define CONTROLLER_SS_PORT PORTA
|
||||
#define CONTROLLER_SS_PIN 5
|
||||
#define CONTROLLER_DC_PORT PORTB
|
||||
#define CONTROLLER_DC_PIN 5
|
||||
#define CONTROLLER_RST_PORT PORTB
|
||||
#define CONTROLLER_RST_PIN 4
|
||||
/**@}*/
|
||||
|
||||
#elif defined (GLCD_CONTROLLER_ST7565R)
|
||||
/**
|
||||
* \name SPI port and pins
|
||||
* @{
|
||||
*/
|
||||
#define AVR_SS_PORT PORTB
|
||||
#define AVR_SS_PIN 0
|
||||
#define CONTROLLER_MOSI_PORT PORTB
|
||||
#define CONTROLLER_MOSI_PIN 2
|
||||
#define CONTROLLER_MISO_PORT PORTB
|
||||
#define CONTROLLER_MISO_PIN 3
|
||||
#define CONTROLLER_SCK_PORT PORTB
|
||||
#define CONTROLLER_SCK_PIN 1
|
||||
/**@}*/
|
||||
|
||||
/**
|
||||
* \name Other pins needed for serial LCD controller
|
||||
* @{
|
||||
*/
|
||||
#define CONTROLLER_A0_PORT PORTC /**< Output port to GLCD A0 pin. */
|
||||
#define CONTROLLER_A0_PIN 0 /**< Output pin number to GLCD A0 pin. */
|
||||
#define CONTROLLER_SS_PORT PORTG
|
||||
#define CONTROLLER_SS_PIN 0
|
||||
#define CONTROLLER_RST_PORT PORTG
|
||||
#define CONTROLLER_RST_PIN 1
|
||||
/**@}*/
|
||||
#else
|
||||
#error "Controller not supported by AVR8"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \name Macros for control lines
|
||||
* @{
|
||||
*/
|
||||
#define GLCD_SELECT() cbi(CONTROLLER_SS_PORT,CONTROLLER_SS_PIN)
|
||||
#define GLCD_DESELECT() sbi(CONTROLLER_SS_PORT,CONTROLLER_SS_PIN)
|
||||
#define GLCD_DC_LOW() cbi(CONTROLLER_DC_PORT,CONTROLLER_DC_PIN)
|
||||
#define GLCD_DC_HIGH() sbi(CONTROLLER_DC_PORT,CONTROLLER_DC_PIN)
|
||||
#define GLCD_RESET_LOW() cbi(CONTROLLER_RST_PORT,CONTROLLER_RST_PIN)
|
||||
#define GLCD_RESET_HIGH() sbi(CONTROLLER_RST_PORT,CONTROLLER_RST_PIN)
|
||||
|
||||
#define GLCD_A0_LOW() cbi(CONTROLLER_A0_PORT,CONTROLLER_A0_PIN)
|
||||
#define GLCD_A0_HIGH() sbi(CONTROLLER_A0_PORT,CONTROLLER_A0_PIN)
|
||||
|
||||
/**@}*/
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* GLCD_PINOUTS_AVR8_H_ */
|
||||
@@ -0,0 +1,94 @@
|
||||
/**
|
||||
* \file LPC111x.c
|
||||
* \brief Initialisation and driver confiuration for NXP LPC111x ARM Cortex-M0 MCUs.
|
||||
* \author Andy Gock
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "../glcd.h"
|
||||
#include "LPC111x.h"
|
||||
|
||||
#if defined(GLCD_DEVICE_LPC111X)
|
||||
|
||||
void glcd_init(void)
|
||||
{
|
||||
|
||||
#if defined(GLCD_CONTROLLER_PCD8544)
|
||||
/*
|
||||
* Set up SPI (SSP)
|
||||
* Note: Max allowed SPI clock is 4 MHz from datasheet.
|
||||
*/
|
||||
|
||||
/* Select SSP/SPI port */
|
||||
SSP_IOConfig( CONTROLLER_SPI_PORT_NUMBER );
|
||||
|
||||
/* Initialise SSP/SPI port */
|
||||
SSP_Init( CONTROLLER_SPI_PORT_NUMBER );
|
||||
|
||||
/* Above functions take care of SPI pins */
|
||||
|
||||
/* Set SS, DC and RST pins to output */
|
||||
CONTROLLER_SS_PORT->DIR |= (1 << CONTROLLER_SS_PIN);
|
||||
CONTROLLER_DC_PORT->DIR |= (1 << CONTROLLER_DC_PIN);
|
||||
CONTROLLER_RST_PORT->DIR |= (1 << CONTROLLER_RST_PIN);
|
||||
|
||||
/* Reset the display */
|
||||
glcd_reset();
|
||||
|
||||
glcd_PCD8544_init();
|
||||
|
||||
glcd_select_screen(glcd_buffer,&glcd_bbox);
|
||||
|
||||
glcd_clear();
|
||||
|
||||
#else /* GLCD_CONTROLLER_PCD8544 */
|
||||
#error "Controller not supported by LPC111x"
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void glcd_spi_write(uint8_t c)
|
||||
{
|
||||
GLCD_SELECT();
|
||||
SSP_Send(CONTROLLER_SPI_PORT_NUMBER,&c,1);
|
||||
GLCD_DESELECT();
|
||||
}
|
||||
|
||||
void glcd_reset(void)
|
||||
{
|
||||
/* Toggle RST low to reset. Minimum pulse 100ns on datasheet. */
|
||||
GLCD_SELECT();
|
||||
GLCD_RESET_LOW();
|
||||
delay_ms(GLCD_RESET_TIME);
|
||||
GLCD_RESET_HIGH();
|
||||
GLCD_DESELECT();
|
||||
}
|
||||
|
||||
#endif /* GLCD_DEVICE_LPC111x */
|
||||
@@ -0,0 +1,71 @@
|
||||
/**
|
||||
* \file LPC111x.h
|
||||
* \brief Pinouts and driver config for NXP LPC111x ARM Cortex-M0 MCUs.
|
||||
* \author Andy Gock
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2012 Andy Gock
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef LPC111X_H_
|
||||
#define LPC111X_H_
|
||||
|
||||
#if defined(GLCD_DEVICE_LPC111X)
|
||||
|
||||
/*
|
||||
* Set up SSP and GPIO drivers (GPIO drivers required for SSP)
|
||||
* Change these paths if the files are located elsewhere
|
||||
*/
|
||||
#include "../../drivers/ssp.h"
|
||||
#include "../../drivers/gpio.h"
|
||||
|
||||
#define swap(a, b) { uint8_t t = a; a = b; b = t; }
|
||||
|
||||
/* Define port and pins used to connecto LCD */
|
||||
#define CONTROLLER_SPI_PORT_NUMBER 1
|
||||
#define CONTROLLER_MOSI_PORT LPC_GPIO2
|
||||
#define CONTROLLER_MOSI_PIN 3
|
||||
#define CONTROLLER_MISO_PORT LPC_GPIO2
|
||||
#define CONTROLLER_MISO_PIN 2
|
||||
#define CONTROLLER_SCK_PORT LPC_GPIO2
|
||||
#define CONTROLLER_SCK_PIN 1
|
||||
#define CONTROLLER_SS_PORT LPC_GPIO2
|
||||
#define CONTROLLER_SS_PIN 0
|
||||
#define CONTROLLER_DC_PORT LPC_GPIO2
|
||||
#define CONTROLLER_DC_PIN 4
|
||||
#define CONTROLLER_RST_PORT LPC_GPIO2
|
||||
#define CONTROLLER_RST_PIN 5
|
||||
|
||||
/* Preprocessor macros */
|
||||
#define GLCD_SELECT() CONTROLLER_SS_PORT->DATA &= ~(1 << CONTROLLER_SS_PIN)
|
||||
#define GLCD_DESELECT() CONTROLLER_SS_PORT->DATA |= (1 << CONTROLLER_SS_PIN)
|
||||
#define GLCD_DC_LOW() CONTROLLER_DC_PORT->DATA &= ~(1 << CONTROLLER_DC_PIN)
|
||||
#define GLCD_DC_HIGH() CONTROLLER_DC_PORT->DATA |= (1 << CONTROLLER_DC_PIN)
|
||||
#define GLCD_RESET_LOW() CONTROLLER_RST_PORT->DATA &= ~(1 << CONTROLLER_RST_PIN)
|
||||
#define GLCD_RESET_HIGH() CONTROLLER_RST_PORT->DATA |= (1 << CONTROLLER_RST_PIN)
|
||||
|
||||
#endif /* GLCD_DEVICE_LPC111X */
|
||||
|
||||
#endif /* LPC111X_H_ */
|
||||
@@ -0,0 +1,179 @@
|
||||
/**
|
||||
\file LPC11Uxx.c
|
||||
\author Andy Gock
|
||||
\brief Functions specific to LPC11Uxx devices.
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "../glcd.h"
|
||||
#include "LPC11Uxx.h"
|
||||
|
||||
#if defined(GLCD_DEVICE_LPC11UXX)
|
||||
|
||||
void glcd_init(void)
|
||||
{
|
||||
|
||||
#if defined(GLCD_CONTROLLER_PCD8544)
|
||||
/*
|
||||
* Set up SPI (SSP)
|
||||
* Note: Max allowed SPI clock is 4 MHz from datasheet.
|
||||
*/
|
||||
|
||||
/* Select SSP/SPI port */
|
||||
SSP_IOConfig( CONTROLLER_SPI_PORT_NUMBER );
|
||||
|
||||
/* Initialise SSP/SPI port */
|
||||
SSP_Init( CONTROLLER_SPI_PORT_NUMBER );
|
||||
|
||||
/* Above functions take care of SPI pins */
|
||||
|
||||
/* Set SS, DC and RST pins to output */
|
||||
CONTROLLER_SS_PORT->DIR |= (1 << CONTROLLER_SS_PIN);
|
||||
CONTROLLER_DC_PORT->DIR |= (1 << CONTROLLER_DC_PIN);
|
||||
CONTROLLER_RST_PORT->DIR |= (1 << CONTROLLER_RST_PIN);
|
||||
|
||||
/* Deselect LCD */
|
||||
GLCD_DESELECT();
|
||||
|
||||
glcd_PCD8544_init();
|
||||
|
||||
glcd_select_screen(glcd_buffer,&glcd_bbox);
|
||||
|
||||
glcd_clear();
|
||||
|
||||
#elif defined(GLCD_CONTROLLER_NT75451)
|
||||
/* Parallel interface controller used on NGX BlueBoards */
|
||||
|
||||
/* Set 4x control lines pins as output */
|
||||
LPC_GPIO->DIR[CONTROLLER_LCD_EN_PORT] |= (1U<<CONTROLLER_LCD_EN_PIN);
|
||||
LPC_GPIO->DIR[CONTROLLER_LCD_RW_PORT] |= (1U<<CONTROLLER_LCD_RW_PIN);
|
||||
LPC_GPIO->DIR[CONTROLLER_LCD_RS_PORT] |= (1U<<CONTROLLER_LCD_RS_PIN);
|
||||
LPC_GPIO->DIR[CONTROLLER_LCD_CS_PORT] |= (1U<<CONTROLLER_LCD_CS_PIN);
|
||||
|
||||
/* Don't worry about setting default RS/RW/CS/EN, they get set during use */
|
||||
|
||||
#ifdef CONTROLLER_LCD_DATA_PORT
|
||||
/* Set data pins as output */
|
||||
LPC_GPIO->DIR[CONTROLLER_LCD_D0_PORT] |= GLCD_PARALLEL_MASK;
|
||||
#else
|
||||
#error "Support of parallel data pins on different ports not supported."
|
||||
#endif
|
||||
|
||||
glcd_NT75451_init();
|
||||
|
||||
/* Select default screen buffer */
|
||||
glcd_select_screen(glcd_buffer,&glcd_bbox);
|
||||
|
||||
/* Clear the screen buffer */
|
||||
glcd_clear();
|
||||
|
||||
#else /* GLCD_CONTROLLER_PCD8544 */
|
||||
#error "Controller not supported by LPC111x"
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#if defined(GLCD_USE_PARALLEL)
|
||||
|
||||
/** Write byte via parallel interface */
|
||||
void glcd_parallel_write(uint8_t c)
|
||||
{
|
||||
|
||||
uint32_t port_output = \
|
||||
( ( (1U << 0) & c ? 1 : 0 ) << CONTROLLER_LCD_D0_PIN ) | \
|
||||
( ( (1U << 1) & c ? 1 : 0 ) << CONTROLLER_LCD_D1_PIN ) | \
|
||||
( ( (1U << 2) & c ? 1 : 0 ) << CONTROLLER_LCD_D2_PIN ) | \
|
||||
( ( (1U << 3) & c ? 1 : 0 ) << CONTROLLER_LCD_D3_PIN ) | \
|
||||
( ( (1U << 4) & c ? 1 : 0 ) << CONTROLLER_LCD_D4_PIN ) | \
|
||||
( ( (1U << 5) & c ? 1 : 0 ) << CONTROLLER_LCD_D5_PIN ) | \
|
||||
( ( (1U << 6) & c ? 1 : 0 ) << CONTROLLER_LCD_D6_PIN ) | \
|
||||
( ( (1U << 7) & c ? 1 : 0 ) << CONTROLLER_LCD_D7_PIN );
|
||||
|
||||
/* Perform the write */
|
||||
|
||||
/* Clear data bits to zero and set required bits as needed */
|
||||
LPC_GPIO->CLR[CONTROLLER_LCD_D0_PORT] |= GLCD_PARALLEL_MASK;
|
||||
LPC_GPIO->SET[CONTROLLER_LCD_D0_PORT] |= port_output;
|
||||
|
||||
GLCD_RW_LOW();
|
||||
GLCD_CS_LOW();
|
||||
GLCD_EN_HIGH();
|
||||
|
||||
/* Must hold for minimum 80 ns = ~12.5 MHz pulse */
|
||||
|
||||
/* Do whatever is needed for your MCU */
|
||||
//glcd_delay(1);
|
||||
|
||||
GLCD_EN_LOW();
|
||||
GLCD_CS_HIGH();
|
||||
GLCD_RW_HIGH();
|
||||
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void glcd_spi_write(uint8_t c)
|
||||
{
|
||||
GLCD_SELECT();
|
||||
SSP_Send(CONTROLLER_SPI_PORT_NUMBER,&c,1);
|
||||
GLCD_DESELECT();
|
||||
}
|
||||
|
||||
#endif /* GLCD_USE_PARALLEL */
|
||||
|
||||
void glcd_reset(void)
|
||||
{
|
||||
#if defined(GLCD_CONTROLLER_PCD8544)
|
||||
/* Toggle RST low to reset. Minimum pulse 100ns on datasheet. */
|
||||
GLCD_SELECT();
|
||||
GLCD_RESET_LOW();
|
||||
delay_ms(GLCD_RESET_TIME);
|
||||
GLCD_RESET_HIGH();
|
||||
GLCD_DESELECT();
|
||||
|
||||
#elif defined(GLCD_CONTROLLER_NT75451)
|
||||
/* No firmware reset possible with our test board (BlueBoard) */
|
||||
|
||||
#endif /* GLCD_CONTROLLER_PCD8544 */
|
||||
}
|
||||
|
||||
void glcd_delay(uint32_t count)
|
||||
{
|
||||
uint16_t j=0,i=0;
|
||||
|
||||
for(j=0;j<count;j++)
|
||||
{
|
||||
/* At 60Mhz, the below loop introduces
|
||||
delay of 10 us */
|
||||
for(i=0;i<35;i++);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* GLCD_DEVICE_LPC11UXX */
|
||||
@@ -0,0 +1,141 @@
|
||||
/**
|
||||
\file LPC11Uxx.h
|
||||
\author Andy Gock
|
||||
\brief Implmentation of NXP LPC11Uxx microcontrollers.
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef DEVICE_LPC11UXX_H
|
||||
#define DEVICE_LPC11UXX_H
|
||||
/**
|
||||
* NXP LPC11Uxx
|
||||
*
|
||||
* \author Andy Gock
|
||||
**/
|
||||
|
||||
#if defined(GLCD_DEVICE_LPC11UXX)
|
||||
|
||||
#define swap(a, b) { uint8_t t = a; a = b; b = t; }
|
||||
|
||||
#if !defined(GLCD_USE_PARALLEL)
|
||||
/* SPI interface */
|
||||
|
||||
/* Define port and pins used to connecto LCD */
|
||||
#define CONTROLLER_SPI_PORT_NUMBER 1
|
||||
#define CONTROLLER_MOSI_PORT LPC_GPIO2
|
||||
#define CONTROLLER_MOSI_PIN 3
|
||||
#define CONTROLLER_MISO_PORT LPC_GPIO2
|
||||
#define CONTROLLER_MISO_PIN 2
|
||||
#define CONTROLLER_SCK_PORT LPC_GPIO2
|
||||
#define CONTROLLER_SCK_PIN 1
|
||||
#define CONTROLLER_SS_PORT LPC_GPIO2
|
||||
#define CONTROLLER_SS_PIN 0
|
||||
#define CONTROLLER_DC_PORT LPC_GPIO2
|
||||
#define CONTROLLER_DC_PIN 4
|
||||
#define CONTROLLER_RST_PORT LPC_GPIO2
|
||||
#define CONTROLLER_RST_PIN 5
|
||||
|
||||
/* Preprocessor macros */
|
||||
#define GLCD_SELECT() CONTROLLER_SS_PORT->DATA &= ~(1 << CONTROLLER_SS_PIN)
|
||||
#define GLCD_DESELECT() CONTROLLER_SS_PORT->DATA |= (1 << CONTROLLER_SS_PIN)
|
||||
#define GLCD_DC_LOW() CONTROLLER_DC_PORT->DATA &= ~(1 << CONTROLLER_DC_PIN)
|
||||
#define GLCD_DC_HIGH() CONTROLLER_DC_PORT->DATA |= (1 << CONTROLLER_DC_PIN)
|
||||
#define GLCD_RESET_LOW() CONTROLLER_RST_PORT->DATA &= ~(1 << CONTROLLER_RST_PIN)
|
||||
#define GLCD_RESET_HIGH() CONTROLLER_RST_PORT->DATA |= (1 << CONTROLLER_RST_PIN)
|
||||
|
||||
#else
|
||||
/* Parallel interface */
|
||||
|
||||
#define CONTROLLER_LCD_EN_PORT 0
|
||||
#define CONTROLLER_LCD_EN_PIN 12 /**< Read write enable pin */
|
||||
#define CONTROLLER_LCD_RW_PORT 0
|
||||
#define CONTROLLER_LCD_RW_PIN 13 /**< Read write signal pin */
|
||||
#define CONTROLLER_LCD_RS_PORT 0
|
||||
#define CONTROLLER_LCD_RS_PIN 14 /**< Command data select pin */
|
||||
#define CONTROLLER_LCD_CS_PORT 1
|
||||
#define CONTROLLER_LCD_CS_PIN 13 /**< Chip select pin */
|
||||
|
||||
#define CONTROLLER_LCD_D0_PORT 1
|
||||
#define CONTROLLER_LCD_D1_PORT 1
|
||||
#define CONTROLLER_LCD_D2_PORT 1
|
||||
#define CONTROLLER_LCD_D3_PORT 1
|
||||
#define CONTROLLER_LCD_D4_PORT 1
|
||||
#define CONTROLLER_LCD_D5_PORT 1
|
||||
#define CONTROLLER_LCD_D6_PORT 1
|
||||
#define CONTROLLER_LCD_D7_PORT 1
|
||||
|
||||
#define CONTROLLER_LCD_D0_PIN 19
|
||||
#define CONTROLLER_LCD_D1_PIN 20
|
||||
#define CONTROLLER_LCD_D2_PIN 21
|
||||
#define CONTROLLER_LCD_D3_PIN 22
|
||||
#define CONTROLLER_LCD_D4_PIN 26
|
||||
#define CONTROLLER_LCD_D5_PIN 27
|
||||
#define CONTROLLER_LCD_D6_PIN 28
|
||||
#define CONTROLLER_LCD_D7_PIN 31
|
||||
|
||||
#if (CONTROLLER_LCD_D1_PORT == CONTROLLER_LCD_D0_PORT) && \
|
||||
(CONTROLLER_LCD_D2_PORT == CONTROLLER_LCD_D0_PORT) && \
|
||||
(CONTROLLER_LCD_D3_PORT == CONTROLLER_LCD_D0_PORT) && \
|
||||
(CONTROLLER_LCD_D4_PORT == CONTROLLER_LCD_D0_PORT) && \
|
||||
(CONTROLLER_LCD_D5_PORT == CONTROLLER_LCD_D0_PORT) && \
|
||||
(CONTROLLER_LCD_D6_PORT == CONTROLLER_LCD_D0_PORT) && \
|
||||
(CONTROLLER_LCD_D7_PORT == CONTROLLER_LCD_D0_PORT)
|
||||
/* All data pins are on the same port */
|
||||
#define CONTROLLER_LCD_DATA_PORT 1
|
||||
|
||||
#define GLCD_PARALLEL_MASK ( \
|
||||
(1U<<CONTROLLER_LCD_D0_PIN)| \
|
||||
(1U<<CONTROLLER_LCD_D1_PIN)| \
|
||||
(1U<<CONTROLLER_LCD_D2_PIN)| \
|
||||
(1U<<CONTROLLER_LCD_D3_PIN)| \
|
||||
(1U<<CONTROLLER_LCD_D4_PIN)| \
|
||||
(1U<<CONTROLLER_LCD_D5_PIN)| \
|
||||
(1U<<CONTROLLER_LCD_D6_PIN)| \
|
||||
(1U<<CONTROLLER_LCD_D7_PIN) \
|
||||
)
|
||||
|
||||
#define GLCD_EN_LOW() LPC_GPIO->CLR[CONTROLLER_LCD_EN_PORT] |= (1U<<CONTROLLER_LCD_EN_PIN);
|
||||
#define GLCD_EN_HIGH() LPC_GPIO->SET[CONTROLLER_LCD_EN_PORT] |= (1U<<CONTROLLER_LCD_EN_PIN);
|
||||
#define GLCD_RW_LOW() LPC_GPIO->CLR[CONTROLLER_LCD_RW_PORT] |= (1U<<CONTROLLER_LCD_RW_PIN);
|
||||
#define GLCD_RW_HIGH() LPC_GPIO->SET[CONTROLLER_LCD_RW_PORT] |= (1U<<CONTROLLER_LCD_RW_PIN);
|
||||
#define GLCD_RS_LOW() LPC_GPIO->CLR[CONTROLLER_LCD_RS_PORT] |= (1U<<CONTROLLER_LCD_RS_PIN);
|
||||
#define GLCD_RS_HIGH() LPC_GPIO->SET[CONTROLLER_LCD_RS_PORT] |= (1U<<CONTROLLER_LCD_RS_PIN);
|
||||
#define GLCD_CS_LOW() LPC_GPIO->CLR[CONTROLLER_LCD_CS_PORT] |= (1U<<CONTROLLER_LCD_CS_PIN);
|
||||
#define GLCD_CS_HIGH() LPC_GPIO->SET[CONTROLLER_LCD_CS_PORT] |= (1U<<CONTROLLER_LCD_CS_PIN);
|
||||
|
||||
#else /* All parallel data pins on same port */
|
||||
#undef CONTROLLER_LCD_DATA_PORT
|
||||
#endif
|
||||
|
||||
#endif /* not use GLCD_USE_SPI */
|
||||
|
||||
#endif /* GLCD_DEVICE_LPC11UXX */
|
||||
|
||||
#endif /* DEVICE_LPC11UXX_H */
|
||||
@@ -0,0 +1,210 @@
|
||||
/**
|
||||
\file PIC24H.c
|
||||
\brief Functions relating to Microchip PIC24H (16-bit).
|
||||
For use with xc16 compiler.
|
||||
\author Andy Gock
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2013, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "../glcd.h"
|
||||
|
||||
#if defined(GLCD_DEVICE_USER)
|
||||
#include "glcd_user_config.h"
|
||||
#include "glcd_user_config.c"
|
||||
#else
|
||||
|
||||
#include "PIC24H.h"
|
||||
|
||||
#if defined(GLCD_DEVICE_PIC24H)
|
||||
|
||||
void glcd_init(void)
|
||||
{
|
||||
|
||||
#if defined(GLCD_CONTROLLER_PCD8544)
|
||||
|
||||
/* Set up remappable outputs for PIC24H, SPI: DO and SCK */
|
||||
OSCCONbits.IOLOCK = 0;
|
||||
REGISTER_MAP_SPI_DO = 0b00111; /* Set as SPI DO */
|
||||
REGISTER_MAP_SPI_SCK = 0b01000; /* Set as SCK */
|
||||
OSCCONbits.IOLOCK = 1;
|
||||
|
||||
/* Set DO and SCK pins as output */
|
||||
CONTROLLER_MOSI_TRIS = 0;
|
||||
CONTROLLER_SCK_TRIS = 0;
|
||||
|
||||
/* If the pins is also an ADC port, set these as digital mode */
|
||||
// Do we really need to do this, or will setting RPxR deal with this
|
||||
//_PCFG9 = 1;
|
||||
//_PCFG10 = 1;
|
||||
|
||||
/* Set SS, DC and RST pins as output */
|
||||
CONTROLLER_SS_TRIS = 0;
|
||||
CONTROLLER_DC_TRIS = 0;
|
||||
CONTROLLER_RST_TRIS = 0;
|
||||
|
||||
/* Deselect LCD */
|
||||
GLCD_DESELECT();
|
||||
|
||||
/* SPI setup based on sample code from datasheet */
|
||||
/* The following code shows the SPI register configuration for Master mode */
|
||||
IFS0bits.SPI1IF = 0; /* Clear the Interrupt Flag */
|
||||
IEC0bits.SPI1IE = 0; /* Disable the Interrupt */
|
||||
|
||||
/* SPI1CON1 Register Settings */
|
||||
SPI1CON1bits.DISSCK = 0; /* Internal Serial Clock is Enabled */
|
||||
SPI1CON1bits.DISSDO = 0; /* SDOx pin is controlled by the module */
|
||||
SPI1CON1bits.MODE16 = 0; /* Communication is word-wide (16 bits) */
|
||||
SPI1CON1bits.SMP = 0; /* Input data is sampled at the middle of data */
|
||||
SPI1CON1bits.CKE = 0; /* Serial output data changes on transition */
|
||||
SPI1CON1bits.CKP = 0; /* Idle state for clock is a low level */
|
||||
SPI1CON1bits.PPRE = 0b11; /* Primary prescale = 1:1 */
|
||||
SPI1CON1bits.SPRE = 0b001; /* Secondary prescale = 4:1 */
|
||||
SPI1CON1bits.MSTEN = 1; /* Master mode Enabled */
|
||||
SPI1STATbits.SPIEN = 1; /* Enable SPI module */
|
||||
|
||||
/* Interrupt Controller Settings */
|
||||
// we're not using interrupts to handle SPI
|
||||
//IFS0bits.SPI1IF = 0; /* Clear the Interrupt Flag */
|
||||
//IEC0bits.SPI1IE = 1; /* Enable the Interrupt */
|
||||
|
||||
/* Send reset pulse to LCD */
|
||||
glcd_reset();
|
||||
|
||||
/* Initialise the display */
|
||||
glcd_PCD8544_init();
|
||||
|
||||
/* Select screen buffer */
|
||||
glcd_select_screen(glcd_buffer,&glcd_bbox);
|
||||
|
||||
/* Clear screen, we are now ready to go */
|
||||
glcd_clear();
|
||||
|
||||
#elif defined(GLCD_CONTROLLER_ST7565R)
|
||||
|
||||
/* Code tested with Newhaven Display NHD-C12832A1Z-FSW-FBW-3V3 */
|
||||
|
||||
/* Set up remappable outputs for PIC24H, SPI: DO and SCK */
|
||||
OSCCONbits.IOLOCK = 0;
|
||||
REGISTER_MAP_SPI_DO = 0b00111; /* Set as SPI DO */
|
||||
REGISTER_MAP_SPI_SCK = 0b01000; /* Set as SCK */
|
||||
OSCCONbits.IOLOCK = 1;
|
||||
|
||||
/* Set DO and SCK pins as output */
|
||||
CONTROLLER_MOSI_TRIS = 0;
|
||||
CONTROLLER_SCK_TRIS = 0;
|
||||
|
||||
/* Set SS, DC and A0 pins as output */
|
||||
CONTROLLER_SS_TRIS = 0;
|
||||
CONTROLLER_A0_TRIS = 0;
|
||||
CONTROLLER_RST_TRIS = 0;
|
||||
|
||||
/* Deselect LCD */
|
||||
GLCD_DESELECT();
|
||||
|
||||
/* SPI setup based on sample code from datasheet */
|
||||
/* The following code shows the SPI register configuration for Master mode */
|
||||
IFS0bits.SPI1IF = 0; /* Clear the Interrupt Flag */
|
||||
IEC0bits.SPI1IE = 0; /* Disable the Interrupt */
|
||||
|
||||
/* SPI1CON1 Register Settings */
|
||||
SPI1CON1bits.DISSCK = 0; /* Internal Serial Clock is Enabled */
|
||||
SPI1CON1bits.DISSDO = 0; /* SDOx pin is controlled by the module */
|
||||
SPI1CON1bits.MODE16 = 0; /* Communication is word-wide (16 bits) */
|
||||
SPI1CON1bits.SMP = 0; /* Input data is sampled at the middle of data */
|
||||
SPI1CON1bits.CKE = 0; /* Serial output data changes on transition */
|
||||
SPI1CON1bits.CKP = 0; /* Idle state for clock is a low level */
|
||||
|
||||
/* Set SPI prescale, this is important make sure SPI click is below datasheets specified max clock speed */
|
||||
|
||||
#if defined(GLCD_INIT_NHD_C12832A1Z_FSW_FBW_3V3)
|
||||
/* Total prescale = 1x7 = 7 */
|
||||
/* This LCD can handle fairly high clocks, but you'll need to check your FCY and adjust as required */
|
||||
SPI1CON1bits.PPRE = 0b11;
|
||||
SPI1CON1bits.SPRE = 0b001;
|
||||
#else
|
||||
/* Total prescale = 4x3 = 12 */
|
||||
SPI1CON1bits.PPRE = 0b10; /* Primary prescale 0b11=1:1, 0b10=4:1, 0b01=16:1, 0b00=64:1 */
|
||||
SPI1CON1bits.SPRE = 0b101; /* Secondary prescale 0b111=1:1 0b110=2:1 ... 0b001=7:1, 0b000=8:1 */
|
||||
#endif
|
||||
|
||||
SPI1CON1bits.MSTEN = 1; /* Master mode Enabled */
|
||||
SPI1STATbits.SPIEN = 1; /* Enable SPI module */
|
||||
|
||||
/* Send reset pulse to LCD */
|
||||
glcd_reset();
|
||||
delay_ms(1);
|
||||
|
||||
/* Begin sending data for initialisation sequence */
|
||||
glcd_ST7565R_init();
|
||||
|
||||
/* Set all dots black and hold for 0.5s, then clear it, we do this so we can visually check init sequence is working */
|
||||
glcd_all_on();
|
||||
delay_ms(500);
|
||||
glcd_normal();
|
||||
|
||||
glcd_set_start_line(0);
|
||||
glcd_clear_now();
|
||||
|
||||
glcd_select_screen(glcd_buffer,&glcd_bbox);
|
||||
|
||||
glcd_clear();
|
||||
|
||||
#else
|
||||
#error "Controller not supported"
|
||||
#endif /* GLCD_CONTROLLER_* */
|
||||
|
||||
}
|
||||
|
||||
void glcd_spi_write(uint8_t c)
|
||||
{
|
||||
GLCD_SELECT();
|
||||
|
||||
while (SPI1STATbits.SPITBF); /* Loop until TX buffer is empty */
|
||||
SPI1BUF = (c & 0x00FF); /* Write data to be transmitted */
|
||||
while(!SPI1STATbits.SPIRBF); /* Wait until TX finished */
|
||||
|
||||
uint8_t read;
|
||||
read = SPI1BUF; /* Throw away the data (not sure if this is neccesary, to force reading of SPI1BUF) */
|
||||
|
||||
GLCD_DESELECT();
|
||||
}
|
||||
|
||||
void glcd_reset(void)
|
||||
{
|
||||
/* Toggle RST low to reset. Minimum pulse 100ns on datasheet. */
|
||||
GLCD_SELECT();
|
||||
GLCD_RESET_LOW();
|
||||
__delay_ms(GLCD_RESET_TIME);
|
||||
GLCD_RESET_HIGH();
|
||||
GLCD_DESELECT();
|
||||
}
|
||||
|
||||
#endif /* defined(GLCD_DEVICE_PIC24H) */
|
||||
|
||||
#endif /* GLCD_DEVICE_USER */
|
||||
@@ -0,0 +1,137 @@
|
||||
/**
|
||||
\file PIC24H.c
|
||||
\brief Functions relating to Microchip PIC24H (16-bit).
|
||||
For use with xc16 compiler.
|
||||
\author Andy Gock
|
||||
*/
|
||||
/*
|
||||
Copyright (c) 2013, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef GLCD_PINOUTS_PIC24H_H_
|
||||
#define GLCD_PINOUTS_PIC24H_H_
|
||||
|
||||
#if defined(GLCD_DEVICE_USER)
|
||||
#include "glcd_user_config.h"
|
||||
#include "glcd_user_config.c"
|
||||
#else
|
||||
|
||||
#if defined(GLCD_DEVICE_PIC24H)
|
||||
|
||||
#include <stdint.h>
|
||||
#include <xc.h>
|
||||
#include <libpic30.h>
|
||||
|
||||
#if defined(GLCD_CONTROLLER_PCD8544)
|
||||
|
||||
/* Pin configuration for Microstick II board, PGE* switch in 'A' position */
|
||||
|
||||
/**
|
||||
* \name SPI port and pins. SPI1 port is used in \file PIC24H.c. Define
|
||||
* the TRIS and PIN registers.
|
||||
* @{
|
||||
*/
|
||||
#define CONTROLLER_MOSI_TRIS _TRISB14
|
||||
#define CONTROLLER_MOSI_PIN _LATB14
|
||||
#define CONTROLLER_SCK_TRIS _TRISB15
|
||||
#define CONTROLLER_SCK_PIN _LATAB15
|
||||
|
||||
/* Output mapping for SPI1 (should be the same as above pins) */
|
||||
#define REGISTER_MAP_SPI_DO _RP14R
|
||||
#define REGISTER_MAP_SPI_SCK _RP15R
|
||||
|
||||
/**@}*/
|
||||
|
||||
/**
|
||||
* \name Other pins needed for serial LCD controller
|
||||
* @{
|
||||
*/
|
||||
#define CONTROLLER_SS_TRIS _TRISB2
|
||||
#define CONTROLLER_SS_PIN _LATB2
|
||||
#define CONTROLLER_DC_TRIS _TRISB3
|
||||
#define CONTROLLER_DC_PIN _LATB3
|
||||
#define CONTROLLER_RST_TRIS _TRISA2
|
||||
#define CONTROLLER_RST_PIN _LATA2
|
||||
/**@}*/
|
||||
|
||||
#elif defined(GLCD_CONTROLLER_ST7565R)
|
||||
|
||||
//#error "ST7565R not supported on PIC24H"
|
||||
|
||||
/**
|
||||
* \name SPI port and pins. SPI1 port is used in \file PIC24H.c. Define
|
||||
* the TRIS and PIN registers.
|
||||
* @{
|
||||
*/
|
||||
#define CONTROLLER_MOSI_TRIS _TRISB14
|
||||
#define CONTROLLER_MOSI_PIN _LATB14
|
||||
#define CONTROLLER_SCK_TRIS _TRISB15
|
||||
#define CONTROLLER_SCK_PIN _LATB15
|
||||
|
||||
/* Output mapping for SPI1 (should be the same as above pins) */
|
||||
#define REGISTER_MAP_SPI_DO _RP14R
|
||||
#define REGISTER_MAP_SPI_SCK _RP15R
|
||||
|
||||
/**@}*/
|
||||
|
||||
/**
|
||||
* \name Other pins needed for serial LCD controller
|
||||
* @{
|
||||
*/
|
||||
#define CONTROLLER_SS_TRIS _TRISB2
|
||||
#define CONTROLLER_SS_PIN _LATB2
|
||||
#define CONTROLLER_A0_TRIS _TRISB3
|
||||
#define CONTROLLER_A0_PIN _LATB3
|
||||
#define CONTROLLER_RST_TRIS _TRISA2
|
||||
#define CONTROLLER_RST_PIN _LATA2
|
||||
/**@}*/
|
||||
|
||||
#else
|
||||
#error "Controller not supported or defined in PIC24H module"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \name Macros for control lines
|
||||
* @{
|
||||
*/
|
||||
#define GLCD_SELECT() CONTROLLER_SS_PIN = 0
|
||||
#define GLCD_DESELECT() CONTROLLER_SS_PIN = 1
|
||||
#define GLCD_DC_LOW() CONTROLLER_DC_PIN = 0
|
||||
#define GLCD_DC_HIGH() CONTROLLER_DC_PIN = 1
|
||||
#define GLCD_RESET_LOW() CONTROLLER_RST_PIN = 0
|
||||
#define GLCD_RESET_HIGH() CONTROLLER_RST_PIN = 1
|
||||
|
||||
#define GLCD_A0_LOW() CONTROLLER_A0_PIN = 0 /* Command write */
|
||||
#define GLCD_A0_HIGH() CONTROLLER_A0_PIN = 1 /* Write to display RAM */
|
||||
|
||||
/**@}*/
|
||||
|
||||
#endif /* GLCD_DEVICE_PIC24H */
|
||||
|
||||
#endif /* GLCD_DEVICE_USER */
|
||||
|
||||
#endif /* GLCD_PINOUTS_PIC24H_H_ */
|
||||
@@ -0,0 +1,171 @@
|
||||
/**
|
||||
\file STM32F0xx.c
|
||||
\author Andy Gock
|
||||
\brief Functions specific to STM32 F0 ARM Cortex-M0 devices.
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(GLCD_DEVICE_STM32F0XX)
|
||||
|
||||
/* Includes from CMSIS and Peripheral Library */
|
||||
#include "stm32f0xx.h"
|
||||
#include "stm32f0xx_gpio.h"
|
||||
#include "stm32f0xx_spi.h"
|
||||
#include "stm32f0xx_rcc.h"
|
||||
#include "stm32f0xx_misc.h"
|
||||
|
||||
/* Includes from GLCD */
|
||||
#include "../glcd.h"
|
||||
#include "inc/STM32F0xx.h"
|
||||
|
||||
void glcd_init(void)
|
||||
{
|
||||
|
||||
#if defined(GLCD_CONTROLLER_PCD8544)
|
||||
/* Initialisation for PCD8544 controller */
|
||||
|
||||
/* Declare GPIO and SPI init structures */
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
SPI_InitTypeDef SPI_InitStructure;
|
||||
//NVIC_InitTypeDef NVIC_InitStructure;
|
||||
|
||||
/* Initialise structures (which we will overide later) */
|
||||
GPIO_StructInit(&GPIO_InitStructure);
|
||||
SPI_StructInit(&SPI_InitStructure);
|
||||
|
||||
/* Need to make start up the correct peripheral clocks */
|
||||
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI1, ENABLE);
|
||||
|
||||
/* SS pin */
|
||||
GPIO_InitStructure.GPIO_Pin = CONTROLLER_SPI_SS_PIN;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_Level_3;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
||||
GPIO_Init(CONTROLLER_SPI_SS_PORT, &GPIO_InitStructure);
|
||||
|
||||
/* DC pin */
|
||||
GPIO_InitStructure.GPIO_Pin = CONTROLLER_SPI_DC_PIN;
|
||||
GPIO_Init(CONTROLLER_SPI_DC_PORT, &GPIO_InitStructure);
|
||||
|
||||
/* RESET pin */
|
||||
GPIO_InitStructure.GPIO_Pin = CONTROLLER_SPI_RST_PIN;
|
||||
GPIO_Init(CONTROLLER_SPI_RST_PORT, &GPIO_InitStructure);
|
||||
|
||||
/* Make sure chip is de-selected by default */
|
||||
GLCD_DESELECT();
|
||||
|
||||
/* Set up GPIO for SPI pins */
|
||||
GPIO_InitStructure.GPIO_Pin = CONTROLLER_SPI_SCK_PIN | CONTROLLER_SPI_MISO_PIN | CONTROLLER_SPI_MOSI_PIN;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_Level_3;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIO_Init(CONTROLLER_SPI_PORT, &GPIO_InitStructure);
|
||||
|
||||
/* Configure alternate function mode for SPI pins */
|
||||
GPIO_PinAFConfig(GPIOA,CONTROLLER_SPI_SCK_PINSRC,GPIO_AF_0);
|
||||
GPIO_PinAFConfig(GPIOA,CONTROLLER_SPI_MOSI_PINSRC,GPIO_AF_0);
|
||||
GPIO_PinAFConfig(GPIOA,CONTROLLER_SPI_MISO_PINSRC,GPIO_AF_0);
|
||||
|
||||
/* Initialise SPI */
|
||||
SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;
|
||||
SPI_InitStructure.SPI_Mode = SPI_Mode_Master;
|
||||
SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;
|
||||
SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low;
|
||||
SPI_InitStructure.SPI_CPHA = SPI_CPHA_2Edge;
|
||||
SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;
|
||||
SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_32; /* Set clock speed! */
|
||||
SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;
|
||||
SPI_InitStructure.SPI_CRCPolynomial = 7;
|
||||
SPI_Init(CONTROLLER_SPI_NUMBER, &SPI_InitStructure);
|
||||
|
||||
/* Enable SPI interupts */
|
||||
/*
|
||||
SPI_I2S_ITConfig(CONTROLLER_SPI_NUMBER, SPI_I2S_IT_TXE, ENABLE);
|
||||
NVIC_InitStructure.NVIC_IRQChannel = SPI1_IRQn;
|
||||
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
|
||||
NVIC_InitStructure.NVIC_IRQChannelPriority = 0x00;
|
||||
NVIC_Init(&NVIC_InitStructure);
|
||||
*/
|
||||
|
||||
/* Enable SPI */
|
||||
SPI_Cmd(CONTROLLER_SPI_NUMBER, ENABLE);
|
||||
|
||||
/* Initialisation sequence of controller */
|
||||
glcd_reset();
|
||||
|
||||
/* Get into the EXTENDED mode! */
|
||||
glcd_command(PCD8544_FUNCTION_SET | PCD8544_EXTENDED_INSTRUCTION);
|
||||
|
||||
/* LCD bias select (4 is optimal?) */
|
||||
glcd_command(PCD8544_SET_BIAS | 0x2);
|
||||
|
||||
/* Set VOP */
|
||||
glcd_command(PCD8544_SET_VOP | 50); // Experimentally determined
|
||||
|
||||
/* Back to standard instructions */
|
||||
glcd_command(PCD8544_FUNCTION_SET);
|
||||
|
||||
/* Normal mode */
|
||||
glcd_command(PCD8544_DISPLAY_CONTROL | PCD8544_DISPLAY_NORMAL);
|
||||
|
||||
glcd_select_screen((uint8_t *)&glcd_buffer,&glcd_bbox);
|
||||
|
||||
glcd_set_contrast(50);
|
||||
|
||||
glcd_clear();
|
||||
|
||||
|
||||
#else
|
||||
#error "Controller not supported by STM32F0xx"
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void glcd_spi_write(uint8_t c)
|
||||
{
|
||||
|
||||
GLCD_SELECT();
|
||||
SPI_SendData8(CONTROLLER_SPI_NUMBER, (uint16_t) c);
|
||||
|
||||
/* Wait until entire byte has been read (which we discard anyway) */
|
||||
while(SPI_I2S_GetFlagStatus(CONTROLLER_SPI_NUMBER, SPI_I2S_FLAG_BSY) != RESET);
|
||||
|
||||
GLCD_DESELECT();
|
||||
}
|
||||
|
||||
void glcd_reset(void)
|
||||
{
|
||||
/* Toggle RST low to reset. Minimum pulse 100ns on datasheet. */
|
||||
GLCD_SELECT();
|
||||
GLCD_RESET_LOW();
|
||||
delay_ms(GLCD_RESET_TIME);
|
||||
GLCD_RESET_HIGH();
|
||||
GLCD_DESELECT();
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,127 @@
|
||||
/**
|
||||
* \file STM32F10x.c
|
||||
* \brief Device implementation for ST STM32F10x ARM Cortex-M3 MCUs
|
||||
* Requires the use of ST's Standard Peripheral Library
|
||||
* \author Andy Gock
|
||||
* \todo Code is untested!
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#if defined(GLCD_DEVICE_STM32F10X)
|
||||
|
||||
#include "STM32F10x.h"
|
||||
|
||||
void glcd_init(void)
|
||||
{
|
||||
|
||||
#if defined(GLCD_CONTROLLER_PCD8544)
|
||||
/* Initialisation for PCD8544 controller */
|
||||
|
||||
/* Need to make start up the correct peripheral clocks */
|
||||
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_SPI1, ENABLE);
|
||||
|
||||
/* Set up GPIO pins */
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
|
||||
/* SS pin */
|
||||
GPIO_InitStructure.GPIO_Pin = CONTROLLER_SPI_SS_PIN;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
|
||||
GPIO_Init(CONTROLLER_SPI_SS_PORT, &GPIO_InitStructure);
|
||||
|
||||
/* DC pin */
|
||||
GPIO_InitStructure.GPIO_Pin = CONTROLLER_SPI_DC_PIN;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
|
||||
GPIO_Init(CONTROLLER_SPI_DC_PORT, &GPIO_InitStructure);
|
||||
|
||||
/* RESET pin */
|
||||
GPIO_InitStructure.GPIO_Pin = CONTROLLER_SPI_RST_PIN;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
|
||||
GPIO_Init(CONTROLLER_SPI_RST_PORT, &GPIO_InitStructure);
|
||||
|
||||
/* Make sure chip is de-selected by default */
|
||||
GLCD_DESELECT();
|
||||
|
||||
/* Set up GPIO for SPI pins */
|
||||
GPIO_InitStructure.GPIO_Pin = CONTROLLER_SPI_SCK_PIN | CONTROLLER_SPI_MISO_PIN | CONTROLLER_SPI_MOSI_PIN;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
|
||||
GPIO_Init(CONTROLLER_SPI_PORT, &GPIO_InitStructure);
|
||||
|
||||
/* Initialise SPI */
|
||||
SPI_InitTypeDef SPI_InitStructure;
|
||||
SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;
|
||||
SPI_InitStructure.SPI_Mode = SPI_Mode_Master;
|
||||
SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;
|
||||
SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low;
|
||||
SPI_InitStructure.SPI_CPHA = SPI_CPHA_2Edge;
|
||||
SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;
|
||||
SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_32; /* Set clock speed! */
|
||||
SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;
|
||||
SPI_InitStructure.SPI_CRCPolynomial = 7;
|
||||
SPI_Init(CONTROLLER_SPI_NUMBER, &SPI_InitStructure);
|
||||
|
||||
SPI_I2S_ITConfig(CONTROLLER_SPI_NUMBER, SPI_I2S_IT_RXNE, ENABLE);
|
||||
|
||||
/* Enable SPI */
|
||||
SPI_Cmd(CONTROLLER_SPI_NUMBER, ENABLE);
|
||||
|
||||
/* Initialisation sequence of controller */
|
||||
/** \todo Need to initialise controller */
|
||||
|
||||
#else
|
||||
#error "Controller not supported by STM32F100x"
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void glcd_spi_write(uint8_t c)
|
||||
{
|
||||
|
||||
GLCD_SELECT();
|
||||
SPI_I2S_SendData(CONTROLLER_SPI_NUMBER, (uint16_t) data);
|
||||
|
||||
/* Wait until entire byte has been read (which we discard anyway) */
|
||||
while( SPI_I2S_GetFlagStatus(CONTROLLER_SPI_NUMBER,SPI_I2S_FLAG_RXNE) != SET );
|
||||
|
||||
GLCD_SELECT();
|
||||
}
|
||||
|
||||
void glcd_reset(void)
|
||||
{
|
||||
GLCD_SELECT();
|
||||
GLCD_RESET_LOW();
|
||||
delay_ms(GLCD_RESET_TIME);
|
||||
GLCD_RESET_HIGH();
|
||||
GLCD_DESELECT();
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,68 @@
|
||||
/**
|
||||
\file STM32F0xx.h
|
||||
\author Andy Gock
|
||||
\brief Functions specific to STM32 F0 ARM Cortex-M0 devices.
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef STM32F0XX_H_
|
||||
#define STM32F0XX_H_
|
||||
|
||||
#if defined(GLCD_DEVICE_STM32F0XX)
|
||||
|
||||
/** SPI port number e.g SPI1, SPI2 (not to be confused with GPIOA, GPIOB, etc) */
|
||||
#define CONTROLLER_SPI_NUMBER SPI1
|
||||
#define CONTROLLER_SPI_PORT GPIOA
|
||||
#define CONTROLLER_SPI_SCK_PIN GPIO_Pin_5
|
||||
#define CONTROLLER_SPI_SCK_PINSRC GPIO_PinSource5
|
||||
#define CONTROLLER_SPI_MISO_PIN GPIO_Pin_6
|
||||
#define CONTROLLER_SPI_MISO_PINSRC GPIO_PinSource6
|
||||
#define CONTROLLER_SPI_MOSI_PIN GPIO_Pin_7
|
||||
#define CONTROLLER_SPI_MOSI_PINSRC GPIO_PinSource7
|
||||
|
||||
#define CONTROLLER_SPI_SS_PORT GPIOA
|
||||
#define CONTROLLER_SPI_SS_PIN GPIO_Pin_1
|
||||
#define CONTROLLER_SPI_DC_PORT GPIOA
|
||||
#define CONTROLLER_SPI_DC_PIN GPIO_Pin_2
|
||||
#define CONTROLLER_SPI_RST_PORT GPIOA
|
||||
#define CONTROLLER_SPI_RST_PIN GPIO_Pin_3
|
||||
|
||||
#define GLCD_SELECT() GPIO_ResetBits(CONTROLLER_SPI_SS_PORT,CONTROLLER_SPI_SS_PIN)
|
||||
#define GLCD_DESELECT() GPIO_SetBits(CONTROLLER_SPI_SS_PORT,CONTROLLER_SPI_SS_PIN)
|
||||
#define GLCD_DC_LOW() GPIO_ResetBits(CONTROLLER_SPI_DC_PORT,CONTROLLER_SPI_DC_PIN)
|
||||
#define GLCD_DC_HIGH() GPIO_SetBits(CONTROLLER_SPI_DC_PORT,CONTROLLER_SPI_DC_PIN)
|
||||
#define GLCD_RESET_LOW() GPIO_ResetBits(CONTROLLER_SPI_RST_PORT,CONTROLLER_SPI_RST_PIN)
|
||||
#define GLCD_RESET_HIGH() GPIO_SetBits(CONTROLLER_SPI_RST_PORT,CONTROLLER_SPI_RST_PIN)
|
||||
|
||||
#else
|
||||
#error "Controller not supported by STM32F0XX"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
* \file STM32F10x.h
|
||||
* \brief Device implementation for ST STM32F10x ARM Cortex-M3 MCUs
|
||||
* Requires the use of ST's Standard Peripheral Library
|
||||
* \author Andy Gock
|
||||
*
|
||||
* \todo Code is untested!
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#ifndef STM32F10X_H_
|
||||
#define STM32F10X_H_
|
||||
|
||||
#if defined(GLCD_DEVICE_STM32F10X)
|
||||
|
||||
/** SPI port number e.g SPI1, SPI2 (not to be confused with GPIOA, GPIOB, etc) */
|
||||
#define CONTROLLER_SPI_NUMBER SPI1
|
||||
#define CONTROLLER_SPI_PORT GPIOA
|
||||
#define CONTROLLER_SPI_SCK_PIN GPIO_Pin_5
|
||||
#define CONTROLLER_SPI_MISO_PIN GPIO_Pin_6
|
||||
#define CONTROLLER_SPI_MOSI_PIN GPIO_Pin_7
|
||||
|
||||
#define CONTROLLER_SPI_SS_PORT GPIOA
|
||||
#define CONTROLLER_SPI_SS_PIN GPIO_Pin_1
|
||||
#define CONTROLLER_SPI_DC_PORT GPIOA
|
||||
#define CONTROLLER_SPI_DC_PIN GPIO_Pin_2
|
||||
#define CONTROLLER_SPI_RST_PORT GPIOA
|
||||
#define CONTROLLER_SPI_RST_PIN GPIO_Pin_3
|
||||
|
||||
#define GLCD_SELECT() GPIO_ResetBits(CONTROLLER_SPI_SS_PORT,CONTROLLER_SPI_SS_PIN)
|
||||
#define GLCD_DESELECT() GPIO_SetBits(CONTROLLER_SPI_SS_PORT,CONTROLLER_SPI_SS_PIN)
|
||||
#define GLCD_DC_LOW() GPIO_ResetBits(CONTROLLER_SPI_DC_PORT,CONTROLLER_SPI_DC_PIN)
|
||||
#define GLCD_DC_HIGH() GPIO_SetBits(CONTROLLER_SPI_DC_PORT,CONTROLLER_SPI_DC_PIN)
|
||||
#define GLCD_RESET_LOW() GPIO_ResetBits(CONTROLLER_SPI_RST_PORT,CONTROLLER_SPI_RST_PIN)
|
||||
#define GLCD_RESET_HIGH() GPIO_SetBits(CONTROLLER_SPI_RST_PORT,CONTROLLER_SPI_RST_PIN)
|
||||
|
||||
#else
|
||||
#error "Controller not supported by STM32F10X"
|
||||
#endif
|
||||
|
||||
#endif /* STM32F10X_H_ */
|
||||
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
|
||||
\page AddingController Adding a new chipset
|
||||
|
||||
\page AddingController
|
||||
|
||||
Code for new controllers are stored in `devices/`. Use a descriptive name for the corresponding `.c` and `.h` file.
|
||||
|
||||
The best way to see how to do this is to view the files already in there.
|
||||
|
||||
The code in here define routines which are specific for the chipset. This does not include the Required Functions used in the deive specific code.
|
||||
|
||||
\see \ref AddingDevice
|
||||
|
||||
Code in these files must only call functions which are:
|
||||
|
||||
- those *required* functions in the `devices/*.h` files
|
||||
- within the same file as itself
|
||||
- functions declared by glcd.h
|
||||
|
||||
\see \ref DeviceRequiredFunctions
|
||||
|
||||
If you *must* do something that is compiler specfic, seperate the code using preprocessor commands that isolate the compiler in question. But try and avoid this if possible.
|
||||
|
||||
## Updating glcd.h
|
||||
|
||||
After adding your device and controller, you'll also need to edit glcd.h, and make any additions as needed. Take a look at the existing code to see what needs to be done. Devices specific such as preprocessor macros, compiler specific include statements can be added here.
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,73 @@
|
||||
/**
|
||||
|
||||
\page AddingDevice Adding a new device
|
||||
|
||||
\section AddingDevice Adding a new device
|
||||
|
||||
Before you add a device, you should make sure you have set up your controller code.
|
||||
|
||||
To add a custom device (microcontroller) implementation, you may wish to check out the source code of the existing devices for some guidance. Note that references to "device" refers to a microcontroller, not the graphics controller.
|
||||
|
||||
The device specific code is stored under:
|
||||
|
||||
devices/
|
||||
|
||||
For example, files relating to NXP LPC111x are `devices/LPC111x.c` and `devices/LPC111x.h`
|
||||
|
||||
\subsection DeviceRequiredFunctions Required functions
|
||||
|
||||
These files define behaviour which are specific to that device. Behaviour specific to a type of device should be <b>not</b> placed in any other directory other than this.
|
||||
|
||||
These files should have functions for all those declared in by `glcd_devices.h`.
|
||||
|
||||
This currently only includes, in the case of SPI operation:
|
||||
|
||||
glcd_init(void)
|
||||
glcd_reset(void)
|
||||
glcd_spi_write(uint8_t c)
|
||||
|
||||
In the case of parallel chipset operation `glcd_parallel_write(uint8_t c)` is used instead of ` glcd_spi_write(uint8_t c)`.
|
||||
|
||||
For chipsets that may not need ay of the functions above, you'll still need to define the function in your code, even if you just leave it blank.
|
||||
|
||||
The corresponding `devices/mydevice.h` should be used as well to store all required constants. Try and avoid using "magic numbers" in the code. This header file should also be used to store port and pin information for the implementation.
|
||||
|
||||
Example:
|
||||
|
||||
\code
|
||||
#define PCD8544_SPI_PORT_NUMBER 1
|
||||
#define PCD8544_MOSI_PORT LPC_GPIO2
|
||||
#define PCD8544_MOSI_PIN 3
|
||||
#define PCD8544_MISO_PORT LPC_GPIO2
|
||||
#define PCD8544_MISO_PIN 2
|
||||
#define PCD8544_SCK_PORT LPC_GPIO2
|
||||
#define PCD8544_SCK_PIN 1
|
||||
#define PCD8544_SS_PORT LPC_GPIO2
|
||||
#define PCD8544_SS_PIN 0
|
||||
#define PCD8544_DC_PORT LPC_GPIO2
|
||||
#define PCD8544_DC_PIN 4
|
||||
#define PCD8544_RST_PORT LPC_GPIO2
|
||||
#define PCD8544_RST_PIN 5
|
||||
\endcode
|
||||
|
||||
If certain code is specific to a controller and is not universal, use ifdef statements to isolate them e.g:
|
||||
|
||||
\code
|
||||
#if defined(GLCD_CONTROLLER_PCD8544)
|
||||
/* insert code */
|
||||
#else
|
||||
/* Use a meaningful error message */
|
||||
#error "Controller not supported for LPC111x"
|
||||
#endif
|
||||
\endcode
|
||||
|
||||
## Updating glcd.h
|
||||
|
||||
After adding your device and controller, you'll also need to edit glcd.h, and make any additions as needed. Take a look at the existing code to see what needs to be done. Devices specific such as preprocessor macros, compiler specific include statements can be added here.
|
||||
|
||||
## Overriding configurations
|
||||
|
||||
Coming soon.
|
||||
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,102 @@
|
||||
/**
|
||||
|
||||
\mainpage
|
||||
|
||||
\section Introduction Introduction
|
||||
|
||||
Welcome to GLCD, an open source graphic LCD library written by Andy Gock.
|
||||
|
||||
Author's web site: http://agock.com/
|
||||
|
||||
GitHub repository: https://github.com/andygock/glcd
|
||||
|
||||
This library has been written cleanly, to allow easy modification for use with different microcontroller devices and controller chipsets. Logic relating to devices and controllers are palced in seperate files and specific implementations can be chosen by the use of special defined symbols.
|
||||
|
||||
It is suitable for monochrome (black and white) LCDs with page by page data and command write style data transfer protocol. It is not suitable for color graphic LCDs.
|
||||
|
||||
\section SupportedLCDChipsets Supported LCD Chipsets
|
||||
|
||||
Current supported LCD controllers / chipsets:
|
||||
|
||||
- PCD8544 based LCDs, e.g Nokia 3110 and 5110 LCDs
|
||||
- ST7565R serial interface (used in Newhaven Display NHD-C12864WC-FSW-FBW-3V3-M)
|
||||
- NT75451 parallel interface (used on NGX BlueBoards)
|
||||
|
||||
The following Newhaven displays have been physically tested with and confirmed working:
|
||||
|
||||
- NHD-C12864WC-FSW-FBW-3V3-M
|
||||
- NHD-C12864A1Z-FSW-FBW-HTT
|
||||
- NHD-C12832A1Z-FSW-FBW-3V3
|
||||
|
||||
\section SupportedMicrocontrollers Supported Microcontrollers
|
||||
|
||||
Current supported devices / microcontrollers:
|
||||
|
||||
- Atmel AVR 8-bit
|
||||
- NXP LPC111x ARM Cortex
|
||||
- NXP LPC11Uxx ARM Cortex
|
||||
- ST STM32F0XX Arm Cortex
|
||||
- Microchip PIC24H
|
||||
|
||||
\section CompilerSetup Compiler Setup
|
||||
|
||||
The following symbols need to be set for the compiler used:
|
||||
|
||||
Pick microcontroller type (pick one only):
|
||||
|
||||
GLCD_DEVICE_LPX111X
|
||||
GLCD_DEVICE_LPX11UXX
|
||||
GLCD_DEVICE_AVR8
|
||||
GLCD_DEVICE_STM32F0XX
|
||||
GLCD_DEVICE_PIC24H
|
||||
|
||||
Pick LCD controller type (pick one only):
|
||||
|
||||
GLCD_CONTROLLER_PCD8544
|
||||
GLCD_CONTROLLER_ST7565R
|
||||
GLCD_CONTROLLER_NT75451
|
||||
|
||||
If using a parallel interface LCD (e.g NT75451 on NGX BlueBoard):
|
||||
|
||||
GLCD_USE_PARALLEL
|
||||
|
||||
When using SPI controllers:
|
||||
|
||||
GLCD_USE_SPI
|
||||
|
||||
Note the SPI symbol isn't checked by the compiler, and it is fine if it is not used.
|
||||
It is for forward compatibility only.
|
||||
|
||||
For the Newhaven displays using ST7565 based controllers listed above which have been tested as working, there
|
||||
are certain initialisation sequences which should be followed, and this may vary
|
||||
from display to display. To force a certain (and tested) initialisation
|
||||
sequence, define one of the following:
|
||||
|
||||
GLCD_INIT_NHD_C12832A1Z_FSW_FBW_3V3
|
||||
GLCD_INIT_NHD_C12864A1Z_FSW_FBW_HTT
|
||||
GLCD_INIT_NHD_C12864WC_FSW_FBW_3V3_M
|
||||
|
||||
If you don't specify a NHD model, ST7565 controller selection will default to `GLCD_INIT_NHD_C12864WC_FSW_FBW_3V3_M` sequence.
|
||||
This however may change in the future.
|
||||
|
||||
These symbols above need to be set in the configuration options of your IDE, usually
|
||||
in the "defined symbols" section, or they can be defined in a makefile
|
||||
as -D options.
|
||||
|
||||
e.g `-DGLCD_DEVICE_LPC111X`
|
||||
|
||||
Also, we need to set the width and height of the LCD in glcd.h
|
||||
|
||||
\section CustomFonts Custom Fonts
|
||||
|
||||
Custom fonts can be generated using the free MikroElektronika GLCD Font Creator tool. The standard 5x7 tiny text font is included together with also a few extra custom fonts to get you started.
|
||||
|
||||
http://www.mikroe.com/eng/products/view/683/glcd-font-creator/
|
||||
|
||||
There is a [tutorial on my web site](http://agock.com/2012/07/making-custom-fonts-for-glcd-library/) on how to use this software.
|
||||
|
||||
I also have been in the progress of working on a dedicated piece of software for generating fonts and bitmaps called [glcd-utils](https://github.com/andygock/glcd-utils). This is not very active at the moment, and is written in Qt Creator. This is set up specifically for glcd and works a lot better. However it is not documented and not really fit for public distribution at the moment.
|
||||
|
||||
https://github.com/andygock/glcd-utils
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Bebas_Neue18x36_Numberes.h
|
||||
*
|
||||
* Created: 30/03/2012 1:54:32 AM
|
||||
* Author: andy
|
||||
*/
|
||||
|
||||
|
||||
#ifndef BEBAS_NEUE18X36_NUMBERS_H_
|
||||
#define BEBAS_NEUE18X36_NUMBERS_H_
|
||||
|
||||
|
||||
//WARNING: This Font Require X-GLCD Lib.
|
||||
// You can not use it with MikroE GLCD Lib.
|
||||
|
||||
//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
|
||||
//MikroElektronika 2011
|
||||
//http://www.mikroe.com
|
||||
|
||||
//GLCD FontName : Bebas_Neue18x36
|
||||
//GLCD FontSize : 18 x 36
|
||||
|
||||
static const char Bebas_Neue18x36_Numbers[] PROGMEM = {
|
||||
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char .
|
||||
0x12, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0x00, 0xFC, 0x07, 0x00, 0x00, 0x00, 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0x01, 0x00, 0x00, 0xF8, 0x3F, 0x00, 0x00, 0x00, 0xFF, 0x0F, 0x00, 0x00, 0xE0, 0xFF, 0x01, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x00, 0x00, 0xFF, 0x0F, 0x00, 0x00, 0xC0, 0xFF, 0x01, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x00, 0x00, 0xFE, 0x0F, 0x00, 0x00, 0x00, 0xFE, 0x03, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, // Code for char /
|
||||
0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x7F, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0x01, 0xFC, 0xFF, 0xFF, 0xFF, 0x03, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0x3F, 0x00, 0x00, 0xC0, 0x0F, 0x1F, 0x00, 0x00, 0x80, 0x0F, 0x1F, 0x00, 0x00, 0x80, 0x0F, 0x1F, 0x00, 0x00, 0x80, 0x0F, 0x3F, 0x00, 0x00, 0xC0, 0x0F, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0xFF, 0x03, 0xF8, 0xFF, 0xFF, 0xFF, 0x01, 0xE0, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 0
|
||||
0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0x00, 0xF0, 0x01, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 1
|
||||
0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x0F, 0x00, 0xF0, 0x07, 0xF8, 0x0F, 0x00, 0xFE, 0x07, 0xFC, 0x0F, 0x00, 0xFF, 0x07, 0xFE, 0x0F, 0xC0, 0xFF, 0x07, 0xFE, 0x0F, 0xE0, 0xFF, 0x07, 0x3E, 0x00, 0xF0, 0xCF, 0x07, 0x1F, 0x00, 0xF8, 0xC3, 0x07, 0x1F, 0x00, 0xFE, 0xC1, 0x07, 0x1F, 0x00, 0x7F, 0xC0, 0x07, 0x1F, 0x80, 0x3F, 0xC0, 0x07, 0x3F, 0xF0, 0x1F, 0xC0, 0x07, 0xFE, 0xFF, 0x0F, 0xC0, 0x07, 0xFE, 0xFF, 0x03, 0xC0, 0x07, 0xFC, 0xFF, 0x01, 0xC0, 0x07, 0xF8, 0x7F, 0x00, 0xC0, 0x07, 0xE0, 0x0F, 0x00, 0x00, 0x00, // Code for char 2
|
||||
0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x7F, 0x00, 0xF8, 0x07, 0x00, 0xFF, 0x01, 0xFC, 0x07, 0x00, 0xFF, 0x03, 0xFE, 0x07, 0x00, 0xFF, 0x07, 0xFE, 0x07, 0x00, 0xFF, 0x07, 0x3F, 0x80, 0x0F, 0xC0, 0x0F, 0x1F, 0x80, 0x0F, 0x80, 0x0F, 0x1F, 0x80, 0x0F, 0x80, 0x0F, 0x1F, 0x80, 0x0F, 0x80, 0x0F, 0x3F, 0xC0, 0x1F, 0xC0, 0x0F, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFD, 0xFF, 0x03, 0xF8, 0xFF, 0xF8, 0xFF, 0x01, 0xE0, 0x1F, 0xC0, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 3
|
||||
0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1F, 0x00, 0x00, 0x00, 0xF0, 0x1F, 0x00, 0x00, 0x00, 0xFC, 0x1F, 0x00, 0x00, 0x00, 0xFF, 0x1F, 0x00, 0x00, 0xE0, 0xFF, 0x1F, 0x00, 0x00, 0xF8, 0x3F, 0x1F, 0x00, 0x00, 0xFF, 0x0F, 0x1F, 0x00, 0xC0, 0xFF, 0x03, 0x1F, 0x00, 0xF0, 0x7F, 0x00, 0x1F, 0x00, 0xFE, 0x1F, 0x00, 0x1F, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, // Code for char 4
|
||||
0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x1F, 0x7E, 0x00, 0xFE, 0xFF, 0x1F, 0xFE, 0x01, 0xFE, 0xFF, 0x1F, 0xFE, 0x03, 0xFE, 0xFF, 0x1F, 0xFE, 0x07, 0xFE, 0xFF, 0x1F, 0xFE, 0x07, 0xFE, 0xC7, 0x03, 0xC0, 0x0F, 0x3E, 0xE0, 0x01, 0x80, 0x0F, 0x3E, 0xE0, 0x01, 0x80, 0x0F, 0x3E, 0xF0, 0x01, 0x80, 0x0F, 0x3E, 0xF0, 0x03, 0xC0, 0x0F, 0x3E, 0xF0, 0xFF, 0xFF, 0x07, 0x3E, 0xE0, 0xFF, 0xFF, 0x07, 0x3E, 0xE0, 0xFF, 0xFF, 0x03, 0x3E, 0xC0, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 5
|
||||
0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x7F, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0x01, 0xFC, 0xFF, 0xFF, 0xFF, 0x03, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0x3E, 0x80, 0x07, 0xC0, 0x0F, 0x1F, 0xC0, 0x03, 0x80, 0x0F, 0x1F, 0xC0, 0x03, 0x80, 0x0F, 0x1F, 0xE0, 0x03, 0x80, 0x0F, 0x3F, 0xE0, 0x07, 0xC0, 0x0F, 0x3E, 0xE0, 0xFF, 0xFF, 0x07, 0xFE, 0xC3, 0xFF, 0xFF, 0x07, 0xFE, 0xC3, 0xFF, 0xFF, 0x03, 0xFC, 0x83, 0xFF, 0xFF, 0x01, 0xF8, 0x03, 0xFE, 0x7F, 0x00, 0xC0, 0x03, 0x00, 0x00, 0x00, // Code for char 6
|
||||
0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x06, 0x3E, 0x00, 0x00, 0xE0, 0x07, 0x3E, 0x00, 0x00, 0xFE, 0x07, 0x3E, 0x00, 0xE0, 0xFF, 0x07, 0x3E, 0x00, 0xFC, 0xFF, 0x07, 0x3E, 0xC0, 0xFF, 0xFF, 0x03, 0x3E, 0xFC, 0xFF, 0x3F, 0x00, 0xFE, 0xFF, 0xFF, 0x03, 0x00, 0xFE, 0xFF, 0x3F, 0x00, 0x00, 0xFE, 0xFF, 0x07, 0x00, 0x00, 0xFE, 0x7F, 0x00, 0x00, 0x00, 0xFE, 0x07, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, // Code for char 7
|
||||
0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x1F, 0xC0, 0x3F, 0x00, 0xF8, 0x7F, 0xF8, 0xFF, 0x01, 0xFC, 0xFF, 0xFD, 0xFF, 0x03, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0x7E, 0xC0, 0x3F, 0xC0, 0x07, 0x1F, 0x80, 0x0F, 0x80, 0x0F, 0x1F, 0x80, 0x0F, 0x80, 0x0F, 0x1F, 0x80, 0x0F, 0x80, 0x0F, 0x1F, 0x80, 0x0F, 0x80, 0x0F, 0x1F, 0x80, 0x0F, 0x80, 0x0F, 0x7E, 0xC0, 0x3F, 0xE0, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFD, 0xFF, 0x03, 0xF8, 0x7F, 0xF8, 0xFF, 0x01, 0xC0, 0x1F, 0xC0, 0x3F, 0x00, // Code for char 8
|
||||
0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 0xE0, 0xFF, 0x07, 0xFC, 0x01, 0xF8, 0xFF, 0x1F, 0xFC, 0x03, 0xFC, 0xFF, 0x3F, 0xFC, 0x07, 0xFE, 0xFF, 0x3F, 0xFC, 0x07, 0xFE, 0xFF, 0x7F, 0xC0, 0x07, 0x3F, 0x00, 0x7E, 0xC0, 0x0F, 0x1F, 0x00, 0x7C, 0x80, 0x0F, 0x1F, 0x00, 0x3C, 0x80, 0x0F, 0x1F, 0x00, 0x3C, 0x80, 0x0F, 0x3F, 0x00, 0x1E, 0xC0, 0x0F, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0xFF, 0x03, 0xF8, 0xFF, 0xFF, 0xFF, 0x01, 0xE0, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // Code for char 9
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* BEBAS_NEUE18X36_NUMBERES_H_ */
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Bebas_Neue20x36_Numbers.h
|
||||
*
|
||||
* Created: 30/03/2012 1:51:48 AM
|
||||
* Author: andy
|
||||
*/
|
||||
|
||||
|
||||
#ifndef BEBAS_NEUE20X36_BOLD_NUMBERS_H_
|
||||
#define BEBAS_NEUE20X36_BOLD_NUMBERS_H_
|
||||
|
||||
|
||||
//WARNING: This Font Require X-GLCD Lib.
|
||||
// You can not use it with MikroE GLCD Lib.
|
||||
|
||||
//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
|
||||
//MikroElektronika 2011
|
||||
//http://www.mikroe.com
|
||||
|
||||
//GLCD FontName : Bebas_Neue20x36
|
||||
//GLCD FontSize : 20 x 36
|
||||
|
||||
static const char Bebas_Neue20x36_Bold_Numbers[] PROGMEM = {
|
||||
0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char .
|
||||
0x14, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0x00, 0xFC, 0x07, 0x00, 0x00, 0x00, 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0x07, 0x00, 0x00, 0xF8, 0xFF, 0x07, 0x00, 0x00, 0xFF, 0xFF, 0x01, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0xF8, 0xFF, 0x0F, 0x00, 0x00, 0xFF, 0xFF, 0x01, 0x00, 0xC0, 0xFF, 0x7F, 0x00, 0x00, 0xF8, 0xFF, 0x0F, 0x00, 0x00, 0xFE, 0xFF, 0x01, 0x00, 0x00, 0xFE, 0x7F, 0x00, 0x00, 0x00, 0xFE, 0x0F, 0x00, 0x00, 0x00, 0xFE, 0x03, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, // Code for char /
|
||||
0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x7F, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0x01, 0xFC, 0xFF, 0xFF, 0xFF, 0x03, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x3F, 0x00, 0x00, 0xC0, 0x0F, 0x1F, 0x00, 0x00, 0x80, 0x0F, 0x3F, 0x00, 0x00, 0xC0, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0xFF, 0x03, 0xF8, 0xFF, 0xFF, 0xFF, 0x01, 0xE0, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 0
|
||||
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0x00, 0xF0, 0x01, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 1
|
||||
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x0F, 0x00, 0xF0, 0x07, 0xF8, 0x0F, 0x00, 0xFE, 0x07, 0xFC, 0x0F, 0x00, 0xFF, 0x07, 0xFE, 0x0F, 0xC0, 0xFF, 0x07, 0xFE, 0x0F, 0xE0, 0xFF, 0x07, 0xFE, 0x0F, 0xF0, 0xFF, 0x07, 0xFF, 0x0F, 0xF8, 0xFF, 0x07, 0x3F, 0x00, 0xFE, 0xCF, 0x07, 0x1F, 0x00, 0xFF, 0xC3, 0x07, 0x1F, 0x80, 0xFF, 0xC1, 0x07, 0x3F, 0xF0, 0x7F, 0xC0, 0x07, 0xFF, 0xFF, 0x3F, 0xC0, 0x07, 0xFF, 0xFF, 0x1F, 0xC0, 0x07, 0xFE, 0xFF, 0x0F, 0xC0, 0x07, 0xFE, 0xFF, 0x03, 0xC0, 0x07, 0xFC, 0xFF, 0x01, 0xC0, 0x07, 0xF8, 0x7F, 0x00, 0xC0, 0x07, 0xE0, 0x0F, 0x00, 0x00, 0x00, // Code for char 2
|
||||
0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x7F, 0x00, 0xF8, 0x07, 0x00, 0xFF, 0x01, 0xFC, 0x07, 0x00, 0xFF, 0x03, 0xFE, 0x07, 0x00, 0xFF, 0x07, 0xFE, 0x07, 0x00, 0xFF, 0x07, 0xFF, 0x87, 0x0F, 0xFF, 0x0F, 0xFF, 0x87, 0x0F, 0xFF, 0x0F, 0x3F, 0x80, 0x0F, 0xC0, 0x0F, 0x1F, 0x80, 0x0F, 0x80, 0x0F, 0x3F, 0xC0, 0x1F, 0xC0, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFD, 0xFF, 0x03, 0xF8, 0xFF, 0xF8, 0xFF, 0x01, 0xE0, 0x1F, 0xC0, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 3
|
||||
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1F, 0x00, 0x00, 0x00, 0xF0, 0x1F, 0x00, 0x00, 0x00, 0xFC, 0x1F, 0x00, 0x00, 0x00, 0xFF, 0x1F, 0x00, 0x00, 0xE0, 0xFF, 0x1F, 0x00, 0x00, 0xF8, 0xFF, 0x1F, 0x00, 0x00, 0xFF, 0xFF, 0x1F, 0x00, 0xC0, 0xFF, 0x3F, 0x1F, 0x00, 0xF0, 0xFF, 0x0F, 0x1F, 0x00, 0xFE, 0xFF, 0x03, 0x1F, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, // Code for char 4
|
||||
0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x1F, 0x7E, 0x00, 0xFE, 0xFF, 0x1F, 0xFE, 0x01, 0xFE, 0xFF, 0x1F, 0xFE, 0x03, 0xFE, 0xFF, 0x1F, 0xFE, 0x07, 0xFE, 0xFF, 0x1F, 0xFE, 0x07, 0xFE, 0xFF, 0x1F, 0xFE, 0x0F, 0xFE, 0xFF, 0x1F, 0xFE, 0x0F, 0xFE, 0xE7, 0x03, 0xC0, 0x0F, 0x3E, 0xF0, 0x01, 0x80, 0x0F, 0x3E, 0xF0, 0x03, 0xC0, 0x0F, 0x3E, 0xF0, 0xFF, 0xFF, 0x0F, 0x3E, 0xF0, 0xFF, 0xFF, 0x0F, 0x3E, 0xF0, 0xFF, 0xFF, 0x07, 0x3E, 0xE0, 0xFF, 0xFF, 0x07, 0x3E, 0xE0, 0xFF, 0xFF, 0x03, 0x3E, 0xC0, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 5
|
||||
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x7F, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0x01, 0xFC, 0xFF, 0xFF, 0xFF, 0x03, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x3F, 0xC0, 0x07, 0xC0, 0x0F, 0x1F, 0xE0, 0x03, 0x80, 0x0F, 0x3F, 0xE0, 0x07, 0xC0, 0x0F, 0x3F, 0xE0, 0xFF, 0xFF, 0x0F, 0xFF, 0xE3, 0xFF, 0xFF, 0x0F, 0xFE, 0xE3, 0xFF, 0xFF, 0x07, 0xFE, 0xC3, 0xFF, 0xFF, 0x07, 0xFE, 0xC3, 0xFF, 0xFF, 0x03, 0xFC, 0x83, 0xFF, 0xFF, 0x01, 0xF8, 0x03, 0xFE, 0x7F, 0x00, 0xC0, 0x03, 0x00, 0x00, 0x00, // Code for char 6
|
||||
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x06, 0x3E, 0x00, 0x00, 0xE0, 0x07, 0x3E, 0x00, 0x00, 0xFE, 0x07, 0x3E, 0x00, 0xE0, 0xFF, 0x07, 0x3E, 0x00, 0xFC, 0xFF, 0x07, 0x3E, 0xC0, 0xFF, 0xFF, 0x07, 0x3E, 0xFC, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x03, 0xFE, 0xFF, 0xFF, 0x3F, 0x00, 0xFE, 0xFF, 0xFF, 0x03, 0x00, 0xFE, 0xFF, 0x3F, 0x00, 0x00, 0xFE, 0xFF, 0x07, 0x00, 0x00, 0xFE, 0x7F, 0x00, 0x00, 0x00, 0xFE, 0x07, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, // Code for char 7
|
||||
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x1F, 0xC0, 0x3F, 0x00, 0xF8, 0x7F, 0xF8, 0xFF, 0x01, 0xFC, 0xFF, 0xFD, 0xFF, 0x03, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x7F, 0xC0, 0x3F, 0xC0, 0x0F, 0x1F, 0x80, 0x0F, 0x80, 0x0F, 0x1F, 0x80, 0x0F, 0x80, 0x0F, 0x1F, 0x80, 0x0F, 0x80, 0x0F, 0x7F, 0xC0, 0x3F, 0xE0, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFD, 0xFF, 0x03, 0xF8, 0x7F, 0xF8, 0xFF, 0x01, 0xC0, 0x1F, 0xC0, 0x3F, 0x00, // Code for char 8
|
||||
0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 0xE0, 0xFF, 0x07, 0xFC, 0x01, 0xF8, 0xFF, 0x1F, 0xFC, 0x03, 0xFC, 0xFF, 0x3F, 0xFC, 0x07, 0xFE, 0xFF, 0x3F, 0xFC, 0x07, 0xFE, 0xFF, 0x7F, 0xFC, 0x07, 0xFF, 0xFF, 0x7F, 0xFC, 0x0F, 0xFF, 0xFF, 0x7F, 0xC0, 0x0F, 0x3F, 0x00, 0x7E, 0xC0, 0x0F, 0x1F, 0x00, 0x7C, 0x80, 0x0F, 0x3F, 0x00, 0x3E, 0xC0, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0xFF, 0x03, 0xF8, 0xFF, 0xFF, 0xFF, 0x01, 0xE0, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // Code for char 9
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* BEBAS_NEUE20X36_NUMBERS_H_ */
|
||||
@@ -0,0 +1,19 @@
|
||||
#ifndef Earthbound_12x19_48to57_H
|
||||
#define Earthbound_12x19_48to57_H
|
||||
|
||||
// Size: 12x19
|
||||
// Chars: 48 to 57
|
||||
const char font_Earthbound_12x19_48to57[] PROGMEM = {
|
||||
0x00, 0xe0, 0xf0, 0x38, 0x0c, 0x0c, 0x0c, 0x0c, 0x38, 0xf8, 0xc0, 0x00, 0x00, 0x1f, 0x7f, 0xe0, 0x80, 0x80, 0x80, 0x80, 0xe0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, // Char '0'
|
||||
0x00, 0x10, 0x18, 0x18, 0xfc, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Char '1'
|
||||
0x00, 0x08, 0x1c, 0x0c, 0x0c, 0x0c, 0x0c, 0x8c, 0xf8, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0xf8, 0x9c, 0x8c, 0x86, 0x86, 0x83, 0x83, 0x80, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, // Char '2'
|
||||
0x00, 0x08, 0x1c, 0x0c, 0x0c, 0x0c, 0x0c, 0x8c, 0xf8, 0xf0, 0x00, 0x00, 0x00, 0x80, 0xc0, 0x80, 0x81, 0x83, 0x83, 0xc7, 0xff, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, // Char '3'
|
||||
0x00, 0x00, 0x00, 0x80, 0xc0, 0x70, 0x38, 0xfc, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x1e, 0x1b, 0x11, 0x18, 0x10, 0xff, 0xff, 0x10, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, // Char '4'
|
||||
0x00, 0x00, 0xf4, 0xfc, 0x1c, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc3, 0x83, 0x83, 0x83, 0x83, 0xc7, 0xfe, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, // Char '5'
|
||||
0x00, 0xc0, 0xf0, 0x78, 0x1c, 0x0c, 0x0c, 0x0c, 0x08, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xc3, 0x83, 0x83, 0x83, 0xc3, 0xfe, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, // Char '6'
|
||||
0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x8c, 0xcc, 0x7c, 0x3c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x80, 0xf0, 0x7c, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Char '7'
|
||||
0x00, 0xf0, 0xf8, 0x1c, 0x0c, 0x0c, 0x0c, 0x0c, 0xf8, 0xf0, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x8f, 0x07, 0x06, 0x06, 0x8f, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, // Char '8'
|
||||
0x00, 0xf0, 0xf8, 0x1c, 0x0c, 0x0c, 0x0c, 0x1c, 0xf8, 0xe0, 0x00, 0x00, 0x00, 0x01, 0x87, 0x8e, 0x8c, 0x8c, 0x8c, 0xee, 0x7f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 // Char '9'
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Liberation_Sans11x14_Numbers.h
|
||||
*
|
||||
* Created: 30/03/2012 1:31:10 AM
|
||||
* Author: andy
|
||||
*/
|
||||
|
||||
|
||||
#ifndef LIBERATION_SANS11X14_NUMBERS_H_
|
||||
#define LIBERATION_SANS11X14_NUMBERS_H_
|
||||
|
||||
|
||||
//WARNING: This Font Require X-GLCD Lib.
|
||||
// You can not use it with MikroE GLCD Lib.
|
||||
|
||||
//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
|
||||
//MikroElektronika 2011
|
||||
//http://www.mikroe.com
|
||||
|
||||
//GLCD FontName : Liberation_Sans11x14 46 to 57
|
||||
//GLCD FontSize : 11 x 14
|
||||
|
||||
static const char Liberation_Sans11x14_Numbers[] PROGMEM = {
|
||||
0x04, 0x00, 0x00, 0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char .
|
||||
0x05, 0x00, 0x38, 0x80, 0x3F, 0xFC, 0x0F, 0xFF, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char /
|
||||
0x0A, 0x00, 0x00, 0xF0, 0x07, 0xFC, 0x1F, 0xFE, 0x3F, 0x0E, 0x38, 0x06, 0x30, 0x0E, 0x38, 0xFE, 0x3F, 0xFC, 0x1F, 0xF0, 0x07, 0x00, 0x00, // Code for char 0
|
||||
0x0B, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x0C, 0x30, 0x0E, 0x30, 0xFE, 0x3F, 0xFE, 0x3F, 0xFE, 0x3F, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, // Code for char 1
|
||||
0x0A, 0x00, 0x00, 0x18, 0x38, 0x1C, 0x3C, 0x1E, 0x3E, 0x06, 0x37, 0x86, 0x33, 0xC6, 0x31, 0xFE, 0x31, 0xFC, 0x30, 0x78, 0x30, 0x00, 0x00, // Code for char 2
|
||||
0x0A, 0x00, 0x00, 0x18, 0x0C, 0x1C, 0x1C, 0x1E, 0x3C, 0xC6, 0x30, 0xC6, 0x30, 0xC6, 0x31, 0xFE, 0x3F, 0xBC, 0x1F, 0x3C, 0x0F, 0x00, 0x00, // Code for char 3
|
||||
0x0B, 0x00, 0x00, 0x00, 0x07, 0xC0, 0x07, 0xE0, 0x06, 0x38, 0x06, 0x1E, 0x06, 0xFE, 0x3F, 0xFE, 0x3F, 0xFE, 0x3F, 0x00, 0x06, 0x00, 0x06, // Code for char 4
|
||||
0x0A, 0x00, 0x00, 0xFE, 0x0C, 0xFE, 0x1C, 0xC6, 0x3C, 0x66, 0x38, 0x66, 0x30, 0xE6, 0x38, 0xE6, 0x3F, 0xC6, 0x1F, 0x80, 0x0F, 0x00, 0x00, // Code for char 5
|
||||
0x0A, 0x00, 0x00, 0xF0, 0x07, 0xFC, 0x1F, 0xFC, 0x3F, 0x8E, 0x38, 0xC6, 0x30, 0xC6, 0x30, 0xCE, 0x3F, 0x8C, 0x1F, 0x08, 0x0F, 0x00, 0x00, // Code for char 6
|
||||
0x0A, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x38, 0x06, 0x3F, 0xC6, 0x3F, 0xE6, 0x03, 0xFE, 0x00, 0x3E, 0x00, 0x0E, 0x00, 0x00, 0x00, // Code for char 7
|
||||
0x0A, 0x00, 0x00, 0x38, 0x0F, 0xFC, 0x1F, 0xFE, 0x3F, 0xC6, 0x30, 0xC6, 0x30, 0xC6, 0x30, 0xFE, 0x3F, 0xFC, 0x1F, 0x38, 0x0F, 0x00, 0x00, // Code for char 8
|
||||
0x0A, 0x00, 0x00, 0x78, 0x08, 0xFC, 0x18, 0xFE, 0x39, 0x86, 0x31, 0x86, 0x31, 0x86, 0x38, 0xFE, 0x1F, 0xFC, 0x1F, 0xF0, 0x07, 0x00, 0x00 // Code for char 9
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* LIBERATION_SANS11X14_NUMBERS_H_ */
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Liberation_Sans15x21_Numbers.h
|
||||
*
|
||||
* Created: 30/03/2012 1:34:30 AM
|
||||
* Author: andy
|
||||
*/
|
||||
|
||||
|
||||
#ifndef LIBERATION_SANS15X21_NUMBERS_H_
|
||||
#define LIBERATION_SANS15X21_NUMBERS_H_
|
||||
|
||||
|
||||
//WARNING: This Font Require X-GLCD Lib.
|
||||
// You can not use it with MikroE GLCD Lib.
|
||||
|
||||
//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
|
||||
//MikroElektronika 2011
|
||||
//http://www.mikroe.com
|
||||
|
||||
//GLCD FontName : Liberation_Sans15x21 46 to 57
|
||||
//GLCD FontSize : 15 x 21
|
||||
|
||||
static const char Liberation_Sans15x21_Numbers[] PROGMEM = {
|
||||
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char .
|
||||
0x07, 0x00, 0x00, 0x1E, 0x00, 0xE0, 0x1F, 0x00, 0xFF, 0x1F, 0xF8, 0xFF, 0x03, 0xFF, 0x1F, 0x00, 0xFF, 0x01, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char /
|
||||
0x0E, 0x00, 0x00, 0x00, 0xC0, 0x7F, 0x00, 0xF8, 0xFF, 0x01, 0xFC, 0xFF, 0x07, 0xFC, 0xFF, 0x07, 0x3E, 0x80, 0x0F, 0x0E, 0x00, 0x0E, 0x0E, 0x00, 0x0E, 0x0E, 0x00, 0x0E, 0x1E, 0x80, 0x0F, 0xFC, 0xFF, 0x07, 0xFC, 0xFF, 0x07, 0xF8, 0xFF, 0x01, 0xC0, 0x7F, 0x00, 0x00, 0x00, 0x00, // Code for char 0
|
||||
0x0E, 0x00, 0x00, 0x00, 0x70, 0x00, 0x0E, 0x38, 0x00, 0x0E, 0x38, 0x00, 0x0E, 0x1C, 0x00, 0x0E, 0x0E, 0x00, 0x0E, 0xFE, 0xFF, 0x0F, 0xFE, 0xFF, 0x0F, 0xFE, 0xFF, 0x0F, 0xFE, 0xFF, 0x0F, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, // Code for char 1
|
||||
0x0E, 0x00, 0x00, 0x00, 0x60, 0x00, 0x0F, 0x78, 0x80, 0x0F, 0x7C, 0xC0, 0x0F, 0x7C, 0xE0, 0x0F, 0x1E, 0xF0, 0x0F, 0x0E, 0xF8, 0x0E, 0x0E, 0x7C, 0x0E, 0x0E, 0x3E, 0x0E, 0x1E, 0x1F, 0x0E, 0xFE, 0x0F, 0x0E, 0xFC, 0x07, 0x0E, 0xF8, 0x03, 0x0E, 0xF0, 0x01, 0x0E, 0x00, 0x00, 0x00, // Code for char 2
|
||||
0x0E, 0x00, 0x00, 0x00, 0x30, 0x80, 0x01, 0x38, 0x80, 0x03, 0x3C, 0x80, 0x07, 0x3C, 0x80, 0x0F, 0x1E, 0x00, 0x0F, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x1E, 0x1F, 0x0F, 0xFE, 0xFF, 0x0F, 0xFC, 0xFB, 0x07, 0xFC, 0xF9, 0x03, 0xF0, 0xE0, 0x01, 0x00, 0x00, 0x00, // Code for char 3
|
||||
0x0F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0xF8, 0x00, 0x00, 0xFE, 0x00, 0x80, 0xEF, 0x00, 0xC0, 0xE7, 0x00, 0xF0, 0xE1, 0x00, 0x7C, 0xE0, 0x00, 0x3E, 0xE0, 0x00, 0xFE, 0xFF, 0x0F, 0xFE, 0xFF, 0x0F, 0xFE, 0xFF, 0x0F, 0xFE, 0xFF, 0x0F, 0x00, 0xE0, 0x00, 0x00, 0xE0, 0x00, // Code for char 4
|
||||
0x0E, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0xF8, 0x87, 0x03, 0xFE, 0x87, 0x07, 0xFE, 0x87, 0x0F, 0xFE, 0x07, 0x0F, 0x0E, 0x03, 0x0E, 0x8E, 0x03, 0x0E, 0x8E, 0x03, 0x0E, 0x8E, 0x07, 0x0F, 0x8E, 0xFF, 0x07, 0x0E, 0xFF, 0x07, 0x0E, 0xFE, 0x03, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x00, // Code for char 5
|
||||
0x0E, 0x00, 0x00, 0x00, 0xC0, 0x7F, 0x00, 0xF0, 0xFF, 0x01, 0xF8, 0xFF, 0x07, 0xFC, 0xFF, 0x07, 0x3E, 0x0E, 0x0F, 0x0E, 0x07, 0x0E, 0x0E, 0x07, 0x0E, 0x0E, 0x07, 0x0E, 0x1E, 0x0F, 0x0F, 0x3E, 0xFF, 0x0F, 0x3C, 0xFE, 0x07, 0x38, 0xFE, 0x03, 0x30, 0xF8, 0x01, 0x00, 0x00, 0x00, // Code for char 6
|
||||
0x0E, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x0E, 0x00, 0x0F, 0x0E, 0xE0, 0x0F, 0x0E, 0xF8, 0x0F, 0x0E, 0xFE, 0x0F, 0x8E, 0xFF, 0x00, 0xCE, 0x0F, 0x00, 0xFE, 0x03, 0x00, 0xFE, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 7
|
||||
0x0E, 0x00, 0x00, 0x00, 0xF0, 0xE0, 0x01, 0xF8, 0xFB, 0x03, 0xFC, 0xFB, 0x07, 0xFE, 0xFF, 0x0F, 0x1E, 0x1F, 0x0F, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x1E, 0x1F, 0x0F, 0xFE, 0xFF, 0x0F, 0xFC, 0xFB, 0x07, 0xFC, 0xFB, 0x03, 0xF0, 0xE0, 0x01, 0x00, 0x00, 0x00, // Code for char 8
|
||||
0x0E, 0x00, 0x00, 0x00, 0xF0, 0x83, 0x01, 0xF8, 0x87, 0x03, 0xFC, 0x8F, 0x07, 0xFE, 0x9F, 0x0F, 0x1E, 0x1E, 0x0F, 0x0E, 0x1C, 0x0E, 0x0E, 0x1C, 0x0E, 0x0E, 0x1C, 0x0E, 0x1E, 0x8E, 0x0F, 0xFC, 0xFF, 0x07, 0xFC, 0xFF, 0x03, 0xF8, 0xFF, 0x01, 0xC0, 0x7F, 0x00, 0x00, 0x00, 0x00 // Code for char 9
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* LIBERATION_SANS15X21_NUMBERS_H_ */
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Liberation_Sans17x17_Alpha.h
|
||||
*
|
||||
* Created: 30/03/2012 1:29:55 AM
|
||||
* Author: andy
|
||||
*/
|
||||
|
||||
|
||||
#ifndef LIBERATION_SANS17X17_ALPHA_H_
|
||||
#define LIBERATION_SANS17X17_ALPHA_H_
|
||||
|
||||
//WARNING: This Font Require X-GLCD Lib.
|
||||
// You can not use it with MikroE GLCD Lib.
|
||||
|
||||
//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
|
||||
//MikroElektronika 2011
|
||||
//http://www.mikroe.com
|
||||
|
||||
//GLCD FontName : Liberation_Sans17x17 46 to 90
|
||||
//GLCD FontSize : 17 x 17
|
||||
|
||||
static const char Liberation_Sans17x17_Alpha[] PROGMEM = {
|
||||
0x0D, 0x00, 0x10, 0x00, 0x00, 0x1E, 0x00, 0xC0, 0x1F, 0x00, 0xF8, 0x0F, 0x00, 0xFF, 0x03, 0x00, 0x1F, 0x03, 0x00, 0x03, 0x03, 0x00, 0x1F, 0x03, 0x00, 0xFF, 0x03, 0x00, 0xF8, 0x0F, 0x00, 0xC0, 0x1F, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char A
|
||||
0x0D, 0x00, 0x00, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0x63, 0x18, 0x00, 0x63, 0x18, 0x00, 0x63, 0x18, 0x00, 0x63, 0x18, 0x00, 0x63, 0x18, 0x00, 0xFF, 0x1C, 0x00, 0xFE, 0x1F, 0x00, 0xDE, 0x0F, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char B
|
||||
0x0D, 0x00, 0x00, 0x00, 0xF8, 0x01, 0x00, 0xFC, 0x07, 0x00, 0xFE, 0x0F, 0x00, 0x0F, 0x0E, 0x00, 0x03, 0x18, 0x00, 0x03, 0x18, 0x00, 0x03, 0x18, 0x00, 0x03, 0x18, 0x00, 0x07, 0x1C, 0x00, 0x0E, 0x0E, 0x00, 0x0E, 0x0E, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char C
|
||||
0x0D, 0x00, 0x00, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0x03, 0x18, 0x00, 0x03, 0x18, 0x00, 0x03, 0x18, 0x00, 0x03, 0x18, 0x00, 0x07, 0x1C, 0x00, 0x0E, 0x0E, 0x00, 0xFE, 0x0F, 0x00, 0xFC, 0x07, 0x00, 0xF0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char D
|
||||
0x0C, 0x00, 0x00, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0x63, 0x18, 0x00, 0x63, 0x18, 0x00, 0x63, 0x18, 0x00, 0x63, 0x18, 0x00, 0x63, 0x18, 0x00, 0x63, 0x18, 0x00, 0x63, 0x18, 0x00, 0x03, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char E
|
||||
0x0B, 0x00, 0x00, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0x63, 0x00, 0x00, 0x63, 0x00, 0x00, 0x63, 0x00, 0x00, 0x63, 0x00, 0x00, 0x63, 0x00, 0x00, 0x63, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char F
|
||||
0x0E, 0x00, 0x00, 0x00, 0xF0, 0x01, 0x00, 0xFC, 0x07, 0x00, 0xFE, 0x0F, 0x00, 0x0E, 0x0E, 0x00, 0x07, 0x1C, 0x00, 0x03, 0x18, 0x00, 0x03, 0x18, 0x00, 0xC3, 0x18, 0x00, 0xC3, 0x18, 0x00, 0xC7, 0x1C, 0x00, 0xCE, 0x0F, 0x00, 0xCE, 0x0F, 0x00, 0xC4, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char G
|
||||
0x0C, 0x00, 0x00, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0x60, 0x00, 0x00, 0x60, 0x00, 0x00, 0x60, 0x00, 0x00, 0x60, 0x00, 0x00, 0x60, 0x00, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char H
|
||||
0x04, 0x00, 0x00, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char I
|
||||
0x0A, 0x00, 0x06, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x1C, 0x00, 0x03, 0x18, 0x00, 0x03, 0x18, 0x00, 0x03, 0x1C, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x0F, 0x00, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char J
|
||||
0x0E, 0x00, 0x00, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0xE0, 0x00, 0x00, 0x60, 0x00, 0x00, 0x70, 0x00, 0x00, 0xF8, 0x01, 0x00, 0xDC, 0x03, 0x00, 0x8E, 0x07, 0x00, 0x07, 0x0E, 0x00, 0x03, 0x1C, 0x00, 0x01, 0x18, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char K
|
||||
0x0B, 0x00, 0x00, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char L
|
||||
0x10, 0x00, 0x00, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0x0F, 0x00, 0x00, 0x7E, 0x00, 0x00, 0xF0, 0x03, 0x00, 0x80, 0x1F, 0x00, 0x00, 0x1C, 0x00, 0x80, 0x1F, 0x00, 0xF0, 0x03, 0x00, 0x7E, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, // Code for char M
|
||||
0x0C, 0x00, 0x00, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0x1F, 0x00, 0x00, 0x7C, 0x00, 0x00, 0xF0, 0x01, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x1E, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char N
|
||||
0x0E, 0x00, 0x00, 0x00, 0xF0, 0x01, 0x00, 0xFC, 0x07, 0x00, 0xFE, 0x0F, 0x00, 0x0E, 0x0E, 0x00, 0x07, 0x1C, 0x00, 0x03, 0x18, 0x00, 0x03, 0x18, 0x00, 0x03, 0x18, 0x00, 0x07, 0x1C, 0x00, 0x0E, 0x0E, 0x00, 0xFE, 0x0F, 0x00, 0xFC, 0x07, 0x00, 0xF0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char O
|
||||
0x0C, 0x00, 0x00, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0x63, 0x00, 0x00, 0x63, 0x00, 0x00, 0x63, 0x00, 0x00, 0x63, 0x00, 0x00, 0x63, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char P
|
||||
0x0E, 0x00, 0x00, 0x00, 0xF0, 0x03, 0x00, 0xFC, 0x07, 0x00, 0xFE, 0x0F, 0x00, 0x0E, 0x1E, 0x00, 0x07, 0x1C, 0x00, 0x03, 0x38, 0x00, 0x03, 0xF8, 0x00, 0x03, 0xF8, 0x01, 0x07, 0xDC, 0x01, 0x0E, 0x9E, 0x01, 0xFE, 0x8F, 0x01, 0xFC, 0x87, 0x01, 0xF0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char Q
|
||||
0x0D, 0x00, 0x00, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0x63, 0x00, 0x00, 0x63, 0x00, 0x00, 0x63, 0x00, 0x00, 0xE3, 0x00, 0x00, 0xE3, 0x03, 0x00, 0xBF, 0x0F, 0x00, 0x3E, 0x1F, 0x00, 0x1C, 0x1C, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char R
|
||||
0x0C, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x1C, 0x0E, 0x00, 0x3E, 0x0E, 0x00, 0x7F, 0x1C, 0x00, 0x73, 0x18, 0x00, 0x63, 0x18, 0x00, 0xE3, 0x18, 0x00, 0xE7, 0x18, 0x00, 0xCF, 0x1F, 0x00, 0xCE, 0x0F, 0x00, 0x8C, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char S
|
||||
0x0C, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0xFF, 0x1F, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char T
|
||||
0x0C, 0x00, 0x00, 0x00, 0xFF, 0x03, 0x00, 0xFF, 0x0F, 0x00, 0xFF, 0x0F, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x1C, 0x00, 0xFF, 0x0F, 0x00, 0xFF, 0x0F, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char U
|
||||
0x0D, 0x03, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x7F, 0x00, 0x00, 0xFC, 0x01, 0x00, 0xE0, 0x07, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x18, 0x00, 0x00, 0x1F, 0x00, 0xE0, 0x0F, 0x00, 0xF8, 0x01, 0x00, 0x7F, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char V
|
||||
0x11, 0x07, 0x00, 0x00, 0x7F, 0x00, 0x00, 0xFF, 0x07, 0x00, 0xF0, 0x1F, 0x00, 0x00, 0x1E, 0x00, 0xC0, 0x1F, 0x00, 0xFC, 0x0F, 0x00, 0xFF, 0x00, 0x00, 0x07, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFC, 0x0F, 0x00, 0xC0, 0x1F, 0x00, 0x00, 0x1E, 0x00, 0xF0, 0x1F, 0x00, 0xFF, 0x07, 0x00, 0x7F, 0x00, 0x00, 0x07, 0x00, 0x00, // Code for char W
|
||||
0x0D, 0x01, 0x10, 0x00, 0x03, 0x18, 0x00, 0x07, 0x1C, 0x00, 0x1E, 0x0F, 0x00, 0xBC, 0x07, 0x00, 0xF0, 0x01, 0x00, 0xE0, 0x00, 0x00, 0xF0, 0x01, 0x00, 0xBC, 0x07, 0x00, 0x1E, 0x0F, 0x00, 0x0F, 0x1E, 0x00, 0x03, 0x18, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char X
|
||||
0x0C, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x07, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x7C, 0x00, 0x00, 0xF0, 0x1F, 0x00, 0xC0, 0x1F, 0x00, 0xF0, 0x1F, 0x00, 0x7C, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x07, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char Y
|
||||
0x0A, 0x00, 0x00, 0x00, 0x03, 0x1C, 0x00, 0x03, 0x1E, 0x00, 0x83, 0x1F, 0x00, 0xC3, 0x1B, 0x00, 0xF3, 0x19, 0x00, 0x7B, 0x18, 0x00, 0x3F, 0x18, 0x00, 0x0F, 0x18, 0x00, 0x07, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // Code for char Z
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* LIBERATION_SANS17X17_ALPHA_H_ */
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Liberation_Sans20x28_Numbers.h
|
||||
*
|
||||
* Created: 30/03/2012 1:41:05 AM
|
||||
* Author: andy
|
||||
*/
|
||||
|
||||
|
||||
#ifndef LIBERATION_SANS20X28_NUMBERS_H_
|
||||
#define LIBERATION_SANS20X28_NUMBERS_H_
|
||||
|
||||
//WARNING: This Font Require X-GLCD Lib.
|
||||
// You can not use it with MikroE GLCD Lib.
|
||||
|
||||
//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
|
||||
//MikroElektronika 2011
|
||||
//http://www.mikroe.com
|
||||
|
||||
//GLCD FontName : Liberation_Sans20x28_Numbers
|
||||
//GLCD FontSize : 20 x 28
|
||||
|
||||
static const char Liberation_Sans20x28_Numbers[] PROGMEM = {
|
||||
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char .
|
||||
0x0A, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0xF0, 0x0F, 0x00, 0x00, 0xFF, 0x0F, 0x00, 0xF8, 0xFF, 0x0F, 0x80, 0xFF, 0xFF, 0x03, 0xFC, 0xFF, 0x3F, 0x00, 0xFF, 0xFF, 0x01, 0x00, 0xFF, 0x1F, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char /
|
||||
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x0F, 0x00, 0xC0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0xFF, 0x00, 0xF0, 0xFF, 0xFF, 0x01, 0xF8, 0xFF, 0xFF, 0x03, 0xF8, 0x01, 0xF0, 0x03, 0x7C, 0x00, 0xC0, 0x07, 0x3C, 0x00, 0x80, 0x07, 0x3C, 0x00, 0x80, 0x07, 0x3C, 0x00, 0x80, 0x07, 0x3C, 0x00, 0x80, 0x07, 0x3C, 0x00, 0x80, 0x07, 0x7C, 0x00, 0xC0, 0x07, 0xF8, 0x01, 0xF0, 0x03, 0xF8, 0xFF, 0xFF, 0x03, 0xF0, 0xFF, 0xFF, 0x01, 0xE0, 0xFF, 0xFF, 0x00, 0xC0, 0xFF, 0x3F, 0x00, 0x00, 0xFE, 0x0F, 0x00, // Code for char 0
|
||||
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x03, 0x80, 0x07, 0xE0, 0x01, 0x80, 0x07, 0xF0, 0x01, 0x80, 0x07, 0xF0, 0x00, 0x80, 0x07, 0x78, 0x00, 0x80, 0x07, 0x78, 0x00, 0x80, 0x07, 0xFC, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x80, 0x07, // Code for char 1
|
||||
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x07, 0xE0, 0x03, 0xE0, 0x07, 0xF0, 0x03, 0xF0, 0x07, 0xF0, 0x03, 0xF8, 0x07, 0xF8, 0x03, 0xFC, 0x07, 0xF8, 0x00, 0xFE, 0x07, 0x7C, 0x00, 0xBE, 0x07, 0x3C, 0x00, 0x9F, 0x07, 0x3C, 0x80, 0x8F, 0x07, 0x3C, 0x80, 0x87, 0x07, 0x3C, 0xC0, 0x87, 0x07, 0x3C, 0xE0, 0x83, 0x07, 0x7C, 0xF0, 0x81, 0x07, 0x7C, 0xF8, 0x81, 0x07, 0xF8, 0xFF, 0x80, 0x07, 0xF8, 0x7F, 0x80, 0x07, 0xF0, 0x3F, 0x80, 0x07, 0xE0, 0x1F, 0x80, 0x07, 0xC0, 0x07, 0x80, 0x07, // Code for char 2
|
||||
0x14, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x30, 0x00, 0xE0, 0x01, 0xF0, 0x00, 0xF0, 0x01, 0xF0, 0x01, 0xF8, 0x01, 0xF0, 0x03, 0xF8, 0x01, 0xF0, 0x03, 0xFC, 0x00, 0xE0, 0x03, 0x7C, 0x00, 0xC0, 0x07, 0x3C, 0xF0, 0x80, 0x07, 0x3C, 0xF0, 0x80, 0x07, 0x3C, 0xF0, 0x80, 0x07, 0x3C, 0xF0, 0x80, 0x07, 0x3C, 0xF8, 0x80, 0x07, 0x7C, 0xF8, 0xC1, 0x07, 0xF8, 0xFF, 0xE3, 0x07, 0xF8, 0xDF, 0xFF, 0x03, 0xF0, 0x9F, 0xFF, 0x03, 0xF0, 0x8F, 0xFF, 0x01, 0xC0, 0x07, 0xFF, 0x00, 0x00, 0x00, 0x7E, 0x00, // Code for char 3
|
||||
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0xC0, 0x3F, 0x00, 0x00, 0xF0, 0x3F, 0x00, 0x00, 0xF8, 0x3D, 0x00, 0x00, 0xFE, 0x3C, 0x00, 0x00, 0x3F, 0x3C, 0x00, 0xC0, 0x1F, 0x3C, 0x00, 0xE0, 0x07, 0x3C, 0x00, 0xF8, 0x03, 0x3C, 0x00, 0xFC, 0x00, 0x3C, 0x00, 0xFC, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x3C, 0x00, // Code for char 4
|
||||
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFC, 0xFF, 0xF0, 0x01, 0xFC, 0xFF, 0xF0, 0x03, 0xFC, 0xFF, 0xF0, 0x03, 0xFC, 0xFF, 0xE0, 0x07, 0x3C, 0x78, 0xC0, 0x07, 0x3C, 0x78, 0x80, 0x07, 0x3C, 0x3C, 0x80, 0x07, 0x3C, 0x3C, 0x80, 0x07, 0x3C, 0x3C, 0x80, 0x07, 0x3C, 0x3C, 0x80, 0x07, 0x3C, 0x7C, 0xC0, 0x07, 0x3C, 0xFC, 0xE0, 0x03, 0x3C, 0xF8, 0xFF, 0x03, 0x3C, 0xF8, 0xFF, 0x01, 0x3C, 0xF0, 0xFF, 0x01, 0x00, 0xE0, 0x7F, 0x00, 0x00, 0x80, 0x1F, 0x00, // Code for char 5
|
||||
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x0F, 0x00, 0x80, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0xFF, 0x00, 0xF0, 0xFF, 0xFF, 0x01, 0xF8, 0xFF, 0xFF, 0x03, 0xF8, 0xE1, 0xE1, 0x03, 0x78, 0xF0, 0xC0, 0x07, 0x3C, 0x70, 0x80, 0x07, 0x3C, 0x78, 0x80, 0x07, 0x3C, 0x78, 0x80, 0x07, 0x3C, 0x78, 0x80, 0x07, 0x7C, 0x78, 0x80, 0x07, 0xFC, 0xF8, 0xC0, 0x07, 0xF8, 0xF9, 0xE1, 0x07, 0xF8, 0xF1, 0xFF, 0x03, 0xF0, 0xF1, 0xFF, 0x03, 0xE0, 0xE0, 0xFF, 0x01, 0x80, 0xC0, 0xFF, 0x00, 0x00, 0x00, 0x3F, 0x00, // Code for char 6
|
||||
0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x3C, 0x00, 0xC0, 0x07, 0x3C, 0x00, 0xF8, 0x07, 0x3C, 0x00, 0xFF, 0x07, 0x3C, 0xC0, 0xFF, 0x07, 0x3C, 0xF0, 0xFF, 0x07, 0x3C, 0xFC, 0x3F, 0x00, 0x3C, 0xFE, 0x03, 0x00, 0xBC, 0xFF, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, 0x0F, 0x00, 0x00, 0xFC, 0x03, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 7
|
||||
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0xC0, 0x07, 0xFF, 0x00, 0xF0, 0x8F, 0xFF, 0x01, 0xF0, 0x9F, 0xFF, 0x03, 0xF8, 0xFF, 0xFF, 0x03, 0xF8, 0xFF, 0xE3, 0x07, 0x7C, 0xF8, 0xC1, 0x07, 0x3C, 0xF0, 0x80, 0x07, 0x3C, 0xF0, 0x80, 0x07, 0x3C, 0xF0, 0x80, 0x07, 0x3C, 0xF0, 0x80, 0x07, 0x3C, 0xF0, 0x80, 0x07, 0x7C, 0xF8, 0xC1, 0x07, 0xF8, 0xFF, 0xC1, 0x07, 0xF8, 0xFF, 0xFF, 0x03, 0xF8, 0x9F, 0xFF, 0x03, 0xF0, 0x8F, 0xFF, 0x01, 0xC0, 0x07, 0xFF, 0x00, 0x00, 0x00, 0x7E, 0x00, // Code for char 8
|
||||
0x14, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1F, 0x20, 0x00, 0xE0, 0x7F, 0xF0, 0x00, 0xF0, 0xFF, 0xF0, 0x01, 0xF8, 0xFF, 0xF1, 0x03, 0xF8, 0xFF, 0xF1, 0x03, 0xF8, 0xF0, 0xE3, 0x07, 0x7C, 0xE0, 0xC3, 0x07, 0x3C, 0xC0, 0x83, 0x07, 0x3C, 0xC0, 0x83, 0x07, 0x3C, 0xC0, 0x83, 0x07, 0x3C, 0xC0, 0x83, 0x07, 0x3C, 0xC0, 0xC1, 0x07, 0x7C, 0xE0, 0xC1, 0x03, 0xF8, 0xF0, 0xF0, 0x03, 0xF8, 0xFF, 0xFF, 0x01, 0xF0, 0xFF, 0xFF, 0x01, 0xE0, 0xFF, 0xFF, 0x00, 0xC0, 0xFF, 0x3F, 0x00, 0x00, 0xFE, 0x07, 0x00 // Code for char 9
|
||||
};
|
||||
|
||||
#endif /* LIBERATION_SANS20X28_NUMBERS_H_ */
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Liberation_Sans27x36_Numbers.h
|
||||
*
|
||||
* Created: 30/03/2012 1:43:14 AM
|
||||
* Author: andy
|
||||
*/
|
||||
|
||||
|
||||
#ifndef LIBERATION_SANS27X36_NUMBERS_H_
|
||||
#define LIBERATION_SANS27X36_NUMBERS_H_
|
||||
|
||||
//WARNING: This Font Require X-GLCD Lib.
|
||||
// You can not use it with MikroE GLCD Lib.
|
||||
|
||||
//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
|
||||
//MikroElektronika 2011
|
||||
//http://www.mikroe.com
|
||||
|
||||
//GLCD FontName : Liberation_Sans27x36_Numbers
|
||||
//GLCD FontSize : 27 x 36
|
||||
|
||||
static const char Liberation_Sans27x36_Numbers[] PROGMEM = {
|
||||
0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char .
|
||||
0x0D, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0xFF, 0x0F, 0x00, 0x00, 0xF8, 0xFF, 0x0F, 0x00, 0xC0, 0xFF, 0xFF, 0x0F, 0x00, 0xFC, 0xFF, 0xFF, 0x0F, 0xE0, 0xFF, 0xFF, 0x7F, 0x00, 0xFE, 0xFF, 0xFF, 0x07, 0x00, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char /
|
||||
0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0x01, 0x00, 0x00, 0xFF, 0xFF, 0x0F, 0x00, 0xC0, 0xFF, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, 0x01, 0xF8, 0xFF, 0xFF, 0xFF, 0x01, 0xF8, 0xFF, 0xFF, 0xFF, 0x03, 0xF8, 0x07, 0x00, 0xFC, 0x03, 0xFC, 0x00, 0x00, 0xE0, 0x07, 0x7C, 0x00, 0x00, 0xC0, 0x07, 0x7C, 0x00, 0x00, 0xC0, 0x07, 0x7C, 0x00, 0x00, 0xC0, 0x07, 0x7C, 0x00, 0x00, 0xC0, 0x07, 0x7C, 0x00, 0x00, 0xE0, 0x07, 0xFC, 0x00, 0x00, 0xF0, 0x07, 0xF8, 0x07, 0x00, 0xFC, 0x03, 0xF8, 0xFF, 0xFF, 0xFF, 0x03, 0xF8, 0xFF, 0xFF, 0xFF, 0x01, 0xF0, 0xFF, 0xFF, 0xFF, 0x01, 0xE0, 0xFF, 0xFF, 0xFF, 0x00, 0xC0, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0xFE, 0xFF, 0x0F, 0x00, 0x00, 0xF0, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 0
|
||||
0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0xC0, 0x07, 0x80, 0x0F, 0x00, 0xC0, 0x07, 0xC0, 0x07, 0x00, 0xC0, 0x07, 0xE0, 0x07, 0x00, 0xC0, 0x07, 0xE0, 0x03, 0x00, 0xC0, 0x07, 0xF0, 0x01, 0x00, 0xC0, 0x07, 0xF8, 0x01, 0x00, 0xC0, 0x07, 0xF8, 0x00, 0x00, 0xC0, 0x07, 0xFC, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 1
|
||||
0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0xE0, 0x07, 0x80, 0x0F, 0x00, 0xF0, 0x07, 0xE0, 0x0F, 0x00, 0xFC, 0x07, 0xF0, 0x0F, 0x00, 0xFE, 0x07, 0xF0, 0x0F, 0x00, 0xFF, 0x07, 0xF8, 0x0F, 0x80, 0xFF, 0x07, 0xF8, 0x0F, 0xC0, 0xFF, 0x07, 0xFC, 0x03, 0xE0, 0xFF, 0x07, 0xFC, 0x00, 0xF0, 0xDF, 0x07, 0x7C, 0x00, 0xF8, 0xCF, 0x07, 0x7C, 0x00, 0xFC, 0xC7, 0x07, 0x7C, 0x00, 0xFE, 0xC3, 0x07, 0x7C, 0x00, 0xFF, 0xC1, 0x07, 0xFC, 0x80, 0xFF, 0xC0, 0x07, 0xFC, 0xC1, 0x7F, 0xC0, 0x07, 0xF8, 0xFF, 0x3F, 0xC0, 0x07, 0xF8, 0xFF, 0x1F, 0xC0, 0x07, 0xF8, 0xFF, 0x0F, 0xC0, 0x07, 0xF0, 0xFF, 0x07, 0xC0, 0x07, 0xE0, 0xFF, 0x03, 0xC0, 0x07, 0xC0, 0xFF, 0x01, 0xC0, 0x07, 0x00, 0x7F, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 2
|
||||
0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x0E, 0x00, 0x3E, 0x00, 0x80, 0x0F, 0x00, 0x7E, 0x00, 0xE0, 0x0F, 0x00, 0xFE, 0x00, 0xE0, 0x0F, 0x00, 0xFE, 0x01, 0xF0, 0x0F, 0x00, 0xFE, 0x03, 0xF8, 0x0F, 0x00, 0xFE, 0x03, 0xF8, 0x0F, 0x00, 0xF8, 0x03, 0xFC, 0x03, 0x00, 0xE0, 0x07, 0xFC, 0x00, 0x1F, 0xE0, 0x07, 0x7C, 0x00, 0x1F, 0xC0, 0x07, 0x7C, 0x00, 0x1F, 0xC0, 0x07, 0x7C, 0x00, 0x1F, 0xC0, 0x07, 0x7C, 0x00, 0x1F, 0xC0, 0x07, 0xFC, 0x80, 0x3F, 0xC0, 0x07, 0xFC, 0xC1, 0x3F, 0xE0, 0x07, 0xF8, 0xFF, 0x7F, 0xF0, 0x07, 0xF8, 0xFF, 0xFB, 0xFF, 0x03, 0xF8, 0xFF, 0xFB, 0xFF, 0x03, 0xF0, 0xFF, 0xF9, 0xFF, 0x03, 0xE0, 0xFF, 0xF0, 0xFF, 0x01, 0xC0, 0x7F, 0xF0, 0xFF, 0x00, 0x00, 0x3F, 0xE0, 0x7F, 0x00, 0x00, 0x00, 0x80, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 3
|
||||
0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x0F, 0x00, 0x00, 0x00, 0xE0, 0x0F, 0x00, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0x00, 0xFC, 0x0F, 0x00, 0x00, 0x00, 0xFF, 0x0F, 0x00, 0x00, 0x80, 0xFF, 0x0F, 0x00, 0x00, 0xE0, 0x9F, 0x0F, 0x00, 0x00, 0xF0, 0x8F, 0x0F, 0x00, 0x00, 0xFC, 0x83, 0x0F, 0x00, 0x00, 0xFE, 0x81, 0x0F, 0x00, 0x80, 0x7F, 0x80, 0x0F, 0x00, 0xC0, 0x3F, 0x80, 0x0F, 0x00, 0xF0, 0x0F, 0x80, 0x0F, 0x00, 0xF8, 0x07, 0x80, 0x0F, 0x00, 0xFC, 0x01, 0x80, 0x0F, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x80, 0x0F, 0x00, 0x00, 0x00, 0x80, 0x0F, 0x00, 0x00, 0x00, 0x80, 0x0F, 0x00, 0x00, 0x00, 0x80, 0x0F, 0x00, // Code for char 4
|
||||
0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0xF0, 0x0F, 0x3C, 0x00, 0xFC, 0xFF, 0x0F, 0xFC, 0x00, 0xFC, 0xFF, 0x0F, 0xFC, 0x01, 0xFC, 0xFF, 0x0F, 0xFC, 0x01, 0xFC, 0xFF, 0x0F, 0xFC, 0x03, 0xFC, 0xFF, 0x0F, 0xFC, 0x03, 0xFC, 0xFF, 0x0F, 0xF8, 0x07, 0x7C, 0xC0, 0x07, 0xE0, 0x07, 0x7C, 0xC0, 0x03, 0xC0, 0x07, 0x7C, 0xE0, 0x03, 0xC0, 0x07, 0x7C, 0xE0, 0x03, 0xC0, 0x07, 0x7C, 0xE0, 0x03, 0xC0, 0x07, 0x7C, 0xE0, 0x03, 0xC0, 0x07, 0x7C, 0xE0, 0x07, 0xE0, 0x07, 0x7C, 0xE0, 0x07, 0xE0, 0x07, 0x7C, 0xE0, 0x1F, 0xF8, 0x03, 0x7C, 0xC0, 0xFF, 0xFF, 0x03, 0x7C, 0xC0, 0xFF, 0xFF, 0x03, 0x7C, 0x80, 0xFF, 0xFF, 0x01, 0x7C, 0x80, 0xFF, 0xFF, 0x00, 0x7C, 0x00, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 5
|
||||
0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x01, 0x00, 0x00, 0xFE, 0xFF, 0x0F, 0x00, 0x80, 0xFF, 0xFF, 0x3F, 0x00, 0xC0, 0xFF, 0xFF, 0xFF, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, 0x01, 0xF8, 0xFF, 0xFF, 0xFF, 0x03, 0xF8, 0x03, 0x1F, 0xF8, 0x03, 0xFC, 0x81, 0x0F, 0xE0, 0x07, 0xFC, 0x80, 0x07, 0xE0, 0x07, 0x7C, 0xC0, 0x07, 0xC0, 0x07, 0x7C, 0xC0, 0x07, 0xC0, 0x07, 0x7C, 0xC0, 0x07, 0xC0, 0x07, 0xFC, 0xC0, 0x07, 0xC0, 0x07, 0xFC, 0xC1, 0x0F, 0xE0, 0x07, 0xFC, 0xC3, 0x3F, 0xF8, 0x07, 0xF8, 0xC3, 0xFF, 0xFF, 0x03, 0xF8, 0x83, 0xFF, 0xFF, 0x03, 0xF0, 0x83, 0xFF, 0xFF, 0x01, 0xF0, 0x01, 0xFF, 0xFF, 0x01, 0xC0, 0x01, 0xFE, 0xFF, 0x00, 0x00, 0x01, 0xFC, 0x3F, 0x00, 0x00, 0x00, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 6
|
||||
0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0xE0, 0x07, 0x7C, 0x00, 0x00, 0xFC, 0x07, 0x7C, 0x00, 0x80, 0xFF, 0x07, 0x7C, 0x00, 0xE0, 0xFF, 0x07, 0x7C, 0x00, 0xF8, 0xFF, 0x07, 0x7C, 0x00, 0xFE, 0xFF, 0x07, 0x7C, 0x80, 0xFF, 0xFF, 0x07, 0x7C, 0xE0, 0xFF, 0x1F, 0x00, 0x7C, 0xF0, 0xFF, 0x01, 0x00, 0x7C, 0xFC, 0x3F, 0x00, 0x00, 0x7C, 0xFE, 0x0F, 0x00, 0x00, 0x7C, 0xFF, 0x03, 0x00, 0x00, 0xFC, 0xFF, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0x00, 0xFC, 0x0F, 0x00, 0x00, 0x00, 0xFC, 0x07, 0x00, 0x00, 0x00, 0xFC, 0x01, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 7
|
||||
0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x1F, 0x00, 0x80, 0x1F, 0xE0, 0x7F, 0x00, 0xC0, 0x7F, 0xF0, 0xFF, 0x00, 0xE0, 0xFF, 0xF8, 0xFF, 0x01, 0xF0, 0xFF, 0xFD, 0xFF, 0x01, 0xF8, 0xFF, 0xFD, 0xFF, 0x03, 0xF8, 0xFF, 0xFD, 0xFF, 0x03, 0xF8, 0xFF, 0x3F, 0xF0, 0x07, 0xFC, 0xE1, 0x1F, 0xE0, 0x07, 0xFC, 0xC0, 0x0F, 0xC0, 0x07, 0x7C, 0x80, 0x0F, 0xC0, 0x07, 0x7C, 0x80, 0x0F, 0xC0, 0x07, 0x7C, 0x80, 0x0F, 0xC0, 0x07, 0x7C, 0x80, 0x0F, 0xC0, 0x07, 0xFC, 0xC0, 0x0F, 0xC0, 0x07, 0xFC, 0xE1, 0x1F, 0xE0, 0x07, 0xFC, 0xFF, 0x3F, 0xF0, 0x07, 0xF8, 0xFF, 0xFD, 0xFF, 0x03, 0xF8, 0xFF, 0xFD, 0xFF, 0x03, 0xF0, 0xFF, 0xFD, 0xFF, 0x01, 0xF0, 0xFF, 0xF8, 0xFF, 0x01, 0xC0, 0x7F, 0xF8, 0xFF, 0x00, 0x80, 0x1F, 0xF0, 0x7F, 0x00, 0x00, 0x00, 0xC0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 8
|
||||
0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x80, 0xFF, 0x07, 0x18, 0x00, 0xE0, 0xFF, 0x0F, 0x78, 0x00, 0xF0, 0xFF, 0x1F, 0xF8, 0x00, 0xF0, 0xFF, 0x3F, 0xFC, 0x01, 0xF8, 0xFF, 0x3F, 0xFC, 0x03, 0xF8, 0xFF, 0x7F, 0xFC, 0x03, 0xFC, 0x83, 0x7F, 0xFC, 0x07, 0xFC, 0x00, 0x7E, 0xF0, 0x07, 0x7C, 0x00, 0x7C, 0xE0, 0x07, 0x7C, 0x00, 0x7C, 0xC0, 0x07, 0x7C, 0x00, 0x7C, 0xC0, 0x07, 0x7C, 0x00, 0x3C, 0xC0, 0x07, 0xFC, 0x00, 0x3C, 0xE0, 0x07, 0xFC, 0x00, 0x1E, 0xF0, 0x07, 0xF8, 0x03, 0x1F, 0xF8, 0x03, 0xF8, 0xFF, 0xFF, 0xFF, 0x03, 0xF0, 0xFF, 0xFF, 0xFF, 0x01, 0xF0, 0xFF, 0xFF, 0xFF, 0x00, 0xE0, 0xFF, 0xFF, 0x7F, 0x00, 0x80, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0xFE, 0xFF, 0x0F, 0x00, 0x00, 0xF0, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // Code for char 9
|
||||
};
|
||||
|
||||
#endif /* LIBERATION_SANS27X36_NUMBERS_H_ */
|
||||
118
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/fonts/font5x7.h
Normal file
118
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/fonts/font5x7.h
Normal file
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* font5x7.h
|
||||
*
|
||||
* Created: 28/03/2012 1:52:20 AM
|
||||
* Author: andy
|
||||
*/
|
||||
|
||||
// Title : Graphic LCD Font (Ascii Charaters)
|
||||
// Author : Pascal Stang
|
||||
|
||||
#ifndef FONT5X7_H_
|
||||
#define FONT5X7_H_
|
||||
|
||||
// standard ascii 5x7 font
|
||||
// defines ascii characters 0x20-0x7F (32-127)
|
||||
static const char Font5x7[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00,// (space)
|
||||
0x00, 0x00, 0x5F, 0x00, 0x00,// !
|
||||
0x00, 0x07, 0x00, 0x07, 0x00,// "
|
||||
0x14, 0x7F, 0x14, 0x7F, 0x14,// #
|
||||
0x24, 0x2A, 0x7F, 0x2A, 0x12,// $
|
||||
0x23, 0x13, 0x08, 0x64, 0x62,// %
|
||||
0x36, 0x49, 0x55, 0x22, 0x50,// &
|
||||
0x00, 0x05, 0x03, 0x00, 0x00,// '
|
||||
0x00, 0x1C, 0x22, 0x41, 0x00,// (
|
||||
0x00, 0x41, 0x22, 0x1C, 0x00,// )
|
||||
0x08, 0x2A, 0x1C, 0x2A, 0x08,// *
|
||||
0x08, 0x08, 0x3E, 0x08, 0x08,// +
|
||||
0x00, 0x50, 0x30, 0x00, 0x00,// ,
|
||||
0x08, 0x08, 0x08, 0x08, 0x08,// -
|
||||
0x00, 0x60, 0x60, 0x00, 0x00,// .
|
||||
0x20, 0x10, 0x08, 0x04, 0x02,// /
|
||||
0x3E, 0x51, 0x49, 0x45, 0x3E,// 0
|
||||
0x00, 0x42, 0x7F, 0x40, 0x00,// 1
|
||||
0x42, 0x61, 0x51, 0x49, 0x46,// 2
|
||||
0x21, 0x41, 0x45, 0x4B, 0x31,// 3
|
||||
0x18, 0x14, 0x12, 0x7F, 0x10,// 4
|
||||
0x27, 0x45, 0x45, 0x45, 0x39,// 5
|
||||
0x3C, 0x4A, 0x49, 0x49, 0x30,// 6
|
||||
0x01, 0x71, 0x09, 0x05, 0x03,// 7
|
||||
0x36, 0x49, 0x49, 0x49, 0x36,// 8
|
||||
0x06, 0x49, 0x49, 0x29, 0x1E,// 9
|
||||
0x00, 0x36, 0x36, 0x00, 0x00,// :
|
||||
0x00, 0x56, 0x36, 0x00, 0x00,// ;
|
||||
0x00, 0x08, 0x14, 0x22, 0x41,// <
|
||||
0x14, 0x14, 0x14, 0x14, 0x14,// =
|
||||
0x41, 0x22, 0x14, 0x08, 0x00,// >
|
||||
0x02, 0x01, 0x51, 0x09, 0x06,// ?
|
||||
0x32, 0x49, 0x79, 0x41, 0x3E,// @
|
||||
0x7E, 0x11, 0x11, 0x11, 0x7E,// A
|
||||
0x7F, 0x49, 0x49, 0x49, 0x36,// B
|
||||
0x3E, 0x41, 0x41, 0x41, 0x22,// C
|
||||
0x7F, 0x41, 0x41, 0x22, 0x1C,// D
|
||||
0x7F, 0x49, 0x49, 0x49, 0x41,// E
|
||||
0x7F, 0x09, 0x09, 0x01, 0x01,// F
|
||||
0x3E, 0x41, 0x41, 0x51, 0x32,// G
|
||||
0x7F, 0x08, 0x08, 0x08, 0x7F,// H
|
||||
0x00, 0x41, 0x7F, 0x41, 0x00,// I
|
||||
0x20, 0x40, 0x41, 0x3F, 0x01,// J
|
||||
0x7F, 0x08, 0x14, 0x22, 0x41,// K
|
||||
0x7F, 0x40, 0x40, 0x40, 0x40,// L
|
||||
0x7F, 0x02, 0x04, 0x02, 0x7F,// M
|
||||
0x7F, 0x04, 0x08, 0x10, 0x7F,// N
|
||||
0x3E, 0x41, 0x41, 0x41, 0x3E,// O
|
||||
0x7F, 0x09, 0x09, 0x09, 0x06,// P
|
||||
0x3E, 0x41, 0x51, 0x21, 0x5E,// Q
|
||||
0x7F, 0x09, 0x19, 0x29, 0x46,// R
|
||||
0x46, 0x49, 0x49, 0x49, 0x31,// S
|
||||
0x01, 0x01, 0x7F, 0x01, 0x01,// T
|
||||
0x3F, 0x40, 0x40, 0x40, 0x3F,// U
|
||||
0x1F, 0x20, 0x40, 0x20, 0x1F,// V
|
||||
0x7F, 0x20, 0x18, 0x20, 0x7F,// W
|
||||
0x63, 0x14, 0x08, 0x14, 0x63,// X
|
||||
0x03, 0x04, 0x78, 0x04, 0x03,// Y
|
||||
0x61, 0x51, 0x49, 0x45, 0x43,// Z
|
||||
0x00, 0x00, 0x7F, 0x41, 0x41,// [
|
||||
0x02, 0x04, 0x08, 0x10, 0x20,// "\"
|
||||
0x41, 0x41, 0x7F, 0x00, 0x00,// ]
|
||||
0x04, 0x02, 0x01, 0x02, 0x04,// ^
|
||||
0x40, 0x40, 0x40, 0x40, 0x40,// _
|
||||
0x00, 0x01, 0x02, 0x04, 0x00,// `
|
||||
0x20, 0x54, 0x54, 0x54, 0x78,// a
|
||||
0x7F, 0x48, 0x44, 0x44, 0x38,// b
|
||||
0x38, 0x44, 0x44, 0x44, 0x20,// c
|
||||
0x38, 0x44, 0x44, 0x48, 0x7F,// d
|
||||
0x38, 0x54, 0x54, 0x54, 0x18,// e
|
||||
0x08, 0x7E, 0x09, 0x01, 0x02,// f
|
||||
0x08, 0x14, 0x54, 0x54, 0x3C,// g
|
||||
0x7F, 0x08, 0x04, 0x04, 0x78,// h
|
||||
0x00, 0x44, 0x7D, 0x40, 0x00,// i
|
||||
0x20, 0x40, 0x44, 0x3D, 0x00,// j
|
||||
0x00, 0x7F, 0x10, 0x28, 0x44,// k
|
||||
0x00, 0x41, 0x7F, 0x40, 0x00,// l
|
||||
0x7C, 0x04, 0x18, 0x04, 0x78,// m
|
||||
0x7C, 0x08, 0x04, 0x04, 0x78,// n
|
||||
0x38, 0x44, 0x44, 0x44, 0x38,// o
|
||||
0x7C, 0x14, 0x14, 0x14, 0x08,// p
|
||||
0x08, 0x14, 0x14, 0x18, 0x7C,// q
|
||||
0x7C, 0x08, 0x04, 0x04, 0x08,// r
|
||||
0x48, 0x54, 0x54, 0x54, 0x20,// s
|
||||
0x04, 0x3F, 0x44, 0x40, 0x20,// t
|
||||
0x3C, 0x40, 0x40, 0x20, 0x7C,// u
|
||||
0x1C, 0x20, 0x40, 0x20, 0x1C,// v
|
||||
0x3C, 0x40, 0x30, 0x40, 0x3C,// w
|
||||
0x44, 0x28, 0x10, 0x28, 0x44,// x
|
||||
0x0C, 0x50, 0x50, 0x50, 0x3C,// y
|
||||
0x44, 0x64, 0x54, 0x4C, 0x44,// z
|
||||
0x00, 0x08, 0x36, 0x41, 0x00,// {
|
||||
0x00, 0x00, 0x7F, 0x00, 0x00,// |
|
||||
0x00, 0x41, 0x36, 0x08, 0x00,// }
|
||||
0x08, 0x08, 0x2A, 0x1C, 0x08,// ->
|
||||
0x08, 0x1C, 0x2A, 0x08, 0x08 // <-
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* FONT5X7_H_ */
|
||||
168
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/glcd.c
Normal file
168
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/glcd.c
Normal file
@@ -0,0 +1,168 @@
|
||||
/**
|
||||
\file glcd.c
|
||||
\author Andy Gock
|
||||
\brief Basic GLCD functions affecting bounding box manipulation,
|
||||
clearing of screen and buffers, and basic scroll functions.
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "glcd.h"
|
||||
|
||||
/** \addtogroup GlobalVars Global Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Screen buffer
|
||||
*
|
||||
* Requires at least one bit for every pixel (e.g 504 bytes for 48x84 LCD)
|
||||
*/
|
||||
uint8_t glcd_buffer[GLCD_LCD_WIDTH * GLCD_LCD_HEIGHT / 8];
|
||||
|
||||
/**
|
||||
* Keeps track of bounding box of area on LCD which need to be
|
||||
* updated next reresh cycle
|
||||
*/
|
||||
glcd_BoundingBox_t glcd_bbox;
|
||||
|
||||
/**
|
||||
* Pointer to screen buffer currently in use.
|
||||
*/
|
||||
uint8_t *glcd_buffer_selected;
|
||||
|
||||
/**
|
||||
* Pointer to bounding box currently in use.
|
||||
*/
|
||||
glcd_BoundingBox_t *glcd_bbox_selected;
|
||||
|
||||
/** @} */
|
||||
|
||||
void glcd_update_bbox(uint8_t xmin, uint8_t ymin, uint8_t xmax, uint8_t ymax)
|
||||
{
|
||||
/* Keep and check bounding box within limits of LCD screen dimensions */
|
||||
if (xmin > (GLCD_LCD_WIDTH-1)) {
|
||||
xmin = GLCD_LCD_WIDTH-1;
|
||||
}
|
||||
if (xmax > (GLCD_LCD_WIDTH-1)) {
|
||||
xmax = GLCD_LCD_WIDTH-1;
|
||||
}
|
||||
|
||||
if (ymin > (GLCD_LCD_HEIGHT-1)) {
|
||||
ymin = GLCD_LCD_HEIGHT-1;
|
||||
}
|
||||
if (ymax > (GLCD_LCD_HEIGHT-1)) {
|
||||
ymax = GLCD_LCD_HEIGHT-1;
|
||||
}
|
||||
|
||||
/* Update the bounding box size */
|
||||
if (xmin < glcd_bbox_selected->x_min) {
|
||||
glcd_bbox_selected->x_min = xmin;
|
||||
}
|
||||
if (xmax > glcd_bbox_selected->x_max) {
|
||||
glcd_bbox_selected->x_max = xmax;
|
||||
}
|
||||
if (ymin < glcd_bbox_selected->y_min) {
|
||||
glcd_bbox_selected->y_min = ymin;
|
||||
}
|
||||
if (ymax > glcd_bbox_selected->y_max) {
|
||||
glcd_bbox_selected->y_max = ymax;
|
||||
}
|
||||
}
|
||||
|
||||
void glcd_reset_bbox()
|
||||
{
|
||||
/* Used after physically writing to the LCD */
|
||||
glcd_bbox_selected->x_min = GLCD_LCD_WIDTH - 1;
|
||||
glcd_bbox_selected->x_max = 0;
|
||||
glcd_bbox_selected->y_min = GLCD_LCD_HEIGHT -1;
|
||||
glcd_bbox_selected->y_max = 0;
|
||||
}
|
||||
|
||||
void glcd_bbox_reset() {
|
||||
glcd_reset_bbox();
|
||||
}
|
||||
|
||||
void glcd_bbox_refresh() {
|
||||
/* Marks bounding box as entire screen, so on next glcd_write(), it writes the entire buffer to the LCD */
|
||||
glcd_bbox_selected->x_min = 0;
|
||||
glcd_bbox_selected->x_max = GLCD_LCD_WIDTH - 1;
|
||||
glcd_bbox_selected->y_min = 0;
|
||||
glcd_bbox_selected->y_max = GLCD_LCD_HEIGHT -1;
|
||||
}
|
||||
|
||||
void glcd_clear(void) {
|
||||
memset(glcd_buffer_selected, 0x00, GLCD_LCD_WIDTH * GLCD_LCD_HEIGHT / 8);
|
||||
glcd_update_bbox(0,0,GLCD_LCD_WIDTH - 1,GLCD_LCD_HEIGHT - 1);
|
||||
glcd_write();
|
||||
}
|
||||
|
||||
void glcd_clear_buffer(void) {
|
||||
memset(glcd_buffer_selected, 0x00, GLCD_LCD_WIDTH * GLCD_LCD_HEIGHT / 8);
|
||||
glcd_update_bbox(0,0,GLCD_LCD_WIDTH - 1,GLCD_LCD_HEIGHT - 1);
|
||||
}
|
||||
|
||||
void glcd_select_screen(uint8_t *buffer, glcd_BoundingBox_t *bbox)
|
||||
{
|
||||
glcd_buffer_selected = buffer;
|
||||
glcd_bbox_selected = bbox;
|
||||
}
|
||||
|
||||
void glcd_scroll(int8_t x, int8_t y)
|
||||
{
|
||||
/** \todo Skeleton */
|
||||
|
||||
uint8_t row;
|
||||
|
||||
for (row=0; row<(GLCD_LCD_HEIGHT / 8); row++) {
|
||||
uint8_t x;
|
||||
for (x=0; x<GLCD_LCD_WIDTH; x++) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void glcd_scroll_line(void)
|
||||
{
|
||||
uint8_t y;
|
||||
uint8_t number_of_rows = GLCD_LCD_HEIGHT / 8;
|
||||
for (y=0; y<number_of_rows; y++) {
|
||||
if (y < (number_of_rows - 1)) {
|
||||
/* All lines except the last */
|
||||
memcpy(glcd_buffer_selected + y*GLCD_LCD_WIDTH, glcd_buffer_selected + y*GLCD_LCD_WIDTH + GLCD_LCD_WIDTH, GLCD_LCD_WIDTH);
|
||||
} else {
|
||||
/* Last line, clear it */
|
||||
memset(glcd_buffer_selected + (number_of_rows - 1)*GLCD_LCD_WIDTH, 0x00, GLCD_LCD_WIDTH);
|
||||
}
|
||||
}
|
||||
glcd_update_bbox(0,0,GLCD_LCD_WIDTH - 1,GLCD_LCD_HEIGHT - 1);
|
||||
}
|
||||
|
||||
295
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/glcd.h
Normal file
295
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/glcd.h
Normal file
@@ -0,0 +1,295 @@
|
||||
/**
|
||||
\file glcd.h
|
||||
\brief GLCD Library main header file. This file must be included into project.
|
||||
\author Andy Gock
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _GLCD_H
|
||||
#define _GLCD_H
|
||||
|
||||
#if defined(GLCD_DEVICE_AVR8)
|
||||
#include <avr/pgmspace.h>
|
||||
#include <avr/io.h>
|
||||
#include <avr/interrupt.h>
|
||||
#include "devices/AVR8.h"
|
||||
|
||||
#if !defined(GLCD_USE_AVR_DELAY)
|
||||
extern void delay_ms(uint32_t ms);
|
||||
#else
|
||||
/* Use AVR __delay_ms() function */
|
||||
#include <util/delay.h>
|
||||
#define delay_ms(t) _delay_ms(t)
|
||||
#endif
|
||||
|
||||
#elif defined(GLCD_DEVICE_LPC111X)
|
||||
#include <LPC11xx.h>
|
||||
#include "devices/LPC111x.h"
|
||||
extern void delay_ms(uint32_t ms);
|
||||
#define PROGMEM
|
||||
|
||||
#elif defined(GLCD_DEVICE_LPC11UXX)
|
||||
#include <LPC11Uxx.h>
|
||||
#include "devices/LPC11Uxx.h"
|
||||
extern void delay_ms(uint32_t ms);
|
||||
#define PROGMEM
|
||||
|
||||
#elif defined(GLCD_DEVICE_STM32F0XX)
|
||||
#include <stm32f0xx.h>
|
||||
#include <stm32f0xx_gpio.h>
|
||||
#include "devices/inc/STM32F0xx.h"
|
||||
extern void delay_ms(uint32_t ms);
|
||||
#define PROGMEM
|
||||
|
||||
#elif defined(GLCD_DEVICE_PIC24H)
|
||||
#define FCY (FOSC/2)
|
||||
#include <stdint.h>
|
||||
#include <xc.h>
|
||||
#include <libpic30.h>
|
||||
#include "devices/PIC24H.h"
|
||||
#define PROGMEM
|
||||
#define delay_ms(t) __delay_ms(t)
|
||||
|
||||
#else
|
||||
#error "Device not supported or defined"
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(GLCD_CONTROLLER_PCD8544)
|
||||
#include "controllers/PCD8544.h"
|
||||
|
||||
#elif defined(GLCD_CONTROLLER_ST7565R)
|
||||
#include "controllers/ST7565R.h"
|
||||
|
||||
#elif defined(GLCD_CONTROLLER_NT75451)
|
||||
#include "controllers/NT75451.h"
|
||||
|
||||
#else
|
||||
#error "Controller not supported or defined"
|
||||
|
||||
#endif
|
||||
|
||||
/* Macros */
|
||||
|
||||
#define swap(a, b) { uint8_t t = a; a = b; b = t; }
|
||||
|
||||
/* Defining new types */
|
||||
|
||||
/**
|
||||
* Font table type
|
||||
*/
|
||||
typedef enum {
|
||||
STANG,
|
||||
MIKRO,
|
||||
GLCD_UTILS
|
||||
} font_table_type_t;
|
||||
|
||||
/**
|
||||
* Bounding box for pixels that need to be updated
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t x_min;
|
||||
uint8_t y_min;
|
||||
uint8_t x_max;
|
||||
uint8_t y_max;
|
||||
} glcd_BoundingBox_t;
|
||||
|
||||
#include <stdint.h>
|
||||
#include "glcd_devices.h"
|
||||
#include "glcd_controllers.h"
|
||||
#include "glcd_graphics.h"
|
||||
#include "glcd_graphs.h"
|
||||
#include "glcd_text_tiny.h"
|
||||
#include "glcd_text.h"
|
||||
#include "unit_tests.h"
|
||||
|
||||
/**
|
||||
* \name Colour Constants
|
||||
* @{
|
||||
*/
|
||||
#define BLACK 1
|
||||
#define WHITE 0
|
||||
/**@}*/
|
||||
|
||||
/**
|
||||
* \name LCD Dimensions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/*
|
||||
* Set to custom value, or leave at 0 for automatic assignment.
|
||||
* For custom dimensions, users can define this in their compiler options.
|
||||
*/
|
||||
|
||||
#if !defined(GLCD_LCD_WIDTH) || !defined(GLCD_LCD_HEIGHT)
|
||||
|
||||
/**
|
||||
* User specified GLCD width in pixels
|
||||
* Set to 0 for automatic assignment based on controller.
|
||||
*/
|
||||
#define GLCD_LCD_WIDTH 0
|
||||
|
||||
/**
|
||||
* User specified GLCD height in pixels
|
||||
* Set to 0 for automatic assignment based on controller.
|
||||
*/
|
||||
|
||||
#define GLCD_LCD_HEIGHT 0
|
||||
|
||||
/* Automatic assignment of width and height, if required. */
|
||||
#if !GLCD_LCD_WIDTH && !GLCD_LCD_HEIGHT
|
||||
#undef GLCD_LCD_WIDTH
|
||||
#undef GLCD_LCD_HEIGHT
|
||||
#if defined(GLCD_CONTROLLER_PCD8544)
|
||||
/* 84x48 is standard for the popular Nokia LCD */
|
||||
#define GLCD_LCD_WIDTH 84
|
||||
#define GLCD_LCD_HEIGHT 48
|
||||
#elif defined(GLCD_CONTROLLER_ST7565R) || defined(GLCD_CONTROLLER_NT75451)
|
||||
/* 128x64 is the most popular for this, so we'll use that as default */
|
||||
#define GLCD_LCD_WIDTH 128
|
||||
#define GLCD_LCD_HEIGHT 64
|
||||
#else
|
||||
#define GLCD_LCD_WIDTH 128
|
||||
#define GLCD_LCD_HEIGHT 64
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* !defined(GLCD_LCD_WIDTH) || !defined(GLCD_LCD_HEIGHT) */
|
||||
|
||||
/*
|
||||
* GLCD_NUMBER_OF_BANKS is typically GLCD_LCD_HEIGHT/8
|
||||
* Don't adjust these below unless required.
|
||||
*/
|
||||
#define GLCD_NUMBER_OF_BANKS (GLCD_LCD_WIDTH / 8)
|
||||
#define GLCD_NUMBER_OF_COLS GLCD_LCD_WIDTH
|
||||
|
||||
/**@}*/
|
||||
|
||||
#if !defined(GLCD_RESET_TIME)
|
||||
/** Reset duration by glcd_reset(), in milliseconds */
|
||||
#define GLCD_RESET_TIME 1
|
||||
#endif
|
||||
|
||||
/* Global variables used for GLCD library */
|
||||
extern uint8_t glcd_buffer[GLCD_LCD_WIDTH * GLCD_LCD_HEIGHT / 8];
|
||||
extern glcd_BoundingBox_t glcd_bbox;
|
||||
extern uint8_t *glcd_buffer_selected;
|
||||
extern glcd_BoundingBox_t *glcd_bbox_selected;
|
||||
|
||||
/** \name Base Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Update bounding box.
|
||||
*
|
||||
* The bounding box defines a rectangle in which needs to be refreshed next time
|
||||
* glcd_write() is called. glcd_write() only writes to those pixels inside the bounding box plus any
|
||||
* surrounding pixels which are required according to the bank/column write method of the controller.
|
||||
*
|
||||
* Define a rectangle here, and it will be <em>added</em> to the existing bounding box.
|
||||
*
|
||||
* \param xmin Minimum x value of rectangle
|
||||
* \param ymin Minimum y value of rectangle
|
||||
* \param xmax Maximum x value of rectangle
|
||||
* \param ymax Maximum y value of rectangle
|
||||
* \see glcd_bbox
|
||||
* \see glcd_bbox_selected
|
||||
*/
|
||||
void glcd_update_bbox(uint8_t xmin, uint8_t ymin, uint8_t xmax, uint8_t ymax);
|
||||
|
||||
/**
|
||||
* Reset the bounding box.
|
||||
* After resetting the bounding box, no pixels are marked as needing refreshing.
|
||||
*/
|
||||
void glcd_reset_bbox(void);
|
||||
|
||||
/**
|
||||
* Same as glcd_reset_bbox()
|
||||
*/
|
||||
void glcd_bbox_reset(void);
|
||||
|
||||
/**
|
||||
* Marks the entire display for re-writing.
|
||||
*/
|
||||
void glcd_bbox_refresh(void);
|
||||
|
||||
/**
|
||||
* Clear the display. This will clear the buffer and physically write and commit it to the LCD
|
||||
*/
|
||||
void glcd_clear(void);
|
||||
|
||||
/**
|
||||
* Clear the display buffer only. This does not physically write the changes to the LCD
|
||||
*/
|
||||
void glcd_clear_buffer(void);
|
||||
|
||||
/**
|
||||
* Select screen buffer and bounding box structure.
|
||||
* This should be selected at initialisation. There are future plans to support multiple screen buffers
|
||||
* but this not yet available.
|
||||
* \param buffer Pointer to screen buffer
|
||||
* \param bbox Pointer to bounding box object.
|
||||
* \see glcd_BoundingBox_t
|
||||
*/
|
||||
void glcd_select_screen(uint8_t *buffer, glcd_BoundingBox_t *bbox);
|
||||
|
||||
/**
|
||||
* Scroll entire screne buffer by x and y pixels. (not implemented yet)
|
||||
* \note Items scrolled off the extents of the display dimensions will be lost.
|
||||
*
|
||||
* \param x X distance to scroll
|
||||
* \param y Y distance to scroll
|
||||
*/
|
||||
void glcd_scroll(int8_t x, int8_t y);
|
||||
|
||||
/**
|
||||
* Scroll screen buffer up by 8 pixels.
|
||||
* This is designed to be used in conjunciton with tiny text functions which are 8 bits high.
|
||||
* \see Tiny Text
|
||||
*/
|
||||
void glcd_scroll_line(void);
|
||||
|
||||
/** @}*/
|
||||
|
||||
typedef struct {
|
||||
const char *font_table;
|
||||
uint8_t width;
|
||||
uint8_t height;
|
||||
char start_char;
|
||||
char end_char;
|
||||
font_table_type_t table_type;
|
||||
} glcd_FontConfig_t;
|
||||
|
||||
extern uint8_t *glcd_buffer_selected;
|
||||
extern glcd_BoundingBox_t *glcd_bbox_selected;
|
||||
extern glcd_FontConfig_t font_current;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,106 @@
|
||||
/**
|
||||
\file glcd_controllers.h
|
||||
\brief Functions specific to certain graphic LCD controllers.
|
||||
\author Andy Gock
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef GLCD_CONTROLLERS_H_
|
||||
#define GLCD_CONTROLLERS_H_
|
||||
|
||||
/**
|
||||
* \addtogroup Controllers Controllers
|
||||
* Controller specific functions.
|
||||
*
|
||||
* Currently only the following controllers are supported:
|
||||
* - PCD8544 (Nokia 5110 LCD) SPI interface
|
||||
* - ST7565R with SPI interface
|
||||
*
|
||||
* The C and header files defining these functions are stored in the subdirectory:
|
||||
*
|
||||
* devices/
|
||||
*
|
||||
* \{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Send command byte to LCD.
|
||||
* \param c Command byte to be written to LCD
|
||||
*/
|
||||
void glcd_command(uint8_t c);
|
||||
|
||||
/**
|
||||
* Send data byte to LCD.
|
||||
* \param c Data byte to be written to LCD
|
||||
*/
|
||||
void glcd_data(uint8_t c);
|
||||
|
||||
/**
|
||||
* Set contrast.
|
||||
* \param val Value from 0 to 127. This should be experimentally determined. Supported by PCD8544 only.
|
||||
*/
|
||||
void glcd_set_contrast(uint8_t val);
|
||||
|
||||
/**
|
||||
* Power down the device.
|
||||
*/
|
||||
void glcd_power_down(void);
|
||||
|
||||
/**
|
||||
* Power up the device.
|
||||
*/
|
||||
void glcd_power_up(void);
|
||||
|
||||
/**
|
||||
* Set Y address of RAM (select bank).
|
||||
* - for PCD8544, device must be under basic instruction set mode before using this.
|
||||
* \param y page address of RAM (0 <= Y < GLCD_LCD_HEIGHT/8)
|
||||
* \see GLCD_LCD_HEIGHT
|
||||
* \see GLCD_NUMBER_OF_BANKS
|
||||
*
|
||||
* \note Update: \p y is actually bank number, not pixel number!
|
||||
*/
|
||||
void glcd_set_y_address(uint8_t y);
|
||||
|
||||
/**
|
||||
* Set X address of RAM (column). Device must be under basic instruction set mode before using this.
|
||||
* \param x X address of RAM (0 <= X <= GLCD_LCD_WIDTH-1)
|
||||
* \see GLCD_LCD_WIDTH
|
||||
*/
|
||||
void glcd_set_x_address(uint8_t x);
|
||||
|
||||
/**
|
||||
* Update the display within the specified bounding box. This physically writes data to the device's RAM.
|
||||
*/
|
||||
void glcd_write(void);
|
||||
|
||||
/** @}*/
|
||||
|
||||
#endif /* GLCD_CONTROLLERS_H_ */
|
||||
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
\file glcd_devices.h
|
||||
\brief Functions specific to certain devices (microcontrollers).
|
||||
These are functions are defined in devices/yourdevice.c
|
||||
\author Andy Gock
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef GLCD_DEVICES_H_
|
||||
#define GLCD_DEVICES_H_
|
||||
|
||||
#if defined(GLCD_DEVICE_AVR8)
|
||||
#include <avr/io.h>
|
||||
#elif defined(GLCD_DEVICE_LPC111X)
|
||||
#include "LPC11xx.h"
|
||||
#elif defined(GLCD_DEVICE_LPC11UXX)
|
||||
#include "LPC11Uxx.h"
|
||||
#elif defined(GLCD_DEVICE_STM32F0XX)
|
||||
#include "STM32F0xx.h"
|
||||
#elif defined(GLCD_DEVICE_PIC24H)
|
||||
#include <stdint.h>
|
||||
#include <xc.h>
|
||||
#include <libpic30.h>
|
||||
#else
|
||||
#error "Device not supported or defined"
|
||||
#endif
|
||||
|
||||
/** \addtogroup Devices Devices
|
||||
* Functions specific to certain devices (microcontrollers)
|
||||
* \{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Initialise the LCD. This function is platform and controller specific.
|
||||
*/
|
||||
void glcd_init(void);
|
||||
|
||||
#if !defined(GLCD_USE_PARALLEL)
|
||||
|
||||
/**
|
||||
* Write a byte to the connected SPI slave.
|
||||
* \param c Byte to be written
|
||||
* \return Returned value from SPI (often not used)
|
||||
*/
|
||||
void glcd_spi_write(uint8_t c);
|
||||
|
||||
#else
|
||||
/* must be GLCD_USE_SPI */
|
||||
void glcd_parallel_write(uint8_t c);
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Reset the LCD.
|
||||
* \note Not all LCD controllers support reset.
|
||||
*/
|
||||
void glcd_reset(void);
|
||||
|
||||
/** @}*/
|
||||
|
||||
#endif /* GLCD_DEVICES_H_ */
|
||||
169
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/glcd_graphics.h
Normal file
169
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/glcd_graphics.h
Normal file
@@ -0,0 +1,169 @@
|
||||
/**
|
||||
\file glcd_graphics.h
|
||||
\brief Graphics routines
|
||||
\author Andy Gock
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef GLCD_GRAPHICS_H_
|
||||
#define GLCD_GRAPHICS_H_
|
||||
|
||||
/** \addtogroup Graphics Graphics
|
||||
* Graphics specific functions such as drawing lines, circles, rectangles etc.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Set pixel to specified colour
|
||||
* \param x X-coordinate
|
||||
* \param y Y-coordinate
|
||||
* \param color Colour to set pixel
|
||||
* \see ColourConstants
|
||||
*/
|
||||
void glcd_set_pixel(uint8_t x, uint8_t y, uint8_t color);
|
||||
|
||||
/**
|
||||
* Get state of pixel from specified location
|
||||
* \param x X-coordinate
|
||||
* \param y Y-coordinate
|
||||
* \return Colour
|
||||
*/
|
||||
uint8_t glcd_get_pixel(uint8_t x, uint8_t y);
|
||||
|
||||
/**
|
||||
* Invert state of pixel of specified location
|
||||
* \param x X-coordinate
|
||||
* \param y Y-coordinate
|
||||
*/
|
||||
void glcd_invert_pixel(uint8_t x, uint8_t y);
|
||||
|
||||
/**
|
||||
* Draw line
|
||||
* \param x0 Start x-coordinate
|
||||
* \param y0 Start y-coordinate
|
||||
* \param x1 End x-coordinate
|
||||
* \param y1 End y-coordinate
|
||||
* \param color Colour to set pixels
|
||||
* \see ColourConstants
|
||||
*/
|
||||
void glcd_draw_line(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t color);
|
||||
|
||||
/**
|
||||
* Draw rectangle and fill with colour.
|
||||
* The border of the rectangle is the same as fill colour
|
||||
* \param x Start x-coordinate (left-most)
|
||||
* \param y Start y-coordinate (top-most)
|
||||
* \param w Width
|
||||
* \param h Height
|
||||
* \param color Colour to fill with
|
||||
* \see ColourConstants
|
||||
*/
|
||||
void glcd_fill_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t color);
|
||||
|
||||
/**
|
||||
* Draw rectangle but do not fill.
|
||||
* The border of the rectangle is the same as fill colour
|
||||
* \param x Start x-coordinate (left-most)
|
||||
* \param y Start y-coordinate (top-most)
|
||||
* \param w Width
|
||||
* \param h Height
|
||||
* \param color Colour of border
|
||||
* \see ColourConstants
|
||||
*/
|
||||
void glcd_draw_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t color);
|
||||
|
||||
/**
|
||||
* Draw rectangle but do not fill. User specified thickness.
|
||||
* The border of the rectangle is the same as fill colour
|
||||
* \param x Start x-coordinate (left-most)
|
||||
* \param y Start y-coordinate (top-most)
|
||||
* \param w Width (outermost pixels)
|
||||
* \param h Height
|
||||
* \param tx Thickness of horizontal border along X axis
|
||||
* \param ty Thickness of vertical border along Y axis
|
||||
* \param color Colour of border
|
||||
* \see ColourConstants
|
||||
*/
|
||||
void glcd_draw_rect_thick(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tx, uint8_t ty, uint8_t color);
|
||||
|
||||
/**
|
||||
* Draw rectangle but do not fill. Place a shadow line on the bottom-right of the window.
|
||||
* The border of the rectangle is the same as fill colour
|
||||
* \param x Start x-coordinate (left-most)
|
||||
* \param y Start y-coordinate (top-most)
|
||||
* \param w Width
|
||||
* \param h Height
|
||||
* \param color Colour of border
|
||||
* \see ColourConstants
|
||||
*/
|
||||
void glcd_draw_rect_shadow(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t color);
|
||||
|
||||
/**
|
||||
* Draw circle but do not fill.
|
||||
* The border of the rectangle is the same as fill colour
|
||||
* \param x0 Centre x-coordinate (left-most)
|
||||
* \param y0 Centre y-coordinate (top-most)
|
||||
* \param r Radius
|
||||
* \param color Colour of border
|
||||
* \see ColourConstants
|
||||
*/
|
||||
void glcd_draw_circle(uint8_t x0, uint8_t y0, uint8_t r, uint8_t color);
|
||||
|
||||
/**
|
||||
* Draw circle and fill.
|
||||
* The border of the rectangle is the same as fill colour
|
||||
* \param x0 Centre x-coordinate (left-most)
|
||||
* \param y0 Centre y-coordinate (top-most)
|
||||
* \param r Radius
|
||||
* \param color Colour of border
|
||||
* \see ColourConstants
|
||||
*/
|
||||
void glcd_fill_circle(uint8_t x0, uint8_t y0, uint8_t r, uint8_t color);
|
||||
|
||||
/**
|
||||
* Invert pixels in a retangular area.
|
||||
* \param x Start x-coordinate (left-most)
|
||||
* \param y Start y-coordinate (top-most)
|
||||
* \param w Width
|
||||
* \param h Height
|
||||
*/
|
||||
void glcd_invert_area(uint8_t x, uint8_t y, uint8_t w, uint8_t h);
|
||||
|
||||
/**
|
||||
* Draw bitmap to screen buffer.
|
||||
* Note this will draw to the entire buffer, its not yet possible to draw partially to the LCD.
|
||||
* Not yet supported with AVR pgmspace.
|
||||
* \param data Pointer to bitmap data.
|
||||
*/
|
||||
void glcd_draw_bitmap(const unsigned char *data);
|
||||
|
||||
/** @}*/
|
||||
|
||||
#endif /* GLCD_GRAPHICS_H_ */
|
||||
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
\file glcd_graphs.h
|
||||
\brief GLCD Library - Graph drawing functions.
|
||||
\author Andy Gock
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef GLCD_GRAPHS_H
|
||||
#define GLCD_GRAPHS_H
|
||||
|
||||
/** \addtogroup Graphing
|
||||
* Functions for graphing, e.g drawing bar graphs etc.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** Draw horizontal bar graph with 1 px wide border.
|
||||
* The bar graph draws from left to right as val increases.
|
||||
* \param x x location for top-left of border
|
||||
* \param y y location for top-left of border
|
||||
* \param width width of the border
|
||||
* \param height height of the border (must be over 2)
|
||||
* \param val value to display in graph (0-255 8 bit value).
|
||||
*/
|
||||
void glcd_bar_graph_horizontal(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t val);
|
||||
|
||||
/** Draw horizontal bar graph with no border.
|
||||
* The bar graph draws from left to right as val increases.
|
||||
* \param x x location for top-left of bar
|
||||
* \param y y location for top-left of bar
|
||||
* \param width width of the bar at full val
|
||||
* \param height height of the bar
|
||||
* \param val value to display in graph (0-255 8 bit value).
|
||||
*/
|
||||
void glcd_bar_graph_horizontal_no_border(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t val);
|
||||
|
||||
/** Draw vertical bar graph with 1px wide border.
|
||||
* The bar graph draws from bottom to top as val increases.
|
||||
* \param x x location for top-left of border
|
||||
* \param y y location for top-left of border
|
||||
* \param width width of the border
|
||||
* \param height height of the border
|
||||
* \param val value to display in graph (0-255 8 bit value).
|
||||
*/
|
||||
void glcd_bar_graph_vertical(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t val);
|
||||
|
||||
/** Draw vertical bar graph with no border.
|
||||
* The bar graph draws from bottom to top as val increases.
|
||||
* \param x x location for top-left of bar
|
||||
* \param y y location for top-left of bar
|
||||
* \param width width of the bar
|
||||
* \param height height of the bar
|
||||
* \param val value to display in graph (0-255 8 bit value).
|
||||
*/
|
||||
void glcd_bar_graph_vertical_no_border(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t val);
|
||||
|
||||
/** \todo write doc */
|
||||
void glcd_scrolling_bar_graph(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t val);
|
||||
|
||||
/** @}*/
|
||||
|
||||
#endif
|
||||
109
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/glcd_text.h
Normal file
109
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/glcd_text.h
Normal file
@@ -0,0 +1,109 @@
|
||||
/**
|
||||
\file glcd_text.h
|
||||
\brief GLCD Library - Text functions
|
||||
\author Andy Gock
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef GLCD_TEXT_H
|
||||
#define GLCD_TEXT_H
|
||||
|
||||
/** \addtogroup Text
|
||||
* Functions relating to using text fonts.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** \addtogroup StandardText Standard Text
|
||||
* Functions relating to using text fonts of all sizes.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** Set GLCD font to predefined font table. Only suitable for MikroElektronika font storage format.
|
||||
*
|
||||
* \param font_table pointer to font table to be used
|
||||
* \param width width of each character
|
||||
* \param height height of each character
|
||||
* \param start_char first character of font table
|
||||
* \param end_char last character of font table
|
||||
* \note Only suitable for MikroElektronika font storage format. For Stang format, use
|
||||
* glcd_tiny_set_font()
|
||||
* \see glcd_tiny_set_font()
|
||||
*/
|
||||
#if defined(GLCD_DEVICE_AVR8)
|
||||
void glcd_set_font(PGM_P font_table, uint8_t width, uint8_t height, char start_char, char end_char);
|
||||
#else
|
||||
void glcd_set_font(const char * font_table, uint8_t width, uint8_t height, char start_char, char end_char);
|
||||
#endif
|
||||
|
||||
/** Set GLCD font to predefined font table. Suitable for different different types of font tables.
|
||||
*
|
||||
* \param font_table pointer to font table to be used
|
||||
* \param width width of each character
|
||||
* \param height height of each character
|
||||
* \param start_char first character of font table
|
||||
* \param end_char last character of font table
|
||||
* \param type font table type
|
||||
* \note Only suitable for MikroElektronika font storage format. For Stang format, use
|
||||
* glcd_tiny_set_font()
|
||||
* \see glcd_tiny_set_font()
|
||||
*/
|
||||
#if defined(GLCD_DEVICE_AVR8)
|
||||
void glcd_font(PGM_P font_table, uint8_t width, uint8_t height, char start_char, char end_char, font_table_type_t type);
|
||||
#else
|
||||
void glcd_font(const char * font_table, uint8_t width, uint8_t height, char start_char, char end_char, font_table_type_t type);
|
||||
#endif
|
||||
|
||||
/** Draw a char at specified location.
|
||||
* \param x x location to place top-left of character frame
|
||||
* \param y y location to place top-left of character frame
|
||||
* \param c character to be drawn
|
||||
* \return width of character, 0 on error (e.g could not read font table)
|
||||
*/
|
||||
uint8_t glcd_draw_char_xy(uint8_t x, uint8_t y, char c);
|
||||
|
||||
/** Draw a string at specified location.
|
||||
* \param x x location to place top-left of character frame
|
||||
* \param y y location to place top-left of character frame
|
||||
* \param c pointer to string to be drawn
|
||||
*/
|
||||
void glcd_draw_string_xy(uint8_t x, uint8_t y, char *c);
|
||||
|
||||
/** Draw a string from program memory at specified location.
|
||||
* \param x x location to place top-left of character frame
|
||||
* \param y y location to place top-left of character frame
|
||||
* \param str pointer to string in program memory to be drawn
|
||||
*/
|
||||
void glcd_draw_string_xy_P(uint8_t x, uint8_t y, const char *str);
|
||||
|
||||
/** @}*/
|
||||
|
||||
/** @}*/
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,136 @@
|
||||
/**
|
||||
\file glcd_text_tiny.h
|
||||
\brief GLCD Library - Tiny Text functions.
|
||||
\author Andy Gock
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef GLCD_TEXT_TINY_H
|
||||
#define GLCD_TEXT_TINY_H
|
||||
|
||||
/** \addtogroup TinyText Tiny Text
|
||||
* Functions relating to using tiny 5x7 text fonts.
|
||||
*
|
||||
* Tiny text functions are usually used on a line by line basis. Each line being 8 bits high.
|
||||
* Characters start on the top most bit and are 7 bits high, leaving a one bit space underneath.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** Set font to be used from now on. This is the tiny 5x7 monospace font.
|
||||
* \param font_table flash pointer to start from font table
|
||||
* \param width width of each character
|
||||
* \param height height of each character
|
||||
* \param start_char start character
|
||||
* \param end_char end character
|
||||
* \note Only suitable for Stang font storage format. For MikroElektronika format, use
|
||||
* glcd_set_font()
|
||||
* \see glcd_set_font()
|
||||
*/
|
||||
#if defined(GLCD_DEVICE_AVR8)
|
||||
void glcd_tiny_set_font(PGM_P font_table, uint8_t width, uint8_t height, char start_char, char end_char);
|
||||
#else
|
||||
void glcd_tiny_set_font(const char *font_table, uint8_t width, uint8_t height, char start_char, char end_char);
|
||||
#endif
|
||||
|
||||
/** Write character to LCD in tiny 5x7 font.
|
||||
* \param x column position to start
|
||||
* \param line line number to be written (each line is 8 pixels high)
|
||||
* \param c char to be written
|
||||
*/
|
||||
void glcd_tiny_draw_char(uint8_t x, uint8_t line, char c);
|
||||
|
||||
/** Write string to display buffer in tiny 5x7 font.
|
||||
* Will wrap to next line if needed. Screen is not updated. Use glcd_write() to physically update display.
|
||||
* \param x column position to start
|
||||
* \param line line number to be written (each line is 8 pixels high)
|
||||
* \param str string to be written
|
||||
*/
|
||||
void glcd_tiny_draw_string(uint8_t x, uint8_t line, char *str);
|
||||
|
||||
/** Write flash string to display buffer in tiny 5x7 font.
|
||||
* Will wrap to next line if needed. Screen is not updated. Use glcd_write() to physically update display.
|
||||
* \param x column position to start
|
||||
* \param line line to be written (each line is 8 pixels high)
|
||||
* \param str string stored in flash memory to be written
|
||||
*/
|
||||
#if defined(GLCD_DEVICE_AVR8)
|
||||
void glcd_tiny_draw_string_P(uint8_t x, uint8_t line, PGM_P str);
|
||||
#else
|
||||
void glcd_tiny_draw_string_P(uint8_t x, uint8_t line, const char *str);
|
||||
#endif
|
||||
|
||||
/** Write string to bottom row of display.
|
||||
* Screen buffer is scrolled up by one line. Screen is then physically updated.
|
||||
* \param str string to be written
|
||||
*/
|
||||
void glcd_tiny_draw_string_ammend(char *str);
|
||||
|
||||
/** Write string from flash memory to bottom row of display.
|
||||
* Screen buffer is scrolled up by one line. Screen is then physically updated.
|
||||
* \param str string to be written
|
||||
*/
|
||||
#if defined(GLCD_DEVICE_AVR8)
|
||||
void glcd_tiny_draw_string_ammend_P(PGM_P str);
|
||||
#else
|
||||
void glcd_tiny_draw_string_ammend_P(const char *str);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Invert all contents of line number. Line 0 is the top most line.
|
||||
* \param line Line number (0 is top most line)
|
||||
*/
|
||||
void glcd_tiny_invert_line(uint8_t line);
|
||||
|
||||
/** Write character to LCD in tiny 5x7 font to specified X, Y location.
|
||||
* If position is aligned with 8 bit line heights, use glcd_tiny_draw_char() instead
|
||||
* as it will be faster.
|
||||
*
|
||||
* \param x column position to start
|
||||
* \param y row position to start (pixel based, not 8 bit high rows)
|
||||
* \param c char to be written
|
||||
* \see glcd_tiny_draw_char()
|
||||
* \note This does the same thing as glcd_tiny_draw_char_xy() but is limited to Stang format
|
||||
* font tables.
|
||||
*/
|
||||
void glcd_tiny_draw_char_xy(uint8_t x, uint8_t y, char c);
|
||||
|
||||
/** Initialise 5x7 text */
|
||||
#define GLCD_TEXT_INIT() glcd_tiny_set_font(Font5x7,5,7,32,127);
|
||||
|
||||
/** Write string to bottom-most line after scrolling everything else up */
|
||||
#define GLCD_WRITE(str) glcd_tiny_draw_string_ammend(str)
|
||||
|
||||
/** Write string from program memory to bottom-most line after scrolling everything else up */
|
||||
#define GLCD_WRITE_P(str) glcd_tiny_draw_string_ammend_P(str)
|
||||
|
||||
/** @}*/
|
||||
|
||||
#endif
|
||||
309
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/graphics.c
Normal file
309
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/graphics.c
Normal file
@@ -0,0 +1,309 @@
|
||||
/**
|
||||
\file graphics.c
|
||||
\brief Functions relating to graphics. e.g drawing lines, rectangles, circles etc.
|
||||
\author Andy Gock
|
||||
|
||||
Some functions based on Limor Fried's PCD8544 Arduino library.
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
Copyright (c) 2012, Adafruit Industries
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "glcd.h"
|
||||
|
||||
/* Based on PCD8544 library by Limor Fried */
|
||||
void glcd_set_pixel(uint8_t x, uint8_t y, uint8_t color) {
|
||||
if (x > (GLCD_LCD_WIDTH-1) || y > (GLCD_LCD_HEIGHT-1)) {
|
||||
/* don't do anything if x/y is outside bounds of display size */
|
||||
return;
|
||||
}
|
||||
|
||||
if (color) {
|
||||
/* Set black */
|
||||
glcd_buffer[x+ (y/8)*GLCD_LCD_WIDTH] |= ( 1 << (y%8));
|
||||
} else {
|
||||
/* Set white */
|
||||
glcd_buffer[x+ (y/8)*GLCD_LCD_WIDTH] &= ~ (1 << (y%8));
|
||||
}
|
||||
|
||||
glcd_update_bbox(x,y,x,y);
|
||||
}
|
||||
|
||||
/* Based on PCD8544 library by Limor Fried */
|
||||
uint8_t glcd_get_pixel(uint8_t x, uint8_t y) {
|
||||
if ((x >= GLCD_LCD_WIDTH) || (y >= GLCD_LCD_HEIGHT)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( glcd_buffer[x+ (y/8)*GLCD_LCD_WIDTH] & ( 1 << (y%8)) ) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void glcd_invert_pixel(uint8_t x, uint8_t y) {
|
||||
if ((x >= GLCD_LCD_WIDTH) || (y >= GLCD_LCD_HEIGHT)) {
|
||||
return;
|
||||
}
|
||||
glcd_update_bbox(x,y,x,y);
|
||||
glcd_buffer[x+ (y/8)*GLCD_LCD_WIDTH] ^= ( 1 << (y%8));
|
||||
}
|
||||
|
||||
/* Bresenham's algorithm - based on PCD8544 library Limor Fried */
|
||||
void glcd_draw_line(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t color) {
|
||||
uint8_t steep = abs(y1 - y0) > abs(x1 - x0);
|
||||
uint8_t dx, dy;
|
||||
int8_t err;
|
||||
int8_t ystep;
|
||||
|
||||
if (steep) {
|
||||
swap(x0, y0);
|
||||
swap(x1, y1);
|
||||
}
|
||||
|
||||
if (x0 > x1) {
|
||||
swap(x0, x1);
|
||||
swap(y0, y1);
|
||||
}
|
||||
|
||||
glcd_update_bbox( x0, y0, x1, y1 );
|
||||
|
||||
dx = x1 - x0;
|
||||
dy = abs(y1 - y0);
|
||||
|
||||
err = dx / 2;
|
||||
|
||||
if (y0 < y1) {
|
||||
ystep = 1;
|
||||
} else {
|
||||
ystep = -1;
|
||||
}
|
||||
|
||||
for (; x0<=x1; x0++) {
|
||||
if (steep) {
|
||||
glcd_set_pixel(y0, x0, color);
|
||||
} else {
|
||||
glcd_set_pixel(x0, y0, color);
|
||||
}
|
||||
err -= dy;
|
||||
if (err < 0) {
|
||||
y0 += ystep;
|
||||
err += dx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void glcd_fill_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t color)
|
||||
{
|
||||
int16_t i;
|
||||
for (i=x; i<x+w; i++) {
|
||||
int16_t j;
|
||||
for (j=y; j<y+h; j++) {
|
||||
glcd_set_pixel(i, j, color);
|
||||
}
|
||||
}
|
||||
glcd_update_bbox(x, y, x+w-1, y+h-1);
|
||||
}
|
||||
|
||||
void glcd_draw_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t color)
|
||||
{
|
||||
int16_t i;
|
||||
for (i=x; i<x+w; i++) {
|
||||
glcd_set_pixel(i, y, color);
|
||||
glcd_set_pixel(i, y+h-1, color);
|
||||
}
|
||||
for (i=y; i<y+h; i++) {
|
||||
glcd_set_pixel(x, i, color);
|
||||
glcd_set_pixel(x+w-1, i, color);
|
||||
}
|
||||
glcd_update_bbox(x, y, x+w-1, y+h-1);
|
||||
}
|
||||
|
||||
void glcd_draw_rect_thick(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tx, uint8_t ty, uint8_t color)
|
||||
{
|
||||
int16_t i, t;
|
||||
|
||||
if (tx == 0) {
|
||||
tx = 1;
|
||||
}
|
||||
|
||||
if (ty == 0) {
|
||||
ty = 1;
|
||||
}
|
||||
|
||||
for (i=x; i<x+w; i++) {
|
||||
/* Top and bottom sides */
|
||||
for (t=0; t<(ty); t++) {
|
||||
glcd_set_pixel(i, y+t, color);
|
||||
glcd_set_pixel(i, y+h-1-t, color);
|
||||
}
|
||||
}
|
||||
for (i=y; i<y+h; i++) {
|
||||
/* Left and right sides */
|
||||
for (t=0; t<(tx); t++) {
|
||||
glcd_set_pixel(x+t, i, color);
|
||||
glcd_set_pixel(x+w-1-t, i, color);
|
||||
}
|
||||
}
|
||||
glcd_update_bbox(x, y, x+w-1, y+h-1);
|
||||
}
|
||||
|
||||
void glcd_draw_rect_shadow(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t color)
|
||||
{
|
||||
glcd_draw_rect(x, y, w, h, color);
|
||||
glcd_draw_line(x+1, y+h, x+w, y+h, color);
|
||||
glcd_draw_line(x+w, y+1, x+w, y+h, color);
|
||||
}
|
||||
|
||||
void glcd_draw_circle(uint8_t x0, uint8_t y0, uint8_t r, uint8_t color)
|
||||
{
|
||||
|
||||
int8_t f = 1 - r;
|
||||
int8_t ddF_x = 1;
|
||||
int8_t ddF_y = -2 * r;
|
||||
int8_t x = 0;
|
||||
int8_t y = r;
|
||||
|
||||
glcd_update_bbox(x0-r, y0-r, x0+r, y0+r);
|
||||
|
||||
glcd_set_pixel(x0, y0+r, color);
|
||||
glcd_set_pixel(x0, y0-r, color);
|
||||
glcd_set_pixel(x0+r, y0, color);
|
||||
glcd_set_pixel(x0-r, y0, color);
|
||||
|
||||
while (x<y) {
|
||||
if (f >= 0) {
|
||||
y--;
|
||||
ddF_y += 2;
|
||||
f += ddF_y;
|
||||
}
|
||||
x++;
|
||||
ddF_x += 2;
|
||||
f += ddF_x;
|
||||
|
||||
glcd_set_pixel(x0 + x, y0 + y, color);
|
||||
glcd_set_pixel(x0 - x, y0 + y, color);
|
||||
glcd_set_pixel(x0 + x, y0 - y, color);
|
||||
glcd_set_pixel(x0 - x, y0 - y, color);
|
||||
|
||||
glcd_set_pixel(x0 + y, y0 + x, color);
|
||||
glcd_set_pixel(x0 - y, y0 + x, color);
|
||||
glcd_set_pixel(x0 + y, y0 - x, color);
|
||||
glcd_set_pixel(x0 - y, y0 - x, color);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void glcd_fill_circle(uint8_t x0, uint8_t y0, uint8_t r, uint8_t color)
|
||||
{
|
||||
|
||||
int8_t f = 1 - r;
|
||||
int8_t ddF_x = 1;
|
||||
int8_t ddF_y = -2 * r;
|
||||
int8_t x = 0;
|
||||
int8_t y = r;
|
||||
|
||||
int16_t i;
|
||||
|
||||
glcd_update_bbox(x0-r, y0-r, x0+r, y0+r);
|
||||
|
||||
for (i=y0-r; i<=y0+r; i++) {
|
||||
glcd_set_pixel(x0, i, color);
|
||||
}
|
||||
|
||||
while (x < y) {
|
||||
if (f >= 0) {
|
||||
y--;
|
||||
ddF_y += 2;
|
||||
f += ddF_y;
|
||||
}
|
||||
x++;
|
||||
ddF_x += 2;
|
||||
f += ddF_x;
|
||||
|
||||
for (i=y0-y; i<=y0+y; i++) {
|
||||
glcd_set_pixel(x0+x, i, color);
|
||||
glcd_set_pixel(x0-x, i, color);
|
||||
}
|
||||
for (i=y0-x; i<=y0+x; i++) {
|
||||
glcd_set_pixel(x0+y, i, color);
|
||||
glcd_set_pixel(x0-y, i, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void glcd_invert_area(uint8_t x, uint8_t y, uint8_t w, uint8_t h)
|
||||
{
|
||||
uint8_t xx, yy;
|
||||
for (xx = x; xx < (x+w); xx++) {
|
||||
/* Loop through each partial column */
|
||||
for (yy = y; yy < (y+h); yy++) {
|
||||
/* Go down and invert every pixel */
|
||||
glcd_invert_pixel(xx,yy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void glcd_draw_bitmap(const unsigned char *data)
|
||||
{
|
||||
|
||||
#if 0
|
||||
/* Testing purposes only: Writing to the LCD right away (not for AVR) */
|
||||
/* Normally, we do not do this, we just write to the screen buffer */
|
||||
uint8_t *original_buffer;
|
||||
|
||||
/* Save the location of original screen buffer */
|
||||
original_buffer = glcd_buffer_selected;
|
||||
|
||||
/* Use bitmap location as screen buffer (this won't work when using AVR8 PGM_P) */
|
||||
glcd_select_screen((uint8_t *)data, glcd_bbox_selected);
|
||||
|
||||
/* Make sure we write the entre display */
|
||||
glcd_bbox_refresh();
|
||||
glcd_write();
|
||||
|
||||
/* Restore the screen buffer back to original */
|
||||
glcd_select_screen(original_buffer, glcd_bbox_selected);
|
||||
#endif
|
||||
|
||||
/* Copy bitmap data to the screen buffer */
|
||||
#if defined(GLCD_DEVICE_AVR8)
|
||||
memcpy_P(glcd_buffer_selected, data, (GLCD_LCD_WIDTH * GLCD_LCD_HEIGHT / 8));
|
||||
#else
|
||||
memcpy(glcd_buffer_selected, data, (GLCD_LCD_WIDTH * GLCD_LCD_HEIGHT / 8));
|
||||
#endif
|
||||
|
||||
glcd_bbox_refresh();
|
||||
}
|
||||
120
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/graphs.c
Normal file
120
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/graphs.c
Normal file
@@ -0,0 +1,120 @@
|
||||
/**
|
||||
\file graphs.c
|
||||
\brief Functions relating to graphs. e.g bar graphs etc.
|
||||
\author Andy Gock
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "glcd.h"
|
||||
|
||||
static uint8_t glcd_map(uint8_t x1, uint8_t x2, uint8_t x);
|
||||
|
||||
void glcd_bar_graph_horizontal(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t val)
|
||||
{
|
||||
if (height < 3) {
|
||||
return;
|
||||
}
|
||||
glcd_draw_rect(x, y, width, height, BLACK);
|
||||
glcd_fill_rect(x+1, y+1, glcd_map(0,width-2,val), height-2 , BLACK);
|
||||
}
|
||||
|
||||
void glcd_bar_graph_horizontal_no_border(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t val)
|
||||
{
|
||||
if (height < 3) {
|
||||
return;
|
||||
}
|
||||
glcd_fill_rect(x, y, glcd_map(0,width,val), height , BLACK);
|
||||
}
|
||||
|
||||
void glcd_bar_graph_vertical(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t val)
|
||||
{
|
||||
glcd_draw_rect(x, y, width, height, BLACK);
|
||||
glcd_fill_rect(x+1, y+1+glcd_map(0,height-2,255-val), width-2, height-2-glcd_map(0,height-2,255-val), BLACK);
|
||||
}
|
||||
|
||||
void glcd_bar_graph_vertical_no_border(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t val)
|
||||
{
|
||||
glcd_fill_rect(x, y+glcd_map(0,height-2,255-val), width, height-2-glcd_map(0,height-2,255-val), BLACK);
|
||||
}
|
||||
|
||||
void glcd_scrolling_bar_graph(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t val)
|
||||
{
|
||||
uint8_t nx, ny;
|
||||
uint8_t color;
|
||||
|
||||
/* Draw border of graph */
|
||||
glcd_draw_rect(x,y,width,height,BLACK);
|
||||
|
||||
/* Scroll inner contents left by one pixel width */
|
||||
for (ny = 1; ny <= (height-2); ny++) {
|
||||
/* Redraw each horizontal line */
|
||||
for (nx = 1; nx <= (width-2); nx += 1) {
|
||||
color = glcd_get_pixel(x+nx+1,y+ny);
|
||||
glcd_set_pixel(x+nx,y+ny,color);
|
||||
}
|
||||
}
|
||||
|
||||
val = val * (height-3) / 255;
|
||||
|
||||
/* Make sure we're not exceeding the size of box interior */
|
||||
if (val > (height-3)) {
|
||||
val = height - 3;
|
||||
}
|
||||
|
||||
/* Draw new bar - both black and white portions*/
|
||||
glcd_draw_line(x+width-2,y+height-2,x+width-2,y+height-2-val,BLACK);
|
||||
glcd_draw_line(x+width-2,y+height-3-val,x+width-2,y+1,WHITE);
|
||||
|
||||
/* Write to display */
|
||||
glcd_write();
|
||||
}
|
||||
|
||||
void glcd_scrolling_bar_graph_timing(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t val, uint8_t line_width, uint16_t delay)
|
||||
{
|
||||
uint8_t n;
|
||||
if (line_width == 0) {
|
||||
line_width = 1;
|
||||
}
|
||||
|
||||
/* Adjust graph line's width by just running glcd_scrolling_bar_graph() x number of times */
|
||||
/* \todo This should be done differently! */
|
||||
for (n=0; n<line_width; n++) {
|
||||
glcd_scrolling_bar_graph(x,y,width,height,val);
|
||||
}
|
||||
|
||||
if (delay) {
|
||||
delay_ms(delay);
|
||||
}
|
||||
}
|
||||
|
||||
static uint8_t glcd_map(uint8_t x1, uint8_t x2, uint8_t x)
|
||||
{
|
||||
return x1+(x2-x1)*x/255;
|
||||
}
|
||||
43
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/main.c
Normal file
43
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/main.c
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
|
||||
Demo of glcd library with AVR8 microcontroller
|
||||
|
||||
Tested on a custom made PCB (intended for another project)
|
||||
|
||||
See ../README.md for connection details
|
||||
|
||||
*/
|
||||
|
||||
#include <avr/io.h>
|
||||
#include "glcd.h"
|
||||
|
||||
/* Function prototypes */
|
||||
static void setup(void);
|
||||
|
||||
static void setup(void)
|
||||
{
|
||||
/* Set up glcd, also sets up SPI and relevent GPIO pins */
|
||||
glcd_init();
|
||||
|
||||
/* Backlight pin PL3, set as output, set high for 100% output */
|
||||
DDRL |= (1<<3);
|
||||
PORTL |= (1<<3);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
setup();
|
||||
|
||||
while(1) {
|
||||
//glcd_test_circles();
|
||||
glcd_test_counter_and_graph();
|
||||
//glcd_test_text_up_down();
|
||||
//glcd_test_tiny_text();
|
||||
//glcd_test_hello_world();
|
||||
//glcd_test_rectangles();
|
||||
//glcd_test_scrolling_graph();
|
||||
//glcd_test_bitmap_128x64();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
304
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/text.c
Normal file
304
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/text.c
Normal file
@@ -0,0 +1,304 @@
|
||||
|
||||
/**
|
||||
\file text.c
|
||||
\brief Functions relating to using text fonts of all sizes.
|
||||
\author Andy Gock
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "glcd.h"
|
||||
|
||||
extern uint8_t *glcd_buffer_selected;
|
||||
extern glcd_BoundingBox_t *glcd_bbox_selected;
|
||||
|
||||
glcd_FontConfig_t font_current;
|
||||
|
||||
#if defined(GLCD_DEVICE_AVR8)
|
||||
void glcd_set_font(PGM_P font_table, uint8_t width, uint8_t height, char start_char, char end_char)
|
||||
#else
|
||||
void glcd_set_font(const char * font_table, uint8_t width, uint8_t height, char start_char, char end_char)
|
||||
#endif
|
||||
{
|
||||
/* Supports variable width fonts */
|
||||
font_current.font_table = font_table;
|
||||
font_current.width = width;
|
||||
font_current.height = height;
|
||||
font_current.start_char = start_char;
|
||||
font_current.end_char = end_char;
|
||||
font_current.table_type = MIKRO; /* Only supports MikroElektronika generated format at the moment */
|
||||
}
|
||||
|
||||
#if defined(GLCD_DEVICE_AVR8)
|
||||
void glcd_font(PGM_P font_table, uint8_t width, uint8_t height, char start_char, char end_char, font_table_type_t type)
|
||||
#else
|
||||
void glcd_font(const char * font_table, uint8_t width, uint8_t height, char start_char, char end_char, font_table_type_t type)
|
||||
#endif
|
||||
{
|
||||
/* Supports variable width fonts */
|
||||
font_current.font_table = font_table;
|
||||
font_current.width = width;
|
||||
font_current.height = height;
|
||||
font_current.start_char = start_char;
|
||||
font_current.end_char = end_char;
|
||||
font_current.table_type = type; /* Only supports MikroElektronika generated format at the moment */
|
||||
}
|
||||
|
||||
uint8_t glcd_draw_char_xy(uint8_t x, uint8_t y, char c)
|
||||
{
|
||||
if (c < font_current.start_char || c > font_current.end_char) {
|
||||
c = '.';
|
||||
}
|
||||
|
||||
if (font_current.table_type == STANG) {
|
||||
/* Font table in Pascal Stang format (single byte height with with no width specifier) */
|
||||
/* Maximum height of 8 bits only */
|
||||
|
||||
uint8_t i;
|
||||
for ( i = 0; i < font_current.width; i++ ) {
|
||||
#if defined(GLCD_DEVICE_AVR8)
|
||||
uint8_t dat = pgm_read_byte( font_current.font_table + ((c - font_current.start_char) * (font_current.width)) + i );
|
||||
#else
|
||||
uint8_t dat = *( font_current.font_table + ((c - font_current.start_char) * (font_current.width)) + i );
|
||||
#endif
|
||||
uint8_t j;
|
||||
for (j = 0; j < 8; j++) {
|
||||
/* Set pixel color for each bit of the column (8-bits) */
|
||||
if (x+i >= GLCD_LCD_WIDTH || y+j >= GLCD_LCD_HEIGHT) {
|
||||
/* Don't try and write past the dimensions of the LCD */
|
||||
return 0;
|
||||
}
|
||||
if (dat & (1<<j)) {
|
||||
glcd_set_pixel(x+i,y+j,BLACK);
|
||||
} else {
|
||||
glcd_set_pixel(x+i,y+j,WHITE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* always return how many pixels of width were written */
|
||||
/* here for "stang" format fonts, it is always fixed */
|
||||
return font_current.width;
|
||||
|
||||
} else if (font_current.table_type == MIKRO) {
|
||||
/* Font table in MikroElecktronica format
|
||||
- multi row fonts allowed (more than 8 pixels high)
|
||||
- variable width fonts allowed
|
||||
a complete column is written before moving to the next */
|
||||
|
||||
uint8_t i;
|
||||
uint8_t var_width;
|
||||
|
||||
uint8_t bytes_high = font_current.height / 8 + 1;
|
||||
uint8_t bytes_per_char = font_current.width * bytes_high + 1; /* The +1 is the width byte at the start */
|
||||
|
||||
const char *p;
|
||||
p = font_current.font_table + (c - font_current.start_char) * bytes_per_char;
|
||||
|
||||
/* The first byte per character is always the width of the character */
|
||||
#if defined(GLCD_DEVICE_AVR8)
|
||||
var_width = pgm_read_byte(p);
|
||||
#else
|
||||
var_width = *p;
|
||||
#endif
|
||||
p++; /* Step over the variable width field */
|
||||
|
||||
/*
|
||||
if (x+var_width >= GLCD_LCD_WIDTH || y+font_current.height >= GLCD_LCD_HEIGHT) {
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
for ( i = 0; i < var_width; i++ ) {
|
||||
uint8_t j;
|
||||
for ( j = 0; j < bytes_high; j++ ) {
|
||||
#if defined(GLCD_DEVICE_AVR8)
|
||||
uint8_t dat = pgm_read_byte( p + i*bytes_high + j );
|
||||
#else
|
||||
uint8_t dat = *( p + i*bytes_high + j );
|
||||
#endif
|
||||
uint8_t bit;
|
||||
for (bit = 0; bit < 8; bit++) {
|
||||
|
||||
if (x+i >= GLCD_LCD_WIDTH || y+j*8+bit >= GLCD_LCD_HEIGHT) {
|
||||
/* Don't write past the dimensions of the LCD, skip the entire char */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* We should not write if the y bit exceeds font height */
|
||||
if ((j*8 + bit) >= font_current.height) {
|
||||
/* Skip the bit */
|
||||
continue;
|
||||
}
|
||||
|
||||
if (dat & (1<<bit)) {
|
||||
glcd_set_pixel(x+i,y+j*8+bit,BLACK);
|
||||
} else {
|
||||
glcd_set_pixel(x+i,y+j*8+bit,WHITE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return var_width;
|
||||
|
||||
} else if (font_current.table_type == GLCD_UTILS) {
|
||||
/* Font table format of glcd-utils
|
||||
- A complete row is written first (not completed columns)
|
||||
- Width not stored, but we can search and determine it
|
||||
- Not yet supported */
|
||||
|
||||
uint8_t var_width, n;
|
||||
uint8_t bytes_high, bytes_per_char;
|
||||
const char *p;
|
||||
|
||||
bytes_high = font_current.height / 8 + 1;
|
||||
bytes_per_char = font_current.width * bytes_high;
|
||||
|
||||
/* Point to chars first byte */
|
||||
p = font_current.font_table + (c - font_current.start_char) * bytes_per_char;
|
||||
|
||||
/* Determine the width of the character */
|
||||
var_width = font_current.width;
|
||||
|
||||
n = 0; /* How many columns back from the end */
|
||||
|
||||
while (1) {
|
||||
uint8_t max_byte = 0;
|
||||
uint8_t row = 0;
|
||||
|
||||
for (row = 0; row < bytes_high; row++) {
|
||||
uint8_t offset;
|
||||
offset = (font_current.width - 1 - n) * row;
|
||||
max_byte = *(p + offset);
|
||||
}
|
||||
if (max_byte == 0) {
|
||||
/* column is empty for all rows, go left and test again */
|
||||
/* reduce variable width by 1 */
|
||||
var_width--;
|
||||
if (var_width == 0) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
break; /* Part of a character was found */
|
||||
}
|
||||
n++;
|
||||
}
|
||||
|
||||
/* Uncomment line below, to force fixed width, for debugging only */
|
||||
//var_width = font_current.width; // bypass auto width detection, treat as fixed width
|
||||
|
||||
/* For glcd-utils format, we write one complete row at a time */
|
||||
uint8_t j; /* loop as rows, 1st row, j=0 */
|
||||
for ( j = 0; j < bytes_high; j++ ) {
|
||||
/* Loop one row at a time */
|
||||
|
||||
uint8_t i;
|
||||
for ( i = 0; i < var_width; i++ ) {
|
||||
/* Loop one column at a time */
|
||||
|
||||
uint8_t dat, bit;
|
||||
|
||||
#if defined(GLCD_DEVICE_AVR8)
|
||||
dat = pgm_read_byte( p + j*font_current.width + i );
|
||||
#else
|
||||
dat = *( p + j*font_current.width + i );
|
||||
#endif
|
||||
|
||||
for (bit = 0; bit < 8; bit++) {
|
||||
|
||||
if ((x+i) >= GLCD_LCD_WIDTH || (y+j*8+bit) >= GLCD_LCD_HEIGHT) {
|
||||
/* Don't write past the dimensions of the LCD, skip the entire char */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* We should not write if the y bit exceeds font height */
|
||||
if ((j*8 + bit) >= font_current.height) {
|
||||
/* Skip the bit */
|
||||
continue;
|
||||
}
|
||||
|
||||
if (dat & (1<<bit)) {
|
||||
glcd_set_pixel(x+i,y+j*8+bit,BLACK);
|
||||
} else {
|
||||
glcd_set_pixel(x+i,y+j*8+bit,WHITE);
|
||||
}
|
||||
}
|
||||
} /* i */
|
||||
} /* j */
|
||||
|
||||
return var_width; /* Number of columns written to display */
|
||||
|
||||
} else {
|
||||
/* Don't recognise the font table */
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void glcd_draw_string_xy(uint8_t x, uint8_t y, char *c)
|
||||
{
|
||||
uint8_t width;
|
||||
|
||||
if (y > (GLCD_LCD_HEIGHT - font_current.height - 1)) {
|
||||
/* Character won't fit */
|
||||
return;
|
||||
}
|
||||
|
||||
while (*c) {
|
||||
width = glcd_draw_char_xy(x,y,*c);
|
||||
x += (width + 1);
|
||||
c++;
|
||||
}
|
||||
}
|
||||
|
||||
void glcd_draw_string_xy_P(uint8_t x, uint8_t y, const char *str)
|
||||
{
|
||||
uint8_t width;
|
||||
|
||||
if (y > (GLCD_LCD_HEIGHT - font_current.height - 1)) {
|
||||
/* Character won't fit */
|
||||
return;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
#if defined(GLCD_DEVICE_AVR8)
|
||||
char c = pgm_read_byte(str++);
|
||||
#else
|
||||
char c = *(str++);
|
||||
#endif
|
||||
if (!c)
|
||||
return;
|
||||
|
||||
width = glcd_draw_char_xy(x,y,c);
|
||||
x += (width + 1);
|
||||
c++;
|
||||
}
|
||||
}
|
||||
|
||||
177
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/text_tiny.c
Normal file
177
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/text_tiny.c
Normal file
@@ -0,0 +1,177 @@
|
||||
/**
|
||||
\file text_tiny.c
|
||||
\brief Functions relating to using tiny 5x7 text fonts.
|
||||
\author Andy Gock
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "glcd.h"
|
||||
|
||||
#if defined(GLCD_DEVICE_AVR8)
|
||||
void glcd_tiny_set_font(PGM_P font_table, uint8_t width, uint8_t height, char start_char, char end_char)
|
||||
#else
|
||||
void glcd_tiny_set_font(const char * font_table, uint8_t width, uint8_t height, char start_char, char end_char)
|
||||
#endif
|
||||
{
|
||||
font_current.font_table = font_table;
|
||||
font_current.width = width;
|
||||
font_current.height = height;
|
||||
font_current.start_char = start_char;
|
||||
font_current.end_char = end_char;
|
||||
font_current.table_type = STANG;
|
||||
}
|
||||
|
||||
void glcd_tiny_draw_char(uint8_t x, uint8_t line, char c)
|
||||
{
|
||||
uint8_t i;
|
||||
|
||||
/* Only works for fonts < 8 bits in height */
|
||||
if (font_current.height >= 8) {
|
||||
return;
|
||||
}
|
||||
if (c < font_current.start_char || c > font_current.end_char) {
|
||||
c = '.';
|
||||
}
|
||||
if ( line >= GLCD_LCD_HEIGHT / (font_current.height + 1) ) {
|
||||
return;
|
||||
}
|
||||
if ( (x+font_current.width) >= GLCD_LCD_WIDTH ) {
|
||||
return;
|
||||
}
|
||||
|
||||
glcd_update_bbox(x, line*(font_current.height + 1), x+font_current.width, line*(font_current.height + 1) + (font_current.height + 1));
|
||||
|
||||
for ( i = 0; i < font_current.width; i++ ) {
|
||||
#if defined(GLCD_DEVICE_AVR8)
|
||||
glcd_buffer_selected[x + (line * GLCD_LCD_WIDTH)] = pgm_read_byte( font_current.font_table + ((c - font_current.start_char) * (font_current.width)) + i );
|
||||
#else
|
||||
glcd_buffer_selected[x + (line * GLCD_LCD_WIDTH)] = *( font_current.font_table + ((c - font_current.start_char) * (font_current.width)) + i );
|
||||
#endif
|
||||
x++;
|
||||
}
|
||||
}
|
||||
|
||||
void glcd_tiny_draw_string(uint8_t x, uint8_t line, char *str)
|
||||
{
|
||||
if (font_current.height >= 8) {
|
||||
return;
|
||||
}
|
||||
while (*str) {
|
||||
glcd_tiny_draw_char(x, line, *str++);
|
||||
x += (font_current.width + 1);
|
||||
if ((x + font_current.width + 1) > GLCD_LCD_WIDTH) {
|
||||
x = 0; /* Ran out of this line */
|
||||
line++;
|
||||
}
|
||||
if (line >= (GLCD_LCD_HEIGHT/(font_current.height + 1)))
|
||||
return; /* Ran out of space :( */
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(GLCD_DEVICE_AVR8)
|
||||
void glcd_tiny_draw_string_P(uint8_t x, uint8_t line, PGM_P str)
|
||||
#else
|
||||
void glcd_tiny_draw_string_P(uint8_t x, uint8_t line, const char *str)
|
||||
#endif
|
||||
{
|
||||
if (font_current.height >= 8) {
|
||||
return;
|
||||
}
|
||||
while (1) {
|
||||
#if defined(GLCD_DEVICE_AVR8)
|
||||
char c = pgm_read_byte(str++);
|
||||
#else
|
||||
char c = *(str++);
|
||||
#endif
|
||||
if (!c)
|
||||
return;
|
||||
|
||||
glcd_tiny_draw_char(x, line, c);
|
||||
|
||||
x += (font_current.width + 1);
|
||||
if ((x + font_current.width + 1) > GLCD_LCD_WIDTH) {
|
||||
x = 0; /* Ran out of this line */
|
||||
line++;
|
||||
}
|
||||
if (line >= (GLCD_LCD_HEIGHT/(font_current.height + 1)))
|
||||
return; /* Ran out of space :( */
|
||||
}
|
||||
}
|
||||
|
||||
void glcd_tiny_draw_string_ammend(char *str) {
|
||||
glcd_scroll_line();
|
||||
glcd_tiny_draw_string(0, (GLCD_LCD_HEIGHT/8-1), str);
|
||||
glcd_write();
|
||||
}
|
||||
|
||||
void glcd_tiny_draw_string_ammend_P(const char *str) {
|
||||
glcd_scroll_line();
|
||||
glcd_tiny_draw_string_P(0, (GLCD_LCD_HEIGHT/8-1), str);
|
||||
glcd_write();
|
||||
}
|
||||
|
||||
void glcd_tiny_invert_line(uint8_t line)
|
||||
{
|
||||
glcd_invert_area(0,line*8,GLCD_LCD_WIDTH-1,8);
|
||||
}
|
||||
|
||||
void glcd_tiny_draw_char_xy(uint8_t x, uint8_t y, char c)
|
||||
{
|
||||
uint8_t i;
|
||||
uint8_t xvar, yvar;
|
||||
uint8_t dat;
|
||||
|
||||
/* Only works for fonts < 8 bits in height */
|
||||
|
||||
/* Check all important bounds requirements are okay */
|
||||
if ( (y >= GLCD_LCD_HEIGHT) || ((x+font_current.width) >= GLCD_LCD_WIDTH) || (font_current.height >= 8) || font_current.table_type != STANG) {
|
||||
return;
|
||||
}
|
||||
if (c < font_current.start_char || c > font_current.end_char) {
|
||||
c = '.';
|
||||
}
|
||||
|
||||
xvar = x;
|
||||
|
||||
for ( i = 0; i < font_current.width; i++ ) {
|
||||
#if defined(GLCD_DEVICE_AVR8)
|
||||
dat = pgm_read_byte( font_current.font_table + ((c - font_current.start_char) * (font_current.width)) + i );
|
||||
#else
|
||||
dat = *( font_current.font_table + ((c - font_current.start_char) * (font_current.width)) + i );
|
||||
#endif
|
||||
for (yvar = 0; yvar < font_current.height; yvar++) {
|
||||
glcd_set_pixel(xvar,y+yvar, (dat & (1<<yvar) ? 1 : 0) );
|
||||
}
|
||||
xvar++;
|
||||
}
|
||||
|
||||
glcd_update_bbox(x, y, x+font_current.width,y+font_current.height);
|
||||
|
||||
}
|
||||
316
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/unit_tests.c
Normal file
316
trunk/workspace/00_Lib/Disp_Nokia5110/glcd-0.5.2/unit_tests.c
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* \file unit_tests.h
|
||||
* \brief Various test functions to demonstrate features of the library
|
||||
* \author Andy Gock
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2012, Andy Gock
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Andy Gock nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANDY GOCK BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _UNIT_TESTS_H
|
||||
#define _UNIT_TESTS_H
|
||||
|
||||
#define GLCD_UNIT_TEST_BITMAP_ENABLE
|
||||
|
||||
extern volatile uint8_t unit_test_return;
|
||||
|
||||
/** Make random "exploding circles" */
|
||||
void glcd_test_circles(void);
|
||||
|
||||
/* Shows a 8-bit counter incorementing, with a verticla and horizontal bar graph */
|
||||
void glcd_test_counter_and_graph(void);
|
||||
|
||||
/* Shows a 16-bit counter incrementing, using glcdutils font format */
|
||||
void glcd_test_glcdutils(void);
|
||||
|
||||
/** Scroll some text up and down the screen */
|
||||
void glcd_test_text_up_down(void);
|
||||
|
||||
/** Display all chars of tiny 5x7 font, scrolling previous lines one by one every second */
|
||||
void glcd_test_tiny_text(void);
|
||||
|
||||
/** Print hello world to display */
|
||||
void glcd_test_hello_world(void);
|
||||
|
||||
/** Demonstrating rectangle drawing */
|
||||
void glcd_test_rectangles(void);
|
||||
|
||||
/** Demonstrate scrolling bar graph */
|
||||
void glcd_test_scrolling_graph(void);
|
||||
|
||||
/** Demonstrate bitmap display */
|
||||
void glcd_test_bitmap_128x64(void);
|
||||
|
||||
#endif
|
||||
30
trunk/workspace/00_Lib/Disp_Nokia5110/nokia_chinese.h
Normal file
30
trunk/workspace/00_Lib/Disp_Nokia5110/nokia_chinese.h
Normal file
@@ -0,0 +1,30 @@
|
||||
static const unsigned char write_chinese[][24]={
|
||||
|
||||
//测
|
||||
{0x89,0xF2,0x00,0xFF,0x01,0xF9,0xFF,0x00,0xFC,0x00,0xFF,0x00,0x00,0x07,0x04,0x04,0x02,0x01,0x02,0x04,0x01,0x04,0x07,0x00},
|
||||
//试
|
||||
{0x11,0xF6,0x00,0x04,0x24,0xE4,0x24,0x24,0xFF,0x05,0x06,0x00,0x00,0x07,0x02,0x01,0x02,0x03,0x01,0x01,0x01,0x02,0x07,0x00},
|
||||
//程
|
||||
{0x8A,0x6A,0xFF,0x49,0x20,0xAF,0xA9,0xE9,0xA9,0xAF,0x20,0x00,0x01,0x00,0x07,0x00,0x04,0x04,0x04,0x07,0x04,0x04,0x04,0x00},
|
||||
//序
|
||||
{0x00,0xFE,0x42,0x4A,0x4A,0x5B,0xEA,0x5A,0x4A,0xC2,0x42,0x00,0x06,0x01,0x00,0x00,0x04,0x04,0x07,0x00,0x00,0x00,0x00,0x00},
|
||||
|
||||
|
||||
//电
|
||||
{0x00,0xFC,0x94,0x94,0x94,0xFF,0x94,0x94,0x94,0xFE,0x04,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x04,0x04,0x04,0x04,0x06,0x00},
|
||||
//子
|
||||
{0x20,0x21,0x21,0x21,0x21,0xF9,0x29,0x25,0x23,0x31,0x20,0x00,0x00,0x00,0x00,0x04,0x04,0x07,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
//制
|
||||
{0x18,0xD6,0x54,0xFF,0x54,0x56,0xD4,0x00,0xFC,0x00,0xFF,0x00,0x00,0x03,0x00,0x07,0x00,0x02,0x03,0x00,0x04,0x04,0x07,0x00},
|
||||
//作
|
||||
{0x10,0x08,0xFC,0x13,0x08,0x04,0xFF,0x24,0x24,0x24,0x04,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x07,0x01,0x01,0x01,0x01,0x00},
|
||||
//杂
|
||||
{0x40,0x62,0x52,0xCA,0x47,0xE2,0x42,0xDE,0x50,0x50,0x58,0x00,0x04,0x02,0x01,0x04,0x04,0x07,0x00,0x00,0x01,0x02,0x04,0x00},
|
||||
//志
|
||||
{0x04,0xA4,0x24,0xA4,0x24,0xBF,0x24,0x24,0x24,0xA6,0x04,0x00,0x02,0x01,0x00,0x07,0x04,0x04,0x05,0x04,0x06,0x00,0x03,0x00},
|
||||
//社
|
||||
{0x84,0x44,0xF5,0x2E,0x40,0x10,0x10,0xFF,0x10,0x10,0x10,0x00,0x00,0x00,0x07,0x00,0x04,0x04,0x04,0x07,0x04,0x04,0x04,0x00},
|
||||
};
|
||||
|
||||
|
||||
|
||||
137
trunk/workspace/00_Lib/Disp_Nokia5110/u8glib/ChangeLog
Normal file
137
trunk/workspace/00_Lib/Disp_Nokia5110/u8glib/ChangeLog
Normal file
@@ -0,0 +1,137 @@
|
||||
|
||||
u8glib ChangeLog
|
||||
|
||||
2012-01-01 v0.01 Oliver Kraus <olikraus@gmail.com>
|
||||
* first beta release for Arduino IDE with simple SSD1325 support
|
||||
2012-01-04 v0.02 Oliver Kraus <olikraus@gmail.com>
|
||||
* support for some more display types
|
||||
2012-01-07 v0.03 Oliver Kraus <olikraus@gmail.com>
|
||||
* fixed some bugs, added more examples
|
||||
2012-01-07 v0.04 Oliver Kraus <olikraus@gmail.com>
|
||||
* single font file
|
||||
2012-01-08 v0.05 Oliver Kraus <olikraus@gmail.com>
|
||||
* Cleanup
|
||||
* More examples
|
||||
* SSD1325 graylevel support
|
||||
2012-01-15 v0.06 Oliver Kraus <olikraus@gmail.com>
|
||||
* LM6063 support
|
||||
2012-01-17 v0.07 Oliver Kraus <olikraus@gmail.com>
|
||||
* LM6063 support (update)
|
||||
2012-01-19 v0.08 Oliver Kraus <olikraus@gmail.com>
|
||||
* ST7920 beta device
|
||||
2012-01-21 v0.09 Oliver Kraus <olikraus@gmail.com>
|
||||
* ST7920 fixed (192x32)
|
||||
* fixed bug in com layer if pins are none
|
||||
* str reference position
|
||||
2012-01-22 v0.10 Oliver Kraus <olikraus@gmail.com>
|
||||
* Experimental LM6059
|
||||
2012-01-24 v0.11 Oliver Kraus <olikraus@gmail.com>
|
||||
* new st7920 memory layout for 128x64 lcd
|
||||
* experimental st7920 SPI
|
||||
2012-01-25 v0.12 Oliver Kraus <olikraus@gmail.com>
|
||||
* fixed st7920 memory layout for 128x64 lcd
|
||||
* ST7920 SPI performance improvement
|
||||
2012-01-27 v0.13 Oliver Kraus <olikraus@gmail.com>
|
||||
* LM6059 (Adafruit Display) fixed
|
||||
2012-02-01 v0.14 Oliver Kraus <olikraus@gmail.com>
|
||||
* undoRotation()
|
||||
* setRot..() can be used without restrictions
|
||||
* Class U8GLIB derived from Print class. New function "print"
|
||||
* Fixed memory index bug in the page management procedures
|
||||
2012-02-12 v1.00 Oliver Kraus <olikraus@gmail.com>
|
||||
* XBM support
|
||||
* F() macro support
|
||||
* str-rotation commands support ref-height and ref-position
|
||||
2012-03-17 v1.02 Oliver Kraus <olikraus@gmail.com>
|
||||
* U8GLIB_ST7687_C144MVGD spi experimental
|
||||
* U8GLIB_LC7981_160X80 8bit
|
||||
* Intersection test for frame and box procedures
|
||||
* 4L double memory architecture
|
||||
* setContrast infrastructure implemented, but not available for all devices
|
||||
* drawCircle, drawDisc
|
||||
* Bugfix for drawStr270
|
||||
* New examples: Chess (ported from dogm128 lib) and GraphicsTest
|
||||
2012-03-31 v1.03 Oliver Kraus <olikraus@gmail.com>
|
||||
* experimental parallel mode atmega
|
||||
* more unifont code pages
|
||||
* double memory, for NHD OLED and DOGXL160
|
||||
* "Menu" example
|
||||
* drawLine
|
||||
2012-04-13 v1.04 Oliver Kraus <olikraus@gmail.com>
|
||||
* Adjust U8grelease: Same version number with AVR and Arduino variant
|
||||
2012-06-10 v1.05 Oliver Kraus <olikraus@gmail.com>
|
||||
* m2icon font
|
||||
* experimental lc7981_240x64 device
|
||||
* experimental ssd1306
|
||||
* experimental ssd1322
|
||||
* Hardware state backup/restore procedure
|
||||
2012-06-15 v1.06 Oliver Kraus <olikraus@gmail.com>
|
||||
* SBN1661 (SED1520?) support
|
||||
* SSD1306 support
|
||||
* U8G_PROGMEM bugfix
|
||||
2012-07-04 v1.07 Oliver Kraus <olikraus@gmail.com>
|
||||
* Added Makefiles for AVR release (issue 77)
|
||||
* Fixed examples for Arduino Environment (issue 78)
|
||||
2012-10-02 v1.08 Oliver Kraus <olikraus@gmail.com>
|
||||
* Improved delay calculation for strobe pulse (issue 20)
|
||||
* Support Chipkit (issue 39)
|
||||
* Improved speed for ST7920 parallel mode (issue 79)
|
||||
* Overall speed optimization (new page intersection algorithm)
|
||||
* Support for Displays Newhaven NHD-C12864, CrystalFontz GFAG20232, Seeedstudio 96x96 OLED
|
||||
* Added SPI support for ST7920 with plain AVR (issue 85)
|
||||
* Add more LC7981 devices
|
||||
2012-12-23 v1.09 Oliver Kraus <olikraus@gmail.com>
|
||||
* Support for Displaytech 64128n
|
||||
* Support for MINI12864
|
||||
* HW SPI for ST7920
|
||||
* Add delay after sending a byte with (ST7920 com)
|
||||
* Support ATTiny
|
||||
* Support I2C for SSD1306
|
||||
* bdf2u8g, Windows executable released
|
||||
* LC7981 320x64
|
||||
* Scalue up: u8g::setScale2x2
|
||||
* Added more bitmap fonts
|
||||
* u8g::drawRBox(), u8g::drawRFrame()
|
||||
* Support for CFAG20232 (st7920_202x32)
|
||||
* Fixed ST7920 SW SPI for ChipKit
|
||||
* Support for tls8204
|
||||
2013-02-02 v1.10 Oliver Kraus <olikraus@gmail.com>
|
||||
* Support for SSD1309
|
||||
* Support for NHD-C12832A1Z
|
||||
* Bugfix: Fixed reset controll in parallel modes
|
||||
* Bugfix: Fixed calculation of cursor position
|
||||
* Bugfix: ST7920 parallel mode
|
||||
2013-03-2 v1.11 Oliver Kraus <olikraus@gmail.com>
|
||||
* Support for T6963
|
||||
* Support for Arduino Due
|
||||
* Sleep Mode
|
||||
* 4x mode for ST7920
|
||||
* New C++ interface for ST7920
|
||||
2013-03-24 v1.12 Oliver Kraus <olikraus@gmail.com>
|
||||
* Added touch panel examples
|
||||
2013-06-30 v1.13 Oliver Kraus <olikraus@gmail.com>
|
||||
* Fixed missing "Arduino.h" in u8g_delay.c
|
||||
* Disable interrupt for port/pin access (AVR), issue 19
|
||||
* Support for HT1632: U8GLIB_HT1632_24X16 u8g(wr, data, cs), issue 165
|
||||
* Support for SSD1351 OLED, issue 168
|
||||
* Cleaned up several compiler warnings
|
||||
* Fixed conflict with scheduler (Arduino Due), issue 155
|
||||
* HW SPI for Arduino Due, issue 180
|
||||
* Performance improvement for ST7920, issue 177
|
||||
* Added ":" to the "n"umeric variant of the fonts, issue 166
|
||||
* Added additional argument u8g_InitCom(). Use U8G_SPI_CLK_CYCLE_NONE by default.
|
||||
* Added double buffer option for many ST7565 devices
|
||||
* Tested with Arduino 1.0.5
|
||||
2013-10-03 v1.14 Oliver Kraus <olikraus@gmail.com>
|
||||
* Support for ARM controller
|
||||
* Support for the A2 micro printer (issue 191)
|
||||
* Ellipse drawing primitive (issue 187)
|
||||
* Added software reset for UC1701
|
||||
* Fixed compiler warning (issue 196)
|
||||
* Support for Freetronics SSD1351 OLED (issue 195)
|
||||
* Several other fixes and improvements
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
238
trunk/workspace/00_Lib/Disp_Nokia5110/u8glib/INSTALL
Normal file
238
trunk/workspace/00_Lib/Disp_Nokia5110/u8glib/INSTALL
Normal file
@@ -0,0 +1,238 @@
|
||||
|
||||
INSTALL Instructions for u8glib ARM release
|
||||
|
||||
|
||||
Section 1: Generic Install Instruction
|
||||
Section 2: NXP LPC Install Instructions
|
||||
|
||||
|
||||
|
||||
============================================================
|
||||
= Generic Install Instruction =
|
||||
|
||||
For NXP LPC devices, see below.
|
||||
|
||||
|
||||
== Linux/Ubuntu ==
|
||||
|
||||
From
|
||||
https://launchpad.net/gcc-arm-embedded/
|
||||
download and extract
|
||||
Linux installation tarball
|
||||
|
||||
== Windows ==
|
||||
|
||||
From
|
||||
https://launchpad.net/gcc-arm-embedded/
|
||||
download and extract
|
||||
Windows installer
|
||||
|
||||
== Prepare for target controller ==
|
||||
|
||||
To modify the existing examples for another arm controller,
|
||||
start with any of the examples for the LPC.
|
||||
|
||||
You need to
|
||||
- update u8g_arm.c
|
||||
- provide a suitable *.ld file
|
||||
|
||||
u8g_arm.c must implement the following functions:
|
||||
void u8g_Delay(uint16_t val) Delay by "val" milliseconds
|
||||
void u8g_MicroDelay(void) Delay be one microsecond
|
||||
void u8g_10MicroDelay(void) Delay by 10 microseconds
|
||||
|
||||
Additionally, u8glib requires a low level procedure to communicate with the display:
|
||||
uint8_t u8g_com_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr)
|
||||
|
||||
Depending on the argument "msg", arg_val and arg_ptr have different meanings.
|
||||
|
||||
msg == U8G_COM_MSG_STOP
|
||||
Expected action:
|
||||
Shut down display (not used at the moment)
|
||||
arg_val:
|
||||
not used
|
||||
arg_ptr:
|
||||
not used
|
||||
|
||||
msg == U8G_COM_MSG_INIT
|
||||
Expected action:
|
||||
Setup and init the display. "arg_val" contains a hint about the possible SPI speed.
|
||||
arg_val:
|
||||
U8G_SPI_CLK_CYCLE_50NS, U8G_SPI_CLK_CYCLE_300NS, U8G_SPI_CLK_CYCLE_400NS, U8G_SPI_CLK_CYCLE_NONE
|
||||
U8G_SPI_CLK_CYCLE_NONE has the largest value.
|
||||
arg_ptr:
|
||||
not used
|
||||
|
||||
msg == U8G_COM_MSG_ADDRESS
|
||||
Expected action:
|
||||
Set the address line (or data/instruction input) of the display.
|
||||
arg_val:
|
||||
0: low level
|
||||
1: high level
|
||||
arg_ptr:
|
||||
not used
|
||||
|
||||
msg == U8G_COM_MSG_CHIP_SELECT
|
||||
Expected action:
|
||||
Enable the controller chip.
|
||||
arg_val:
|
||||
0: no controller enabled
|
||||
1: enable 1st controller
|
||||
2: enable 2nd controller
|
||||
3: enable 3rd controller
|
||||
arg_ptr:
|
||||
not used
|
||||
|
||||
msg == U8G_COM_MSG_RESET
|
||||
Expected action:
|
||||
Set level for the reset input of the display.
|
||||
arg_val:
|
||||
0: low level
|
||||
1: high level
|
||||
arg_ptr:
|
||||
not used
|
||||
|
||||
msg == U8G_COM_MSG_WRITE_BYTE
|
||||
Expected action:
|
||||
Send single byte to the display.
|
||||
arg_val:
|
||||
Value, that should be sent to the display.
|
||||
arg_ptr:
|
||||
not used
|
||||
|
||||
msg == U8G_COM_MSG_WRITE_SEQ
|
||||
msg == U8G_COM_MSG_WRITE_SEQ_P
|
||||
Expected action:
|
||||
Send a sequence of bytes to the display.
|
||||
arg_val:
|
||||
Number of bytes to sent
|
||||
arg_ptr:
|
||||
Pointer to the memory location of the first value.
|
||||
For AVR controller, the memory location can be in
|
||||
flash (message U8G_COM_MSG_WRITE_SEQ_P),
|
||||
|
||||
|
||||
|
||||
============================================================
|
||||
= NXP LPC Install Instructions =
|
||||
|
||||
== Linux/Ubuntu ==
|
||||
|
||||
From
|
||||
https://launchpad.net/gcc-arm-embedded/
|
||||
download and extract
|
||||
Linux installation tarball
|
||||
|
||||
From
|
||||
http://sourceforge.net/projects/lpc21isp/files/
|
||||
download, extract and compile (make)
|
||||
lpc21isp tar file
|
||||
|
||||
In the u8g example files, update the Makefile with the path to the
|
||||
ARM gcc ("GCCPATH" in the Makeilfe)
|
||||
and
|
||||
LPC flash utility ("FLASHTOOL" in the Makeilfe)
|
||||
|
||||
== Prepare for target controller ==
|
||||
|
||||
Depending on your controller, do one of the following:
|
||||
|
||||
1) Target controller is named in this U8glib distribution
|
||||
--> Nothing to do. Examples will work
|
||||
2) A member of the same controller family is available in the U8glib distribution
|
||||
--> locate the *.ld script in the "common" folder and update the FLASH and RAM values
|
||||
3) If neither 1) or 2) is true for the target controller, one example subdirectory (e.g.
|
||||
lpc1114 can be used as template. Usually you need to update/replace all files
|
||||
in the common folder. See also the generic instruction in the first section of this
|
||||
document.
|
||||
|
||||
== Compile U8g example ==
|
||||
|
||||
Inside the folder of one of the examples:
|
||||
make upload
|
||||
will compile, link and upload the example
|
||||
|
||||
|
||||
== Windows (Min-GW) ==
|
||||
|
||||
Download and install mingw and msys (http://www.mingw.org/).
|
||||
|
||||
From
|
||||
https://launchpad.net/gcc-arm-embedded/
|
||||
download and extract
|
||||
Windows installer
|
||||
Default path:
|
||||
/c/Program\ Files\ \(x86\)/GNU\ Tools\ ARM\ Embedded/xxxxxxx/
|
||||
|
||||
Windows driver for the USB to UART converter.
|
||||
For FTDI devices, use the virtual com port (VCP) driver.
|
||||
Download and install:
|
||||
http://www.ftdichip.com/Drivers/VCP.htm
|
||||
|
||||
To flash the ARM controller via UART interface (attached to a FTDI USB/UART converter),
|
||||
download and install the virtual com port (VCP) driver:
|
||||
http://www.ftdichip.com/Drivers/VCP.htm
|
||||
|
||||
The flash procedure can be done with "flashmagic".
|
||||
Download and install:
|
||||
http://www.flashmagictool.com/
|
||||
|
||||
Unzip u8glib for ARM controller into an empty folder (c:\u8g)
|
||||
|
||||
cd /c/u8g/lpc1114/hello_world
|
||||
|
||||
Update the path to gcc-arm-embedded in Makefile.mingw.
|
||||
|
||||
make
|
||||
|
||||
Expect some delay during linking phase. The .hex file is placed in the same directory.
|
||||
Call flashmagic
|
||||
- select the correct uC,
|
||||
- load the .hex file,
|
||||
- enable "Erase blocks used by flashfile" and
|
||||
- put the uC into programming mode (pull ISP pin low and reset the uC)
|
||||
before starting the flash procedure.
|
||||
|
||||
|
||||
== Windows (gnu make) ==
|
||||
|
||||
From
|
||||
http://gnuwin32.sourceforge.net/packages/make.htm
|
||||
download and execute
|
||||
setup
|
||||
for "make" ("Complete package, except sources")
|
||||
The rest of this sections assumes, that make has been installed at the default location.
|
||||
|
||||
From
|
||||
https://launchpad.net/gcc-arm-embedded/
|
||||
download and execute the
|
||||
Windows installer
|
||||
The rest of this sections assumes, that gcc-arm-embedded has been installed at the default location.
|
||||
|
||||
To flash the ARM controller via UART interface (attached to a FTDI USB/UART converter),
|
||||
download and install the virtual com port (VCP) driver:
|
||||
http://www.ftdichip.com/Drivers/VCP.htm
|
||||
|
||||
The flash procedure can be done with "flashmagic".
|
||||
Download and install:
|
||||
http://www.flashmagictool.com/
|
||||
|
||||
Unzip u8glib for ARM controller into an empty folder (c:\u8g).
|
||||
|
||||
Start "cmd.exe"
|
||||
|
||||
cd c:\u8g\lpc1114\hello_world\
|
||||
|
||||
"c:\Program Files (x86)\GnuWin32\bin\make.exe" -f Makefile.gnuwin32
|
||||
|
||||
Expect some delay during linking phase. The .hex file is placed in the same directory.
|
||||
Call flashmagic
|
||||
- select the correct uC,
|
||||
- load the .hex file,
|
||||
- enable "Erase blocks used by flashfile" and
|
||||
- put the uC into programming mode (pull ISP pin low and reset the uC)
|
||||
before starting the flash procedure.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,559 @@
|
||||
/****************************************************************************
|
||||
* $Id:: LPC11xx.h 3635 2010-06-02 00:31:46Z usb00423 $
|
||||
* Project: NXP LPC11xx software example
|
||||
*
|
||||
* Description:
|
||||
* CMSIS Cortex-M0 Core Peripheral Access Layer Header File for
|
||||
* NXP LPC11xx Device Series
|
||||
*
|
||||
****************************************************************************
|
||||
* Software that is described herein is for illustrative purposes only
|
||||
* which provides customers with programming information regarding the
|
||||
* products. This software is supplied "AS IS" without any warranties.
|
||||
* NXP Semiconductors assumes no responsibility or liability for the
|
||||
* use of the software, conveys no license or title under any patent,
|
||||
* copyright, or mask work right to the product. NXP Semiconductors
|
||||
* reserves the right to make changes in the software without
|
||||
* notification. NXP Semiconductors also make no representation or
|
||||
* warranty that such application will be suitable for the specified
|
||||
* use without further testing or modification.
|
||||
****************************************************************************/
|
||||
#ifndef __LPC11xx_H__
|
||||
#define __LPC11xx_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** @addtogroup LPC11xx_Definitions LPC11xx Definitions
|
||||
This file defines all structures and symbols for LPC11xx:
|
||||
- Registers and bitfields
|
||||
- peripheral base address
|
||||
- peripheral ID
|
||||
- PIO definitions
|
||||
@{
|
||||
*/
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* Processor and Core Peripherals */
|
||||
/******************************************************************************/
|
||||
/** @addtogroup LPC11xx_CMSIS LPC11xx CMSIS Definitions
|
||||
Configuration of the Cortex-M0 Processor and Core Peripherals
|
||||
@{
|
||||
*/
|
||||
|
||||
/*
|
||||
* ==========================================================================
|
||||
* ---------- Interrupt Number Definition -----------------------------------
|
||||
* ==========================================================================
|
||||
*/
|
||||
|
||||
typedef enum IRQn
|
||||
{
|
||||
/****** Cortex-M0 Processor Exceptions Numbers ***************************************************/
|
||||
NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
|
||||
HardFault_IRQn = -13, /*!< 3 Cortex-M0 Hard Fault Interrupt */
|
||||
SVCall_IRQn = -5, /*!< 11 Cortex-M0 SV Call Interrupt */
|
||||
PendSV_IRQn = -2, /*!< 14 Cortex-M0 Pend SV Interrupt */
|
||||
SysTick_IRQn = -1, /*!< 15 Cortex-M0 System Tick Interrupt */
|
||||
|
||||
/****** LPC11xx Specific Interrupt Numbers *******************************************************/
|
||||
WAKEUP0_IRQn = 0, /*!< All I/O pins can be used as wakeup source. */
|
||||
WAKEUP1_IRQn = 1, /*!< There are 13 pins in total for LPC11xx */
|
||||
WAKEUP2_IRQn = 2,
|
||||
WAKEUP3_IRQn = 3,
|
||||
WAKEUP4_IRQn = 4,
|
||||
WAKEUP5_IRQn = 5,
|
||||
WAKEUP6_IRQn = 6,
|
||||
WAKEUP7_IRQn = 7,
|
||||
WAKEUP8_IRQn = 8,
|
||||
WAKEUP9_IRQn = 9,
|
||||
WAKEUP10_IRQn = 10,
|
||||
WAKEUP11_IRQn = 11,
|
||||
WAKEUP12_IRQn = 12,
|
||||
CAN_IRQn = 13, /*!< CAN Interrupt */
|
||||
SSP1_IRQn = 14, /*!< SSP1 Interrupt */
|
||||
I2C_IRQn = 15, /*!< I2C Interrupt */
|
||||
TIMER_16_0_IRQn = 16, /*!< 16-bit Timer0 Interrupt */
|
||||
TIMER_16_1_IRQn = 17, /*!< 16-bit Timer1 Interrupt */
|
||||
TIMER_32_0_IRQn = 18, /*!< 32-bit Timer0 Interrupt */
|
||||
TIMER_32_1_IRQn = 19, /*!< 32-bit Timer1 Interrupt */
|
||||
SSP0_IRQn = 20, /*!< SSP0 Interrupt */
|
||||
UART_IRQn = 21, /*!< UART Interrupt */
|
||||
ADC_IRQn = 24, /*!< A/D Converter Interrupt */
|
||||
WDT_IRQn = 25, /*!< Watchdog timer Interrupt */
|
||||
BOD_IRQn = 26, /*!< Brown Out Detect(BOD) Interrupt */
|
||||
EINT3_IRQn = 28, /*!< External Interrupt 3 Interrupt */
|
||||
EINT2_IRQn = 29, /*!< External Interrupt 2 Interrupt */
|
||||
EINT1_IRQn = 30, /*!< External Interrupt 1 Interrupt */
|
||||
EINT0_IRQn = 31, /*!< External Interrupt 0 Interrupt */
|
||||
} IRQn_Type;
|
||||
|
||||
|
||||
/*
|
||||
* ==========================================================================
|
||||
* ----------- Processor and Core Peripheral Section ------------------------
|
||||
* ==========================================================================
|
||||
*/
|
||||
|
||||
/* Configuration of the Cortex-M3 Processor and Core Peripherals */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of Bits used for Priority Levels */
|
||||
#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
|
||||
|
||||
/*@}*/ /* end of group LPC11xx_CMSIS */
|
||||
|
||||
|
||||
#include "core_cm0.h" /* Cortex-M0 processor and core peripherals */
|
||||
#include "system_LPC11xx.h" /* System Header */
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* Device Specific Peripheral Registers structures */
|
||||
/******************************************************************************/
|
||||
|
||||
#if defined ( __CC_ARM )
|
||||
#pragma anon_unions
|
||||
#endif
|
||||
|
||||
/*------------- System Control (SYSCON) --------------------------------------*/
|
||||
/** @addtogroup LPC11xx_SYSCON LPC11xx System Control Block
|
||||
@{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
__IO uint32_t SYSMEMREMAP; /*!< Offset: 0x000 System memory remap (R/W) */
|
||||
__IO uint32_t PRESETCTRL; /*!< Offset: 0x004 Peripheral reset control (R/W) */
|
||||
__IO uint32_t SYSPLLCTRL; /*!< Offset: 0x008 System PLL control (R/W) */
|
||||
__IO uint32_t SYSPLLSTAT; /*!< Offset: 0x00C System PLL status (R/ ) */
|
||||
uint32_t RESERVED0[4];
|
||||
|
||||
__IO uint32_t SYSOSCCTRL; /*!< Offset: 0x020 System oscillator control (R/W) */
|
||||
__IO uint32_t WDTOSCCTRL; /*!< Offset: 0x024 Watchdog oscillator control (R/W) */
|
||||
__IO uint32_t IRCCTRL; /*!< Offset: 0x028 IRC control (R/W) */
|
||||
uint32_t RESERVED1[1];
|
||||
__IO uint32_t SYSRESSTAT; /*!< Offset: 0x030 System reset status Register (R/ ) */
|
||||
uint32_t RESERVED2[3];
|
||||
__IO uint32_t SYSPLLCLKSEL; /*!< Offset: 0x040 System PLL clock source select (R/W) */
|
||||
__IO uint32_t SYSPLLCLKUEN; /*!< Offset: 0x044 System PLL clock source update enable (R/W) */
|
||||
uint32_t RESERVED3[10];
|
||||
|
||||
__IO uint32_t MAINCLKSEL; /*!< Offset: 0x070 Main clock source select (R/W) */
|
||||
__IO uint32_t MAINCLKUEN; /*!< Offset: 0x074 Main clock source update enable (R/W) */
|
||||
__IO uint32_t SYSAHBCLKDIV; /*!< Offset: 0x078 System AHB clock divider (R/W) */
|
||||
uint32_t RESERVED4[1];
|
||||
|
||||
__IO uint32_t SYSAHBCLKCTRL; /*!< Offset: 0x080 System AHB clock control (R/W) */
|
||||
uint32_t RESERVED5[4];
|
||||
__IO uint32_t SSP0CLKDIV; /*!< Offset: 0x094 SSP0 clock divider (R/W) */
|
||||
__IO uint32_t UARTCLKDIV; /*!< Offset: 0x098 UART clock divider (R/W) */
|
||||
__IO uint32_t SSP1CLKDIV; /*!< Offset: 0x09C SSP1 clock divider (R/W) */
|
||||
uint32_t RESERVED6[4];
|
||||
|
||||
__IO uint32_t SYSTICKCLKDIV; /*!< Offset: 0x0B0 SYSTICK clock divider (R/W) */
|
||||
uint32_t RESERVED7[7];
|
||||
|
||||
__IO uint32_t WDTCLKSEL; /*!< Offset: 0x0D0 WDT clock source select (R/W) */
|
||||
__IO uint32_t WDTCLKUEN; /*!< Offset: 0x0D4 WDT clock source update enable (R/W) */
|
||||
__IO uint32_t WDTCLKDIV; /*!< Offset: 0x0D8 WDT clock divider (R/W) */
|
||||
uint32_t RESERVED8[1];
|
||||
__IO uint32_t CLKOUTCLKSEL; /*!< Offset: 0x0E0 CLKOUT clock source select (R/W) */
|
||||
__IO uint32_t CLKOUTUEN; /*!< Offset: 0x0E4 CLKOUT clock source update enable (R/W) */
|
||||
__IO uint32_t CLKOUTDIV; /*!< Offset: 0x0E8 CLKOUT clock divider (R/W) */
|
||||
uint32_t RESERVED9[5];
|
||||
|
||||
__IO uint32_t PIOPORCAP0; /*!< Offset: 0x100 POR captured PIO status 0 (R/ ) */
|
||||
__IO uint32_t PIOPORCAP1; /*!< Offset: 0x104 POR captured PIO status 1 (R/ ) */
|
||||
uint32_t RESERVED10[18];
|
||||
|
||||
__IO uint32_t BODCTRL; /*!< Offset: 0x150 BOD control (R/W) */
|
||||
uint32_t RESERVED11[1];
|
||||
__IO uint32_t SYSTCKCAL; /*!< Offset: 0x158 System tick counter calibration (R/W) */
|
||||
uint32_t RESERVED12;
|
||||
__IO uint32_t MAINREGVOUT0CFG; /*!< Offset: 0x160 Main Regulator Voltage 0 Configuration */
|
||||
__IO uint32_t MAINREGVOUT1CFG; /*!< Offset: 0x164 Main Regulator Voltage 1 Configuration */
|
||||
uint32_t RESERVED13[38];
|
||||
|
||||
__IO uint32_t STARTAPRP0; /*!< Offset: 0x200 Start logic edge control Register 0 (R/W) */
|
||||
__IO uint32_t STARTERP0; /*!< Offset: 0x204 Start logic signal enable Register 0 (R/W) */
|
||||
__IO uint32_t STARTRSRP0CLR; /*!< Offset: 0x208 Start logic reset Register 0 ( /W) */
|
||||
__IO uint32_t STARTSRP0; /*!< Offset: 0x20C Start logic status Register 0 (R/W) */
|
||||
uint32_t RESERVED14[8];
|
||||
|
||||
__IO uint32_t PDSLEEPCFG; /*!< Offset: 0x230 Power-down states in Deep-sleep mode (R/W) */
|
||||
__IO uint32_t PDAWAKECFG; /*!< Offset: 0x234 Power-down states after wake-up (R/W) */
|
||||
__IO uint32_t PDRUNCFG; /*!< Offset: 0x238 Power-down configuration Register (R/W) */
|
||||
uint32_t RESERVED15[101];
|
||||
__O uint32_t VOUTCFGPROT; /*!< Offset: 0x3D0 Voltage Output Configuration Protection Register (W) */
|
||||
uint32_t RESERVED16[8];
|
||||
__I uint32_t DEVICE_ID; /*!< Offset: 0x3F4 Device ID (R/ ) */
|
||||
} LPC_SYSCON_TypeDef;
|
||||
/*@}*/ /* end of group LPC11xx_SYSCON */
|
||||
|
||||
|
||||
/*------------- Pin Connect Block (IOCON) --------------------------------*/
|
||||
/** @addtogroup LPC11xx_IOCON LPC11xx I/O Configuration Block
|
||||
@{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
__IO uint32_t PIO2_6; /*!< Offset: 0x000 I/O configuration for pin PIO2_6 (R/W) */
|
||||
uint32_t RESERVED0[1];
|
||||
__IO uint32_t PIO2_0; /*!< Offset: 0x008 I/O configuration for pin PIO2_0/DTR/SSEL1 (R/W) */
|
||||
__IO uint32_t RESET_PIO0_0; /*!< Offset: 0x00C I/O configuration for pin RESET/PIO0_0 (R/W) */
|
||||
__IO uint32_t PIO0_1; /*!< Offset: 0x010 I/O configuration for pin PIO0_1/CLKOUT/CT32B0_MAT2 (R/W) */
|
||||
__IO uint32_t PIO1_8; /*!< Offset: 0x014 I/O configuration for pin PIO1_8/CT16B1_CAP0 (R/W) */
|
||||
uint32_t RESERVED1[1];
|
||||
__IO uint32_t PIO0_2; /*!< Offset: 0x01C I/O configuration for pin PIO0_2/SSEL0/CT16B0_CAP0 (R/W) */
|
||||
|
||||
__IO uint32_t PIO2_7; /*!< Offset: 0x020 I/O configuration for pin PIO2_7 (R/W) */
|
||||
__IO uint32_t PIO2_8; /*!< Offset: 0x024 I/O configuration for pin PIO2_8 (R/W) */
|
||||
__IO uint32_t PIO2_1; /*!< Offset: 0x028 I/O configuration for pin PIO2_1/nDSR/SCK1 (R/W) */
|
||||
__IO uint32_t PIO0_3; /*!< Offset: 0x02C I/O configuration for pin PIO0_3 (R/W) */
|
||||
__IO uint32_t PIO0_4; /*!< Offset: 0x030 I/O configuration for pin PIO0_4/SCL (R/W) */
|
||||
__IO uint32_t PIO0_5; /*!< Offset: 0x034 I/O configuration for pin PIO0_5/SDA (R/W) */
|
||||
__IO uint32_t PIO1_9; /*!< Offset: 0x038 I/O configuration for pin PIO1_9/CT16B1_MAT0 (R/W) */
|
||||
__IO uint32_t PIO3_4; /*!< Offset: 0x03C I/O configuration for pin PIO3_4 (R/W) */
|
||||
|
||||
__IO uint32_t PIO2_4; /*!< Offset: 0x040 I/O configuration for pin PIO2_4 (R/W) */
|
||||
__IO uint32_t PIO2_5; /*!< Offset: 0x044 I/O configuration for pin PIO2_5 (R/W) */
|
||||
__IO uint32_t PIO3_5; /*!< Offset: 0x048 I/O configuration for pin PIO3_5 (R/W) */
|
||||
__IO uint32_t PIO0_6; /*!< Offset: 0x04C I/O configuration for pin PIO0_6/SCK0 (R/W) */
|
||||
__IO uint32_t PIO0_7; /*!< Offset: 0x050 I/O configuration for pin PIO0_7/nCTS (R/W) */
|
||||
__IO uint32_t PIO2_9; /*!< Offset: 0x054 I/O configuration for pin PIO2_9 (R/W) */
|
||||
__IO uint32_t PIO2_10; /*!< Offset: 0x058 I/O configuration for pin PIO2_10 (R/W) */
|
||||
__IO uint32_t PIO2_2; /*!< Offset: 0x05C I/O configuration for pin PIO2_2/DCD/MISO1 (R/W) */
|
||||
|
||||
__IO uint32_t PIO0_8; /*!< Offset: 0x060 I/O configuration for pin PIO0_8/MISO0/CT16B0_MAT0 (R/W) */
|
||||
__IO uint32_t PIO0_9; /*!< Offset: 0x064 I/O configuration for pin PIO0_9/MOSI0/CT16B0_MAT1 (R/W) */
|
||||
__IO uint32_t SWCLK_PIO0_10; /*!< Offset: 0x068 I/O configuration for pin SWCLK/PIO0_10/SCK0/CT16B0_MAT2 (R/W) */
|
||||
__IO uint32_t PIO1_10; /*!< Offset: 0x06C I/O configuration for pin PIO1_10/AD6/CT16B1_MAT1 (R/W) */
|
||||
__IO uint32_t PIO2_11; /*!< Offset: 0x070 I/O configuration for pin PIO2_11/SCK0 (R/W) */
|
||||
__IO uint32_t R_PIO0_11; /*!< Offset: 0x074 I/O configuration for pin TDI/PIO0_11/AD0/CT32B0_MAT3 (R/W) */
|
||||
__IO uint32_t R_PIO1_0; /*!< Offset: 0x078 I/O configuration for pin TMS/PIO1_0/AD1/CT32B1_CAP0 (R/W) */
|
||||
__IO uint32_t R_PIO1_1; /*!< Offset: 0x07C I/O configuration for pin TDO/PIO1_1/AD2/CT32B1_MAT0 (R/W) */
|
||||
|
||||
__IO uint32_t R_PIO1_2; /*!< Offset: 0x080 I/O configuration for pin nTRST/PIO1_2/AD3/CT32B1_MAT1 (R/W) */
|
||||
__IO uint32_t PIO3_0; /*!< Offset: 0x084 I/O configuration for pin PIO3_0/nDTR (R/W) */
|
||||
__IO uint32_t PIO3_1; /*!< Offset: 0x088 I/O configuration for pin PIO3_1/nDSR (R/W) */
|
||||
__IO uint32_t PIO2_3; /*!< Offset: 0x08C I/O configuration for pin PIO2_3/RI/MOSI1 (R/W) */
|
||||
__IO uint32_t SWDIO_PIO1_3; /*!< Offset: 0x090 I/O configuration for pin SWDIO/PIO1_3/AD4/CT32B1_MAT2 (R/W) */
|
||||
__IO uint32_t PIO1_4; /*!< Offset: 0x094 I/O configuration for pin PIO1_4/AD5/CT32B1_MAT3 (R/W) */
|
||||
__IO uint32_t PIO1_11; /*!< Offset: 0x098 I/O configuration for pin PIO1_11/AD7 (R/W) */
|
||||
__IO uint32_t PIO3_2; /*!< Offset: 0x09C I/O configuration for pin PIO3_2/nDCD (R/W) */
|
||||
|
||||
__IO uint32_t PIO1_5; /*!< Offset: 0x0A0 I/O configuration for pin PIO1_5/nRTS/CT32B0_CAP0 (R/W) */
|
||||
__IO uint32_t PIO1_6; /*!< Offset: 0x0A4 I/O configuration for pin PIO1_6/RXD/CT32B0_MAT0 (R/W) */
|
||||
__IO uint32_t PIO1_7; /*!< Offset: 0x0A8 I/O configuration for pin PIO1_7/TXD/CT32B0_MAT1 (R/W) */
|
||||
__IO uint32_t PIO3_3; /*!< Offset: 0x0AC I/O configuration for pin PIO3_3/nRI (R/W) */
|
||||
__IO uint32_t SCK_LOC; /*!< Offset: 0x0B0 SCK pin location select Register (R/W) */
|
||||
__IO uint32_t DSR_LOC; /*!< Offset: 0x0B4 DSR pin location select Register (R/W) */
|
||||
__IO uint32_t DCD_LOC; /*!< Offset: 0x0B8 DCD pin location select Register (R/W) */
|
||||
__IO uint32_t RI_LOC; /*!< Offset: 0x0BC RI pin location Register (R/W) */
|
||||
} LPC_IOCON_TypeDef;
|
||||
/*@}*/ /* end of group LPC11xx_IOCON */
|
||||
|
||||
|
||||
/*------------- Power Management Unit (PMU) --------------------------*/
|
||||
/** @addtogroup LPC11xx_PMU LPC11xx Power Management Unit
|
||||
@{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
__IO uint32_t PCON; /*!< Offset: 0x000 Power control Register (R/W) */
|
||||
__IO uint32_t GPREG0; /*!< Offset: 0x004 General purpose Register 0 (R/W) */
|
||||
__IO uint32_t GPREG1; /*!< Offset: 0x008 General purpose Register 1 (R/W) */
|
||||
__IO uint32_t GPREG2; /*!< Offset: 0x00C General purpose Register 2 (R/W) */
|
||||
__IO uint32_t GPREG3; /*!< Offset: 0x010 General purpose Register 3 (R/W) */
|
||||
__IO uint32_t GPREG4; /*!< Offset: 0x014 General purpose Register 4 (R/W) */
|
||||
} LPC_PMU_TypeDef;
|
||||
/*@}*/ /* end of group LPC11xx_PMU */
|
||||
|
||||
|
||||
/*------------- General Purpose Input/Output (GPIO) --------------------------*/
|
||||
/** @addtogroup LPC11xx_GPIO LPC11xx General Purpose Input/Output
|
||||
@{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
union {
|
||||
__IO uint32_t MASKED_ACCESS[4096]; /*!< Offset: 0x0000 to 0x3FFC Port data Register for pins PIOn_0 to PIOn_11 (R/W) */
|
||||
struct {
|
||||
uint32_t RESERVED0[4095];
|
||||
__IO uint32_t DATA; /*!< Offset: 0x3FFC Port data Register (R/W) */
|
||||
};
|
||||
};
|
||||
uint32_t RESERVED1[4096];
|
||||
__IO uint32_t DIR; /*!< Offset: 0x8000 Data direction Register (R/W) */
|
||||
__IO uint32_t IS; /*!< Offset: 0x8004 Interrupt sense Register (R/W) */
|
||||
__IO uint32_t IBE; /*!< Offset: 0x8008 Interrupt both edges Register (R/W) */
|
||||
__IO uint32_t IEV; /*!< Offset: 0x800C Interrupt event Register (R/W) */
|
||||
__IO uint32_t IE; /*!< Offset: 0x8010 Interrupt mask Register (R/W) */
|
||||
__IO uint32_t RIS; /*!< Offset: 0x8014 Raw interrupt status Register (R/ ) */
|
||||
__IO uint32_t MIS; /*!< Offset: 0x8018 Masked interrupt status Register (R/ ) */
|
||||
__IO uint32_t IC; /*!< Offset: 0x801C Interrupt clear Register (R/W) */
|
||||
} LPC_GPIO_TypeDef;
|
||||
/*@}*/ /* end of group LPC11xx_GPIO */
|
||||
|
||||
|
||||
/*------------- Timer (TMR) --------------------------------------------------*/
|
||||
/** @addtogroup LPC11xx_TMR LPC11xx 16/32-bit Counter/Timer
|
||||
@{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
__IO uint32_t IR; /*!< Offset: 0x000 Interrupt Register (R/W) */
|
||||
__IO uint32_t TCR; /*!< Offset: 0x004 Timer Control Register (R/W) */
|
||||
__IO uint32_t TC; /*!< Offset: 0x008 Timer Counter Register (R/W) */
|
||||
__IO uint32_t PR; /*!< Offset: 0x00C Prescale Register (R/W) */
|
||||
__IO uint32_t PC; /*!< Offset: 0x010 Prescale Counter Register (R/W) */
|
||||
__IO uint32_t MCR; /*!< Offset: 0x014 Match Control Register (R/W) */
|
||||
__IO uint32_t MR0; /*!< Offset: 0x018 Match Register 0 (R/W) */
|
||||
__IO uint32_t MR1; /*!< Offset: 0x01C Match Register 1 (R/W) */
|
||||
__IO uint32_t MR2; /*!< Offset: 0x020 Match Register 2 (R/W) */
|
||||
__IO uint32_t MR3; /*!< Offset: 0x024 Match Register 3 (R/W) */
|
||||
__IO uint32_t CCR; /*!< Offset: 0x028 Capture Control Register (R/W) */
|
||||
__I uint32_t CR0; /*!< Offset: 0x02C Capture Register 0 (R/ ) */
|
||||
uint32_t RESERVED1[3];
|
||||
__IO uint32_t EMR; /*!< Offset: 0x03C External Match Register (R/W) */
|
||||
uint32_t RESERVED2[12];
|
||||
__IO uint32_t CTCR; /*!< Offset: 0x070 Count Control Register (R/W) */
|
||||
__IO uint32_t PWMC; /*!< Offset: 0x074 PWM Control Register (R/W) */
|
||||
} LPC_TMR_TypeDef;
|
||||
/*@}*/ /* end of group LPC11xx_TMR */
|
||||
|
||||
|
||||
/*------------- Universal Asynchronous Receiver Transmitter (UART) -----------*/
|
||||
/** @addtogroup LPC11xx_UART LPC11xx Universal Asynchronous Receiver/Transmitter
|
||||
@{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
union {
|
||||
__I uint32_t RBR; /*!< Offset: 0x000 Receiver Buffer Register (R/ ) */
|
||||
__O uint32_t THR; /*!< Offset: 0x000 Transmit Holding Register ( /W) */
|
||||
__IO uint32_t DLL; /*!< Offset: 0x000 Divisor Latch LSB (R/W) */
|
||||
};
|
||||
union {
|
||||
__IO uint32_t DLM; /*!< Offset: 0x004 Divisor Latch MSB (R/W) */
|
||||
__IO uint32_t IER; /*!< Offset: 0x000 Interrupt Enable Register (R/W) */
|
||||
};
|
||||
union {
|
||||
__I uint32_t IIR; /*!< Offset: 0x008 Interrupt ID Register (R/ ) */
|
||||
__O uint32_t FCR; /*!< Offset: 0x008 FIFO Control Register ( /W) */
|
||||
};
|
||||
__IO uint32_t LCR; /*!< Offset: 0x00C Line Control Register (R/W) */
|
||||
__IO uint32_t MCR; /*!< Offset: 0x010 Modem control Register (R/W) */
|
||||
__I uint32_t LSR; /*!< Offset: 0x014 Line Status Register (R/ ) */
|
||||
__I uint32_t MSR; /*!< Offset: 0x018 Modem status Register (R/ ) */
|
||||
__IO uint32_t SCR; /*!< Offset: 0x01C Scratch Pad Register (R/W) */
|
||||
__IO uint32_t ACR; /*!< Offset: 0x020 Auto-baud Control Register (R/W) */
|
||||
uint32_t RESERVED0;
|
||||
__IO uint32_t FDR; /*!< Offset: 0x028 Fractional Divider Register (R/W) */
|
||||
uint32_t RESERVED1;
|
||||
__IO uint32_t TER; /*!< Offset: 0x030 Transmit Enable Register (R/W) */
|
||||
uint32_t RESERVED2[6];
|
||||
__IO uint32_t RS485CTRL; /*!< Offset: 0x04C RS-485/EIA-485 Control Register (R/W) */
|
||||
__IO uint32_t ADRMATCH; /*!< Offset: 0x050 RS-485/EIA-485 address match Register (R/W) */
|
||||
__IO uint32_t RS485DLY; /*!< Offset: 0x054 RS-485/EIA-485 direction control delay Register (R/W) */
|
||||
__I uint32_t FIFOLVL; /*!< Offset: 0x058 FIFO Level Register (R/ ) */
|
||||
} LPC_UART_TypeDef;
|
||||
/*@}*/ /* end of group LPC11xx_UART */
|
||||
|
||||
|
||||
/*------------- Synchronous Serial Communication (SSP) -----------------------*/
|
||||
/** @addtogroup LPC11xx_SSP LPC11xx Synchronous Serial Port
|
||||
@{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
__IO uint32_t CR0; /*!< Offset: 0x000 Control Register 0 (R/W) */
|
||||
__IO uint32_t CR1; /*!< Offset: 0x004 Control Register 1 (R/W) */
|
||||
__IO uint32_t DR; /*!< Offset: 0x008 Data Register (R/W) */
|
||||
__I uint32_t SR; /*!< Offset: 0x00C Status Registe (R/ ) */
|
||||
__IO uint32_t CPSR; /*!< Offset: 0x010 Clock Prescale Register (R/W) */
|
||||
__IO uint32_t IMSC; /*!< Offset: 0x014 Interrupt Mask Set and Clear Register (R/W) */
|
||||
__IO uint32_t RIS; /*!< Offset: 0x018 Raw Interrupt Status Register (R/W) */
|
||||
__IO uint32_t MIS; /*!< Offset: 0x01C Masked Interrupt Status Register (R/W) */
|
||||
__IO uint32_t ICR; /*!< Offset: 0x020 SSPICR Interrupt Clear Register (R/W) */
|
||||
} LPC_SSP_TypeDef;
|
||||
/*@}*/ /* end of group LPC11xx_SSP */
|
||||
|
||||
|
||||
/*------------- Inter-Integrated Circuit (I2C) -------------------------------*/
|
||||
/** @addtogroup LPC11xx_I2C LPC11xx I2C-Bus Interface
|
||||
@{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
__IO uint32_t CONSET; /*!< Offset: 0x000 I2C Control Set Register (R/W) */
|
||||
__I uint32_t STAT; /*!< Offset: 0x004 I2C Status Register (R/ ) */
|
||||
__IO uint32_t DAT; /*!< Offset: 0x008 I2C Data Register (R/W) */
|
||||
__IO uint32_t ADR0; /*!< Offset: 0x00C I2C Slave Address Register 0 (R/W) */
|
||||
__IO uint32_t SCLH; /*!< Offset: 0x010 SCH Duty Cycle Register High Half Word (R/W) */
|
||||
__IO uint32_t SCLL; /*!< Offset: 0x014 SCL Duty Cycle Register Low Half Word (R/W) */
|
||||
__O uint32_t CONCLR; /*!< Offset: 0x018 I2C Control Clear Register ( /W) */
|
||||
__IO uint32_t MMCTRL; /*!< Offset: 0x01C Monitor mode control register (R/W) */
|
||||
__IO uint32_t ADR1; /*!< Offset: 0x020 I2C Slave Address Register 1 (R/W) */
|
||||
__IO uint32_t ADR2; /*!< Offset: 0x024 I2C Slave Address Register 2 (R/W) */
|
||||
__IO uint32_t ADR3; /*!< Offset: 0x028 I2C Slave Address Register 3 (R/W) */
|
||||
__I uint32_t DATA_BUFFER; /*!< Offset: 0x02C Data buffer register ( /W) */
|
||||
__IO uint32_t MASK0; /*!< Offset: 0x030 I2C Slave address mask register 0 (R/W) */
|
||||
__IO uint32_t MASK1; /*!< Offset: 0x034 I2C Slave address mask register 1 (R/W) */
|
||||
__IO uint32_t MASK2; /*!< Offset: 0x038 I2C Slave address mask register 2 (R/W) */
|
||||
__IO uint32_t MASK3; /*!< Offset: 0x03C I2C Slave address mask register 3 (R/W) */
|
||||
} LPC_I2C_TypeDef;
|
||||
/*@}*/ /* end of group LPC11xx_I2C */
|
||||
|
||||
|
||||
/*------------- Watchdog Timer (WDT) -----------------------------------------*/
|
||||
/** @addtogroup LPC11xx_WDT LPC11xx WatchDog Timer
|
||||
@{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
__IO uint32_t MOD; /*!< Offset: 0x000 Watchdog mode register (R/W) */
|
||||
__IO uint32_t TC; /*!< Offset: 0x004 Watchdog timer constant register (R/W) */
|
||||
__O uint32_t FEED; /*!< Offset: 0x008 Watchdog feed sequence register ( /W) */
|
||||
__I uint32_t TV; /*!< Offset: 0x00C Watchdog timer value register (R/ ) */
|
||||
uint32_t RESERVED0;
|
||||
__IO uint32_t WARNINT;
|
||||
__IO uint32_t WINDOW;
|
||||
} LPC_WDT_TypeDef;
|
||||
/*@}*/ /* end of group LPC11xx_WDT */
|
||||
|
||||
|
||||
/*------------- Analog-to-Digital Converter (ADC) ----------------------------*/
|
||||
/** @addtogroup LPC11xx_ADC LPC11xx Analog-to-Digital Converter
|
||||
@{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
__IO uint32_t CR; /*!< Offset: 0x000 A/D Control Register (R/W) */
|
||||
__IO uint32_t GDR; /*!< Offset: 0x004 A/D Global Data Register (R/W) */
|
||||
uint32_t RESERVED0;
|
||||
__IO uint32_t INTEN; /*!< Offset: 0x00C A/D Interrupt Enable Register (R/W) */
|
||||
__IO uint32_t DR[8]; /*!< Offset: 0x010-0x02C A/D Channel 0..7 Data Register (R/W) */
|
||||
__I uint32_t STAT; /*!< Offset: 0x030 A/D Status Register (R/ ) */
|
||||
} LPC_ADC_TypeDef;
|
||||
/*@}*/ /* end of group LPC11xx_ADC */
|
||||
|
||||
|
||||
/*------------- CAN Controller (CAN) ----------------------------*/
|
||||
/** @addtogroup LPC11xx_CAN LPC11xx Controller Area Network(CAN)
|
||||
@{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
__IO uint32_t CNTL; /* 0x000 */
|
||||
__IO uint32_t STAT;
|
||||
__IO uint32_t EC;
|
||||
__IO uint32_t BT;
|
||||
__IO uint32_t INT;
|
||||
__IO uint32_t TEST;
|
||||
__IO uint32_t BRPE;
|
||||
uint32_t RESERVED0;
|
||||
__IO uint32_t IF1_CMDREQ; /* 0x020 */
|
||||
__IO uint32_t IF1_CMDMSK;
|
||||
__IO uint32_t IF1_MSK1;
|
||||
__IO uint32_t IF1_MSK2;
|
||||
__IO uint32_t IF1_ARB1;
|
||||
__IO uint32_t IF1_ARB2;
|
||||
__IO uint32_t IF1_MCTRL;
|
||||
__IO uint32_t IF1_DA1;
|
||||
__IO uint32_t IF1_DA2;
|
||||
__IO uint32_t IF1_DB1;
|
||||
__IO uint32_t IF1_DB2;
|
||||
uint32_t RESERVED1[13];
|
||||
__IO uint32_t IF2_CMDREQ; /* 0x080 */
|
||||
__IO uint32_t IF2_CMDMSK;
|
||||
__IO uint32_t IF2_MSK1;
|
||||
__IO uint32_t IF2_MSK2;
|
||||
__IO uint32_t IF2_ARB1;
|
||||
__IO uint32_t IF2_ARB2;
|
||||
__IO uint32_t IF2_MCTRL;
|
||||
__IO uint32_t IF2_DA1;
|
||||
__IO uint32_t IF2_DA2;
|
||||
__IO uint32_t IF2_DB1;
|
||||
__IO uint32_t IF2_DB2;
|
||||
uint32_t RESERVED2[21];
|
||||
__I uint32_t TXREQ1; /* 0x100 */
|
||||
__I uint32_t TXREQ2;
|
||||
uint32_t RESERVED3[6];
|
||||
__I uint32_t ND1; /* 0x120 */
|
||||
__I uint32_t ND2;
|
||||
uint32_t RESERVED4[6];
|
||||
__I uint32_t IR1; /* 0x140 */
|
||||
__I uint32_t IR2;
|
||||
uint32_t RESERVED5[6];
|
||||
__I uint32_t MSGV1; /* 0x160 */
|
||||
__I uint32_t MSGV2;
|
||||
uint32_t RESERVED6[6];
|
||||
__IO uint32_t CLKDIV; /* 0x180 */
|
||||
} LPC_CAN_TypeDef;
|
||||
/*@}*/ /* end of group LPC11xx_CAN */
|
||||
|
||||
#if defined ( __CC_ARM )
|
||||
#pragma no_anon_unions
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
/* Peripheral memory map */
|
||||
/******************************************************************************/
|
||||
/* Base addresses */
|
||||
#define LPC_FLASH_BASE (0x00000000UL)
|
||||
#define LPC_RAM_BASE (0x10000000UL)
|
||||
#define LPC_APB0_BASE (0x40000000UL)
|
||||
#define LPC_AHB_BASE (0x50000000UL)
|
||||
|
||||
/* APB0 peripherals */
|
||||
#define LPC_I2C_BASE (LPC_APB0_BASE + 0x00000)
|
||||
#define LPC_WDT_BASE (LPC_APB0_BASE + 0x04000)
|
||||
#define LPC_UART_BASE (LPC_APB0_BASE + 0x08000)
|
||||
#define LPC_CT16B0_BASE (LPC_APB0_BASE + 0x0C000)
|
||||
#define LPC_CT16B1_BASE (LPC_APB0_BASE + 0x10000)
|
||||
#define LPC_CT32B0_BASE (LPC_APB0_BASE + 0x14000)
|
||||
#define LPC_CT32B1_BASE (LPC_APB0_BASE + 0x18000)
|
||||
#define LPC_ADC_BASE (LPC_APB0_BASE + 0x1C000)
|
||||
#define LPC_PMU_BASE (LPC_APB0_BASE + 0x38000)
|
||||
#define LPC_SSP0_BASE (LPC_APB0_BASE + 0x40000)
|
||||
#define LPC_IOCON_BASE (LPC_APB0_BASE + 0x44000)
|
||||
#define LPC_SYSCON_BASE (LPC_APB0_BASE + 0x48000)
|
||||
#define LPC_CAN_BASE (LPC_APB0_BASE + 0x50000)
|
||||
#define LPC_SSP1_BASE (LPC_APB0_BASE + 0x58000)
|
||||
|
||||
/* AHB peripherals */
|
||||
#define LPC_GPIO_BASE (LPC_AHB_BASE + 0x00000)
|
||||
#define LPC_GPIO0_BASE (LPC_AHB_BASE + 0x00000)
|
||||
#define LPC_GPIO1_BASE (LPC_AHB_BASE + 0x10000)
|
||||
#define LPC_GPIO2_BASE (LPC_AHB_BASE + 0x20000)
|
||||
#define LPC_GPIO3_BASE (LPC_AHB_BASE + 0x30000)
|
||||
|
||||
/******************************************************************************/
|
||||
/* Peripheral declaration */
|
||||
/******************************************************************************/
|
||||
#define LPC_I2C ((LPC_I2C_TypeDef *) LPC_I2C_BASE )
|
||||
#define LPC_WDT ((LPC_WDT_TypeDef *) LPC_WDT_BASE )
|
||||
#define LPC_UART ((LPC_UART_TypeDef *) LPC_UART_BASE )
|
||||
#define LPC_TMR16B0 ((LPC_TMR_TypeDef *) LPC_CT16B0_BASE)
|
||||
#define LPC_TMR16B1 ((LPC_TMR_TypeDef *) LPC_CT16B1_BASE)
|
||||
#define LPC_TMR32B0 ((LPC_TMR_TypeDef *) LPC_CT32B0_BASE)
|
||||
#define LPC_TMR32B1 ((LPC_TMR_TypeDef *) LPC_CT32B1_BASE)
|
||||
#define LPC_ADC ((LPC_ADC_TypeDef *) LPC_ADC_BASE )
|
||||
#define LPC_PMU ((LPC_PMU_TypeDef *) LPC_PMU_BASE )
|
||||
#define LPC_SSP0 ((LPC_SSP_TypeDef *) LPC_SSP0_BASE )
|
||||
#define LPC_SSP1 ((LPC_SSP_TypeDef *) LPC_SSP1_BASE )
|
||||
#define LPC_CAN ((LPC_CAN_TypeDef *) LPC_CAN_BASE )
|
||||
#define LPC_IOCON ((LPC_IOCON_TypeDef *) LPC_IOCON_BASE )
|
||||
#define LPC_SYSCON ((LPC_SYSCON_TypeDef *) LPC_SYSCON_BASE)
|
||||
#define LPC_GPIO0 ((LPC_GPIO_TypeDef *) LPC_GPIO0_BASE )
|
||||
#define LPC_GPIO1 ((LPC_GPIO_TypeDef *) LPC_GPIO1_BASE )
|
||||
#define LPC_GPIO2 ((LPC_GPIO_TypeDef *) LPC_GPIO2_BASE )
|
||||
#define LPC_GPIO3 ((LPC_GPIO_TypeDef *) LPC_GPIO3_BASE )
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __LPC11xx_H__ */
|
||||
@@ -0,0 +1,962 @@
|
||||
/**************************************************************************//**
|
||||
* $Id:: $
|
||||
*
|
||||
* @file core_cm0.h
|
||||
* @brief CMSIS Cortex-M0 Core Peripheral Access Layer Header File
|
||||
* @version V1.30
|
||||
* @date 30. October 2009
|
||||
*
|
||||
* @note
|
||||
* Copyright (C) 2009 ARM Limited. All rights reserved.
|
||||
*
|
||||
* @par
|
||||
* ARM Limited (ARM) is supplying this software for use with Cortex-M
|
||||
* processor based microcontrollers. This file can be freely distributed
|
||||
* within development tools that are supporting such ARM based processors.
|
||||
*
|
||||
* @par
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
|
||||
* OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
|
||||
* ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
|
||||
* CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __CM0_CORE_H__
|
||||
#define __CM0_CORE_H__
|
||||
|
||||
/** @addtogroup CMSIS_CM0_core_LintCinfiguration CMSIS CM0 Core Lint Configuration
|
||||
*
|
||||
* List of Lint messages which will be suppressed and not shown:
|
||||
* - not yet checked
|
||||
* .
|
||||
* Note: To re-enable a Message, insert a space before 'lint' *
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/** @addtogroup CMSIS_CM0_core_definitions CM0 Core Definitions
|
||||
This file defines all structures and symbols for CMSIS core:
|
||||
- CMSIS version number
|
||||
- Cortex-M core registers and bitfields
|
||||
- Cortex-M core peripheral base address
|
||||
@{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define __CM0_CMSIS_VERSION_MAIN (0x01) /*!< [31:16] CMSIS HAL main version */
|
||||
#define __CM0_CMSIS_VERSION_SUB (0x30) /*!< [15:0] CMSIS HAL sub version */
|
||||
#define __CM0_CMSIS_VERSION ((__CM0_CMSIS_VERSION_MAIN << 16) | __CM0_CMSIS_VERSION_SUB) /*!< CMSIS HAL version number */
|
||||
|
||||
#define __CORTEX_M (0x00) /*!< Cortex core */
|
||||
|
||||
#include <stdint.h> /* Include standard types */
|
||||
|
||||
#if defined (__ICCARM__)
|
||||
#include <intrinsics.h> /* IAR Intrinsics */
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __NVIC_PRIO_BITS
|
||||
#define __NVIC_PRIO_BITS 2 /*!< standard definition for NVIC Priority Bits */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* IO definitions
|
||||
*
|
||||
* define access restrictions to peripheral registers
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define __I volatile /*!< defines 'read only' permissions */
|
||||
#else
|
||||
#define __I volatile const /*!< defines 'read only' permissions */
|
||||
#endif
|
||||
#define __O volatile /*!< defines 'write only' permissions */
|
||||
#define __IO volatile /*!< defines 'read / write' permissions */
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Register Abstraction
|
||||
******************************************************************************/
|
||||
/** @addtogroup CMSIS_CM0_core_register CMSIS CM0 Core Register
|
||||
@{
|
||||
*/
|
||||
|
||||
|
||||
/** @addtogroup CMSIS_CM0_NVIC CMSIS CM0 NVIC
|
||||
memory mapped structure for Nested Vectored Interrupt Controller (NVIC)
|
||||
@{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
__IO uint32_t ISER[1]; /*!< (Offset: 0x000) Interrupt Set Enable Register */
|
||||
uint32_t RESERVED0[31];
|
||||
__IO uint32_t ICER[1]; /*!< (Offset: 0x080) Interrupt Clear Enable Register */
|
||||
uint32_t RSERVED1[31];
|
||||
__IO uint32_t ISPR[1]; /*!< (Offset: 0x100) Interrupt Set Pending Register */
|
||||
uint32_t RESERVED2[31];
|
||||
__IO uint32_t ICPR[1]; /*!< (Offset: 0x180) Interrupt Clear Pending Register */
|
||||
uint32_t RESERVED3[31];
|
||||
uint32_t RESERVED4[64];
|
||||
__IO uint32_t IPR[8]; /*!< (Offset: 0x3EC) Interrupt Priority Register */
|
||||
} NVIC_Type;
|
||||
/*@}*/ /* end of group CMSIS_CM0_NVIC */
|
||||
|
||||
|
||||
/** @addtogroup CMSIS_CM0_SCB CMSIS CM0 SCB
|
||||
memory mapped structure for System Control Block (SCB)
|
||||
@{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
__I uint32_t CPUID; /*!< Offset: 0x00 CPU ID Base Register */
|
||||
__IO uint32_t ICSR; /*!< Offset: 0x04 Interrupt Control State Register */
|
||||
uint32_t RESERVED0;
|
||||
__IO uint32_t AIRCR; /*!< Offset: 0x0C Application Interrupt / Reset Control Register */
|
||||
__IO uint32_t SCR; /*!< Offset: 0x10 System Control Register */
|
||||
__IO uint32_t CCR; /*!< Offset: 0x14 Configuration Control Register */
|
||||
uint32_t RESERVED1;
|
||||
__IO uint32_t SHP[2]; /*!< Offset: 0x1C System Handlers Priority Registers. [0] is RESERVED */
|
||||
__IO uint32_t SHCSR; /*!< Offset: 0x24 System Handler Control and State Register */
|
||||
uint32_t RESERVED2[2];
|
||||
__IO uint32_t DFSR; /*!< Offset: 0x30 Debug Fault Status Register */
|
||||
} SCB_Type;
|
||||
|
||||
/* SCB CPUID Register Definitions */
|
||||
#define SCB_CPUID_IMPLEMENTER_Pos 24 /*!< SCB CPUID: IMPLEMENTER Position */
|
||||
#define SCB_CPUID_IMPLEMENTER_Msk (0xFFul << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */
|
||||
|
||||
#define SCB_CPUID_VARIANT_Pos 20 /*!< SCB CPUID: VARIANT Position */
|
||||
#define SCB_CPUID_VARIANT_Msk (0xFul << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */
|
||||
|
||||
#define SCB_CPUID_ARCHITECTURE_Pos 16 /*!< SCB CPUID: ARCHITECTURE Position */
|
||||
#define SCB_CPUID_ARCHITECTURE_Msk (0xFul << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */
|
||||
|
||||
#define SCB_CPUID_PARTNO_Pos 4 /*!< SCB CPUID: PARTNO Position */
|
||||
#define SCB_CPUID_PARTNO_Msk (0xFFFul << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */
|
||||
|
||||
#define SCB_CPUID_REVISION_Pos 0 /*!< SCB CPUID: REVISION Position */
|
||||
#define SCB_CPUID_REVISION_Msk (0xFul << SCB_CPUID_REVISION_Pos) /*!< SCB CPUID: REVISION Mask */
|
||||
|
||||
/* SCB Interrupt Control State Register Definitions */
|
||||
#define SCB_ICSR_NMIPENDSET_Pos 31 /*!< SCB ICSR: NMIPENDSET Position */
|
||||
#define SCB_ICSR_NMIPENDSET_Msk (1ul << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */
|
||||
|
||||
#define SCB_ICSR_PENDSVSET_Pos 28 /*!< SCB ICSR: PENDSVSET Position */
|
||||
#define SCB_ICSR_PENDSVSET_Msk (1ul << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */
|
||||
|
||||
#define SCB_ICSR_PENDSVCLR_Pos 27 /*!< SCB ICSR: PENDSVCLR Position */
|
||||
#define SCB_ICSR_PENDSVCLR_Msk (1ul << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */
|
||||
|
||||
#define SCB_ICSR_PENDSTSET_Pos 26 /*!< SCB ICSR: PENDSTSET Position */
|
||||
#define SCB_ICSR_PENDSTSET_Msk (1ul << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */
|
||||
|
||||
#define SCB_ICSR_PENDSTCLR_Pos 25 /*!< SCB ICSR: PENDSTCLR Position */
|
||||
#define SCB_ICSR_PENDSTCLR_Msk (1ul << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */
|
||||
|
||||
#define SCB_ICSR_ISRPREEMPT_Pos 23 /*!< SCB ICSR: ISRPREEMPT Position */
|
||||
#define SCB_ICSR_ISRPREEMPT_Msk (1ul << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */
|
||||
|
||||
#define SCB_ICSR_ISRPENDING_Pos 22 /*!< SCB ICSR: ISRPENDING Position */
|
||||
#define SCB_ICSR_ISRPENDING_Msk (1ul << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */
|
||||
|
||||
#define SCB_ICSR_VECTPENDING_Pos 12 /*!< SCB ICSR: VECTPENDING Position */
|
||||
#define SCB_ICSR_VECTPENDING_Msk (0x1FFul << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */
|
||||
|
||||
#define SCB_ICSR_VECTACTIVE_Pos 0 /*!< SCB ICSR: VECTACTIVE Position */
|
||||
#define SCB_ICSR_VECTACTIVE_Msk (0x1FFul << SCB_ICSR_VECTACTIVE_Pos) /*!< SCB ICSR: VECTACTIVE Mask */
|
||||
|
||||
/* SCB Application Interrupt and Reset Control Register Definitions */
|
||||
#define SCB_AIRCR_VECTKEY_Pos 16 /*!< SCB AIRCR: VECTKEY Position */
|
||||
#define SCB_AIRCR_VECTKEY_Msk (0xFFFFul << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */
|
||||
|
||||
#define SCB_AIRCR_VECTKEYSTAT_Pos 16 /*!< SCB AIRCR: VECTKEYSTAT Position */
|
||||
#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFul << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */
|
||||
|
||||
#define SCB_AIRCR_ENDIANESS_Pos 15 /*!< SCB AIRCR: ENDIANESS Position */
|
||||
#define SCB_AIRCR_ENDIANESS_Msk (1ul << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */
|
||||
|
||||
#define SCB_AIRCR_SYSRESETREQ_Pos 2 /*!< SCB AIRCR: SYSRESETREQ Position */
|
||||
#define SCB_AIRCR_SYSRESETREQ_Msk (1ul << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */
|
||||
|
||||
#define SCB_AIRCR_VECTCLRACTIVE_Pos 1 /*!< SCB AIRCR: VECTCLRACTIVE Position */
|
||||
#define SCB_AIRCR_VECTCLRACTIVE_Msk (1ul << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */
|
||||
|
||||
/* SCB System Control Register Definitions */
|
||||
#define SCB_SCR_SEVONPEND_Pos 4 /*!< SCB SCR: SEVONPEND Position */
|
||||
#define SCB_SCR_SEVONPEND_Msk (1ul << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */
|
||||
|
||||
#define SCB_SCR_SLEEPDEEP_Pos 2 /*!< SCB SCR: SLEEPDEEP Position */
|
||||
#define SCB_SCR_SLEEPDEEP_Msk (1ul << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */
|
||||
|
||||
#define SCB_SCR_SLEEPONEXIT_Pos 1 /*!< SCB SCR: SLEEPONEXIT Position */
|
||||
#define SCB_SCR_SLEEPONEXIT_Msk (1ul << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */
|
||||
|
||||
/* SCB Configuration Control Register Definitions */
|
||||
#define SCB_CCR_STKALIGN_Pos 9 /*!< SCB CCR: STKALIGN Position */
|
||||
#define SCB_CCR_STKALIGN_Msk (1ul << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */
|
||||
|
||||
#define SCB_CCR_UNALIGN_TRP_Pos 3 /*!< SCB CCR: UNALIGN_TRP Position */
|
||||
#define SCB_CCR_UNALIGN_TRP_Msk (1ul << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */
|
||||
|
||||
/* SCB System Handler Control and State Register Definitions */
|
||||
#define SCB_SHCSR_SVCALLPENDED_Pos 15 /*!< SCB SHCSR: SVCALLPENDED Position */
|
||||
#define SCB_SHCSR_SVCALLPENDED_Msk (1ul << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */
|
||||
|
||||
/* SCB Debug Fault Status Register Definitions */
|
||||
#define SCB_DFSR_EXTERNAL_Pos 4 /*!< SCB DFSR: EXTERNAL Position */
|
||||
#define SCB_DFSR_EXTERNAL_Msk (1ul << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */
|
||||
|
||||
#define SCB_DFSR_VCATCH_Pos 3 /*!< SCB DFSR: VCATCH Position */
|
||||
#define SCB_DFSR_VCATCH_Msk (1ul << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */
|
||||
|
||||
#define SCB_DFSR_DWTTRAP_Pos 2 /*!< SCB DFSR: DWTTRAP Position */
|
||||
#define SCB_DFSR_DWTTRAP_Msk (1ul << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */
|
||||
|
||||
#define SCB_DFSR_BKPT_Pos 1 /*!< SCB DFSR: BKPT Position */
|
||||
#define SCB_DFSR_BKPT_Msk (1ul << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */
|
||||
|
||||
#define SCB_DFSR_HALTED_Pos 0 /*!< SCB DFSR: HALTED Position */
|
||||
#define SCB_DFSR_HALTED_Msk (1ul << SCB_DFSR_HALTED_Pos) /*!< SCB DFSR: HALTED Mask */
|
||||
/*@}*/ /* end of group CMSIS_CM0_SCB */
|
||||
|
||||
|
||||
/** @addtogroup CMSIS_CM0_SysTick CMSIS CM0 SysTick
|
||||
memory mapped structure for SysTick
|
||||
@{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
__IO uint32_t CTRL; /*!< Offset: 0x00 SysTick Control and Status Register */
|
||||
__IO uint32_t LOAD; /*!< Offset: 0x04 SysTick Reload Value Register */
|
||||
__IO uint32_t VAL; /*!< Offset: 0x08 SysTick Current Value Register */
|
||||
__I uint32_t CALIB; /*!< Offset: 0x0C SysTick Calibration Register */
|
||||
} SysTick_Type;
|
||||
|
||||
/* SysTick Control / Status Register Definitions */
|
||||
#define SysTick_CTRL_COUNTFLAG_Pos 16 /*!< SysTick CTRL: COUNTFLAG Position */
|
||||
#define SysTick_CTRL_COUNTFLAG_Msk (1ul << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */
|
||||
|
||||
#define SysTick_CTRL_CLKSOURCE_Pos 2 /*!< SysTick CTRL: CLKSOURCE Position */
|
||||
#define SysTick_CTRL_CLKSOURCE_Msk (1ul << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */
|
||||
|
||||
#define SysTick_CTRL_TICKINT_Pos 1 /*!< SysTick CTRL: TICKINT Position */
|
||||
#define SysTick_CTRL_TICKINT_Msk (1ul << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */
|
||||
|
||||
#define SysTick_CTRL_ENABLE_Pos 0 /*!< SysTick CTRL: ENABLE Position */
|
||||
#define SysTick_CTRL_ENABLE_Msk (1ul << SysTick_CTRL_ENABLE_Pos) /*!< SysTick CTRL: ENABLE Mask */
|
||||
|
||||
/* SysTick Reload Register Definitions */
|
||||
#define SysTick_LOAD_RELOAD_Pos 0 /*!< SysTick LOAD: RELOAD Position */
|
||||
#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFul << SysTick_LOAD_RELOAD_Pos) /*!< SysTick LOAD: RELOAD Mask */
|
||||
|
||||
/* SysTick Current Register Definitions */
|
||||
#define SysTick_VAL_CURRENT_Pos 0 /*!< SysTick VAL: CURRENT Position */
|
||||
#define SysTick_VAL_CURRENT_Msk (0xFFFFFFul << SysTick_VAL_CURRENT_Pos) /*!< SysTick VAL: CURRENT Mask */
|
||||
|
||||
/* SysTick Calibration Register Definitions */
|
||||
#define SysTick_CALIB_NOREF_Pos 31 /*!< SysTick CALIB: NOREF Position */
|
||||
#define SysTick_CALIB_NOREF_Msk (1ul << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */
|
||||
|
||||
#define SysTick_CALIB_SKEW_Pos 30 /*!< SysTick CALIB: SKEW Position */
|
||||
#define SysTick_CALIB_SKEW_Msk (1ul << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */
|
||||
|
||||
#define SysTick_CALIB_TENMS_Pos 0 /*!< SysTick CALIB: TENMS Position */
|
||||
#define SysTick_CALIB_TENMS_Msk (0xFFFFFFul << SysTick_VAL_CURRENT_Pos) /*!< SysTick CALIB: TENMS Mask */
|
||||
/*@}*/ /* end of group CMSIS_CM0_SysTick */
|
||||
|
||||
|
||||
/** @addtogroup CMSIS_CM0_CoreDebug CMSIS CM0 Core Debug
|
||||
memory mapped structure for Core Debug Register
|
||||
@{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
__IO uint32_t DHCSR; /*!< Offset: 0x00 Debug Halting Control and Status Register */
|
||||
__O uint32_t DCRSR; /*!< Offset: 0x04 Debug Core Register Selector Register */
|
||||
__IO uint32_t DCRDR; /*!< Offset: 0x08 Debug Core Register Data Register */
|
||||
__IO uint32_t DEMCR; /*!< Offset: 0x0C Debug Exception and Monitor Control Register */
|
||||
} CoreDebug_Type;
|
||||
|
||||
/* Debug Halting Control and Status Register */
|
||||
#define CoreDebug_DHCSR_DBGKEY_Pos 16 /*!< CoreDebug DHCSR: DBGKEY Position */
|
||||
#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFul << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */
|
||||
|
||||
#define CoreDebug_DHCSR_S_RESET_ST_Pos 25 /*!< CoreDebug DHCSR: S_RESET_ST Position */
|
||||
#define CoreDebug_DHCSR_S_RESET_ST_Msk (1ul << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */
|
||||
|
||||
#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24 /*!< CoreDebug DHCSR: S_RETIRE_ST Position */
|
||||
#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1ul << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */
|
||||
|
||||
#define CoreDebug_DHCSR_S_LOCKUP_Pos 19 /*!< CoreDebug DHCSR: S_LOCKUP Position */
|
||||
#define CoreDebug_DHCSR_S_LOCKUP_Msk (1ul << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */
|
||||
|
||||
#define CoreDebug_DHCSR_S_SLEEP_Pos 18 /*!< CoreDebug DHCSR: S_SLEEP Position */
|
||||
#define CoreDebug_DHCSR_S_SLEEP_Msk (1ul << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */
|
||||
|
||||
#define CoreDebug_DHCSR_S_HALT_Pos 17 /*!< CoreDebug DHCSR: S_HALT Position */
|
||||
#define CoreDebug_DHCSR_S_HALT_Msk (1ul << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */
|
||||
|
||||
#define CoreDebug_DHCSR_S_REGRDY_Pos 16 /*!< CoreDebug DHCSR: S_REGRDY Position */
|
||||
#define CoreDebug_DHCSR_S_REGRDY_Msk (1ul << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */
|
||||
|
||||
#define CoreDebug_DHCSR_C_MASKINTS_Pos 3 /*!< CoreDebug DHCSR: C_MASKINTS Position */
|
||||
#define CoreDebug_DHCSR_C_MASKINTS_Msk (1ul << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */
|
||||
|
||||
#define CoreDebug_DHCSR_C_STEP_Pos 2 /*!< CoreDebug DHCSR: C_STEP Position */
|
||||
#define CoreDebug_DHCSR_C_STEP_Msk (1ul << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */
|
||||
|
||||
#define CoreDebug_DHCSR_C_HALT_Pos 1 /*!< CoreDebug DHCSR: C_HALT Position */
|
||||
#define CoreDebug_DHCSR_C_HALT_Msk (1ul << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */
|
||||
|
||||
#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0 /*!< CoreDebug DHCSR: C_DEBUGEN Position */
|
||||
#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1ul << CoreDebug_DHCSR_C_DEBUGEN_Pos) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */
|
||||
|
||||
/* Debug Core Register Selector Register */
|
||||
#define CoreDebug_DCRSR_REGWnR_Pos 16 /*!< CoreDebug DCRSR: REGWnR Position */
|
||||
#define CoreDebug_DCRSR_REGWnR_Msk (1ul << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */
|
||||
|
||||
#define CoreDebug_DCRSR_REGSEL_Pos 0 /*!< CoreDebug DCRSR: REGSEL Position */
|
||||
#define CoreDebug_DCRSR_REGSEL_Msk (0x1Ful << CoreDebug_DCRSR_REGSEL_Pos) /*!< CoreDebug DCRSR: REGSEL Mask */
|
||||
|
||||
/* Debug Exception and Monitor Control Register */
|
||||
#define CoreDebug_DEMCR_DWTENA_Pos 24 /*!< CoreDebug DEMCR: DWTENA Position */
|
||||
#define CoreDebug_DEMCR_DWTENA_Msk (1ul << CoreDebug_DEMCR_DWTENA_Pos) /*!< CoreDebug DEMCR: DWTENA Mask */
|
||||
|
||||
#define CoreDebug_DEMCR_VC_HARDERR_Pos 10 /*!< CoreDebug DEMCR: VC_HARDERR Position */
|
||||
#define CoreDebug_DEMCR_VC_HARDERR_Msk (1ul << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */
|
||||
|
||||
#define CoreDebug_DEMCR_VC_CORERESET_Pos 0 /*!< CoreDebug DEMCR: VC_CORERESET Position */
|
||||
#define CoreDebug_DEMCR_VC_CORERESET_Msk (1ul << CoreDebug_DEMCR_VC_CORERESET_Pos) /*!< CoreDebug DEMCR: VC_CORERESET Mask */
|
||||
/*@}*/ /* end of group CMSIS_CM0_CoreDebug */
|
||||
|
||||
|
||||
/* Memory mapping of Cortex-M0 Hardware */
|
||||
#define SCS_BASE (0xE000E000) /*!< System Control Space Base Address */
|
||||
#define CoreDebug_BASE (0xE000EDF0) /*!< Core Debug Base Address */
|
||||
#define SysTick_BASE (SCS_BASE + 0x0010) /*!< SysTick Base Address */
|
||||
#define NVIC_BASE (SCS_BASE + 0x0100) /*!< NVIC Base Address */
|
||||
#define SCB_BASE (SCS_BASE + 0x0D00) /*!< System Control Block Base Address */
|
||||
|
||||
#define SCB ((SCB_Type *) SCB_BASE) /*!< SCB configuration struct */
|
||||
#define SysTick ((SysTick_Type *) SysTick_BASE) /*!< SysTick configuration struct */
|
||||
#define NVIC ((NVIC_Type *) NVIC_BASE) /*!< NVIC configuration struct */
|
||||
#define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */
|
||||
|
||||
/*@}*/ /* end of group CMSIS_CM0_core_register */
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Hardware Abstraction Layer
|
||||
******************************************************************************/
|
||||
|
||||
#if defined ( __CC_ARM )
|
||||
#define __ASM __asm /*!< asm keyword for ARM Compiler */
|
||||
#define __INLINE __inline /*!< inline keyword for ARM Compiler */
|
||||
|
||||
#elif defined ( __ICCARM__ )
|
||||
#define __ASM __asm /*!< asm keyword for IAR Compiler */
|
||||
#define __INLINE inline /*!< inline keyword for IAR Compiler. Only avaiable in High optimization mode! */
|
||||
|
||||
#elif defined ( __GNUC__ )
|
||||
#define __ASM __asm /*!< asm keyword for GNU Compiler */
|
||||
#define __INLINE inline /*!< inline keyword for GNU Compiler */
|
||||
|
||||
#elif defined ( __TASKING__ )
|
||||
#define __ASM __asm /*!< asm keyword for TASKING Compiler */
|
||||
#define __INLINE inline /*!< inline keyword for TASKING Compiler */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* ################### Compiler specific Intrinsics ########################### */
|
||||
|
||||
#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/
|
||||
/* ARM armcc specific functions */
|
||||
|
||||
#define __enable_fault_irq __enable_fiq
|
||||
#define __disable_fault_irq __disable_fiq
|
||||
|
||||
#define __NOP __nop
|
||||
#define __WFI __wfi
|
||||
#define __WFE __wfe
|
||||
#define __SEV __sev
|
||||
#define __ISB() __isb(0)
|
||||
#define __DSB() __dsb(0)
|
||||
#define __DMB() __dmb(0)
|
||||
#define __REV __rev
|
||||
|
||||
|
||||
/* intrinsic void __enable_irq(); */
|
||||
/* intrinsic void __disable_irq(); */
|
||||
|
||||
|
||||
/**
|
||||
* @brief Return the Process Stack Pointer
|
||||
*
|
||||
* @return ProcessStackPointer
|
||||
*
|
||||
* Return the actual process stack pointer
|
||||
*/
|
||||
extern uint32_t __get_PSP(void);
|
||||
|
||||
/**
|
||||
* @brief Set the Process Stack Pointer
|
||||
*
|
||||
* @param topOfProcStack Process Stack Pointer
|
||||
*
|
||||
* Assign the value ProcessStackPointer to the MSP
|
||||
* (process stack pointer) Cortex processor register
|
||||
*/
|
||||
extern void __set_PSP(uint32_t topOfProcStack);
|
||||
|
||||
/**
|
||||
* @brief Return the Main Stack Pointer
|
||||
*
|
||||
* @return Main Stack Pointer
|
||||
*
|
||||
* Return the current value of the MSP (main stack pointer)
|
||||
* Cortex processor register
|
||||
*/
|
||||
extern uint32_t __get_MSP(void);
|
||||
|
||||
/**
|
||||
* @brief Set the Main Stack Pointer
|
||||
*
|
||||
* @param topOfMainStack Main Stack Pointer
|
||||
*
|
||||
* Assign the value mainStackPointer to the MSP
|
||||
* (main stack pointer) Cortex processor register
|
||||
*/
|
||||
extern void __set_MSP(uint32_t topOfMainStack);
|
||||
|
||||
/**
|
||||
* @brief Reverse byte order in unsigned short value
|
||||
*
|
||||
* @param value value to reverse
|
||||
* @return reversed value
|
||||
*
|
||||
* Reverse byte order in unsigned short value
|
||||
*/
|
||||
extern uint32_t __REV16(uint16_t value);
|
||||
|
||||
/**
|
||||
* @brief Reverse byte order in signed short value with sign extension to integer
|
||||
*
|
||||
* @param value value to reverse
|
||||
* @return reversed value
|
||||
*
|
||||
* Reverse byte order in signed short value with sign extension to integer
|
||||
*/
|
||||
extern int32_t __REVSH(int16_t value);
|
||||
|
||||
|
||||
#if (__ARMCC_VERSION < 400000)
|
||||
|
||||
/**
|
||||
* @brief Return the Priority Mask value
|
||||
*
|
||||
* @return PriMask
|
||||
*
|
||||
* Return state of the priority mask bit from the priority mask register
|
||||
*/
|
||||
extern uint32_t __get_PRIMASK(void);
|
||||
|
||||
/**
|
||||
* @brief Set the Priority Mask value
|
||||
*
|
||||
* @param priMask PriMask
|
||||
*
|
||||
* Set the priority mask bit in the priority mask register
|
||||
*/
|
||||
extern void __set_PRIMASK(uint32_t priMask);
|
||||
|
||||
/**
|
||||
* @brief Return the Control Register value
|
||||
*
|
||||
* @return Control value
|
||||
*
|
||||
* Return the content of the control register
|
||||
*/
|
||||
extern uint32_t __get_CONTROL(void);
|
||||
|
||||
/**
|
||||
* @brief Set the Control Register value
|
||||
*
|
||||
* @param control Control value
|
||||
*
|
||||
* Set the control register
|
||||
*/
|
||||
extern void __set_CONTROL(uint32_t control);
|
||||
|
||||
#else /* (__ARMCC_VERSION >= 400000) */
|
||||
|
||||
|
||||
/**
|
||||
* @brief Return the Priority Mask value
|
||||
*
|
||||
* @return PriMask
|
||||
*
|
||||
* Return state of the priority mask bit from the priority mask register
|
||||
*/
|
||||
static __INLINE uint32_t __get_PRIMASK(void)
|
||||
{
|
||||
register uint32_t __regPriMask __ASM("primask");
|
||||
return(__regPriMask);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the Priority Mask value
|
||||
*
|
||||
* @param priMask PriMask
|
||||
*
|
||||
* Set the priority mask bit in the priority mask register
|
||||
*/
|
||||
static __INLINE void __set_PRIMASK(uint32_t priMask)
|
||||
{
|
||||
register uint32_t __regPriMask __ASM("primask");
|
||||
__regPriMask = (priMask);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the Control Register value
|
||||
*
|
||||
* @return Control value
|
||||
*
|
||||
* Return the content of the control register
|
||||
*/
|
||||
static __INLINE uint32_t __get_CONTROL(void)
|
||||
{
|
||||
register uint32_t __regControl __ASM("control");
|
||||
return(__regControl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the Control Register value
|
||||
*
|
||||
* @param control Control value
|
||||
*
|
||||
* Set the control register
|
||||
*/
|
||||
static __INLINE void __set_CONTROL(uint32_t control)
|
||||
{
|
||||
register uint32_t __regControl __ASM("control");
|
||||
__regControl = control;
|
||||
}
|
||||
|
||||
#endif /* __ARMCC_VERSION */
|
||||
|
||||
|
||||
|
||||
#elif (defined (__ICCARM__)) /*------------------ ICC Compiler -------------------*/
|
||||
/* IAR iccarm specific functions */
|
||||
|
||||
#define __enable_irq __enable_interrupt /*!< global Interrupt enable */
|
||||
#define __disable_irq __disable_interrupt /*!< global Interrupt disable */
|
||||
|
||||
static __INLINE void __enable_fault_irq() { __ASM ("cpsie f"); }
|
||||
static __INLINE void __disable_fault_irq() { __ASM ("cpsid f"); }
|
||||
|
||||
#define __NOP __no_operation /*!< no operation intrinsic in IAR Compiler */
|
||||
static __INLINE void __WFI() { __ASM ("wfi"); }
|
||||
static __INLINE void __WFE() { __ASM ("wfe"); }
|
||||
static __INLINE void __SEV() { __ASM ("sev"); }
|
||||
|
||||
/* intrinsic void __ISB(void) */
|
||||
/* intrinsic void __DSB(void) */
|
||||
/* intrinsic void __DMB(void) */
|
||||
/* intrinsic void __set_PRIMASK(); */
|
||||
/* intrinsic void __get_PRIMASK(); */
|
||||
|
||||
|
||||
/* intrinsic uint32_t __REV(uint32_t value); */
|
||||
/* intrinsic uint32_t __REVSH(uint32_t value); */
|
||||
|
||||
|
||||
/**
|
||||
* @brief Return the Process Stack Pointer
|
||||
*
|
||||
* @return ProcessStackPointer
|
||||
*
|
||||
* Return the actual process stack pointer
|
||||
*/
|
||||
extern uint32_t __get_PSP(void);
|
||||
|
||||
/**
|
||||
* @brief Set the Process Stack Pointer
|
||||
*
|
||||
* @param topOfProcStack Process Stack Pointer
|
||||
*
|
||||
* Assign the value ProcessStackPointer to the MSP
|
||||
* (process stack pointer) Cortex processor register
|
||||
*/
|
||||
extern void __set_PSP(uint32_t topOfProcStack);
|
||||
|
||||
/**
|
||||
* @brief Return the Main Stack Pointer
|
||||
*
|
||||
* @return Main Stack Pointer
|
||||
*
|
||||
* Return the current value of the MSP (main stack pointer)
|
||||
* Cortex processor register
|
||||
*/
|
||||
extern uint32_t __get_MSP(void);
|
||||
|
||||
/**
|
||||
* @brief Set the Main Stack Pointer
|
||||
*
|
||||
* @param topOfMainStack Main Stack Pointer
|
||||
*
|
||||
* Assign the value mainStackPointer to the MSP
|
||||
* (main stack pointer) Cortex processor register
|
||||
*/
|
||||
extern void __set_MSP(uint32_t topOfMainStack);
|
||||
|
||||
/**
|
||||
* @brief Reverse byte order in unsigned short value
|
||||
*
|
||||
* @param value value to reverse
|
||||
* @return reversed value
|
||||
*
|
||||
* Reverse byte order in unsigned short value
|
||||
*/
|
||||
extern uint32_t __REV16(uint16_t value);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#elif (defined (__GNUC__)) /*------------------ GNU Compiler ---------------------*/
|
||||
/* GNU gcc specific functions */
|
||||
|
||||
static __INLINE void __enable_irq() { __ASM volatile ("cpsie i"); }
|
||||
static __INLINE void __disable_irq() { __ASM volatile ("cpsid i"); }
|
||||
|
||||
static __INLINE void __enable_fault_irq() { __ASM volatile ("cpsie f"); }
|
||||
static __INLINE void __disable_fault_irq() { __ASM volatile ("cpsid f"); }
|
||||
|
||||
static __INLINE void __NOP() { __ASM volatile ("nop"); }
|
||||
static __INLINE void __WFI() { __ASM volatile ("wfi"); }
|
||||
static __INLINE void __WFE() { __ASM volatile ("wfe"); }
|
||||
static __INLINE void __SEV() { __ASM volatile ("sev"); }
|
||||
static __INLINE void __ISB() { __ASM volatile ("isb"); }
|
||||
static __INLINE void __DSB() { __ASM volatile ("dsb"); }
|
||||
static __INLINE void __DMB() { __ASM volatile ("dmb"); }
|
||||
|
||||
|
||||
/**
|
||||
* @brief Return the Process Stack Pointer
|
||||
*
|
||||
* @return ProcessStackPointer
|
||||
*
|
||||
* Return the actual process stack pointer
|
||||
*/
|
||||
extern uint32_t __get_PSP(void);
|
||||
|
||||
/**
|
||||
* @brief Set the Process Stack Pointer
|
||||
*
|
||||
* @param topOfProcStack Process Stack Pointer
|
||||
*
|
||||
* Assign the value ProcessStackPointer to the MSP
|
||||
* (process stack pointer) Cortex processor register
|
||||
*/
|
||||
extern void __set_PSP(uint32_t topOfProcStack);
|
||||
|
||||
/**
|
||||
* @brief Return the Main Stack Pointer
|
||||
*
|
||||
* @return Main Stack Pointer
|
||||
*
|
||||
* Return the current value of the MSP (main stack pointer)
|
||||
* Cortex processor register
|
||||
*/
|
||||
extern uint32_t __get_MSP(void);
|
||||
|
||||
/**
|
||||
* @brief Set the Main Stack Pointer
|
||||
*
|
||||
* @param topOfMainStack Main Stack Pointer
|
||||
*
|
||||
* Assign the value mainStackPointer to the MSP
|
||||
* (main stack pointer) Cortex processor register
|
||||
*/
|
||||
extern void __set_MSP(uint32_t topOfMainStack);
|
||||
|
||||
/**
|
||||
* @brief Return the Priority Mask value
|
||||
*
|
||||
* @return PriMask
|
||||
*
|
||||
* Return state of the priority mask bit from the priority mask register
|
||||
*/
|
||||
extern uint32_t __get_PRIMASK(void);
|
||||
|
||||
/**
|
||||
* @brief Set the Priority Mask value
|
||||
*
|
||||
* @param priMask PriMask
|
||||
*
|
||||
* Set the priority mask bit in the priority mask register
|
||||
*/
|
||||
extern void __set_PRIMASK(uint32_t priMask);
|
||||
|
||||
/**
|
||||
* @brief Return the Control Register value
|
||||
*
|
||||
* @return Control value
|
||||
*
|
||||
* Return the content of the control register
|
||||
*/
|
||||
extern uint32_t __get_CONTROL(void);
|
||||
|
||||
/**
|
||||
* @brief Set the Control Register value
|
||||
*
|
||||
* @param control Control value
|
||||
*
|
||||
* Set the control register
|
||||
*/
|
||||
extern void __set_CONTROL(uint32_t control);
|
||||
|
||||
/**
|
||||
* @brief Reverse byte order in integer value
|
||||
*
|
||||
* @param value value to reverse
|
||||
* @return reversed value
|
||||
*
|
||||
* Reverse byte order in integer value
|
||||
*/
|
||||
extern uint32_t __REV(uint32_t value);
|
||||
|
||||
/**
|
||||
* @brief Reverse byte order in unsigned short value
|
||||
*
|
||||
* @param value value to reverse
|
||||
* @return reversed value
|
||||
*
|
||||
* Reverse byte order in unsigned short value
|
||||
*/
|
||||
extern uint32_t __REV16(uint16_t value);
|
||||
|
||||
/**
|
||||
* @brief Reverse byte order in signed short value with sign extension to integer
|
||||
*
|
||||
* @param value value to reverse
|
||||
* @return reversed value
|
||||
*
|
||||
* Reverse byte order in signed short value with sign extension to integer
|
||||
*/
|
||||
extern int32_t __REVSH(int16_t value);
|
||||
|
||||
|
||||
#elif (defined (__TASKING__)) /*------------------ TASKING Compiler ---------------------*/
|
||||
/* TASKING carm specific functions */
|
||||
|
||||
/*
|
||||
* The CMSIS functions have been implemented as intrinsics in the compiler.
|
||||
* Please use "carm -?i" to get an up to date list of all instrinsics,
|
||||
* Including the CMSIS ones.
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/** @addtogroup CMSIS_CM0_Core_FunctionInterface CMSIS CM0 Core Function Interface
|
||||
Core Function Interface containing:
|
||||
- Core NVIC Functions
|
||||
- Core SysTick Functions
|
||||
- Core Reset Functions
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/* ########################## NVIC functions #################################### */
|
||||
|
||||
/* Interrupt Priorities are WORD accessible only under ARMv6M */
|
||||
/* The following MACROS handle generation of the register offset and byte masks */
|
||||
#define _BIT_SHIFT(IRQn) ( (((uint32_t)(IRQn) ) & 0x03) * 8 )
|
||||
#define _SHP_IDX(IRQn) ( ((((uint32_t)(IRQn) & 0x0F)-8) >> 2) )
|
||||
#define _IP_IDX(IRQn) ( ((uint32_t)(IRQn) >> 2) )
|
||||
|
||||
|
||||
/**
|
||||
* @brief Enable Interrupt in NVIC Interrupt Controller
|
||||
*
|
||||
* @param IRQn The positive number of the external interrupt to enable
|
||||
*
|
||||
* Enable a device specific interupt in the NVIC interrupt controller.
|
||||
* The interrupt number cannot be a negative value.
|
||||
*/
|
||||
static __INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
|
||||
{
|
||||
NVIC->ISER[0] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* enable interrupt */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disable the interrupt line for external interrupt specified
|
||||
*
|
||||
* @param IRQn The positive number of the external interrupt to disable
|
||||
*
|
||||
* Disable a device specific interupt in the NVIC interrupt controller.
|
||||
* The interrupt number cannot be a negative value.
|
||||
*/
|
||||
static __INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
|
||||
{
|
||||
NVIC->ICER[0] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* disable interrupt */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read the interrupt pending bit for a device specific interrupt source
|
||||
*
|
||||
* @param IRQn The number of the device specifc interrupt
|
||||
* @return 1 = interrupt pending, 0 = interrupt not pending
|
||||
*
|
||||
* Read the pending register in NVIC and return 1 if its status is pending,
|
||||
* otherwise it returns 0
|
||||
*/
|
||||
static __INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn)
|
||||
{
|
||||
return((uint32_t) ((NVIC->ISPR[0] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0)); /* Return 1 if pending else 0 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the pending bit for an external interrupt
|
||||
*
|
||||
* @param IRQn The number of the interrupt for set pending
|
||||
*
|
||||
* Set the pending bit for the specified interrupt.
|
||||
* The interrupt number cannot be a negative value.
|
||||
*/
|
||||
static __INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn)
|
||||
{
|
||||
NVIC->ISPR[0] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* set interrupt pending */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear the pending bit for an external interrupt
|
||||
*
|
||||
* @param IRQn The number of the interrupt for clear pending
|
||||
*
|
||||
* Clear the pending bit for the specified interrupt.
|
||||
* The interrupt number cannot be a negative value.
|
||||
*/
|
||||
static __INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn)
|
||||
{
|
||||
NVIC->ICPR[0] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* Clear pending interrupt */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the priority for an interrupt
|
||||
*
|
||||
* @param IRQn The number of the interrupt for set priority
|
||||
* @param priority The priority to set
|
||||
*
|
||||
* Set the priority for the specified interrupt. The interrupt
|
||||
* number can be positive to specify an external (device specific)
|
||||
* interrupt, or negative to specify an internal (core) interrupt.
|
||||
*
|
||||
* Note: The priority cannot be set for every core interrupt.
|
||||
*/
|
||||
static __INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
|
||||
{
|
||||
if(IRQn < 0) {
|
||||
SCB->SHP[_SHP_IDX(IRQn)] = (SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFF << _BIT_SHIFT(IRQn))) |
|
||||
(((priority << (8 - __NVIC_PRIO_BITS)) & 0xFF) << _BIT_SHIFT(IRQn)); }
|
||||
else {
|
||||
NVIC->IPR[_IP_IDX(IRQn)] = (NVIC->IPR[_IP_IDX(IRQn)] & ~(0xFF << _BIT_SHIFT(IRQn))) |
|
||||
(((priority << (8 - __NVIC_PRIO_BITS)) & 0xFF) << _BIT_SHIFT(IRQn)); }
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read the priority for an interrupt
|
||||
*
|
||||
* @param IRQn The number of the interrupt for get priority
|
||||
* @return The priority for the interrupt
|
||||
*
|
||||
* Read the priority for the specified interrupt. The interrupt
|
||||
* number can be positive to specify an external (device specific)
|
||||
* interrupt, or negative to specify an internal (core) interrupt.
|
||||
*
|
||||
* The returned priority value is automatically aligned to the implemented
|
||||
* priority bits of the microcontroller.
|
||||
*
|
||||
* Note: The priority cannot be set for every core interrupt.
|
||||
*/
|
||||
static __INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn)
|
||||
{
|
||||
|
||||
if(IRQn < 0) {
|
||||
return((uint32_t)((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) >> (8 - __NVIC_PRIO_BITS))); } /* get priority for Cortex-M0 system interrupts */
|
||||
else {
|
||||
return((uint32_t)((NVIC->IPR[_IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) >> (8 - __NVIC_PRIO_BITS))); } /* get priority for device specific interrupts */
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ################################## SysTick function ############################################ */
|
||||
|
||||
#if (!defined (__Vendor_SysTickConfig)) || (__Vendor_SysTickConfig == 0)
|
||||
|
||||
/**
|
||||
* @brief Initialize and start the SysTick counter and its interrupt.
|
||||
*
|
||||
* @param ticks number of ticks between two interrupts
|
||||
* @return 1 = failed, 0 = successful
|
||||
*
|
||||
* Initialise the system tick timer and its interrupt and start the
|
||||
* system tick timer / counter in free running mode to generate
|
||||
* periodical interrupts.
|
||||
*/
|
||||
static __INLINE uint32_t SysTick_Config(uint32_t ticks)
|
||||
{
|
||||
if (ticks > SysTick_LOAD_RELOAD_Msk) return (1); /* Reload value impossible */
|
||||
|
||||
SysTick->LOAD = (ticks & SysTick_LOAD_RELOAD_Msk) - 1; /* set reload register */
|
||||
NVIC_SetPriority (SysTick_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority for Cortex-M0 System Interrupts */
|
||||
SysTick->VAL = 0; /* Load the SysTick Counter Value */
|
||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||
SysTick_CTRL_TICKINT_Msk |
|
||||
SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
|
||||
return (0); /* Function successful */
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* ################################## Reset function ############################################ */
|
||||
|
||||
/**
|
||||
* @brief Initiate a system reset request.
|
||||
*
|
||||
* Initiate a system reset request to reset the MCU
|
||||
*/
|
||||
static __INLINE void NVIC_SystemReset(void)
|
||||
{
|
||||
SCB->AIRCR = ((0x5FA << SCB_AIRCR_VECTKEY_Pos) |
|
||||
SCB_AIRCR_SYSRESETREQ_Msk);
|
||||
__DSB(); /* Ensure completion of memory access */
|
||||
while(1); /* wait until reset */
|
||||
}
|
||||
|
||||
/*@}*/ /* end of group CMSIS_CM0_Core_FunctionInterface */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/*@}*/ /* end of group CMSIS_CM0_core_definitions */
|
||||
|
||||
#endif /* __CM0_CORE_H__ */
|
||||
|
||||
/*lint -restore */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user