All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Note: As this project is still very early in its lifecycle, we don't have proper releases yet. Instead, the CHANGELOG will document changes over time so people already using the crates have a reference what is changing upstream.
- Large refactor of the USART implementation (#116). The user-facing API is mostly the same though there might be some small details which have changed. Especially the user-facing interrupt methods look different now.
- Updated the target specs to be in sync with upstream again. There were no major changes so it shouldn't be necessary to update downstream copies for now.
- Upgraded to
avr-device
0.3 (#128). As there can only ever be one version ofavr-device
in the dependency graph, you'll need to update all local dependencies which still point to 0.2 as well!
- Removed a bashism in the runner scripts (#126).
- A method to reconfigure an SPI peripheral (#112).
- An example implementation of the Arduino
millis()
function:uno-millis.rs
. There is also a blog post with a code walkthrough: https://blog.rahix.de/005-avr-hal-millis
I2c
was renamed toI2cMaster
. There is a (deprecated) alias for the old name but where possible, the new one should be used (#102).
- The SPI driver now wraps the chip-select (CS) pin to enforce proper usage
(#103). Downstream code must change slightly to use the new API (example
for Arduino Uno):
- let mut cs_pin = pins.d10.into_output(&mut pins.ddr); - let mut spi = spi::Spi::new( + let (mut spi, mut cs_pin) = spi::Spi::new( dp.SPI, pins.d13.into_output(&mut pins.ddr), pins.d11.into_output(&mut pins.ddr), pins.d12.into_pull_up_input(&mut pins.ddr), + pins.d10.into_output(&mut pins.ddr), spi::Settings::default(), );
- Fixed a soundness issue in the SPI driver. The hardware requires proper setup of the CS pin which was not guaranteed. An API change was made to enforce the necessary invariant (#103).
arduino-mega2560
: Ausart
module with type aliases for all other USART peripherals apart fromUsart0
(#100).
- The
avr-hal-generic::serial
module was renamed toavr-hal-generic::usart
for consistency (493546530eb8
).
- Serial/USART: The
Baudrate
type for more precise control over the baudrate selection (#88).
- The constructor for the
Serial
/USART driver must now be called with aBaudrate
value, not an integer (#88). In practice, the easiest way to do this is using the.into_baudrate()
conversion method. As an example, the needed change might look like this:let mut serial = arduino_uno::Serial::new( dp.USART0, pins.d0, pins.d1.into_output(&mut pins.ddr), - 57600, + 57600.into_baudrate(), );
- Support for
ATmega328PB
(#96).
atmega328p-hal
: You must now select a chip via either theatmega328p
oratmega328pb
features. Selecting no or more than one chip will lead to a compile-error. As an example:[dependencies.atmega328p-hal] git = "https://github.com/Rahix/avr-hal.git" rev = "<latest git commit hash>" features = ["atmega328p"]
- In HAL crates, the
avr-hal-generic
crate is no longer renamed toavr-hal
as this will just lead to confusion and problems down the line (#89). - In HAL crates, the peripheral access crate (submodule of
avr-device
) is imported aspac
everywhere instead of using the actual device name. This will make it easier to support multiple devices in a single HAL in the future (#89). - The reexported modules in board crates were cleaned up: The HAL crate is now
reexported as
hal
and the PAC crates aspac
(#89).
- The runner scripts now have better suport for MacOS out of the box (#87).
- Added a script for automatically synchronizing target specs with upstream (#84).
- Moved all target specs (like
avr-atmega32u4.json
) to a single directory namedavr-specs/
(#82). - Updated various settings in all target specs for better compatibility and general cleanup (#85).
- Fixed a number of issues in the
sparkfun-pro-micro
board crate (#74).
- The
Pins::new()
forarduino-leonardo
now also consumes thePORTF
peripheral and exposes its pins asa0
-a5
(#73).
- Fixed a nightly regression which broke our target specs (#72).
- Added support for Arduino Nano (in
arduino-uno
board crate) (#69). - Added support for
ADC6
andADC7
pins inatmega328p-hal
(#69).
- Reduced the overhead from
delay_us(u32)
(#68).
- Support for Sparkfun's Pro Micro board (#62).
- SPI driver now implements the
blocking::spi::{Transfer, Write}
traits (#66).
- Fixed not resetting
U2X
bit inUSART
driver which leads to wrong baudrates in some situations (reported in #67, fixed in7caed3a995e2
). - Fixed I2C/TWI driver not resetting all bits during initialization
(
3116e9ad5441
).
Please look at the git log for changes before this point :)