Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
lcd1100.h@1:6b0d8c274965, 2012-07-21 (annotated)
- Committer:
- Carlos_Gomez
- Date:
- Sat Jul 21 04:09:25 2012 +0000
- Revision:
- 1:6b0d8c274965
- Parent:
- 0:63329911c8c0
- Child:
- 2:d689e9c18cf8
20 de Julio de 2012
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Carlos_Gomez | 1:6b0d8c274965 | 1 | /* Copyright (c) 2012 Carlos Gomez, Hector vargas, MIT License |
| Carlos_Gomez | 1:6b0d8c274965 | 2 | * |
| Carlos_Gomez | 1:6b0d8c274965 | 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
| Carlos_Gomez | 1:6b0d8c274965 | 4 | * and associated documentation files (the "Software"), to deal in the Software without restriction, |
| Carlos_Gomez | 1:6b0d8c274965 | 5 | * including without limitation the rights to use, copy, modify, merge, publish, distribute, |
| Carlos_Gomez | 1:6b0d8c274965 | 6 | * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is |
| Carlos_Gomez | 1:6b0d8c274965 | 7 | * furnished to do so, subject to the following conditions: |
| Carlos_Gomez | 1:6b0d8c274965 | 8 | * |
| Carlos_Gomez | 1:6b0d8c274965 | 9 | * The above copyright notice and this permission notice shall be included in all copies or |
| Carlos_Gomez | 1:6b0d8c274965 | 10 | * substantial portions of the Software. |
| Carlos_Gomez | 1:6b0d8c274965 | 11 | * |
| Carlos_Gomez | 1:6b0d8c274965 | 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
| Carlos_Gomez | 1:6b0d8c274965 | 13 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| Carlos_Gomez | 1:6b0d8c274965 | 14 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| Carlos_Gomez | 1:6b0d8c274965 | 15 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| Carlos_Gomez | 1:6b0d8c274965 | 16 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| Carlos_Gomez | 1:6b0d8c274965 | 17 | */ |
| Carlos_Gomez | 0:63329911c8c0 | 18 | ////////////////////////////////////////////////////// |
| Carlos_Gomez | 0:63329911c8c0 | 19 | /* |
| Carlos_Gomez | 1:6b0d8c274965 | 20 | esta libreria fue adaptada por Carlos Gomez y Hector |
| Carlos_Gomez | 1:6b0d8c274965 | 21 | Vargas para uso enel proyecto de fin de carrera en |
| Carlos_Gomez | 1:6b0d8c274965 | 22 | Ingenieria ilectronica |
| Carlos_Gomez | 0:63329911c8c0 | 23 | en la Universidad de los Llanos - Villavicencio - Colombia |
| Carlos_Gomez | 0:63329911c8c0 | 24 | */ |
| Carlos_Gomez | 0:63329911c8c0 | 25 | ////////////////////////////////////////////////////// |
| Carlos_Gomez | 0:63329911c8c0 | 26 | /// lcd1100.c |
| Carlos_Gomez | 0:63329911c8c0 | 27 | /// |
| Carlos_Gomez | 0:63329911c8c0 | 28 | /// Badr Ghatasheh (demonspells) |
| Carlos_Gomez | 0:63329911c8c0 | 29 | /// 11/3/2011 |
| Carlos_Gomez | 0:63329911c8c0 | 30 | ////////////////////// |
| Carlos_Gomez | 0:63329911c8c0 | 31 | #ifndef LCD1100_H |
| Carlos_Gomez | 0:63329911c8c0 | 32 | #define LCD1100_H |
| Carlos_Gomez | 0:63329911c8c0 | 33 | #include "mbed.h" |
| Carlos_Gomez | 0:63329911c8c0 | 34 | |
| Carlos_Gomez | 0:63329911c8c0 | 35 | #define CMD 0 |
| Carlos_Gomez | 0:63329911c8c0 | 36 | #define DATA 1 |
| Carlos_Gomez | 0:63329911c8c0 | 37 | class lcd1100 { |
| Carlos_Gomez | 0:63329911c8c0 | 38 | public: |
| Carlos_Gomez | 0:63329911c8c0 | 39 | lcd1100(PinName _sclk,PinName _sda,PinName _cs,PinName _rst); |
| Carlos_Gomez | 0:63329911c8c0 | 40 | //Inicializa la LCD |
| Carlos_Gomez | 0:63329911c8c0 | 41 | void Lcd_Init(void); |
| Carlos_Gomez | 0:63329911c8c0 | 42 | //Limpia la LCD |
| Carlos_Gomez | 0:63329911c8c0 | 43 | void Lcd_Clear(void); |
| Carlos_Gomez | 0:63329911c8c0 | 44 | void SetX(char x); |
| Carlos_Gomez | 0:63329911c8c0 | 45 | void SetY(char y); |
| Carlos_Gomez | 0:63329911c8c0 | 46 | //sed the position of cursor X(0 to 96) and Y(0 to 7)each position in "Y" is 8*y pixels |
| Carlos_Gomez | 0:63329911c8c0 | 47 | //pone el cursor en la posicion X,Y*8 |
| Carlos_Gomez | 0:63329911c8c0 | 48 | //los valores aceptables para Y son de 0 a 96 y para Y de 0 a 9 |
| Carlos_Gomez | 0:63329911c8c0 | 49 | void Gotoxy(char x,char y); |
| Carlos_Gomez | 0:63329911c8c0 | 50 | //dibuja una linea vertical |
| Carlos_Gomez | 0:63329911c8c0 | 51 | void VLine(char x,char y,char on); |
| Carlos_Gomez | 0:63329911c8c0 | 52 | //dibuja una linea Horizontal |
| Carlos_Gomez | 0:63329911c8c0 | 53 | void Line(unsigned char x,unsigned char y,unsigned char y2,unsigned char on); |
| Carlos_Gomez | 0:63329911c8c0 | 54 | //imprime un caracter |
| Carlos_Gomez | 0:63329911c8c0 | 55 | void print_char(char c); |
| Carlos_Gomez | 0:63329911c8c0 | 56 | //imprime un String |
| Carlos_Gomez | 0:63329911c8c0 | 57 | void printf_lcd(char *s); |
| Carlos_Gomez | 0:63329911c8c0 | 58 | //imprime una imagen |
| Carlos_Gomez | 0:63329911c8c0 | 59 | void cargar_imagen(char *dir); |
| Carlos_Gomez | 0:63329911c8c0 | 60 | char bitaddr; |
| Carlos_Gomez | 0:63329911c8c0 | 61 | private: |
| Carlos_Gomez | 0:63329911c8c0 | 62 | DigitalOut sclk; |
| Carlos_Gomez | 0:63329911c8c0 | 63 | DigitalOut sda; |
| Carlos_Gomez | 0:63329911c8c0 | 64 | DigitalOut cs; |
| Carlos_Gomez | 0:63329911c8c0 | 65 | DigitalOut rst; |
| Carlos_Gomez | 0:63329911c8c0 | 66 | // lookup table, here you can modify the font |
| Carlos_Gomez | 0:63329911c8c0 | 67 | static const char FontLookup1[48][5]; |
| Carlos_Gomez | 0:63329911c8c0 | 68 | static const char FontLookup2[48][5]; |
| Carlos_Gomez | 0:63329911c8c0 | 69 | //envia datos los datos a la LCD1100 |
| Carlos_Gomez | 0:63329911c8c0 | 70 | void Lcd_Write(bool cd,unsigned char c); |
| Carlos_Gomez | 0:63329911c8c0 | 71 | }; |
| Carlos_Gomez | 0:63329911c8c0 | 72 | |
| Carlos_Gomez | 0:63329911c8c0 | 73 | #endif |