/// <summary> /// 初始化GPIO输出信息 /// </summary> private void InitializeGPIO() { UInt32 Status; int bankNum = 0; DeviceInfo info = new DeviceInfo(SusiGPIO.SUSI_ID_GPIO_BANK((UInt32)bankNum)); Status = SusiGPIO.SusiGPIOGetCaps(info.ID, SusiGPIO.SUSI_ID_GPIO_OUTPUT_SUPPORT, out info.SupportOutput); if (Status != SusiStatus.SUSI_STATUS_SUCCESS) { //添加日志信息 return; } DevList.Add(info); }
/// <summary> /// 设置引脚电平高位 /// </summary> /// <param name="ID">引脚ID</param> /// <returns>设置成功与否</returns> public bool SetHighLevel(UInt32 ID = 0) { if (bSusiIoctl) { UInt32 Status; UInt32 Value = Convert.ToUInt32("0", 2); Status = SusiGPIO.SusiGPIOSetLevel(ID, 1, Value); if (Status != SusiStatus.SUSI_STATUS_SUCCESS) { return(false); } Thread.Sleep(500); } return(true); }
/// <summary> /// 初始化GPIO输出信息 /// </summary> private void InitializeGPIO() { UInt32 Status; int bankNum = 0; DeviceInfo info = new DeviceInfo(SusiGPIO.SUSI_ID_GPIO_BANK((UInt32)bankNum)); Status = SusiGPIO.SusiGPIOGetCaps(info.ID, SusiGPIO.SUSI_ID_GPIO_OUTPUT_SUPPORT, out info.SupportOutput); if (Status != SusiStatus.SUSI_STATUS_SUCCESS) { throw new Exception("Call SusiGPIOGetCaps Failed"); } else { DevList.Add(info); } }