LTlib LaurTec Library
4.0.0 Beta
Open Source C Library for Microchip Microcontrollers based on XC8 Compiler
|
#include "module_SPI.h"
Go to the source code of this file.
Functions | |
void | SPI1_open (unsigned char device_type) |
void | SPI1_close (void) |
void | SPI1_baudrate (unsigned char baudrate) |
void | SPI1_mode (unsigned char communication_mode) |
unsigned char | SPI1_write_byte (unsigned char byte_to_send) |
unsigned char | SPI1_read_byte (void) |
void SPI1_baudrate | ( | unsigned char | baudrate | ) |
This function sets the communication baudrate. It should be called before SPI_open function.
baudrate | Baudrate [SPI_CLK_OSC_64, SPI_CLK_OSC_16, SPI_CLK_OSC_4, SPI_TIMER_OUT_CLK] |
Definition at line 151 of file module_SPI.c.
void SPI1_close | ( | void | ) |
This function close the SPI module.
void |
Definition at line 134 of file module_SPI.c.
void SPI1_mode | ( | unsigned char | communication_mode | ) |
This function sets the communication mode. It should be called before SPI_open function.
communication_mode | Operational mode [SPI_MODE_0, SPI_MODE_1, SPI_MODE_2, SPI_MODE_3] |
Definition at line 168 of file module_SPI.c.
References SPI_MODE_0, SPI_MODE_1, SPI_MODE_2, and SPI_MODE_3.
void SPI1_open | ( | unsigned char | device_type | ) |
This function opens the SPI module for communication. In particular it sets the device type either to Master or Slave.
device_type | Device Type [SPI_MASTER_DEVICE, SPI_SLAVE_DEVICE] |
Definition at line 52 of file module_SPI.c.
References PIN_AS_INPUT, PIN_AS_OUTPUT, SPI1_SS_PIN, SPI_MASTER_DEVICE, and SPI_SLAVE_DEVICE.
unsigned char SPI1_read_byte | ( | void | ) |
This function reads a single byte from the bus
void |
Definition at line 286 of file module_SPI.c.
References SPI1_is_TX_over.
unsigned char SPI1_write_byte | ( | unsigned char | byte_to_send | ) |
This function writes a single byte on the bus.
byte_to_send | Byte to send [0..255] |
Definition at line 228 of file module_SPI.c.
References SPI1_is_TX_over.