ashish4hub/atmega328p-hal ? reverse-engineered prompt
Reverse engineered prompt
Build me a bare metal firmware framework for the ATmega328P in C, with the application logic kept separate from the low level register work.
I want reusable drivers for the main peripherals, especially ADC, timers, PWM, UART, SPI, and input capture, plus a simple 1 ms system tick and a non blocking wait helper. Please include a UART based command line interface so I can interact with the board, trigger tests, and inspect results in real time over serial.
The goal is to make it easy to do things like read an analog input, change PWM duty cycle, send and receive serial data, and measure timing signals without writing register code in the application every time. Keep it suitable for a 16 MHz ATmega328P, and make the code clean and modular so the drivers can be reused.
If anything is unclear, look up the current ATmega328P docs online and then fill in the missing details in a practical way.
Are you gonna build this?
make sure you review the code using coderabbit