LTlib LaurTec Library
4.0.0 Beta
Open Source C Library for Microchip Microcontrollers based on XC8 Compiler
|
#include "LTlib.h"
Go to the source code of this file.
Macros | |
#define | UART1_data_ready() (PIR1bits.RCIF) |
#define | UART1_close() (RCSTA&=0b01001111,TXSTAbits.TXEN=0) |
#define | UART1_TX_busy() (!TXSTAbits.TRMT) |
Functions | |
void | UART1_open (unsigned int baud_rate) |
void | UART1_write_byte (unsigned char data) |
unsigned char | UART1_read_byte (void) |
void | UART1_write_message (const unsigned char *data) |
void | UART1_write_string (unsigned char *data) |
#define UART1_close | ( | ) | (RCSTA&=0b01001111,TXSTAbits.TXEN=0) |
This macro close the USART disabling RX and TX buffer.
none |
Definition at line 109 of file module_UART.h.
#define UART1_data_ready | ( | ) | (PIR1bits.RCIF) |
This macro is used to check if the USART has some data in the RX buffer.
none |
Definition at line 99 of file module_UART.h.
#define UART1_TX_busy | ( | ) | (!TXSTAbits.TRMT) |
This macro is used to check if the USART is busy sending other data out.
none |
Definition at line 122 of file module_UART.h.
void UART1_open | ( | unsigned int | baud_rate | ) |
This function Opens the UART module enabling TX and RX channels.
data | Byte to write [min: UART_BAUDRATE_9600, max: UART_BAUDRATE_115200] |
You must use the constants UART_BAUDRATE_9600, UART_BAUDRATE_19200, UART_BAUDRATE_57600, UART_BAUDRATE_115200 to set the baudrate
Definition at line 48 of file module_UART.c.
References PIN_AS_INPUT.
unsigned char UART1_read_byte | ( | void | ) |
This function reads a byte from the RX buffer
none |
Definition at line 218 of file module_UART.c.
void UART1_write_byte | ( | unsigned char | data | ) |
This function writes a byte to the UART module.
data | Byte to write [min: 0, max: 255] |
Definition at line 157 of file module_UART.c.
References UART1_TX_busy.
void UART1_write_message | ( | const unsigned char * | data | ) |
This function writes a constant message to the UART.
*data | Constant string pointer |
Definition at line 172 of file module_UART.c.
References UART1_TX_busy, and UART1_write_byte().
void UART1_write_string | ( | unsigned char * | data | ) |
This function writes a string to the UART.
*data | Pointer to the array of char (string) |
Definition at line 195 of file module_UART.c.
References UART1_TX_busy, and UART1_write_byte().