mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
50 lines
1.8 KiB
C
50 lines
1.8 KiB
C
/*********************************************************************************************************************
|
||
* COPYRIGHT NOTICE
|
||
* Copyright (c) 2020,<2C><><EFBFBD>ɿƼ<C9BF>
|
||
* All rights reserved.
|
||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>QQȺ<51><C8BA><EFBFBD><EFBFBD>Ⱥ<EFBFBD><C8BA>824575535
|
||
*
|
||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD>Ȩ<EFBFBD><C8A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɿƼ<C9BF><C6BC><EFBFBD><EFBFBD>У<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>;<EFBFBD><CDBE>
|
||
* <20><>ӭ<EFBFBD><D3AD>λʹ<CEBB>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>뱣<EFBFBD><EBB1A3><EFBFBD><EFBFBD><EFBFBD>ɿƼ<C9BF><C6BC>İ<EFBFBD>Ȩ<EFBFBD><C8A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
*
|
||
* @file stm_systick
|
||
* @company <09>ɶ<EFBFBD><C9B6><EFBFBD><EFBFBD>ɿƼ<C9BF><C6BC><EFBFBD><EFBFBD><EFBFBD>˾
|
||
* @author <09><><EFBFBD>ɿƼ<C9BF>(QQ3184284598)
|
||
* @version <09>鿴doc<6F><63>version<6F>ļ<EFBFBD> <20>汾˵<E6B1BE><CBB5>
|
||
* @Software ADS v1.2.2
|
||
* @Target core TC264D
|
||
* @Taobao https://seekfree.taobao.com/
|
||
* @date 2020-3-23
|
||
********************************************************************************************************************/
|
||
|
||
#ifndef _zf_stm_systick_h
|
||
#define _zf_stm_systick_h
|
||
|
||
#include "common.h"
|
||
|
||
|
||
|
||
typedef enum // ö<><C3B6>STMģ<4D><C4A3><EFBFBD><EFBFBD>
|
||
{
|
||
STM0,
|
||
STM1,
|
||
}STMN_enum;
|
||
|
||
|
||
void systick_delay(STMN_enum stmn, uint32 time);
|
||
void systick_start(STMN_enum stmn);
|
||
uint32 systick_getval(STMN_enum stmn);
|
||
|
||
//------------------------------------<2D><><EFBFBD>º궨<C2BA><EAB6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ------------------------------------
|
||
#define systick_delay_ms(stmn, time) systick_delay(stmn, time*1000000) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱʱ<CAB1><CAB1> <20><>λms
|
||
#define systick_delay_us(stmn, time) systick_delay(stmn, time*1000) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱʱ<CAB1><CAB1> <20><>λus
|
||
#define systick_delay_ns(stmn, time) systick_delay(stmn, time) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱʱ<CAB1><CAB1> <20><>λns
|
||
|
||
//------------------------------------<2D><><EFBFBD>º궨<C2BA><EAB6A8><EFBFBD><EFBFBD><EFBFBD>ڻ<EFBFBD>ȡ<EFBFBD><C8A1>ǰʱ<C7B0><CAB1>------------------------------------
|
||
#define systick_getval_ms(stmn) systick_getval(stmn)/100000 //<2F><>ȡ<EFBFBD><C8A1>ǰ<EFBFBD><C7B0>ʱʱ<CAB1><CAB1> <20><>λms
|
||
#define systick_getval_us(stmn) systick_getval(stmn)/100 //<2F><>ȡ<EFBFBD><C8A1>ǰ<EFBFBD><C7B0>ʱʱ<CAB1><CAB1> <20><>λus
|
||
#define systick_getval_ns(stmn) systick_getval(stmn)*10 //<2F><>ȡ<EFBFBD><C8A1>ǰ<EFBFBD><C7B0>ʱʱ<CAB1><CAB1> <20><>λns
|
||
|
||
|
||
#endif
|