Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pub mod gpio {
- //! GPIO Pin mapping macros crate
- macro_rules! pin_name {
- ($gpio:ident, spi_sck) => { $gpio.pin5 };
- ($gpio:ident, spi_mosi) => { $gpio.pin3 };
- ($gpio:ident, spi_miso) => { $gpio.pin4 };
- ($gpio:ident, spi_ss0) => { $gpio.pin2 };
- }
- #[macro_export(local_inner_macros)]
- macro_rules! pin {
- ($gpio:ident.$name:ident) => {
- pin_name!($gpio, $name)
- }
- }
- #[macro_export(local_inner_macros)]
- macro_rules! pins {
- ( $gpio:ident, ($($name:ident),+) ) => {
- ($(pin_name!($gpio, $name)),+)
- }
- }
- }
- fn main() {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement