
March 14th, 2013, 07:53 AM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 2
Time spent in forums: 27 m 43 sec
Reputation Power: 0
|
|
|
Doubt regarding the volatile keyword
What i understood about volatile keyword
(1)volatile unsigned char * ADC_address;
ADC_address is a pointer which stores a volatile unsigned character .
(2)volatile unsigned int ADC_voltage = 0;
ADC_voltage is volatile unsigned integer variable ,
(3)volatile unsigned char * ADC_REAL_ADDRESS;
ADC_REAL_ADDRESS = (volatile unsigned char *)STA_MEMORY_BASE;
Typecasting STA_MEMORY_BASE to volatile unsigned char pointer and assigned to ADC_REAL_ADDRESS.
If I wrong means please correct me.
(4)Can anyone explain the below statements
#define PINSEL_BASE_ADDR 0xE002C000
#define PINSEL0 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x00))
what I understood is (volatile unsigned long *)(PINSEL_BASE_ADDR + 0x00) in this statement (PINSEL_BASE_ADDR + 0x00) is type casted to volatile unsigned long pointer. But (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x00)) , what is for the starting star(dereferencing operator) after first bracket.
|