form1.cs

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

CS
60
字号
//---------------------------------------------------------------------------------
// Copyright (c) 2008 David Vescovi.  All rights reserved.
//
// Example AudiostixII interface
// Controls analog and digital I/O on UCB1400 Codec chip
//
//---------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Gumstix.AudioStix;

namespace test
{
    public partial class Form1 : Form
    {
        IO audio;

        public Form1()
        {
            UInt16 readback;

            InitializeComponent();
            audio = new IO();
            audio.SetGPIODirection(IO.GPIO.GPIO_0,IO.InOut.Output);
            readback = audio.GetGPIODirection();
        }

        private void btAD1_Click(object sender, EventArgs e)
        {
            UInt16 result;
            audio.SetAdChannel(IO.ADChannel.AD1);
            result = audio.ConvertAd();
            lblAD1.Text = result.ToString();
        }

        private void btIO0Off_Click(object sender, EventArgs e)
        {
            audio.BitClear(IO.GPIO.GPIO_0);
        }

        private void btIO0On_Click(object sender, EventArgs e)
        {
            audio.BitSet(IO.GPIO.GPIO_0);
        }

        private void btReadIO9_Click(object sender, EventArgs e)
        {
            if (audio.BitTest(IO.GPIO.GPIO_9))
                lblReadIO9.Text = "On";
            else
                lblReadIO9.Text = "Off";
        }

    }
}

⌨️ 快捷键说明

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