-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpit.h
40 lines (31 loc) · 769 Bytes
/
pit.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
/*
* pit.h
*
* Created on: 18/04/2017
* Author: Evandro
*/
#ifndef SOURCES_PIT_H_
#define SOURCES_PIT_H_
#include "../Library-FRDM-KL25Z/externs.h"
//#include "stdbool.h"
#define PIT_CH_0 0
#define PIT_CH_1 1
#define FLAG_TPM 1
#define COUNTER_TPM 2
#define NONE_TPM 0
#define MODEISRTPM (COUNTER_TPM)
//void init_pit(uint32_t value);
bool pit_Init(uint32_t value,bool ch);
void pit_Start(bool ch);
void pit_Stop(bool ch);
void pit_Add_Callback( void(*task)(uint8_t ch) );
//#if (MODEISRTPM == FLAG_TPM)
// bool pit_GetFlag_Isr(bool ch);
// void pit_ClearFlag_Isr(bool ch);
//#else if (MODEISRTPM == COUNTER_TPM)
// void pit_ClearCounter_Isr(bool ch);
// uint64_t pit_GetCounter_Isr(bool ch);
//#else
// NC
//#endif
#endif /* SOURCES_PIT_H_ */