| 
 | 
	
     
     
How to set pull-up of the FirePrime's GPIOs ?
    
    Posted at  2/2/2018 20:43:45
            
         View:3296
     |
     Replies:0
     
  
     
 
   	
    
  Print   
        
  
   
   Only Author 
     
 [Copy Link]
	
    
 
  	             
1#
 
        
 
Hi, 
 
I want to use the pins 23, 25, 27 and 29 of the FirePrime S as GPIO (GPIO1 A5, A4, A2 and A1). For my project, I need 2 IN and 2 OUT so I decided to use A1 and A2 as outputs and A4 and A5 as inputs. 
 
For now, I am able to export these pins from user space (echo 33 > /sys/class/gpio/export) and the outputs work like a charm but I can't set the pull-up resistor for the inputs.  
 
I tried to change:- rockchip,pull = <VALUE_PULL_DEFAULT>;
 
  Copy the code to  
- rockchip,pull = <VALUE_PULL_UP>; 
 
  Copy the code in the pinctrl node for GPIO1_A1...GPIO1_A5 but it didn't change anything.  
 
Then I tried to control the GPIO from user space using mmap (/dev/mem) but in the Technical Reference Manual I couldn't find the registers for setting pull up, pull down or pull none. Just, in chapiter 5 (grf), I found the registers for enable/disable pull up/down. 
 
Is it possible to change this setting ? How to proceed ? 
 
 |   
 
 
 
 |