lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | #ifndef __ZX234290_RTC_H
|
| 2 | #define __ZX234290_RTC_H
|
| 3 |
|
| 4 | //typedef unsigned char UINT8;
|
| 5 | //typedef int UINT16;
|
| 6 |
|
| 7 | //#define ZX234290_RTC_IRQ 81 // 49+32
|
| 8 |
|
| 9 | #define ZX234290_RTC_ONE_HOUR_INT_MASK_LSH (4)
|
| 10 | #define ZX234290_RTC_ONE_HOUR_INT_MASK_WID (1)
|
| 11 |
|
| 12 | #define ZX234290_RTC_ONE_MINUTE_INT_MASK_LSH (3)
|
| 13 | #define ZX234290_RTC_ONE_MINUTE_INT_MASK_WID (1)
|
| 14 |
|
| 15 | #define ZX234290_RTC_ALARM_INT_MASK_LSH (0)
|
| 16 | #define ZX234290_RTC_ALARM_INT_MASK_WID (1)
|
| 17 |
|
| 18 |
|
| 19 | #define ZX234290_RTC_ALARM_INT_EN_LSH (1)
|
| 20 | #define ZX234290_RTC_ALARM_INT_EN_WID (1)
|
| 21 |
|
| 22 | #define ZX234290_RTC_TIMER_INT_EN_LSH (0)
|
| 23 | #define ZX234290_RTC_TIMER_INT_EN_WID (1)
|
| 24 |
|
| 25 |
|
| 26 | /*RTC TIME SECONDS MIN HOU DAY MON YEAR WEEKDAY*/
|
| 27 | #define ZX234290_RTC_TIME_SECONDS_LSH (0)
|
| 28 | #define ZX234290_RTC_TIME_SECONDS_WID (7)
|
| 29 |
|
| 30 | #define ZX234290_RTC_TIME_MINUTES_LSH (0)
|
| 31 | #define ZX234290_RTC_TIME_MINUTES_WID (7)
|
| 32 |
|
| 33 | #define ZX234290_RTC_TIME_HOURS_LSH (0)
|
| 34 | #define ZX234290_RTC_TIME_HOURS_WID (6)
|
| 35 |
|
| 36 | #define ZX234290_RTC_TIME_DAYS_LSH (0)
|
| 37 | #define ZX234290_RTC_TIME_DAYS_WID (6)
|
| 38 |
|
| 39 | #define ZX234290_RTC_TIME_MONTHS_LSH (0)
|
| 40 | #define ZX234290_RTC_TIME_MONTHS_WID (5)
|
| 41 | #define ZX234290_RTC_TIME_CENTURY_LSH (7)
|
| 42 | #define ZX234290_RTC_TIME_CENTURY_WID (1)
|
| 43 |
|
| 44 | #define ZX234290_RTC_TIME_YEAR_LSH (0)
|
| 45 | #define ZX234290_RTC_TIME_YEAR_WID (7)
|
| 46 |
|
| 47 | #define ZX234290_RTC_TIME_WEEKDAY_LSH (0)
|
| 48 | #define ZX234290_RTC_TIME_WEEKDAY_WID (3)
|
| 49 |
|
| 50 | /*RTC ALARM MIN HOU DAY WEEKDAY*/
|
| 51 | #define ZX234290_RTC_AlARM_MINUTES_LSH (0)
|
| 52 | #define ZX234290_RTC_AlARM_MINUTES_WID (7)
|
| 53 |
|
| 54 | #define ZX234290_RTC_AlARM_HOURS_LSH (0)
|
| 55 | #define ZX234290_RTC_AlARM_HOURS_WID (6)
|
| 56 |
|
| 57 | #define ZX234290_RTC_AlARM_DAYS_LSH (0)
|
| 58 | #define ZX234290_RTC_AlARM_DAYS_WID (6)
|
| 59 |
|
| 60 | #define ZX234290_RTC_AlARM_WEEKDAY_LSH (0)
|
| 61 | #define ZX234290_RTC_AlARM_WEEKDAY_WID (3)
|
| 62 |
|
| 63 | #define ZX234290_RTC_AlARM_SECOND_LSH (0)
|
| 64 | #define ZX234290_RTC_AlARM_SECOND_WID (7)
|
| 65 |
|
| 66 | /*RTC ALARM1 IGNORE*/
|
| 67 | #define ZX234290_RTC_AlARM1_SECONDSIGNORE_LSH (7)
|
| 68 | #define ZX234290_RTC_AlARM1_SECONDSIGNORE_WID (1)
|
| 69 |
|
| 70 | #define ZX234290_RTC_AlARM1_MINUTESIGNORE_LSH (7)
|
| 71 | #define ZX234290_RTC_AlARM1_MINUTESIGNORE_WID (1)
|
| 72 |
|
| 73 | #define ZX234290_RTC_AlARM1_HOURSIGNORE_LSH (7)
|
| 74 | #define ZX234290_RTC_AlARM1_HOURSIGNORE_WID (1)
|
| 75 |
|
| 76 | #define ZX234290_RTC_AlARM1_DAYSIGNORE_LSH (7)
|
| 77 | #define ZX234290_RTC_AlARM1_DAYSIGNORE_WID (1)
|
| 78 |
|
| 79 | #define ZX234290_RTC_AlARM1_MONTHSIGNORE_LSH (7)
|
| 80 | #define ZX234290_RTC_AlARM1_MONTHSIGNORE_WID (1)
|
| 81 |
|
| 82 | #define ZX234290_RTC_AlARM1_YEARIGNORE_LSH (7)
|
| 83 | #define ZX234290_RTC_AlARM1_YEARIGNORE_WID (1)
|
| 84 |
|
| 85 | #define ZX234290_RTC_AlARM1_WEEKDAYIGNORE_LSH (7)
|
| 86 | #define ZX234290_RTC_AlARM1_WEEKDAYIGNORE_WID (1)
|
| 87 |
|
| 88 | #define ZX234290_RTC_ALARM_AF_LSH (3)
|
| 89 | #define ZX234290_RTC_ALARM_AF_WID (1)
|
| 90 | /*RTC ALARM Enable*/
|
| 91 | #define ZX234290_RTC_AlARM_ACTIVATED_LSH (7)
|
| 92 | #define ZX234290_RTC_AlARM_ACTIVATED_WID (1)
|
| 93 |
|
| 94 | /* RTC TIMER ENABLE */
|
| 95 | #define ZX234290_RTC_TIMER_EN_LSH (7)
|
| 96 | #define ZX234290_RTC_TIMER_EN_WID (1)
|
| 97 |
|
| 98 | #define ZX234290_RTC_TIMER_TD_LSH (0)
|
| 99 | #define ZX234290_RTC_TIMER_TD_WID (2)
|
| 100 |
|
| 101 | #define ZX234290_RTC_TIMER_CNT_LSH (0)
|
| 102 | #define ZX234290_RTC_TIMER_CNT_WID (8)
|
| 103 |
|
| 104 | /*RTC UNLOCK*/
|
| 105 |
|
| 106 | #define ZX234290_RTC_UNLOCK_LSH (2)
|
| 107 | #define ZX234290_RTC_UNLOCK_WID (1)
|
| 108 |
|
| 109 | #define ZX234290_RTC_DATALATCH_LSH (3)
|
| 110 | #define ZX234290_RTC_DATALATCH_WID (1)
|
| 111 |
|
| 112 | #define ZX234290_MONITOR_FLA_LSH (0)
|
| 113 | #define ZX234290_MONITOR_FLA_WID (1)
|
| 114 |
|
| 115 | /*reg 0x31*/
|
| 116 | #define ZX234290_RTC_TIE_LSH (0)
|
| 117 | #define ZX234290_RTC_TIE_WID (1)
|
| 118 |
|
| 119 | #define ZX234290_RTC_AIE_LSH (1)
|
| 120 | #define ZX234290_RTC_AIE_WID (1)
|
| 121 |
|
| 122 | #define ZX234290_RTC_TF_LSH (2)
|
| 123 | #define ZX234290_RTC_TF_WID (1)
|
| 124 |
|
| 125 | #define ZX234290_RTC_AF_LSH (3)
|
| 126 | #define ZX234290_RTC_AF_WID (1)
|
| 127 | #endif
|