Files
Embedded-Hacking/drivers/0x01_uart_cbm/Src/main.c
T
Kevin Thomas d072ec5946 refactor: convert 0x01_uart_cbm and 0x02_blink_cbm to bare-metal Inc/Src structure
- Restructure flat files into Inc/ (headers) and Src/ (sources)
- Replace constants.h with rp2350.h register layer (datasheet-verified)
- Add full Doxygen docstrings on all files, functions, and structs
- Replace build.bat/clean.bat with cross-platform Makefile
- Fix GPIO_IN offset (0x004), XOSC COUNT offset (0x10), SRAM size (520K)
- Rename blink_* API to led_* (name after peripheral, not feature)
- Build outputs to build/ directory
- Cross-platform .vscode configs (Windows/macOS/Linux)
2026-04-05 15:57:44 -04:00

47 lines
1.4 KiB
C

/**
******************************************************************************
* @file main.c
* @author Kevin Thomas
* @brief UART demonstration: echo received characters in uppercase.
*
* Demonstrates hardware UART0 using the bare-metal UART driver.
* Characters typed into a terminal via a USB-to-UART adapter
* are echoed back in uppercase.
*
* Wiring:
* GPIO0 (TX) -> USB-to-UART adapter RX
* GPIO1 (RX) -> USB-to-UART adapter TX
* GND -> USB-to-UART adapter GND
*
******************************************************************************
* @attention
*
* Copyright (c) 2026 Kevin Thomas.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
#include "rp2350_uart.h"
/**
* @brief Application entry point for the UART uppercase echo demo.
* @retval int does not return
*/
int main(void)
{
uart_puts("UART driver ready (115200 8N1)\r\n");
uart_puts("Type characters to echo them back in UPPERCASE:\r\n");
while (1) {
if (uart_is_readable()) {
char c = uart_getchar();
char upper = uart_to_upper(c);
uart_putchar(upper);
}
}
}