Pardon me for late response but things have started to move in the regards of this issue.
Python library again uses file operations.
I wanted to be able to manipulate registers to control GPIOs i-e mmap operation with GPIO registers.
To be able to play with GPIO registers, the first step will be to find out the register addresses.
I used the links from Topic 144550 to write a script to read/modify xavier nx’s registers.
On referring to Xavier technical reference manual, I tried to figure out the GPIO registers but it seemed little complicated.
For an example, I was able to successfully figure out the address of PWM’s1 register and used mmap operations to turn it off.
(1) Table in the section 3.1.2 System Address Map (Page 42 ) mentions,
PWM1 0x03280000 0x0328ffff SYSTEM
(2) So, we have the start address of PWM1 register and now we need bit wise description of the register to be able to control the PWM.
(3) Section 10.7.3 PWM Registers contains the bit wise description and using the info from the two sections mentioned above, I was able to manipulate the correct bit to turn off/onPWM.
This looks fine, but my goal is to be able to control GPIOs with register writes (lets say GPIO11 for example).
Following the same steps as I did for PWM, I started looking for GPIO register addresses corresponding to GPIO11 in section 3.1.2. Jetson_Xavier_NX_Pinmux_Configuration_Template_v1.06.xlsm mentions full description for gpio11 as GPIO3_PQ.06.
So , thinking logically, I tried to locate GPIO3 in the section 3.1.2 of TRM but found numerous GPIO3s over there, namely, GPIO_CTL0_GPIO3, GPIO_CTL1_GPIO3, etc.
So how to figure out which address should I consult from all of these CTLX_GPIO3 addresses available ?
and, if this is done then how to find GPIO register description just like there is one for PWM registers in section 10.7.3 of xavier’s TRM ?