#
The SERIAL1
module provides an interface for serial communication using the Enhanced Universal Synchronous Asynchronous Receiver Transmitter (EUSART1) on Microchip PIC16F series microcontrollers. It includes functions for configuring the serial interface, sending and receiving data, and checking transmission and reception statuses.
File Information #
- Files:
serial1.h
,serial1.c
- Version: 1.0.2
Supported Processors: #
SERIAL1 Interface #
The SERIAL1
provides an interface for serial communication using the EUSART1 (Enhanced Universal Synchronous Asynchronous Receiver Transmitter) peripheral on Microchip PIC16F series microcontrollers. This interface allows for initializing the serial port, sending and receiving data, and checking the status of the transmit and receive buffers.
Functions in the SERIAL1 Interface #
Initialize(SerialBaudEnum_t BaudSelect)
- Description: Initializes the EUSART1 module with the specified baud rate. This function configures the input/output pins for the serial port and enables both the transmitter and receiver.
WriteByte(uint8_t SerialData)
- Description: Sends a single byte of data over the EUSART1 serial port. This function waits until the transmit buffer is ready before sending the byte.
WriteString(char *StringData)
- Description: Sends a null-terminated string of characters over the EUSART1 serial port. This function sends each character in sequence and blocks until all characters are transmitted.
IsDataAvailable(void)
- Description: Checks if there is data available in the EUSART1 receive buffer. This function can be used to determine if a new byte has been received and is ready to be read.
IsTransmitComplete(void)
- Description: Checks if the transmission shift register has completed sending the last byte. This is useful for determining if the UART is busy.
ReadByte(void)
- Description: Reads a byte of data from the EUSART1 receive buffer. This function retrieves the oldest byte received through the serial port.
IsTransmitBufferReady(void)
- Description: Checks if the transmit buffer is ready to accept new data. This function can be used to determine if it is safe to send more data without overwriting the current data in the buffer.