Skip to content
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

Add fully abstracted GPIO #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dtwood
Copy link
Collaborator

@dtwood dtwood commented Jul 19, 2020

This adds a downgrade() method to the semi-abstracted GPIOs, to allow them to be downgraded to be generic over all GPIO ports.

@dtwood dtwood requested a review from thejpster July 19, 2020 19:51
@@ -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) => {
Copy link
Member

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, [
Copy link
Member

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,
Copy link
Member

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/?

@thejpster
Copy link
Member

Paging @dtwood :)

@thejpster
Copy link
Member

(and I totally understand GitHub notifications getting lost - I had so many I just turned them all off)

@thejpster
Copy link
Member

Paging @dtwood

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants