Chameleon-Mini
Pin.h
1 /*
2  * Pin.h
3  *
4  * Created on: 01.09.2020
5  * Author: endres
6  */
7 
8 #ifndef PIN_H
9 #define PIN_H
10 
11 #include <avr/io.h>
12 #include "Common.h"
13 
14 #define PIN_PORT PORTE
15 #define PIN_0 PIN0_bm
16 
17 typedef enum PinFunctionEnum {
18  PIN_NO_FUNC = 0, /* Pin is HI-Z */
19  PIN_ON, /* Pin is ON (3 V) */
20  PIN_OFF, /* Pin is OFF (0 V) */
21 
22  /* Have to be sequentially ordered */
23  PIN_1_TICK, /* Pin is ON for 1 Tick, afterwards OFF */
24  PIN_2_TICKS, /* Pin is ON for 2 Ticks, afterwards OFF */
25  PIN_3_TICKS, /* Pin is ON for 3 Ticks, afterwards OFF */
26  PIN_4_TICKS, /* Pin is ON for 4 Ticks, afterwards OFF */
27  PIN_5_TICKS, /* Pin is ON for 5 Ticks, afterwards OFF */
28 
29  /* Has to be last element */
30  PIN_FUNC_COUNT
31 } PinFunctionEnum;
32 
33 void PinInit(void);
34 void PinTick(void);
35 
36 void PinGetFuncList(char *List, uint16_t BufferSize);
37 void PinSetFuncById(PinFunctionEnum Func);
38 void PinGetFuncByName(char *Function, uint16_t BufferSize);
39 bool PinSetFuncByName(const char *Function);
40 
41 #endif /* PIN_H */