An attempt tp port Arduino ST1201 code to the KL25Z
Embed:
(wiki syntax)
Show/hide line numbers
KTMS1201.h
00001 /* Header file for Arduino and KTM-S1201 LCD module 00002 Originally Written by Jeff Albertson Ver 1.0 00003 Modifications and code normalisation by Robert W. Mech rob@mechsoftware.com 00004 Modified by John Boxall 11/March/2013 00005 00006 These are the pins that are output on the KTM-S1201 00007 00008 LCD pin number 00009 Pin 1 LcdVcc +5V dc power 00010 pin 2 LcdVss GND 00011 pin 3 LcdnSck Not Serial clock 00012 pin 4 LcdSi Serial data 00013 pin 5 LcdCnD Select Command or Data mode 00014 pin 6 LcdnRes Reset LCD 00015 pin 7 LcdnBus LCD not busy 00016 pin 8 LcdnCs LCD not Chip select 00017 pin 9 Pot wiper Vlc LCD Contrast Connect POT between pin 9 and GND 00018 pin 10 NC 00019 */ 00020 00021 #define HIGH 1 00022 #define LOW 0 00023 00024 // Here we set which LCD pins will connect to which Arduino pin 00025 /* 00026 #define LcdSck 4 //Not Serial clock 00027 #define LcdSi 5 //Serial data in 00028 #define LcdCnD 6 //Command or Not data in 00029 #define LcdnRes 7 //Not reset low = reset 00030 #define LcdnBus 9// Not Busy output from LCD not used if delay(1) after LcdnCs changes 00031 #define LcdnCs 8 //Not Chip select Low = LCD selected 00032 THESE DEFINITION MOVED TO DigitalOut FUNCTIONS IN main.cpp 00033 */ 00034 // Put a delay(1) after every LcdnCs change or check LcdnBus 00035 #define t 100 00036 #define t1 10 00037 00038 // The Not Chip select pin is the only unique 00039 // Pin on the LCD all other pins can be paralleled 00040 // for more ktm-s1201 displays 00041 #define _Mode 0x40 00042 #define _USync 0x31 00043 #define _FBlink 0x1b 00044 #define _SBlink 0x1a 00045 #define _NoBlink 0x18 00046 #define _DispOn 0x11 00047 #define _Decode 0x15 00048 #define _NoDecode 0x14 00049 #define _LoadPtr 0xE0 00050 #define _SetDp 0xb8 // Set decimal point (Dp) 00051 #define _ClearDp 0x9f // Clear decimal point (Dp) 00052 #define _ClearDsp 0x20 // Clear display memory 00053 00054 // To set Dp you must be in NoDecode mode and point to character (LoadPtr) 00055 // --- 0x01 00056 //0x10 | | 0x02 00057 //0x20 --- 00058 //0x40 | | 0x04 00059 //0x80 --- o 0x08 00060 00061 #define _cet 0x31 // Celsius 00062 #define _ 0x0 // Space 00063 #define _A 0x77 // 00064 #define _B 0xF4 // 00065 #define _C 0xE0 // 00066 #define _D 0xE6 // 00067 #define _E 0xF1 // 00068 #define _F 0x71 // 00069 #define _G 0xD5 // 00070 #define _H 0x74 // 00071 #define _I 0x04 // 00072 #define _J 0x86 // 00073 #define _K 0x70 // 00074 #define _L 0xD0 // 00075 #define _M 0x76 // 00076 #define _N 0x64 // 00077 #define _O 0xE4 // 00078 #define _P 0x73 // 00079 #define _Q 0xDF // 00080 #define _R 0x60 // 00081 #define _S 0xB5 // 00082 #define _T 0xF0 // 00083 #define _U 0xC4 // 00084 #define _V 0xD6 // 00085 #define _W 0xF6 // 00086 #define _X 0x56 // 00087 #define _Y 0x72 // 00088 #define _Z 0xEB // 00089 #define _1 0x06 // 00090 #define _2 0xE3 // 00091 #define _3 0xA7 // 00092 #define _4 0x36 // 00093 #define _5 0xB5 // 00094 #define _6 0xF4 // 00095 #define _7 0x07 // 00096 #define _8 0xF7 // 00097 #define _9 0x37 // 00098 #define _0 0xD7 // 00099 #define _DASH 0x20 // 00100 #define _DEGREE 0x33 // 00101 00102
Generated on Mon Aug 1 2022 11:29:05 by 1.7.2