program.cs

来自「This is a Windows CE 6.0 Board Support P」· CS 代码 · 共 31 行

CS
31
字号
//---------------------------------------------------------------------------------
// Copyright (c) 2008 David Vescovi.  All rights reserved.
//
// Exercise GPIO line via Gumstix Managed API 
//
//---------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
using Gumstix;

namespace GPIO_test
{
    class Program
    {
        static void Main(string[] args)
        {
            IO.Register.BitSet((uint)PXA270.GPIO.GPDR3, (uint)PXA270.GPIOBit.fGPIOBit101);   // GPIO 101 direction is output

            // toggle the IO line 10 times
            for (int I = 0; I < 10; I++)
            {
                IO.Register.Write((uint)PXA270.GPIO.GPSR3, (uint)PXA270.GPIOBit.fGPIOBit101);   // GPIO 101 set (1)
                System.Threading.Thread.Sleep(1000);
                IO.Register.Write((uint)PXA270.GPIO.GPCR3, (uint)PXA270.GPIOBit.fGPIOBit101);   // GPIO 101 clear (0)
                System.Threading.Thread.Sleep(1000);
            }
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?