Vous êtes sur la page 1sur 1

1 #ifndef BRANCHSERVICE_H

2 #define BRANCHSERVICE_H
3
4 /****************************************************************************
5
6
Header file for BranchService
7
based on the Gen 2 Events and Services Framework
8
9
****************************************************************************/
10
11 #include <stdint.h>
12 #include <stdbool.h>
13 #include <stdio.h>
14 #include <math.h>
15
16 // Event Definitions
17 #include "ES_Configure.h" /* gets us event definitions */
18 #include "ES_Types.h"
/* gets bool type for returns */
19 #include "ES_Framework.h"
20 #include "ES_Events.h"
21 #include "ES_Port.h"
22
23 #include "termio.h"
24 #include "inc/hw_memmap.h"
25 #include "inc/hw_types.h"
26 #include "inc/hw_gpio.h"
27 #include "inc/hw_sysctl.h"
28 #include "driverlib/gpio.h"
29
30 #include "DEFINITIONS.h"
31 #include "LEDService.h"
32
33 typedef enum { Branch_InitPState, WaitForStartBranch, WelcomingBranch,
34
TimingBranch, WeatherBranch, NormalBranch,
35
ReplayingBranch } BranchState_t ;
36
37 // ES FRAMEWORK
38 bool Init_BranchService(uint8_t Priority);
39 bool Post_BranchService(ES_Event ThisEvent);
40 ES_Event Run_BranchService(ES_Event ThisEvent);
41
42 // BRANCH EDITING
43 void Branch_IncrementColor(uint8_t BRANCHidx, uint8_t StripNum);
44 void Branch_SetColor(uint8_t BRANCHidx, uint8_t StripNum, uint32_t RGB);
45 void AllBranchesOff(void);
46 void RestoreBranches(void);
47 void ArchiveBranches(void);
48 void SetAllBranches(uint32_t HSV);
49
50 // EVENT CHECKERS
51 bool CheckProxEvents(void);
52 uint8_t PollProx(uint8_t SensorIdx);
53 bool CheckAnalogEvent(void);
54
55 // HELPERS/UPDATERS
56 uint8_t absDiff(uint8_t Val1, uint8_t Val2);
57 uint32_t HSV2RGB(uint32_t HSV);
58 void SetNewColorLimit(uint16_t Input);
59 void IncReplayTimeIter(void);
60 void UpdateFrontPanel(void);
61 void UpdateArrow(void);
62
63 #endif

Vous aimerez peut-être aussi