LTlib LaurTec Library  4.0.3
Open Source C Library for Microchip Microcontrollers based on XC8 Compiler
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
module_UART.c File Reference
#include "module_UART.h"

Go to the source code of this file.

Functions

void UART1_open (unsigned int baud_rate)
 
void UART1_write_byte (unsigned char data)
 
void UART1_write_message (const unsigned char *data)
 
void UART1_write_string (unsigned char *data)
 
unsigned char UART1_read_byte (void)
 

Function Documentation

void UART1_open ( unsigned int  baud_rate)

This function Opens the UART module enabling TX and RX channels.

Parameters
dataByte to write [min: UART_BAUDRATE_9600, max: UART_BAUDRATE_115200]
Returns
void

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

Parameters
none
Returns
byte Value out of the RX buffer.

Definition at line 224 of file module_UART.c.

void UART1_write_byte ( unsigned char  data)

This function writes a byte to the UART module.

Parameters
dataByte to write [min: 0, max: 255]
Returns
void
Warning
this function is a blocking one since it waits for the byte to be sent out.

Definition at line 163 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.

Parameters
*dataConstant string pointer
Returns
none
Note
A constant message is a string within "" like this "Hello World".

Definition at line 178 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.

Parameters
*dataPointer to the array of char (string)
Returns
none
Note
A string is an array of chars.

Definition at line 201 of file module_UART.c.

References UART1_TX_busy, and UART1_write_byte().