-
Notifications
You must be signed in to change notification settings - Fork 0
/
Timer_Ctrl.h
43 lines (43 loc) · 1.88 KB
/
Timer_Ctrl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*============================================================================*
* O O __ ______ __ *
* \ / /\ / /_ _ __ / /___/ / /_ _ *
* [+] / \/ / \\ //__ / /__ / /____ / / \\ // *
* / \ / /\ / \\__// --/ /---/ /----// / \\_// *
* O O /_/ \/ \__/ \_\/ /_/ /_/ ____/_/ *
* *
* *
* Multi-Rotor controller firmware for Nuvoton Cortex M4 series *
* *
* Written by by T.L. Shen for Nuvoton Technology. *
* tlshen@nuvoton.com/tzulan611126@gmail.com *
* *
*============================================================================*
*/
#ifndef _TIMER_CTRL_H
#define _TIMER_CTRL_H
#include <stdint.h>
#define configTICK_RATE_HZ 1000
#define ChronMain 0
#define ChronMAG 1
#define ChronRC 2
#define ChronTemp 3
#define NumCron 4
//Milliseconds to OS Ticks
#define M2T(X) ((unsigned int)(X*(configTICK_RATE_HZ/1000.0)))
void ChronographSet(char Chron);
void ChronographStart(char Chron);
int32_t ChronographRead(char Chron);
int getTickCount(void);
void SetTickSSVRC(uint8_t tick);
void DelayLoop(unsigned short delay);
void DelayUsec(unsigned int usec);
void DelayMsec(unsigned short msec);
void setup_system_tick(uint32_t sampleRate);
void IncFrameCount(int inc);
uint32_t GetFrameCount(void);
uint32_t micros(void);
uint32_t millis(void);
void TIMER_Init(void);
void TIMER_Enable(char enable);
float getUpdateDT(void);
#endif