Started by iw2lsi, March 13, 2013, 11:31:43 pm
__u32 reg_val = 0;__u32 pin_idx = pin >> 3;void *raddr = addr + (((port)-1)*0x24 + ((pin_idx)<<2) + 0x00);reg_val = readl(raddr);reg_val &= ~(0x07 << (((pin - (pin_idx<<3))<<2)));reg_val |= 1 << (((pin - (pin_idx<<3))<<2)); ****// Set pin to Output mode****writel(reg_val, raddr);
Quote>>> GPIO.init() #init GPIOs>>> GPIO.getcfg(GPIO.PIN37) #config PIN37 as GPIO ****(probably can be traced to the above)****>>> GPIO.setcfg(GPIO.PIN37, GPIO.OUTPUT) #config PIN37 as output....
Quote from: iw2lsi on March 14, 2013, 10:38:02 pmHi thanks you all for the help... I'm looking deeper at the dummy GPIO driver (sun4i-gpio.c) at the moment not sure, but it seems a good point to start with. working directly with memory locations could be another (good) way... I'll be back ASAP thanks again Giampaolo