LTlib LaurTec Library
4.0.3
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
2
#include <xc.h>
3
4
#include "
LTlib.h
"
5
6
#include "
module_IO.h
"
7
#include "
module_IO.c
"
8
9
#include "
module_SPI.h
"
10
#include "
module_SPI.c
"
11
12
13
//*************************************
14
// SPI Slave
15
//*************************************
16
17
int
main
(
void
) {
18
19
IO_set_all_ports_as_inputs
();
20
21
IO_set_port_direction
(
IO_PORTD
,
IO_ALL_PORT_OUTPUT
);
22
23
SPI1_mode
(
SPI_MODE_1
);
24
SPI1_open
(
SPI_SLAVE_DEVICE
);
25
26
while
(1) {
27
IO_write_port
(
IO_PORTD
,
SPI1_read_byte
());
28
}
29
}
30
31
32
LTlib_v_4.0.3
ex
PIC18
_module_SPI
01_SPI_Slave.X
main.c
Generated on Wed Aug 3 2016 19:57:31 for LTlib LaurTec Library by
1.8.3.1