Skip to content

jw-mcu-rust/stm32f1-hal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stm32f1-hal

Because the design of stm32f1xx-hal is unsuitable for my needs and stm32-hal doesn't support the F1 series, I decided to write a new crate. Many codes come from stm32f1xx-hal.

Example is here.

Design

Below are the design principles.

  1. Readability is the most important.
    • We only write code a few times, but we read it countless times. Moreover, understanding the code is a necessary condition for maintaining it.
  2. Concise is not equal to simple.
    • Fewer lines of code do not necessarily mean easier to read and understand.

Therefore, if a module is quite complex, I would not use a macro + generic approach, as it is too difficult to read.

Instead, I use a synchronization script to manage duplicate code across peripherals and a script to generate code for GPIO alternate function remapping.

Note

This project is still in its early stages, with only a few features completed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published