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,<EFBFBD><EFBFBD><EFBFBD>ɿƼ<EFBFBD>
|
|||
|
* All rights reserved.
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>QQȺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱥ<EFBFBD><EFBFBD>824575535
|
|||
|
*
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɿƼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD>δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD>;<EFBFBD><EFBFBD>
|
|||
|
* <EFBFBD><EFBFBD>ӭ<EFBFBD><EFBFBD>λʹ<EFBFBD>ò<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD>뱣<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɿƼ<EFBFBD><EFBFBD>İ<EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*
|
|||
|
* @file stm_systick
|
|||
|
* @company <EFBFBD>ɶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɿƼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾
|
|||
|
* @author <EFBFBD><EFBFBD><EFBFBD>ɿƼ<EFBFBD>(QQ3184284598)
|
|||
|
* @version <EFBFBD>鿴doc<EFBFBD><EFBFBD>version<EFBFBD>ļ<EFBFBD> <EFBFBD>汾˵<EFBFBD><EFBFBD>
|
|||
|
* @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
|