Have you read chapter 11 of the E300 Platform Reference Manual? Although to be fair there isn’t a lot of tutorial material there. I guess it assumes familiarity with other microcontrollers.
I believe the GPIO_OUTPUT_XOR register should toggle any GPIO pin whose bit it set to 1 when a write is made to the register.
In which case those last two lines look like a bug. I don’t know what is supposed to happen if you read from that register. Maybe it should be:
Yeah I read.yes i understood !Well ,the information was good and helpful and i feel that i should improve my understanding over micro controllers.Anyways thank you.
… to turn off the green and blue LED’s GPIOs and turn on the red LED’s GPIO without having to read the whole IO register to a CPU register, turn bits on and off, and write the new value back.
We don’t seem to have that, but I guess the XOR register will often allow the same kind of things, possibly even with slightly less code if you implicitly already know the previous state.
.
As opposed to reserving special differently-addressed memory regions for atomic set and clear of device bits (bit banding), the RISC-V amoor and amoand instructions allow you to set and clear bits in a memory-mapped device with a single instruction using the normal device address. Amoxor lets you toggle the bits as described by Bruce.