-
Notifications
You must be signed in to change notification settings - Fork 27
Add fully abstracted GPIO #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
@@ -116,3 +126,18 @@ gpio_macro!(tm4c123x, GPIO_PORTF, gpiof, GpioF, PFx, [ | |||
PF6: (pf6, 6, Tristate), | |||
PF7: (pf7, 7, Tristate), | |||
]); | |||
|
|||
macro_rules! get_field { | |||
($j:expr, $field:ident) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the field parameter for?
///! An internal macro to implement the GPIO functionality for each port | ||
#[macro_export] | ||
macro_rules! gpio_macro { | ||
($chip_crate:ident, $GPIOX:ident, $gpiox:ident, $iopd:ident, $PXx:ident, [ | ||
($chip_crate:ident, $GPIOX:ident, $gpiox:ident, $iopd:ident, $PXx:ident, $j:expr, [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the $j parameter for?
() => { | ||
/// Fully erased pin | ||
pub struct Pxx<MODE> { | ||
i: u8, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe s/i/pin/ and s/j/port/?
Paging @dtwood :) |
(and I totally understand GitHub notifications getting lost - I had so many I just turned them all off) |
Paging @dtwood |
This adds a
downgrade()
method to the semi-abstracted GPIOs, to allow them to be downgraded to be generic over all GPIO ports.