1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * 4 * HDF is dual licensed: you can use it either under the terms of 5 * the GPL, or the BSD license, at your option. 6 * See the LICENSE file in the root of this repository for complete details. 7 */ 8 9 #ifndef RTC_TEST_H 10 #define RTC_TEST_H 11 12 #include "rtc_if.h" 13 14 #ifdef __cplusplus 15 extern "C" { 16 #endif /* __cplusplus */ 17 18 int32_t RtcTestExecute(int cmd); 19 20 struct RtcTestConfig { 21 uint32_t time; 22 uint32_t maxYear; 23 uint32_t year; 24 uint32_t month; 25 uint32_t day; 26 uint32_t weekday; 27 uint32_t millisecond; 28 uint32_t hour; 29 uint32_t minute; 30 uint32_t second; 31 uint32_t frequency; 32 uint32_t userValue; 33 uint32_t userMaxIndex; 34 uint32_t waitTimeSecond; 35 uint32_t writeWaitMillisecond; 36 }; 37 38 struct RtcTester { 39 struct RtcTestConfig config; 40 struct RtcTime time; 41 DevHandle handle; 42 }; 43 44 enum RtcTestCmd { 45 RTC_TEST_CMD_WR_TIME = 0, 46 RTC_TEST_CMD_WR_MAX_TIME, 47 RTC_TEST_CMD_WR_MIN_TIME, 48 RTC_TEST_CMD_WR_ALARM_TIME, 49 RTC_TEST_CMD_WR_ALARM_MAX_TIME, 50 RTC_TEST_CMD_WR_ALARM_MIN_TIME, 51 RTC_TEST_CMD_RTC_ALARM_ENABLE, 52 RTC_TEST_CMD_RTC_ALARM_IRQ, 53 RTC_TEST_CMD_RTC_REGISTER_CALLBACK, 54 RTC_TEST_CMD_RTC_REGISTER_CALLBACK_NULL, 55 RTC_TEST_CMD_RTC_WR_FREQ, 56 RTC_TEST_CMD_RTC_WR_MAX_FREQ, 57 RTC_TEST_CMD_RTC_WR_MIN_FREQ, 58 RTC_TEST_CMD_RTC_WR_USER_REG, 59 RTC_TEST_CMD_RTC_WR_USER_REG_MAX_INDEX, 60 RTC_TEST_CMD_RTC_WR_RELIABILITY, 61 RTC_TEST_CMD_RTC_FUNCTION_TEST, 62 RTC_MINI_SET_GET_TIME_ZONE_TEST, 63 RTC_TEST_CMD_MAX, 64 }; 65 66 #ifdef __cplusplus 67 } 68 #endif /* __cplusplus */ 69 70 #endif /* RTC_TEST_H */ 71