-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
55 lines (44 loc) · 1.44 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <stdio.h>
#include <stdint.h>
#include "src/lcd.h"
#define LOCATION_PATTERN_0 (0)
#define LOCATION_PATTERN_1 (1)
void ctrlEn(uint8_t status){
//PORTDbits.RD7 = status;
}
void ctrlRs(uint8_t status){
//PORTDbits.RD6 = status;
}
void ctrlData(uint8_t Data){
//PORTC = Data;
}
void delay_ms(uint32_t milliseconds){
while(milliseconds > 0)
{
//__delay_ms(1);
milliseconds--;
}
}
//TODO: pendiente agregar unity test, cmock
int main(){
lcdData_t objLcd;
lcdInit(&objLcd,ctrlEn, ctrlRs , ctrlData, delay_ms );
unsigned char Pattern1 [ ] = { 0x0e, 0x0e, 0x04, 0x04, 0x1f, 0x04, 0x0a, 0x0a } ;
unsigned char Pattern0[]= {0x00,0x00,0x0a,0x15,0x11,0x0a,0x04,0x00};
//unsigned char Pattern4[]= {0x00,0x00,0x0a,0x1f,0x1f,0x0e,0x04,0x00};
lcdCreateCustomCharacter (&objLcd, Pattern1, LOCATION_PATTERN_1);
lcdCreateCustomCharacter (&objLcd, Pattern0, LOCATION_PATTERN_0);
//while(1)
{
lcdSetCursorPosition(&objLcd, 0);
lcdPrint(&objLcd, "123456789012345abcdefghijklmnopq123456");
lcdPrintInLine1(&objLcd, "a", 0);
lcdSetCursorPosition(&objLcd, 0);
lcdPrintChar(&objLcd, 0x7e);
lcdPrintInLine1(&objLcd, "123456789012345abcdefghijklmnopq123456",1);
lcdSetCursorPosition(&objLcd, 6);
lcdPrintChar(&objLcd, LOCATION_PATTERN_1);
lcdSetCursorPosition(&objLcd, 8);
lcdPrintChar(&objLcd, LOCATION_PATTERN_0);
}
}