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

wiringpi: A06: add PU/PD/Hi-Z control #51

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Code/devterm_wiringpi_cpi/gpio/CPi.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
extern int wiringPiSetupRaw (void);
extern void CPiBoardId (int *model, int *rev, int *mem, int *maker, int *warranty);
extern int CPi_get_gpio_mode(int pin);
extern int CPi_digitalRead(int pin);
extern void CPi_digitalWrite(int pin, int value);
extern int __CPi_digitalRead(int pin);
extern void __CPi_digitalWrite(int pin, int value);
extern void CPiReadAll(void);
extern void CPiReadAllRaw(void);

Expand Down
8 changes: 4 additions & 4 deletions Code/devterm_wiringpi_cpi/gpio/CPi_readall.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ void CPiReadAll(void)
printf (" | %4d", bcmToGpioCPi[pin]);
printf (" | %-4s", get_pin_name(bcmToGpioCPi[pin]));
printf (" | %4s", alts [CPi_get_gpio_mode(bcmToGpioCPi[pin])]);
printf (" | %d", CPi_digitalRead(bcmToGpioCPi[pin])) ;
printf (" | %d", __CPi_digitalRead(bcmToGpioCPi[pin])) ;
pin2 = pin + 23;
printf (" | %3d", pin2);
printf (" | %4d", bcmToGpioCPi[pin2]);
printf (" | %-4s", get_pin_name(bcmToGpioCPi[pin2]));
printf (" | %4s", alts [CPi_get_gpio_mode(bcmToGpioCPi[pin2])]);
printf (" | %d", CPi_digitalRead(bcmToGpioCPi[pin2])) ;
printf (" | %d", __CPi_digitalRead(bcmToGpioCPi[pin2])) ;
printf (" |\n") ;
}

Expand Down Expand Up @@ -158,7 +158,7 @@ void CPiReadAllRaw(void)
printf (" | %4d", pin2) ;
printf (" | %-4s", get_pin_name(pin2));
printf (" | %4s", alts [CPi_get_gpio_mode(pin2)]) ;
printf (" | %d", CPi_digitalRead(pin2)) ;
printf (" | %d", __CPi_digitalRead(pin2)) ;
} else {
printf (" | ") ;
printf (" | ") ;
Expand Down Expand Up @@ -186,7 +186,7 @@ void CPiReadAllRaw(void)
for(i = 0; i < 5; i++) {
printf (" | %4d", pin2) ;
printf (" | %4s", alts [CPi_get_gpio_mode(pin2)]) ;
printf (" | %d", CPi_digitalRead(pin2)) ;
printf (" | %d", __CPi_digitalRead(pin2)) ;
pin2 += 32;
}
printf (" |\n") ;
Expand Down
6 changes: 3 additions & 3 deletions Code/devterm_wiringpi_cpi/gpio/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,7 @@ static void doReadRaw (int argc, char *argv [])
}

pin = atoi (argv [2]) ;
val = CPi_digitalRead(pin);
val = __CPi_digitalRead(pin);

printf ("%s\n", val == 0 ? "0" : "1") ;
#endif
Expand All @@ -1352,9 +1352,9 @@ static void doWriteRaw (int argc, char *argv [])
val = atoi (argv [3]) ;

if (val == 0)
CPi_digitalWrite (pin, LOW) ;
__CPi_digitalWrite (pin, LOW) ;
else
CPi_digitalWrite (pin, HIGH) ;
__CPi_digitalWrite (pin, HIGH) ;
#endif
}

Expand Down
Loading