You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/API-GUIDELINES.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,15 +28,14 @@ The following paragraphs contain additional recommendations.
28
28
29
29
## API Surface
30
30
31
-
- Add `#[deny(missing_docs)]` to new modules or when reworking a larger part of a module. In the end we will require this for whole crates.
32
-
- API documentation shouldn't be an afterthought
31
+
- API documentation shouldn't be an afterthought.
33
32
- Private details shouldn't leak into the public API, and should be made private where technically possible.
34
-
- Implementation details that _need_ to be public should be marked with `#[doc(hidden)]` and a comment as to why it needs to be public.
35
-
- Functions which technically need to be public but shouldn't be callable by the user need to be sealed.
33
+
- Implementation details that _need_ to be public should be marked with `#[doc(hidden)]` and a comment as to why it needs to be public.
34
+
- Functions which technically need to be public but shouldn't be callable by the user need to be sealed.
36
35
- see [this example in Rust's core library](https://github.com/rust-lang/rust/blob/044a28a4091f2e1a5883f7fa990223f8b200a2cd/library/core/src/error.rs#L89-L100)
37
-
- Any public traits, that **must not** be implemented downstream need to be `Sealed`
36
+
- Any public traits, that **must not** be implemented downstream need to be `Sealed`.
38
37
- Prefer compile-time checks over runtime checks where possible, prefer a fallible API over panics.
39
-
- Follow naming conventions in order to be consistent across drivers - take inspiration from existing drivers
38
+
- Follow naming conventions in order to be consistent across drivers - take inspiration from existing drivers.
40
39
- Design APIs in a way that they are easy to use.
41
40
- Driver API decisions should be assessed individually, don't _not_ just follow embedded-hal or other ecosystem trait crates. Expose the capabilities of the hardware. (Ecosystem traits are implemented on top of the inherent API)
42
41
- Avoid type states and extraneous generics whenever possible
@@ -45,6 +44,7 @@ The following paragraphs contain additional recommendations.
45
44
- Avoiding `&mut self` when `&self` is safe to use. `&self` is generally easier to use as an API. Typical applications of this are where the methods just do writes to registers which don't have side effects.
46
45
- For example starting a timer is fine for `&self`, worst case a timer will be started twice if two parts of the program call it. You can see a real example of this [here](https://github.com/esp-rs/esp-hal/pull/1500#pullrequestreview-2015911974)
47
46
- Maintain order consistency in the API, such as in the case of pairs like RX/TX.
47
+
- If your driver provides a way to listen for interrupts, the interrupts should be listed in a `derive(EnumSetType)` enum as opposed to one function per interrupt flag.
// Define all necessary configuration symbols for the configured device:
38
39
config.define_symbols();
39
40
41
+
// emit config
42
+
generate_config(
43
+
"esp_hal_embassy",
44
+
&[(
45
+
"low-power-wait",
46
+
Value::Bool(true),
47
+
"Enables the lower-power wait if no tasks are ready to run on the thread-mode executor. This allows the MCU to use less power if the workload allows. Recommended for battery-powered systems. May impact analog performance.",
Copy file name to clipboardExpand all lines: esp-hal/CHANGELOG.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
## [Unreleased]
9
9
10
10
### Added
11
-
12
11
- A new config option `PLACE_SWITCH_TABLES_IN_RAM` to improve performance (especially for interrupts) at the cost of slightly more RAM usage (#2331)
13
12
- A new config option `PLACE_ANON_IN_RAM` to improve performance (especially for interrupts) at the cost of RAM usage (#2331)
14
13
- Add burst transfer support to DMA buffers (#2336)
@@ -23,6 +22,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
23
22
-`Cpu::COUNT` and `Cpu::current()` (#?)
24
23
- Add RGB/DPI driver (#2415)
25
24
- Add `DmaLoopBuf` (#2415)
25
+
-`Cpu::COUNT` and `Cpu::current()` (#2411)
26
+
-`UartInterrupt` and related functions (#2406)
27
+
- I2S Parallel output driver for esp32. (#2348)
28
+
- Add an option to configure `WDT` action (#2330)
26
29
27
30
### Changed
28
31
@@ -33,11 +36,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
33
36
- The SPI driver has been rewritten to allow using half-duplex and full-duplex functionality on the same bus. See the migration guide for details. (#2373)
34
37
- Renamed `SpiDma` functions: `dma_transfer` to `transfer`, `dma_write` to `write`, `dma_read` to `read`. (#2373)
35
38
- Peripheral type erasure for UART (#2381)
39
+
- Changed listening for UART events (#2406)
40
+
- Circular DMA transfers now correctly error, `available` returns `Result<usize,DmaError>` now (#2409)
36
41
37
42
### Fixed
38
43
39
44
- Fix conflict between `RtcClock::get_xtal_freq` and `Rtc::disable_rom_message_printing` (#2360)
40
45
- Fixed an issue where interrupts enabled before `esp_hal::init` were disabled. This issue caused the executor created by `#[esp_hal_embassy::main]` to behave incorrectly in multi-core applications. (#2377)
46
+
- Fixed `TWAI::transmit_async`: bus-off state is not reached when CANH and CANL are shorted. (#2421)
0 commit comments