Skip to content
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
2 changes: 1 addition & 1 deletion lib/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ int gpio_open(unsigned int gpio_id, const char *direction)
{
int rc = -1;
gpio_list *ptr;
gpio *g = libsoc_gpio_request(gpio_id, LS_SHARED);
gpio *g = libsoc_gpio_request(gpio_id, LS_GPIO_SHARED);
if (!g)
return rc;
if (!strcmp(direction, "in"))
Expand Down
9 changes: 9 additions & 0 deletions lib/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
#define HIGH 1
#define LOW 0


#ifdef __cplusplus
extern "C" {
#endif

// Look up gpio ID by pin name, eg "GPIO_A"
unsigned int gpio_id(const char *pin_name);
// Look up gpio ID by letter, eq 'A'
Expand All @@ -38,3 +43,7 @@ int gpio_open(unsigned int gpio_id, const char *direction);
int digitalRead(unsigned int gpio_id);
// Set a GPIO in OUTPUT mode to HIGH(1) or LOW(0)
int digitalWrite(unsigned int gpio_id, unsigned int value);

#ifdef __cplusplus
}
#endif