Skip to content

Release v0.8.0

Compare
Choose a tag to compare
@Sh3Rm4n Sh3Rm4n released this 16 Aug 06:55
· 153 commits to master since this release

Added

  • Readd MonoTimer. This was accidentally removed before. (#247)
    • Different to before, frequency() and now() now do not consume the MonoTimer.
      &self is used instead. (#267)
  • Basic serial implementation also available for UART4 and UART5 (#246)
  • Implement serial DMA also for Serial (#246)
  • Add enumset as a optional dependency, which allow more ergonomic functions
    regarding enums. This is especially useful for status event query functions.
    (#253)
  • As serial Error and serial Events share things in common. TryFrom<Event>
    and From<Error> is implemented for conversions. (#253)
  • Add serial character match function, with which events can be triggered for
    the set character. (#253)
  • Add receiver timeout function, which configures the serial peripheral to
    trigger an event, if nothing happened after a certain time on the serial
    receiver line. (#253)
  • Add raw_read() function, which does no error handling and also does not
    clear any Event by itself. Useful, if the error_handling has to be done in
    another context (like an interrupt rountine). (#253)
  • Introduce Toggle, with On and Off as a convinience wrapper around bool
    for configuration purposes. (#253)
  • Add an associated const to serial::Instance to return the corresponding
    pac::Interrupt-number, which is useful to unmask() interrupts.
    An interrupt() function to Serial was also added for convinience. (#253)
  • Add a Serial::is_busy() function to check, if the serial device is busy.
    Useful to block on this function, e.g. while serial.is_busy() {}. (#253)
  • Add BaudTable a convinience wrapper around Baud to configure the Serial
    to the most commen baud rates. (#253)
  • Add Serial::detect_overrun() function, to en- or disable the overrun
    detection of the Serial. If overrun is disabled (enabled by default), than
    newly arrived bytes are overwriting the current data in the read receive
    register without throwing any event. (#253).
  • Lift generic constraint of most Serial method on TxPin and RxPin.
    This should make it easier to generically use the Serial peripheral. (#253)
  • Greatly increase coverage of Debug and defmt::Format implementations.
    Almost all important types should now be supported. (#265)
  • Add a free() function to the RTC implementation to retrieve the passed-in
    peripheral. (#266)
  • Implement an API to return the corresponding interrupt number of timer through
    the newly introduced InterruptNumber trait, where the Interrupt is held
    as an associated const. (#267)
    • Depending on the timer one Interrupt or a bundle of InterruptTypes is
      returned.
    • On the bases of these interrupts, the interrupt controller (NVIC) can
      be set to mask or unmask these interrupts.
  • Implement the embedded-hal::timer::Cancel trait for timers. (#267)
  • Add use_pll to CFGR - the clock configuration - to force to use the PLL
    source for the systemclock. Also Clocks::pllclk() was introduced to be able
    to check, whether PLL is used.
  • Add unsafe peripheral function to access underlying peripheral (#277)
  • Implement fmt::Write for Serial (#278)
    • This allowes using writeln! in combination with Serial.

Changed

  • PXx struct (representing a generic GPIO pin) implements Send and Sync (#251)
  • Each pin aliases (PA0, PA1, ..) are defined under gpio module directly.
    Re-export from gpio port sub-modules are provided for compatibility. (#257)
  • The embedded-hal Read implementation of Serial does now return WoudBlock
    if the peripheral is busy. Also if an Overrun occured the receive data
    register (RDR) is flushed to have a more consistent API. (#253)
  • Remove cargo-metadata as a build dependency to cut down dependencies and
    the reliance on resolver = "2". (#270)

Fixed

  • The "unproven" feature, which itself does enable the "embedded-hal/unproven"
    features, can no longer be disabled. (#259)
    1. The "unproven" features are no longer unproven and used anywhere anyways.
    2. This crate was not building successfully without the unproven feature.
  • Set the correct baud rate for chips where USART1SW_A::PCLK leads to a
    baud rate derived from PCLK1, rather than the ports own bus clock, PCLK2.
    (#260)

Breaking Changes

  • Refactor CAN to use the bxCan crate. (#207)
  • Add support for configuring parity and stop bits in addition to baud rate for
    Serial with serial::config::Config. (#239)
  • Implement Serial::join which allows to re-create the serial peripheral,
    when Serial::split was previously called. (#252)
  • Parameterized usb::Peripheral and usb::UsbType on the pin configuration
    used (#255)
  • Add (almost) all missing serial (interrupt and status) events.
    Also rename all the event names to be more descriptive. (#253)
  • A new serial interrupt API was introduced: (#253)
    • listen() and unlisten() are renamed to enable_interrupt() and
      disable_interrupt().
    • is_tc() and other non-parametrizable functions are removed.
    • configure_interrupt() was added, which can be parameterized.
    • clear_event() was added to clear specific events.
    • clear_events() was added to clear all events at once.
    • is_event_triggered() can check if an Event is triggered.
    • triggered_events returns an EnumSet of triggered events.
  • Change gpio interrupt API to be more in line with the new serial interrupt
    API. (#262)
  • Move EXTI interrupt management to SysCfg. (#262)
    • Becuase EXTI interrupt confiugration could cancel out, make it more obvious
      in that SysCfg manages the interrupts, not the pin itself.
      Change make_interrupt_source() to SysCfg::select_exti_interrupt_source().
  • Change dma interrupt API to be more in line with the new serial interrupt
    API. (#263)
  • Change timer interrupt API to the same of the serial interface. (#264)
  • Make timer Events #[non_exhaustive]. (#264)
  • Renames timers release() function to free() to be more in line with the
    rest of this crate. (#264)
  • rtc's Error type and OperationMode and CkMode of adc are now #[non_exhaustive].
    (#266)
  • All non-camel-case types are chaged to be consistently camel-case types.
    Types which do not follow these rules are re-exported types by stm32f3 for
    example. (#266)
  • Adc's SampleTime type has been reworked and is now a consistent wrapper around
    the underlying types for stm32f3's SMP9_A and SMP18_A type. (#266)
  • Rename CkMode to ClockMode (#266)
  • Rename stm32-usbd feature to usb. stm32-usbd is still used as a
    dependency. (#271)
  • Rework the timer implementation: (#267)
    • PclkSrc trait was removed in favor of generic Instance trait, which
      is a common ground for all available timers.
    • Timer::tim1 and so on are renamed to Timer::new
    • The implementation of the timers are corrected to better represent the
      avaibilities of timers of the hardware.
    • Timer::new now does not take a timeout value. This means, that the
      timer will now not be started automatically and one has to explicitly call
      start().
  • Rework SPI implementation: (#273)
    • A generic Instance trait now represents all Spi peripherals.
    • Spi::spi1 and so on are renamed to Spi::new.
    • Add SPI configuration type to be passed into Spi::new
  • Remove public fields from Adc and Rtc (#277)