aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/machine/machine_avr.go
AgeCommit message (Collapse)Author
2023-05-20avr: add attiny1616 supportAyke van Laethem
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/
2022-12-19build: drop deprecated build tagsYurii Soldak
2022-01-20move AVR interrupt related code to runtimeDmitriy Zakharkin
move AVR interrupt related code to runtime address formatting add volatile to access counters
2021-12-30Interrupt based time. Adjust tick cost when timer-0 is reconfigured (the ↵Dmitriy
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.
2021-11-30machine: add Device constantAyke van Laethem
This field contains the microcontroller name that we're compiling for, or "generic" if we're not running on a microcontroller.
2021-10-28machine: support Pin.Get() function when the pin is configured as outputAyke van Laethem
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.
2021-05-06machine: move PinMode to central locationAyke van Laethem
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.
2021-03-29avr: remove I2C stubs from attiny supportAyke van Laethem
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).
2021-03-10attiny: remove dummy UARTAyke van Laethem
I think it's better not to provide a UART0 global at all than one that does nothing.
2021-01-31accept configuration struct for ADC parameters (#1533)ardnew
2020-05-22avr: add support for PinInputPullupAyke van Laethem
2020-05-22avr: unify GPIO pin/port codeAyke van Laethem
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.
2019-06-06all: move Register{8,16,32} values into runtime/volatileAyke van Laethem
This avoids duplication of code. None of the smoke tests have changed their output.
2019-05-27machine/avr: use HasBits() method to simplify bit comparisonsRon Evans
Signed-off-by: Ron Evans <[email protected]>
2019-05-26machine: refactor pins to be of Pin typeAyke van Laethem
2019-05-14avr: use register wrappers that use runtime/volatile.*Uint8 callsAyke van Laethem
This avoids the //go:volatile pragma on types in Go source code, at least for AVR targets.
2019-01-25Add core support for multiple UARTs (#152)Ron Evans
* 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
2018-11-20machine/avr: implement raw GPIO access for bitbanged driversAyke van Laethem
2018-11-20avr: add support for the digisparkAyke van Laethem
Blinking the on-board LED works. Nothing else has been tested yet.
2018-11-16machine: redesign I2C interfaceAyke van Laethem
2018-10-05nrf: I2C interfaceRon Evans
Signed-off-by: Ron Evans <[email protected]>
2018-10-04avr: use machine.UART0 as stdoutAyke van Laethem
2018-10-02nrf: implement UART interfaceRon Evans
Signed-off-by: Ron Evans <[email protected]>
2018-10-01avr: implement UART interfaceRon Evans
Signed-off-by: Ron Evans <[email protected]>
2018-09-25avr: fix build for ArduinoAyke van Laethem
I'm afraid I broke this while merging the I2S changes...
2018-09-25avr: i2c implementation with BlinkM exampleRon Evans
Signed-off-by: Ron Evans <[email protected]>
2018-09-22machine: split board definitions in separate filesAyke van Laethem
2018-09-20avr: set ADLAR bit in ADC to get a value scaled to 16-bitAyke van Laethem
2018-09-20avr: ADC with 0-1023 rangeRon Evans
2018-09-17avr: initial implementation for PWMRon Evans
Signed-off-by: Ron Evans <[email protected]> Edited slightly by Ayke van Laethem
2018-09-13avr: implement Get() function on AVR, and leave stubs for NRF and dummy machinesRon Evans
Signed-off-by: Ron Evans <[email protected]>
2018-09-13avr: correct register for Set() operation on pins 0-7Ron Evans
Signed-off-by: Ron Evans <[email protected]>
2018-09-05all: use less magic in memory-mapped IOAyke van Laethem
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.
2018-08-17go fmtAyke van Laethem
2018-06-07Add AVR supportAyke van Laethem
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.