I have a Real Time Clock (RTC) located at address 0x180000 I would like to create a struct of the RTC registers and map it to 0x180000 where the RTC registers start, located in far xdata memory or (HDATA). I want to access the RTC such as
RTC.Month = 8;
I think that would be a reasonable thing to do, yes. Something like:
#define RtcAddr 0x180000 typedef struct { U16 year; U8 month; U8 day; } RtcReg; #define Rtc FVAR (RtcReg, RtcAddr) ... Rtc.month = 8;
RtcReg far Rtc _at_ 0x180000UL; Rtc.month = 8;