@@ -37,37 +37,37 @@ or a console to operate either on hardware serial ports or on virtual ones like
37
37
The HAL
38
38
39
39
- Must * erase* device specific details. Neither register, register blocks, nor magic values should
40
- appear in the API.
40
+ appear in the API.
41
41
42
42
- Must be generic * within* a device and * across* devices. The API to use a serial interface must
43
- be the same regardless of whether the implementation uses the USART1 or UART4 peripheral of a
44
- device or the UART0 peripheral of another device.
43
+ be the same regardless of whether the implementation uses the USART1 or UART4 peripheral of a
44
+ device or the UART0 peripheral of another device.
45
45
46
46
- Where possible must * not* be tied to a specific asynchronous model. The API should be usable
47
- in blocking mode, with the ` futures ` model, with an async/await model or with a callback model.
48
- (cf. the [ ` nb ` ] ( https://docs.rs/nb ) crate)
47
+ in blocking mode, with the ` futures ` model, with an async/await model or with a callback model.
48
+ (cf. the [ ` nb ` ] ( https://docs.rs/nb ) crate)
49
49
50
50
- Must be minimal, and thus easy to implement and zero cost, yet highly composable. People that
51
- want higher level abstraction should * prefer to use this HAL* rather than * re-implement*
52
- register manipulation code.
51
+ want higher level abstraction should * prefer to use this HAL* rather than * re-implement*
52
+ register manipulation code.
53
53
54
54
- Serve as a foundation for building an ecosystem of platform-agnostic drivers. Here driver
55
- means a library crate that lets a target platform interface an external device like a digital
56
- sensor or a wireless transceiver. The advantage of this system is that by writing the driver as
57
- a generic library on top of ` embedded-hal ` driver authors can support any number of target
58
- platforms (e.g. Cortex-M microcontrollers, AVR microcontrollers, embedded Linux, etc.). The
59
- advantage for application developers is that by adopting ` embedded-hal ` they can unlock all
60
- these drivers for their platform.
55
+ means a library crate that lets a target platform interface an external device like a digital
56
+ sensor or a wireless transceiver. The advantage of this system is that by writing the driver as
57
+ a generic library on top of ` embedded-hal ` driver authors can support any number of target
58
+ platforms (e.g. Cortex-M microcontrollers, AVR microcontrollers, embedded Linux, etc.). The
59
+ advantage for application developers is that by adopting ` embedded-hal ` they can unlock all
60
+ these drivers for their platform.
61
61
62
62
- Trait methods must be fallible so that they can be used in any possible situation.
63
- Nevertheless, HAL implementations can additionally provide infallible versions of the same methods
64
- if they can never fail in their platform. This way, generic code can use the fallible abstractions
65
- provided here but platform-specific code can avoid fallibility-related boilerplate if possible.
63
+ Nevertheless, HAL implementations can additionally provide infallible versions of the same methods
64
+ if they can never fail in their platform. This way, generic code can use the fallible abstractions
65
+ provided here but platform-specific code can avoid fallibility-related boilerplate if possible.
66
66
67
67
## Out of scope
68
68
69
69
- Initialization and configuration stuff like "ensure this serial interface and that SPI
70
- interface are not using the same pins". The HAL will focus on * doing I/O* .
70
+ interface are not using the same pins". The HAL will focus on * doing I/O* .
71
71
72
72
## Platform agnostic drivers
73
73
0 commit comments