Age | Commit message (Collapse) | Author |
|
This is just support for the chip, no boards are currently supported.
However, you can use this target on a custom board.
Notes:
- This required a new runtime and machine implementation, because the
hardware is actually very different (and much nicer than older
AVRs!).
- I had to update gen-device-avr to support this chip. This also
affects the generated output of other AVRs, but I checked all chips
we support and there shouldn't be any backwards incompatible
changes.
- I did not implement peripherals like UART, I2C, SPI, etc because I
don't need them. That is left to do in the future.
You can flash these chips with only a UART and a 1kOhm resistor, which
is really nice (no special hardware needed). Here is the program I've
used for this purpose: https://pypi.org/project/pymcuprog/
|
|
|
|
move AVR interrupt related code to runtime
address formatting
add volatile to access counters
|
|
time precision affected when timer-0 reconfigured). Keep all time in nanoseconds.
Interrupt based time. Adjust tick cost every 1 minute and when timer-0 is reconfigured (the time precision affected when timer-0 reconfigured). Keep all time in nanoseconds.
|
|
This field contains the microcontroller name that we're compiling for,
or "generic" if we're not running on a microcontroller.
|
|
To my surprise, this is supported on all the devices I could test so
therefore it makes sense to change the API to allow this.
|
|
It is always implemented exactly the same way (as an uint8) so there is
no reason to implement it in each target separately.
This also makes it easier to add some documentation to it.
|
|
These stubs don't really belong there: attiny currently doesn't directly
support I2C at all (although it has hardware to support a software
implementation).
|
|
I think it's better not to provide a UART0 global at all than one that
does nothing.
|
|
|
|
|
|
All the AVRs that I've looked at had the same pin/port structure, with
the possible states being input/floating, input/pullup, low, and high
(with the same PORT/DDR registers). The main difference is the number of
available ports and pins. To reduce the amount of code and avoid
duplication (and thus errors) I decided to centralize this, following
the design used by the atmega2560 but while using a trick to save
tracking a few registers.
In the process, I noticed that the Pin.Get() function was incorrect on
the atmega2560 implementation. It is now fixed in the unified code.
|
|
This avoids duplication of code. None of the smoke tests have changed
their output.
|
|
Signed-off-by: Ron Evans <[email protected]>
|
|
|
|
This avoids the //go:volatile pragma on types in Go source code, at
least for AVR targets.
|
|
* machine/uart: add core support for multiple UARTs by allowing for multiple RingBuffers
* machine/uart: complete core support for multiple UARTs
* machine/uart: no need to store pointer to UART, better to treat like I2C and SPI
* machine/uart: increase ring buffer size to 128 bytes
* machine/uart: improve godocs comments and use comma-ok idiom for buffer Put/Get methods
|
|
|
|
Blinking the on-board LED works. Nothing else has been tested yet.
|
|
|
|
Signed-off-by: Ron Evans <[email protected]>
|
|
|
|
Signed-off-by: Ron Evans <[email protected]>
|
|
Signed-off-by: Ron Evans <[email protected]>
|
|
I'm afraid I broke this while merging the I2S changes...
|
|
Signed-off-by: Ron Evans <[email protected]>
|
|
|
|
|
|
|
|
Signed-off-by: Ron Evans <[email protected]>
Edited slightly by Ayke van Laethem
|
|
Signed-off-by: Ron Evans <[email protected]>
|
|
Signed-off-by: Ron Evans <[email protected]>
|
|
Don't store addresses in the values of registers, this leads to problems
with char arrays (among others). Instead, do it like it's done in C with
raw addresses cast to struct pointers.
This commit also splits gen-device.py, as AVR and ARM have very
different ideas of what a register is. It's easier to just keep them
separate.
|
|
|
|
This requires support in LLVM, as AVR support is still experimental. For
example, in bindings/go/build.sh, add
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=AVR to cmake_flags.
|