/// +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= /// <summary> /// Constructor /// </summary> /// <param name="gpioIDIn">The gpio we open the port on</param> /// <param name="pullUpDownMode">The pull up or pull down mode</param> /// <history> /// 01 Dec 16 Cynic - Originally written /// </history> public InputPortMM(GpioEnum gpioIDIn, GPIOPullUpDownModeEnum pullUpDownMode) : base(gpioIDIn) { // open the port OpenPort(); // set the mode SetPullUpDownModeForPort(pullUpDownMode); }
/// +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= /// <summary> /// Constructor /// </summary> /// <param name="eventInterruptModeIn">The interrupt mode</param> /// <param name="gpioIn">The GPIO this interrupt is on. /// <param name="pullUpDownMode">The pull up or pull down mode</param> /// <history> /// 01 Dec 16 Cynic - Originally written /// </history> public InterruptPortMM(GpioEnum gpioIn, GPIOPullUpDownModeEnum pullUpDownMode, InterruptMode eventInterruptModeIn) : base(gpioIn) { EventInterruptMode = eventInterruptModeIn; // setup for event detection SetEventMasks(); // open the port and turn on event detection OpenPort(); // set the mode to disable pullUpDown MMDevMem.SetGPIOPullUpDownMode(GpioCfgObject, pullUpDownMode); // set up the interrupts MMDevMem.DisableAllInterruptsAtGPIOLevel(GpioCfgObject); MMDevMem.EnableInterruptsAtGPIOLevelAccordingToEnum(GpioCfgObject, EventInterruptMode); }
/// +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= /// <summary> /// Sets the pinmux modes for the port /// </summary> /// <param name="pullUpDownMode">The pull up or pull down mode</param> /// <history> /// 01 Dec 16 Cynic - Originally written /// </history> public void SetPullUpDownModeForPort(GPIOPullUpDownModeEnum pullUpDownMode) { MMDevMem.SetGPIOPullUpDownMode(GpioCfgObject, pullUpDownMode); }