I am obsessed with the BB and the PRU. I think I need treatment! With that out of the way, after slaving over my computer for the last several days, I have succeeded in writing a C program for the PRU which controls standard GPIO outputs using the Sitara memory map, getting it built using clpru, and then deployed to the PRU using Remoteproc. Then I was able to debug it so I finally got it to execute. I also have figured out how to start the PRU automatically at reboot. Whew. Now I need to learn how to pass data in and out of the PRU using RPMsg. And I am clueless how to remotely debug code (either PRU or userspace code) running on the BB.
But what I really need to know is how do I interpret this statement: #define GPIO0_SETDATAOUT* (*(volatile uint32_t *)*(GPIO0_BASE + 0x190)) One way I use it is as follows: GPIO0_SETDATAOUT = 1u << PWM2A_OFFSET; I think I understand the second statement, it first shifts a 1 to the left until the 1 is in the proper bit position for the desired GPIO. Then it writes into the proper memory location for the GPIOs SetDataOut register. This causes a certain GPIO output to be turned on. I also understand how the memory address for the GPIO0 SetDataOut register is computed based on the values from the TRM. What I don't understand is how I intrepret the first statement, especially the bolded part. I understand the meaning of #define and I understand the simple GPIO0BASE + 0x190 offset math. What I don't understand is the bolded part. It looks like it is a pointer to a pointer to a uint32_t, but that doesn't make sense to me. I don't see the need for double indirection. And I'm not too clear on the difference between a uint32 and a uint32_t. Can someone give me a plain english translation for the #define statement? Clark -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/aa006d5f-4abe-499c-bae7-4da2899600d6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
