Low-power
RMK supports low-power mode by using utilizing embassy's low-power feature and Wait trait in embedded-hal-async. To enable low-power mode, add async_matrix feature to your Cargo.toml:
If you're using nRF chips or rp2040, you're all set! You've already got your keyboard running in low-power mode.
For stm32, there's some limitations about Exti(see here):
EXTI is not built into Input itself because it needs to take ownership of the corresponding EXTI channel, which is a limited resource.
Pins PA5, PB5, PC5… all use EXTI channel 5, so you can’t use EXTI on, say, PA5 and PC5 at the same time.
There are a few more things that you have to do:
-
Enable
extifeature of yourembassy-stm32dependency -
Ensure that your input pins don't share same EXTI channel
-
If you're using
keyboard.toml, nothing more to do. The[rmk_keyboard]macro will check yourCargo.tomland do the work for you. But if you're using Rust code, you need to useExtiInputas your input pins, and update generics type of RMK keyboard run: