add rtc read and write function