Commit Graph

122 Commits (49dc85c29507b22756f5b333c02b493081f0fe8b)

Author SHA1 Message Date
Daniel Egger 53e6f73106 Assume twice the timer frequency when HCLK != PCLK
Internally the frequency going to the timers is doubled if PCLK is
prescaled.

Fixes #90

Signed-off-by: Daniel Egger <daniel@eggers-club.de>
4 years ago
James Munns b15fc1532f
Add I2C Read implementation (#88)
* Add read implementation
* Add changelog
4 years ago
Nathan Conrad d59291f414 Correct logic used to determine default PLL pre-divider. 4 years ago
Nathan Conrad b3988e768e RCC: USB source switching code. 4 years ago
Nathan Conrad 8bcf488582 RCC: Only provide HSI48 in API for devices which are documented to have it. 4 years ago
Daniel Egger 865dc15f53 Run through rustfmt
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
4 years ago
Daniel Egger 33fe6da6dc Fix STM32F030/STM32F070 impl
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
4 years ago
Daniel Egger 67e29bfa8b Bump stm32f0 version to 0.9 and upgrade code accordingly
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
4 years ago
Nathan Conrad 02278e5542 Add (breaking) API change to allow for HSE bypass to be selected. 4 years ago
Nathan Conrad 3ba20dc0cb RCC: PLL: Modify CR instead of write, plus remove unnecessary unsafe tag. 4 years ago
Vadim Kaushan 150063efa1
Mention the stm32-usbd feature 4 years ago
Vadim Kaushan f9ef8c3479
Enable USB support for STM32F070x6/B 4 years ago
Vadim Kaushan 86c7f95c0e
Add USB driver 4 years ago
Daniel Egger 9cf30e9961
Merge pull request #73 from stm32-rs/gpios-in-one
Improve legibility by having a single macro structure for all pins
4 years ago
Daniel Egger 143f6b2bf8 Clear error flags before returning
Closes #61

Signed-off-by: Daniel Egger <daniel@eggers-club.de>
4 years ago
Daniel Egger 9f933af6a2 Improve legibility by having a single macro structure for all pins
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
4 years ago
Daniel Egger 1e649bbc0b Fix a number of clippy warnings
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
4 years ago
Mike Panetta 4c3504c8e1 Add dac (#70)
* Added dac.rs from stm32g4xx-hal crate and modified it a bit.

* Removed IDE files.

* Fix feature gating for DAC module.

* Remove unused calibrate function from DacPin trait.

* Add feature gates for all devices that support DAC.

* Added docs and example.

* Some cleanup, fixed feature gate.
4 years ago
Daniel Egger 7e345c6b4c Changed implementation to implement digital v2 interface
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
4 years ago
Daniel Egger 2116717507 Fixed a number of deprecation warnings and lints
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
4 years ago
Daniel Egger ff1cea2829 Enable commented out GPIOE support which now works
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
4 years ago
Daniel Egger 9a1ba72ed1 Extract the GPIO RegisterBlock address only once per function call
This improves code clarity and slightly reduces dev mode build sizes

Signed-off-by: Daniel Egger <daniel@eggers-club.de>
4 years ago
Daniel Egger cf4de96aee Clear UART errors after we've detected and reported them
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
4 years ago
Daniel Egger aec4e470d9 Added #inline(always) attributes to gpio functions
This has a positive effect on dev build sizes

Signed-off-by: Daniel Egger <daniel@eggers-club.de>
4 years ago
Daniel Egger 89d2d6f07b Enable CRS support for USB
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
4 years ago
Matous Hybl 4714c70d18 Remove STM32F030 from devices that have I2C1 available on pins PA11 and PA12. 4 years ago
David Turner be7084cbbe Fix typo in SPI example 5 years ago
Daniel Egger 1e040f403b Implement TSC (touch sensitive controller) support
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
5 years ago
Daniel Egger 2f0fb0b09e Use modify instead of write for HSI14 clock setup
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
5 years ago
Daniel Egger 77a6dad00a Improved serial write_str implementation to properly handle errors
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
5 years ago
HarkonenBade e081e82390 Update the ADC code to take advantage of the named variants in stm32-rs v0.6.0 5 years ago
Tom 1524cb1967 Update to stm32f0 - 0.6.0 (#52)
* Updated stm32f0 to 0.6.0 and neatened other deps

* Adjusted names and removed unneeded unsafe blocks

* Overhauled RCC to gate HSI48 correctly and add a selector function for it to CFGR
5 years ago
Jesse Braham 63bbfd3068 Review all device datasheets and fix inconsistencies 5 years ago
Jesse Braham e3d7111c08 Fix some long-standing errors and inconsistencies for USARTS 5 years ago
Jesse Braham 32b14bf976 Add support for stm32f098 5 years ago
Jesse Braham fca47168d2 Add support for stm32f078 5 years ago
Jesse Braham c79c69c0f3 Add support for stm32f058 5 years ago
Jesse Braham e225bc0f68 Add support for stm32f048 5 years ago
Jesse Braham 95aadbbe18 Add support for stm32f038 5 years ago
David Sawatzke c8dd9b1f81 Add documentation and update a few examples
Also add the `Write` implementation for Serial
5 years ago
David Sawatzke ec1fa416e2 Move `read`, `flush` & `write` in separate functions 5 years ago
David Sawatzke 2c62bd99eb Only enable usart tx/rx when needed 5 years ago
David Sawatzke 8e0179d60c Add a tx only and a rx only serial instance 5 years ago
Jesse Braham ce2ef0d854 Fix build error, update CHANGELOG and README 5 years ago
Jesse Braham c4967c2645 Add support for stm32f071 5 years ago
Jesse Braham b016ffdfe9 Add support for stm32f051 5 years ago
Jesse Braham e6db427c09 Add support for stm32f031 5 years ago
HarkonenBade 7ea2af8a74 Enforce better safety guarentees
* Makes use of Rcc parameters rather than making RCC pointers
* Applys CS parameters to GPIO functions that mutate the port non
atomically
* Cut down on build gating hell a bit
5 years ago
david-sawatzke f54423aa9c Optimize delay implementation (#42)
* Optimize delay implementation
* Configure delay with hclk & only for 1MHz+
* Clean up delay implementation
* Add more reasoning and fix documentation
* Add changelog entry for delay optimization
5 years ago
david-sawatzke b2111b98b0 Fix overflow in delay (#40)
Gets checked in debug builds
5 years ago