Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Nano pi DUO GPIO PL11

Featured Replies

Hello.

 

I am trying read to directly access GPIO PL11 (IRTX) from nano Pi DUO without success, other pins with this same code work very well.

 

Via Userspace work well

 

echo "363" > /sys/class/gpio/export

echo "in" > /sys/class/gpio/gpio363/direction

 

cat /sys/class/gpio/gpio363/value Then i receive 0 or 1 (This proves that hardware is ok.)

 

My example code

To compile

gcc gpio_lib.c simple_gpio.c -o blink

#include <stdlib.h>
#include <stdio.h>

#include "gpio_lib.h"



int main()
{
	sunxi_gpio_init();
	//gpio_PA3
	sunxi_gpio_set_cfgpin(SUNXI_GPA(4), SUNXI_GPIO_OUTPUT);
	sunxi_gpio_set_cfgpin(SUNXI_GPL(11), SUNXI_GPIO_INPUT);


	while(1) {
		unsigned int b = sunxi_gpio_input(SUNXI_GPL(11));
		printf("%x\n", b);
	    sunxi_gpio_output(SUNXI_GPA(4), 1);
	    sleep(1);
	    sunxi_gpio_output(SUNXI_GPA(4), 0);
	    sleep(1);
	}
	return 0;
}

 

gpio_lib.c

gpio_lib.h

simple_gpio.c

Not sure where you got that code from, but my ArmbianIO library seems to work correctly. Make sure the pin isn't enabled as a tty or the system will keep you from using the pin as a GPIO.

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.