src/setup.S
: code for intializing cpu and interrupt vectors (defined only TIMER0_COMPA and TIMER1_COMPA)src/registers.h
: definitions of registers and register bitssrc/interrupts.h
: defines ISR macro for declaring interrupt handlersexamples
analogRead.c
: reads analog value from pin A5, which can be connected to a potentiometeranalogWrite.c
: output pwm to pins 10 and 11, which can be connecte to ledsled.c
: turns the builtin led on and off every seconduart.c
: writes and reads to/from the console
To be able to run an example, you need to have installed these tools: make
, avr-as
, avr-gcc
, avr-objcopy
, avrdude
. To run a , use:
make <example>-example-run DEVICE=<device>
led example:
make led-example-run DEVICE=/dev/ttyACM0
analogWrite example:
make analogWrite-example-run DEVICE=/dev/ttyACM0
uart example:
make uart-example-run DEVICE=/dev/ttyACM0 && \
stty -F /dev/ttyACM0 cs8 9600 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts && \
cat /dev/ttyACM0
Run echo -n 111 > /dev/ttyACM0
to send characters.
analogRead example:
make analogRead-example-run DEVICE=/dev/ttyACM0 && \
stty -F /dev/ttyACM0 cs8 9600 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts && \
cat /dev/ttyACM0
src/bits_and_bytes.h
basic_functions.c
+basic_functions.h
: port manipulating functions, timer functionssrc/analog.h
+src/analog.c
: analog functions
src/buffer.c
+src/buffer.h
: functions for manipulating buffersrc/parse_int.c
+src/parse_int.h
: functions for parsing intsrc/uart.c
+src/uart.h
: functions for working with uart
See examples/stop_watch.c