This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Structutral

Hello to all who are reading my post.
I am a novice in C programming for At91sam7x. I am involved in an extensive project that my part include working with the device. But , Although I was bean reading several examples to understand such expressions:

(AT91C_BASE_PIOA->PIO_PDSR & AT91B_SW5) == 0
This expression placed as a conditional term in WHILE Structure in BLINKY example.
In advance I would thank a lot for your precious and useful answers.

Avi Muzaich

Parents
  • The pointer is just pointing to a struct that is mapped to the registers relevant for a specific port or device. This can be seen by the "base" part of the name.

    The data sheet/user manual of the processor should contain the description of all special function registers that the processor has for the different registers. So you should be able to locate a register that correlates with the PIO_PDSR field in the above struct. And when you have found that register, you should be able to figure out what it means to check the specific bit AT91B_SW5 and testing if that bit is cleared.

Reply
  • The pointer is just pointing to a struct that is mapped to the registers relevant for a specific port or device. This can be seen by the "base" part of the name.

    The data sheet/user manual of the processor should contain the description of all special function registers that the processor has for the different registers. So you should be able to locate a register that correlates with the PIO_PDSR field in the above struct. And when you have found that register, you should be able to figure out what it means to check the specific bit AT91B_SW5 and testing if that bit is cleared.

Children
No data