70 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
		
		
			
		
	
	
			70 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| 
								 | 
							
								/****************************************************************************
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
							 | 
						||
| 
								 | 
							
								be copied by any method or incorporated into another program without
							 | 
						||
| 
								 | 
							
								the express written consent of Aerospace C.Power. This Information or any portion
							 | 
						||
| 
								 | 
							
								thereof remains the property of Aerospace C.Power. The Information contained herein
							 | 
						||
| 
								 | 
							
								is believed to be accurate and Aerospace C.Power assumes no responsibility or
							 | 
						||
| 
								 | 
							
								liability for its use in any way and conveys no license or title under
							 | 
						||
| 
								 | 
							
								any patent or copyright and makes no representation or warranty that this
							 | 
						||
| 
								 | 
							
								Information is free from patent or copyright infringement.
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								****************************************************************************/
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifndef PROTO_645_EXT_TIME_H
							 | 
						||
| 
								 | 
							
								#define PROTO_645_EXT_TIME_H
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifdef __cplusplus
							 | 
						||
| 
								 | 
							
								extern "C" {
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/**
							 | 
						||
| 
								 | 
							
								 * @brief proto_handle_645_ext_calendar_time_to_unix_timestamp() - Get the uxix
							 | 
						||
| 
								 | 
							
								 *                                               timestamp according to the
							 | 
						||
| 
								 | 
							
								 *                                               calendar time.
							 | 
						||
| 
								 | 
							
								 * @param currTime:  the calendar time.
							 | 
						||
| 
								 | 
							
								 *
							 | 
						||
| 
								 | 
							
								 * @return        -- the unix timestamp.
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								uint32_t proto_handle_645_ext_calendar_time_to_unix_timestamp(
							 | 
						||
| 
								 | 
							
								    proto_645_ext_corr_time_t *currTime);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/**
							 | 
						||
| 
								 | 
							
								* @brief proto_handle_645_ext_unix_timestamp_to_calendar_time() - Get the
							 | 
						||
| 
								 | 
							
								*                                               calendar time according to the
							 | 
						||
| 
								 | 
							
								*                                                unix timestamp.
							 | 
						||
| 
								 | 
							
								* @param utc_sec:  The UTC timestamp.
							 | 
						||
| 
								 | 
							
								* @param result:  the calendar time.
							 | 
						||
| 
								 | 
							
								*/
							 | 
						||
| 
								 | 
							
								void proto_handle_645_ext_unix_timestamp_to_calendar_time(uint32_t utc_sec,
							 | 
						||
| 
								 | 
							
								    proto_645_07_ext_time_t *result);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/**
							 | 
						||
| 
								 | 
							
								 * @brief proto_645_ext_time_week() - Get the week index according to the
							 | 
						||
| 
								 | 
							
								 *                                    given date.
							 | 
						||
| 
								 | 
							
								 * @param year:  The number of years.
							 | 
						||
| 
								 | 
							
								 * @param month:  The number of months.
							 | 
						||
| 
								 | 
							
								 * @param days:  The number of days.
							 | 
						||
| 
								 | 
							
								 *
							 | 
						||
| 
								 | 
							
								 * @return        -- the week index.
							 | 
						||
| 
								 | 
							
								 *                0:suday     6:saturday
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								uint8_t proto_handle_645_ext_time_week(uint8_t nyear, uint8_t month,
							 | 
						||
| 
								 | 
							
								    uint8_t day);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/**
							 | 
						||
| 
								 | 
							
								 * @brief proto_645_ext_time_last_day_of_mon() - Determine how many days there
							 | 
						||
| 
								 | 
							
								 *                                               are in a month.
							 | 
						||
| 
								 | 
							
								 * @param month:  The number of months.
							 | 
						||
| 
								 | 
							
								 * @param year:  The number of years.
							 | 
						||
| 
								 | 
							
								 *
							 | 
						||
| 
								 | 
							
								 * @return       -- how many days.
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								uint8_t proto_handle_645_ext_time_last_day_of_mon(uint8_t month,
							 | 
						||
| 
								 | 
							
								    uint8_t nyear);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif /* PROTO_645_EXT_TIME_H */
							 | 
						||
| 
								 | 
							
								
							 |