1 /** 
2  * Type definitions
3  *
4  * The types here are defined by
5  * this library's own names but
6  * their values do link back to
7  * that of WiringPi's
8  *
9  * Authors: Tristan Brice Velloza Kildaire
10  */
11 module bcm2835.types;
12 
13 import bcm2835.wiringPi : OUTPUT, INPUT;
14 
15 /** 
16  * Pin mode
17  *
18  * Represented as an unisgned 8-bit
19  * integer
20  */
21 public enum Mode : ubyte
22 {
23 	/**
24 	 * Output pin mode
25 	 */
26 	Output = OUTPUT,
27 
28 	/**
29 	 * Input pin mode
30 	 */
31 	Input = INPUT
32 }
33 
34 import bcm2835.wiringPi : HIGH, LOW;
35 
36 /** 
37  * Pin state
38  *
39  * Represented as an unisgned 8-bit
40  * integer
41  */
42 public enum State : ubyte
43 {
44 	/**
45 	 * Pin is high
46 	 */
47 	High = HIGH,
48 
49 	/** 
50 	 * Pin is low
51 	 */
52 	Low = LOW
53 }
54 
55 /** 
56  * Represents a pin
57  *
58  * An alias for the `ubyte` type
59  * which is an 8-bit unsigned
60  * integer
61  */
62 public alias Pin = ubyte;
63 
64 import bcm2835.wiringPi : WPIPinType, WPI_PIN_BCM, WPI_PIN_WPI, WPI_PIN_PHYS;
65 
66 /** 
67  * The addressing mode for
68  * the pins
69  */
70 public enum Addressing : ubyte
71 {
72 	/**
73 	 * Broadcom addressing
74 	 * scheme
75 	 */
76 	BCM = WPI_PIN_BCM,
77 
78 	/**
79 	 * WiringPi addressing
80 	 * scheme
81 	 */
82 	WPI = WPI_PIN_WPI,
83 
84 	/**
85 	 * Pin addressing
86 	 * scheme
87 	 */
88 	PHYS = WPI_PIN_PHYS
89 }