-
Notifications
You must be signed in to change notification settings - Fork 0
/
button_block.h
78 lines (60 loc) · 1.12 KB
/
button_block.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
* Header file for the Button Block peripheral
*
*
*/
#ifndef _BUTTON_BLOCK_H_
#define _BUTTON_BLOCK_H_
#include "miniat/miniat.h"
#include "SDL/edison_button.h"
#define BUTTON_NUMBER 8
typedef struct button_block button_block;
/*
* Creates a new Button Block peripheral, setting it's address
* to "address" for the miniAT
*
*
*
*/
extern button_block *button_block_new(m_uword address);
/*
* Free's the memory address for the Button Block passed
* as argument
*
*
*
*/
extern void button_block_free(button_block *buttons);
/*
* Clock function
*
* This will update the current value for the Button Block
*
*
*/
extern void button_block_clock(button_block *buttons, edison_button *sdl_buttons[BUTTON_NUMBER]);
/*
* Tries to connect the Button Block with the bus
*
*
*
*
*/
extern void button_block_bus_connector_set(button_block *buttons, m_bus *bus);
/*
* Sets the Button block's bus
*
*
*
*
*/
extern m_bus button_block_get_bus(button_block *buttons);
/*
* boolToBin
*
* This functions transforms an array of booleans
* in a binary integer
*
*/
extern int boolToDec(bool *states);
#endif