namespace Unosquare.RaspberryIO.Gpio { /// /// 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 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, } /// /// The PWM mode. /// public enum PwmMode { /// /// PWM pulses are sent using mark-sign patterns (old school) /// MarkSign = 0, /// /// PWM pulses are sent as a balanced signal (default, newer mode) /// Balanced = 1, } /// /// Defines the different edge detection modes for pin interrupts /// public enum EdgeDetection { /// /// Assumes edge detection was already setup externally /// ExternalSetup = 0, /// /// Falling Edge /// FallingEdge = 1, /// /// Rising edge /// RisingEdge = 2, /// /// Both, rising and falling edges /// RisingAndFallingEdges = 3 } /// /// Defines the GPIO Pin values 0 for low, 1 for High /// public enum GpioPinValue { /// /// Digital high /// High = 1, /// /// Digital low /// Low = 0 } /// /// Defines the Header connectors available /// public enum GpioHeader { /// /// Not defined /// None, /// /// The P1 connector (main connector) /// P1, /// /// The P5 connector (auxiliary, not commonly used) /// P5, } /// /// Defines all the available Wiring Pi Pin Numbers /// public enum WiringPiPin { /// /// The unknown /// Unknown = -1, /// /// The pin00 /// Pin00 = 0, /// /// The pin01 /// Pin01 = 1, /// /// The pin02 /// Pin02 = 2, /// /// The pin03 /// Pin03 = 3, /// /// The pin04 /// Pin04 = 4, /// /// The pin05 /// Pin05 = 5, /// /// The pin06 /// Pin06 = 6, /// /// The pin07 /// Pin07 = 7, /// /// The pin08 /// Pin08 = 8, /// /// The pin09 /// Pin09 = 9, /// /// The pin10 /// Pin10 = 10, /// /// The pin11 /// Pin11 = 11, /// /// The pin12 /// Pin12 = 12, /// /// The pin13 /// Pin13 = 13, /// /// The pin14 /// Pin14 = 14, /// /// The pin15 /// Pin15 = 15, /// /// The pin16 /// Pin16 = 16, /// /// The pin17 /// Pin17 = 17, /// /// The pin18 /// Pin18 = 18, /// /// The pin19 /// Pin19 = 19, /// /// The pin20 /// Pin20 = 20, /// /// The pin21 /// Pin21 = 21, /// /// The pin22 /// Pin22 = 22, /// /// The pin23 /// Pin23 = 23, /// /// The pin24 /// Pin24 = 24, /// /// The pin25 /// Pin25 = 25, /// /// The pin26 /// Pin26 = 26, /// /// The pin27 /// Pin27 = 27, /// /// The pin28 /// Pin28 = 28, /// /// The pin29 /// Pin29 = 29, /// /// The pin30 /// Pin30 = 30, /// /// The pin31 /// Pin31 = 31, } /// /// Enumerates the different pins on the P1 Header /// as commonly referenced by Raspberry Pi Documentation. /// Enumeration values correspond to the physical pin number. /// public enum P1 { /// /// Header P1, GPIO Pin 02 /// Gpio02 = 3, /// /// Header P1, GPIO Pin 03 /// Gpio03 = 5, /// /// Header P1, GPIO Pin 04 /// Gpio04 = 7, /// /// Header P1, GPIO Pin 17 /// Gpio17 = 11, /// /// Header P1, GPIO Pin 27 /// Gpio27 = 13, /// /// Header P1, GPIO Pin 22 /// Gpio22 = 15, /// /// Header P1, GPIO Pin 10 /// Gpio10 = 19, /// /// Header P1, GPIO Pin 09 /// Gpio09 = 21, /// /// Header P1, GPIO Pin 11 /// Gpio11 = 23, /// /// Header P1, GPIO Pin 05 /// Gpio05 = 29, /// /// Header P1, GPIO Pin 06 /// Gpio06 = 31, /// /// Header P1, GPIO Pin 13 /// Gpio13 = 33, /// /// Header P1, GPIO Pin 19 /// Gpio19 = 35, /// /// Header P1, GPIO Pin 26 /// Gpio26 = 37, /// /// Header P1, GPIO Pin 14 /// Gpio14 = 8, /// /// Header P1, GPIO Pin 15 /// Gpio15 = 10, /// /// Header P1, GPIO Pin 18 /// Gpio18 = 12, /// /// Header P1, GPIO Pin 23 /// Gpio23 = 16, /// /// Header P1, GPIO Pin 24 /// Gpio24 = 18, /// /// Header P1, GPIO Pin 25 /// Gpio25 = 22, /// /// Header P1, GPIO Pin 08 /// Gpio08 = 24, /// /// Header P1, GPIO Pin 07 /// Gpio07 = 26, /// /// Header P1, GPIO Pin 12 /// Gpio12 = 32, /// /// Header P1, GPIO Pin 16 /// Gpio16 = 36, /// /// Header P1, GPIO Pin 20 /// Gpio20 = 38, /// /// Header P1, GPIO Pin 21 /// Gpio21 = 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, GPIO Pin 28 /// Gpio28 = 3, /// /// Header P5, GPIO Pin 29 /// Gpio29 = 4, /// /// Header P5, GPIO Pin 30 /// Gpio30 = 5, /// /// Header P5, GPIO Pin 31 /// Gpio31 = 6 } /// /// Defines the different pin capabilities /// public enum PinCapability { /// /// General Purpose capability: Digital and Analog Read/Write /// GP, /// /// General Purpose Clock (not PWM) /// GPCLK, /// /// i2c data channel /// I2CSDA, /// /// i2c clock channel /// I2CSCL, /// /// SPI Master Out, Slave In channel /// SPIMOSI, /// /// SPI Master In, Slave Out channel /// SPIMISO, /// /// SPI Clock channel /// SPICLK, /// /// SPI Chip Select Channel /// SPICS, /// /// UART Request to Send Channel /// UARTRTS, /// /// UART Transmit Channel /// UARTTXD, /// /// UART Receive Channel /// UARTRXD, /// /// Hardware Pule Width Modulation /// PWM } /// /// Defines the SPI channel numbers /// internal enum SpiChannelNumber { /// /// The channel 0 /// Channel0 = 0, /// /// The channel 1 /// Channel1 = 1, } /// /// Defines GPIO controller initialization modes /// internal enum ControllerMode { /// /// The not initialized /// NotInitialized, /// /// The direct with wiring pi pins /// DirectWithWiringPiPins, /// /// The direct with BCM pins /// DirectWithBcmPins, /// /// The direct with header pins /// DirectWithHeaderPins, /// /// The file stream with hardware pins /// FileStreamWithHardwarePins, } }