-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutlet.h
47 lines (37 loc) · 987 Bytes
/
outlet.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
44
45
46
47
#ifndef OUTLET_H
#define OUTLET_H
//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif
#define PORTA 0
#define PORTB 1
#define PORTC 2
#define PORTD 3
#define ALL_PINS 0xff
#define OUTLET_SIZE 8
#define CURRENT_PORT PORTB
typedef struct{
int hrOn;
int minOn;
int hrOff;
int minOff;
}Outlet_Schedule_t;
typedef struct{
bool uia8OutletStatus[8];
Outlet_Schedule_t Schedule[OUTLET_SIZE];
}Outlet_t;
void Outlet_Init(void);
uint8_t Outlet_Read(uint8_t ui8Pins);
void Outlet_On(uint8_t ui8Pins);
void Outlet_Off(uint8_t ui8Pins);
void Outlet_Check_Schedule(void);
bool Outlet_Get_Status( uint8_t outlet );
void Outlet_Set_Schedule( uint8_t Outlet_Number, Outlet_Schedule_t * pSet_Time );
#endif