LTlib LaurTec Library
4.0.1
Open Source C Library for Microchip Microcontrollers based on XC8 Compiler
Main Page
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
main.c
Go to the documentation of this file.
1
#include <xc.h>
2
3
#include "
LTlib.h
"
4
5
#include "
module_IO.h
"
6
#include "
module_IO.c
"
7
8
#include "
module_I2C.h
"
9
#include "
module_I2C.c
"
10
11
#include "
delay.h
"
12
#include "
delay.c
"
13
14
#include "
MCP7940.h
"
15
#include "
MCP7940.c
"
16
17
#include "
MCP2300x.h
"
18
#include "
MCP2300x.c
"
19
20
#include "
LCD_44780_I2C.h
"
21
#include "
LCD_44780_I2C.c
"
22
23
int
main
(
void
) {
24
25
IO_set_all_ports_as_inputs
();
26
27
//Enable the Buzzer output
28
IO_set_port_direction
(
IO_PORTC
, 0x00);
29
IO_write_port
(
IO_PORTC
, 0x00);
30
31
LCD_initialize
(20);
32
RTCC_initialize
(100);
33
34
RTCC_set_years
(0x15);
35
RTCC_set_months
(0x11);
36
RTCC_set_days
(0x22);
37
38
RTCC_set_hours
(0x16);
39
RTCC_set_minutes
(0x20);
40
RTCC_set_seconds
(0x57);
41
42
RTCC_set_hours_alarm
(0x16,
RTCC_ENABLE_ON
);
43
RTCC_set_minutes_alarm
(0x21,
RTCC_ENABLE_ON
);
44
45
LCD_backlight
(
LCD_TURN_ON_LED
);
46
47
while
(1){
48
LCD_home
();
49
LCD_write_message
(
"Date : "
);
50
LCD_write_string
(
RTCC_get_date
());
51
LCD_goto_line
(2);
52
LCD_write_message
(
"Time : "
);
53
LCD_write_string
(
RTCC_get_time_seconds
());
54
55
if
(
RTCC_is_alarm_ON
()){
56
IO_write_port
(
IO_PORTC
, 0x01);
57
}
58
59
delay_ms
(500);
60
}
61
}
LTlib_v_4.0.1
ex
PIC18
MCP7940
02 - MCP7940_Time_Alarm.X
main.c
Generated on Sat Mar 12 2016 11:01:40 for LTlib LaurTec Library by
1.8.3.1