lulf
Joined 8 years ago
Joined 8 years ago
The other part is the stm32-metapac (not specific to async) that generates the PAC for any stm32 chip.
Read more about embassy here: https://github.com/embassy-rs/embassy
For a generic led driver, it should not use these types, but instead the trait types from the embedded_hal crate, such as "OutputPin" that is implemented by the different chip-specific HALs. There is an example of a generic led driver that uses these traits at [1].
In general I recommend everyone who wants to try out Rust on embedded to read the embedded rust book, because it clarifies a lot of the reasons and advantages of its approach.
[0] https://docs.rust-embedded.org/book/static-guarantees/typest...
[1] https://github.com/drogue-iot/drogue-device/blob/main/rt/src...
Example “blocking” client https://github.com/EnMasseProject/enmasse/blob/master/amqp-u... , but might give an idea of how to set “dynamic source” required for rpc.
In general though I think the Qpid python and c++ examples might be better.
* AMQP 1.0 - can also be used for RPC without a broker in between client and server. See https://qpid.apache.org/proton/
* Aeron - low latency, UDP based, see https://github.com/real-logic/aeron
If you have a mix of pub-sub, work queues and request-response, it could simplify your dependencies perhaps.
Also AMQP 1.0 has some nice async capabilities and acknowledge modes that I believe goes beyond what http/2 and grpc supports today.
OTOH I don’t have any real world experience operating such a mix of different communication patterns, so it could be the advantage is insignificant.
With the dispatch router, you can use pattern matching to specify if addresses should be routed to a broker or be routed directly to a particular service.
This is way you can get the semantics that best fits your use case.
A lot of applications simply don't use the MPU. And then consider what you get from Rust memory safety and the reduction in overall complexity of the firmware without the RTOS.