I do understand that this statement is casting a unsigned volatile char to a memory address but what I don't understand is the pointer after volatile.
#define PORTC *(unsigned char volatile *)(0x1003)
It says: treat the number 0x1003
as a volatile unsigned character pointer; read or write the (byte) value at that address, depending on how it is used:
unsigned char c = PORTC; // read
PORTC = c + 1; // write
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With