96 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			96 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
/****************************************************************************
 | 
						|
 | 
						|
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 OS_SHIM_UTILS_API_H
 | 
						|
#define OS_SHIM_UTILS_API_H
 | 
						|
 | 
						|
/* os shim includes */
 | 
						|
#include "os_types_api.h"
 | 
						|
 | 
						|
#ifdef __cplusplus
 | 
						|
extern "C" {
 | 
						|
#endif
 | 
						|
 | 
						|
 | 
						|
/** \defgroup OS_APIs PLC OS APIs
 | 
						|
  * @brief WQ30x1 PLC OS APIs
 | 
						|
  */
 | 
						|
 | 
						|
 | 
						|
/** @addtogroup OS_APIs
 | 
						|
  * @{
 | 
						|
  */
 | 
						|
 | 
						|
/** \defgroup OS_UTILS_APIs PLC OS UTILS APIs
 | 
						|
  * @brief PLC OS UTILS
 | 
						|
  *
 | 
						|
  * OS Timer helper function for applications
 | 
						|
  *
 | 
						|
  */
 | 
						|
 | 
						|
/** @addtogroup OS_UTILS_APIs
 | 
						|
  * @{
 | 
						|
  */
 | 
						|
 | 
						|
/**
 | 
						|
 * @brief os_boot_time32() - get the time since boot up in ms. uint32_t time
 | 
						|
 * value will overflow in 49.71 days.
 | 
						|
 *
 | 
						|
 * @return                  duration in milliseconds since the system boot up
 | 
						|
 */
 | 
						|
uint32_t os_boot_time32();
 | 
						|
 | 
						|
/**
 | 
						|
 * @brief os_boot_time64() - get the time since boot up in ms
 | 
						|
 *
 | 
						|
 * @return                  duration in milliseconds since the system boot up
 | 
						|
 */
 | 
						|
uint64_t os_boot_time64();
 | 
						|
 | 
						|
/**
 | 
						|
 * @brief os_rand() - get a pseudo random number
 | 
						|
 *
 | 
						|
 * @return                  a pseudo random number
 | 
						|
 */
 | 
						|
uint32_t os_rand();
 | 
						|
 | 
						|
/**
 | 
						|
 * @brief os_delay - wait for timeout (Time Delay)
 | 
						|
 * @param millisec:         millisec time delay value
 | 
						|
 */
 | 
						|
uint32_t os_delay(uint32_t millisec);
 | 
						|
 | 
						|
/**
 | 
						|
 * @brief os_check_heap_address - Check if an address is in heap.
 | 
						|
 * @param addr:         Address to be checked.
 | 
						|
 *
 | 
						|
 * @return: 1 - addr in heap, 0 - addr not in heap
 | 
						|
 */
 | 
						|
uint32_t os_check_heap_address(void *addr);
 | 
						|
 | 
						|
/**
 | 
						|
  * @}
 | 
						|
  */
 | 
						|
 | 
						|
/**
 | 
						|
  * @}
 | 
						|
  */
 | 
						|
 | 
						|
 | 
						|
#ifdef __cplusplus
 | 
						|
}
 | 
						|
#endif
 | 
						|
 | 
						|
#endif /* OS_SHIM_UTILS_API_H */ |