-
Notifications
You must be signed in to change notification settings - Fork 20
/
SPI18F67J60.h
24 lines (21 loc) · 802 Bytes
/
SPI18F67J60.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* SPI library for 16F886*/
#ifndef SPI18F67J60_h
#define SPI18F67J60_h
#include <stdio.h>
#include <stdlib.h>
#include "SPI18F67J60.h"
//turn on SPI module (really the MSSP)
void SPIOn();
//init SPI with the mode choice (1 -4), clock division (4,16,64 - not used for slave), master mode or slave mode ('m'.'s')
int initSPI(int mode, int clockDivide, char masterSlave);
//write an SPI unsigned char - include GenericTypeDeffs.h
unsigned char writeSPIByte (unsigned char data);
//Read an SPI unsigned char - include GenericTypeDeffs.h
unsigned char readSPIByte (void);
//write an SPI WORD - include GenericTypeDeffs.h
void writeSPIWord(unsigned short int setting);
//write an SPI WORD - include GenericTypeDeffs.h
void readSPIWord();
//turn off SPI module
void SPIOff();
#endif