|
Serial Musical Organ 1.0
Buzzer controller and musical organ
|
USART serial communication interface. More...

Go to the source code of this file.
Functions | |
| void | initUSART (void) |
| Initializes the USART peripheral for serial communication. | |
| void | printString (const char String[]) |
| Sends a null-terminated string over USART. | |
| uint8_t | receiveByte (void) |
| Receives a single byte from USART. | |
| void | transmitByte (uint8_t data) |
| Transmits a single byte over USART. | |
USART serial communication interface.
This file provides functions for initializing and using the USART (Universal Synchronous/Asynchronous Receiver/Transmitter) peripheral for serial communication. It supports byte transmission/reception, string printing, and formatted output.
Definition in file USART.h.
| void initUSART | ( | void | ) |
Initializes the USART peripheral for serial communication.
Configures the USART with the following settings:
Initializes the USART peripheral for serial communication.
Configures the USART with baud rate from setbaud.h calculations, enables transmitter and receiver, and sets frame format to 8 data bits, 1 stop bit, no parity.
Definition at line 34 of file USART.c.
Referenced by main().

| void printString | ( | const char | String[] | ) |
Sends a null-terminated string over USART.
Transmits each character of the string sequentially until the null terminator ('\0') is reached.
| String | Pointer to the null-terminated string to transmit |
Referenced by main().

| uint8_t receiveByte | ( | void | ) |
Receives a single byte from USART.
Waits for a byte to be received on the USART RX line and returns it. Function blocks until data is available.
Waits for a byte to be received (RXC flag set), then returns the received data from the UDR register.
Definition at line 88 of file USART.c.
Referenced by main().

| void transmitByte | ( | uint8_t | data | ) |
Transmits a single byte over USART.
Sends one byte of data through the USART TX line. Function blocks until the transmission is complete.
| data | The byte (0-255) to transmit |
Waits for the transmit data register to be empty, then loads the data into the UDR register for transmission.
| data | The byte to transmit (0-255) |
Definition at line 71 of file USART.c.
Referenced by main(), and printString().
