namespace Unosquare.RaspberryIO.Abstractions {
///
/// Defines the SPI channel numbers.
///
public enum SpiChannelNumber {
///
/// The channel 0
///
Channel0 = 0,
///
/// The channel 1
///
Channel1 = 1,
}
///
/// Defines the GPIO Pin values 0 for low, 1 for High.
///
public enum GpioPinValue {
///
/// Digital high
///
High = 1,
///
/// Digital low
///
Low = 0,
}
///
/// The GPIO pin resistor mode. This is used on input pins so that their
/// lines are not floating.
///
public enum GpioPinResistorPullMode {
///
/// Pull resistor not active. Line floating
///
Off = 0,
///
/// Pull resistor sets a default value of 0 on no-connects
///
PullDown = 1,
///
/// Pull resistor sets a default value of 1 on no-connects
///
PullUp = 2,
}
///
/// Defines the different drive modes of a GPIO pin.
///
public enum GpioPinDriveMode {
///
/// Input drive mode (perform reads)
///
Input = 0,
///
/// Output drive mode (perform writes)
///
Output = 1,
///
/// PWM output mode (only certain pins support this -- 2 of them at the moment)
///
PwmOutput = 2,
///
/// GPIO Clock output mode (only a pin supports this at this time)
///
GpioClock = 3,
///
/// The alt0 operating mode
///
Alt0 = 4,
///
/// The alt1 operating mode
///
Alt1 = 5,
///
/// The alt2 operating mode
///
Alt2 = 6,
///
/// The alt3 operating mode
///
Alt3 = 7,
}
///
/// Defines the different threading locking keys.
///
public enum ThreadLockKey {
///
/// The lock 0
///
Lock0 = 0,
///
/// The lock 1
///
Lock1 = 1,
///
/// The lock 2
///
Lock2 = 2,
///
/// The lock 3
///
Lock3 = 3,
}
///
/// Defines the different edge detection modes for pin interrupts.
///
public enum EdgeDetection {
///
/// Falling Edge
///
FallingEdge,
///
/// Rising edge
///
RisingEdge,
///
/// Both, falling and rising edges
///
FallingAndRisingEdge,
}
///
/// The hardware revision of the board.
///
public enum BoardRevision {
///
/// Revision 1 (the early Model A and B's).
///
Rev1 = 1,
///
/// Revision 2 (everything else - it covers the B, B+ and CM).
///
Rev2 = 2,
}
///
/// Defines the Header connectors available.
///
public enum GpioHeader {
///
/// Not defined
///
None,
///
/// P1 connector (main connector)
///
P1,
///
/// P5 connector (auxiliary, not commonly used)
///
P5,
}
///
/// Defines all the BCM Pin numbers available for the user.
///
public enum BcmPin {
///
/// GPIO 0
///
Gpio00 = 0,
///
/// GPIO 1
///
Gpio01 = 1,
///
/// GPIO02
///
Gpio02 = 2,
///
/// GPIO 3
///
Gpio03 = 3,
///
/// GPIO 4
///
Gpio04 = 4,
///
/// GPIO 5
///
Gpio05 = 5,
///
/// GPIO 6
///
Gpio06 = 6,
///
/// GPIO 7
///
Gpio07 = 7,
///
/// GPIO 8
///
Gpio08 = 8,
///
/// GPIO 9
///
Gpio09 = 9,
///
/// GPIO 10
///
Gpio10 = 10,
///
/// GPIO 11
///
Gpio11 = 11,
///
/// GPIO 12
///
Gpio12 = 12,
///
/// GPIO 13
///
Gpio13 = 13,
///
/// GPIO 14
///
Gpio14 = 14,
///
/// GPIO 15
///
Gpio15 = 15,
///
/// GPIO 16
///
Gpio16 = 16,
///
/// GPIO 17
///
Gpio17 = 17,
///
/// GPIO 18
///
Gpio18 = 18,
///
/// GPIO 19
///
Gpio19 = 19,
///
/// GPIO 20
///
Gpio20 = 20,
///
/// GPIO 21
///
Gpio21 = 21,
///
/// GPIO 22
///
Gpio22 = 22,
///
/// GPIO 23
///
Gpio23 = 23,
///
/// GPIO 24
///
Gpio24 = 24,
///
/// GPIO 25
///
Gpio25 = 25,
///
/// GPIO 26
///
Gpio26 = 26,
///
/// GPIO 27
///
Gpio27 = 27,
///
/// GPIO 28
///
Gpio28 = 28,
///
/// GPIO 29
///
Gpio29 = 29,
///
/// GPIO 30
///
Gpio30 = 30,
///
/// GPIO 31
///
Gpio31 = 31,
}
///
/// Enumerates the different pins on the P1 Header.
/// Enumeration values correspond to the physical pin number.
///
public enum P1 {
///
/// Header P1 Physical Pin 3. GPIO 0 for rev1 or GPIO 2 for rev2.
///
Pin03 = 3,
///
/// Header P1 Physical Pin 5. GPIO 1 for rev1 or GPIO 3 for rev2.
///
Pin05 = 5,
///
/// Header P1 Physical Pin 7. GPIO 4.
///
Pin07 = 7,
///
/// Header P1 Physical Pin 11. GPIO 17.
///
Pin11 = 11,
///
/// Header P1 Physical Pin 13. GPIO 21 for rev1 or GPIO 27 for rev2.
///
Pin13 = 13,
///
/// Header P1 Physical Pin 15. GPIO 22.
///
Pin15 = 15,
///
/// Header P1 Physical Pin 19. GPIO 10.
///
Pin19 = 19,
///
/// Header P1 Physical Pin 21. GPIO 9.
///
Pin21 = 21,
///
/// Header P1 Physical Pin 23. GPIO 11.
///
Pin23 = 23,
///
/// Header P1 Physical Pin 27. GPIO 0.
///
Pin27 = 27,
///
/// Header P1 Physical Pin 29. GPIO 5.
///
Pin29 = 29,
///
/// Header P1 Physical Pin 31. GPIO 6.
///
Pin31 = 31,
///
/// Header P1 Physical Pin 33. GPIO 13.
///
Pin33 = 33,
///
/// Header P1 Physical Pin 35. GPIO 19.
///
Pin35 = 35,
///
/// Header P1 Physical Pin 37. GPIO 26.
///
Pin37 = 37,
///
/// Header P1 Physical Pin 8. GPIO 14.
///
Pin08 = 8,
///
/// Header P1 Physical Pin 10. GPIO 15.
///
Pin10 = 10,
///
/// Header P1 Physical Pin 12. GPIO 18.
///
Pin12 = 12,
///
/// Header P1 Physical Pin 16. GPIO 23.
///
Pin16 = 16,
///
/// Header P1 Physical Pin 18. GPIO 24.
///
Pin18 = 18,
///
/// Header P1 Physical Pin 22. GPIO 25.
///
Pin22 = 22,
///
/// Header P1 Physical Pin 24. GPIO 8.
///
Pin24 = 24,
///
/// Header P1 Physical Pin 26. GPIO 7.
///
Pin26 = 26,
///
/// Header P1 Physical Pin 28. GPIO 1.
///
Pin28 = 28,
///
/// Header P1 Physical Pin 32. GPIO 12.
///
Pin32 = 32,
///
/// Header P1 Physical Pin 36. GPIO 16.
///
Pin36 = 36,
///
/// Header P1 Physical Pin 38. GPIO 20.
///
Pin38 = 38,
///
/// Header P1 Physical Pin 40. GPIO 21.
///
Pin40 = 40,
}
///
/// Enumerates the different pins on the P5 Header
/// as commonly referenced by Raspberry Pi documentation.
/// Enumeration values correspond to the physical pin number.
///
public enum P5 {
///
/// Header P5 Physical Pin 3, GPIO 28.
///
Pin03 = 3,
///
/// Header P5 Physical Pin 4, GPIO 29.
///
Pin04 = 4,
///
/// Header P5 Physical Pin 5, GPIO 30.
///
Pin05 = 5,
///
/// Header P5 Physical Pin 6, GPIO 31.
///
Pin06 = 6,
}
}