00001 /*---------------------------------------------------------------------------- 00002 * Copyright (c) <2013-2015>, <Huawei Technologies Co., Ltd> 00003 * All rights reserved. 00004 * Redistribution and use in source and binary forms, with or without modification, 00005 * are permitted provided that the following conditions are met: 00006 * 1. Redistributions of source code must retain the above copyright notice, this list of 00007 * conditions and the following disclaimer. 00008 * 2. Redistributions in binary form must reproduce the above copyright notice, this list 00009 * of conditions and the following disclaimer in the documentation and/or other materials 00010 * provided with the distribution. 00011 * 3. Neither the name of the copyright holder nor the names of its contributors may be used 00012 * to endorse or promote products derived from this software without specific prior written 00013 * permission. 00014 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00015 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00016 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00017 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 00018 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00019 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00020 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 00021 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 00022 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 00023 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 00024 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00025 *---------------------------------------------------------------------------*/ 00026 /*---------------------------------------------------------------------------- 00027 * Notice of Export Control Law 00028 * =============================================== 00029 * Huawei LiteOS may be subject to applicable export control laws and regulations, which might 00030 * include those applicable to Huawei LiteOS of U.S. and the country in which you are located. 00031 * Import, export and usage of Huawei LiteOS in any manner by you shall be in compliance with such 00032 * applicable export control laws and regulations. 00033 *---------------------------------------------------------------------------*/ 00034 00035 /**@defgroup los_tick Tick 00036 * @ingroup kernel 00037 */ 00038 00039 #ifndef _LOS_TICK_H 00040 #define _LOS_TICK_H 00041 00042 #include "los_errno.h" 00043 00044 #ifdef __cplusplus 00045 #if __cplusplus 00046 extern "C" { 00047 #endif /* __cplusplus */ 00048 #endif /* __cplusplus */ 00049 00050 00051 /** 00052 * @ingroup los_tick 00053 * Tick error code: The Tick configuration is incorrect. 00054 * 00055 * Value: 0x02000400 00056 * 00057 * Solution: Change values of the OS_SYS_CLOCK and LOSCFG_BASE_CORE_TICK_PER_SECOND system time configuration modules in Los_config.h. 00058 */ 00059 #define LOS_ERRNO_TICK_CFG_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_TICK, 0x00) 00060 00061 /** 00062 * @ingroup los_tick 00063 * Tick error code: This error code is not in use temporarily. 00064 * 00065 * Value: 0x02000401 00066 * 00067 * Solution: None. 00068 */ 00069 #define LOS_ERRNO_TICK_NO_HWTIMER LOS_ERRNO_OS_ERROR(LOS_MOD_TICK, 0x01) 00070 00071 /** 00072 * @ingroup los_tick 00073 * Tick error code: The number of Ticks is too small. 00074 * 00075 * Value: 0x02000402 00076 * 00077 * Solution: Change values of the OS_SYS_CLOCK and LOSCFG_BASE_CORE_TICK_PER_SECOND system time configuration modules according to the SysTick_Config function. 00078 */ 00079 #define LOS_ERRNO_TICK_PER_SEC_TOO_SMALL LOS_ERRNO_OS_ERROR(LOS_MOD_TICK, 0x02) 00080 00081 /** 00082 * @ingroup los_tick 00083 * @brief: System clock get function. 00084 * 00085 * @par Description: 00086 * This API is used to get system clock. 00087 * 00088 * @attention: 00089 * <ul><li>None.</li></ul> 00090 * 00091 * @param: None. 00092 * 00093 * @retval: system clock. 00094 * 00095 * @par Dependency: 00096 * <ul><li>los_tick.h: the header file that contains the API declaration.</li></ul> 00097 * @see None. 00098 * @since Huawei LiteOS V100R001C00 00099 * 00100 * */ 00101 extern UINT32 LOS_SysClockGet(void); 00102 00103 #ifdef __cplusplus 00104 #if __cplusplus 00105 } 00106 #endif /* __cplusplus */ 00107 #endif /* __cplusplus */ 00108 00109 #endif /* _LOS_TICK_H */