# GPIO_IOEXPANSORiMX51 Class Reference

General Purpose Input Output class This class manage the GPIO expansor on the DevBoard using the I2C driver. More...

Inheritance diagram for GPIO_IOEXPANSORiMX51:

List of all members.

## Public Member Functions
| GPIO_IOEXPANSORiMX51 (uint PinNumber)
| Constructor, need pin number.
| GPIO_IOEXPANSORiMX51 (uint PinNumber, DirectionValue PinDirection)
| Constructor, need pin number and direction.
| GPIO_IOEXPANSORiMX51 (uint PinNumber, DirectionValue PinDirection, IoValue PinValue)
| Constructor, need pin number, direction and pin value.
override int | Wait ()
| Not supported.
override bool | Poll (IoValue value, uint tries, int sleep)
| Function that makes a polling of the pin.
## Properties
override DirectionValue | Direction`[get, set]`
| Get/Set direction property of the gpio (use DirectionValue constants).
override IrqValue | IrqMode`[get, set]`
| Not supported.
override bool | Block`[get, set]`
| Not supported.
override IoValue | Value`[get, set]`
| Get/Set the value of the gpio (use IoValue constants).
bool | Invert`[get, set]`
| Get/Set Invert property of the gpio (use true/false values).

## Detailed Description

General Purpose Input Output class This class manage the GPIO expansor on the DevBoard using the I2C driver.

## Constructor & Destructor Documentation

public GPIO_IOEXPANSORiMX51::GPIO_IOEXPANSORiMX51 | ( | uint | PinNumber | ) |

Constructor, need pin number.

Parameters:

  | PinNumber | Pin number to be open

public GPIO_IOEXPANSORiMX51::GPIO_IOEXPANSORiMX51 | ( | uint | PinNumber,
|  | DirectionValue | PinDirection |
| ) |  |  |

Constructor, need pin number and direction.

Parameters:

  | PinNumber | Pin number to be open
  | PinDirection | Direction of the pin (use DirectionValue constants)

public GPIO_IOEXPANSORiMX51::GPIO_IOEXPANSORiMX51 | ( | uint | PinNumber,
|  | DirectionValue | PinDirection,
|  | IoValue | PinValue |
| ) |  |  |

Constructor, need pin number, direction and pin value.

Parameters:

  | PinNumber | Pin number to be open
  | PinDirection | Direction of the pin (use DirectionValue constants)
  | PinValue | Value of the pin (use IoValue constants)

## Member Function Documentation

public override bool GPIO_IOEXPANSORiMX51::Poll | ( | IoValue | value,
|  | uint | tries,
|  | int | sleep |
| ) |  |  | `[virtual]`

Function that makes a polling of the pin.

Parameters:

  | value | Input value to be pooled (use IoValue constants)
  | tries | Number of tries to achieve the value
  | sleep | Time to wait between tries

Returns:
  true indicates success, false indicates failure

            // Wait for a specific value in the gpio configured as input
            if(mygpio.Poll(IoValue.Low,100,1))
                MessageBox.Show("poll achieved");
            else
                MessageBox.Show("poll not achieved");

Implements Digi.Drivers.GPIO.

public override int GPIO_IOEXPANSORiMX51::Wait | ( |  | ) | `[virtual]`

Not supported.

Implements Digi.Drivers.GPIO.

## Property Documentation

public override bool GPIO_IOEXPANSORiMX51::Block`[get, set]`

Not supported.

Reimplemented from Digi.Drivers.GPIO.

public override DirectionValue GPIO_IOEXPANSORiMX51::Direction`[get, set]`

Get/Set direction property of the gpio (use DirectionValue constants).

            //use DirectionValue constants (DirectionValue.Input / DirectionValue.Output)
            mygpio.Direction = DirectionValue.Input;
            DirectionValue Value = mygpio.Direction;

Reimplemented from Digi.Drivers.GPIO.

public bool GPIO_IOEXPANSORiMX51::Invert`[get, set]`

Get/Set Invert property of the gpio (use true/false values).

            //use boolean values (true/false)
            mygpio.Invert = true;
            bool Value = Invert.Value;

public override IrqValue GPIO_IOEXPANSORiMX51::IrqMode`[get, set]`

Not supported.

Reimplemented from Digi.Drivers.GPIO.

public override IoValue GPIO_IOEXPANSORiMX51::Value`[get, set]`

Get/Set the value of the gpio (use IoValue constants).

            //use IoValue constants (IoValue.High / IoValue.Low)
            mygpio.Value = IoValue.High;
            IoValue Value = mygpio.Value;

Reimplemented from Digi.Drivers.GPIO.

The documentation for this class was generated from the following file:

- C:/Documents and Settings/aramos/Desktop/Freescale i.MX51_CSharp_API/Digi.Drivers/Digi.Drivers/GPIO.cs