A collection of useful things in C to complement existing avr-libc features.
The style will appeal to people that prefer:
- standard types
- enum instead of macros where appropriate
- code that works correctly between mainloop and interrupt
- code that works correctly with system clock prescaler
- ATMEGA328p
Some modules depend on others (e.g. uart uses fifo).
- read and write pins using Arduino pin naming conventions
- set/clear pin change interrupt handlers
- byte oriented FIFO
- variable buffer size set at initialisation time
- works between interrupt and mainloop
- non-blocking semaphores (i.e. flags)
- works between interrupt and mainloop
- master mode only
- bit rate and mode settings
- configures pins as required
compile options:
- F_CPU (system clock in Hz)
- baud rate setting
- buffered tx and rx
- put/get from interrupt and mainloop
- tx_empty/rx_ready handlers
- depends on fifo
compile options:
- F_CPU (system clock in Hz)
- UART_TX_SIZE (tx buffer size)
- UART_RX_SIZE (rx buffer size)
- hardware dependent RC oscillator calibration
- uses TC2 (32768Hz async mode) to calibrate RC using TC0 (io clock)
AVRBits has an MIT license.