当前位置: 首页 > news >正文

模板网官网电脑优化是什么意思

模板网官网,电脑优化是什么意思,昆山做网站的公司有哪些,什么网站做任务能挣FT2232调试记录 #xff08;1#xff09;获取当前连接的FTDI设备通道个数:#xff08;2#xff09;获取当前连接的设备通道的信息:#xff08;3#xff09;配置SPI的通道:#xff08;4#xff09;如何设置GPIO:#xff08;5#xff09;DEMO测试#xff1a; FT2232调… FT2232调试记录 1获取当前连接的FTDI设备通道个数:2获取当前连接的设备通道的信息:3配置SPI的通道:4如何设置GPIO:5DEMO测试 FT2232调试记录1: FT2232调试记录2: FT2232调试记录3: #参考文档 1包含了FT2xxx和IIC SPI的操作手册。 相关文档:https://ftdichip.com/document/programming-guides/ 2包含了MPSSE和MCU主机总线仿真模式的命令处理器。 AN108Command Processor for MPSSE and MCU Host Bus Emulation Modes. (3)相关博客FT2232H编程流程分析 1获取当前连接的FTDI设备通道个数: status SPI_GetNumChannels((DWORD *)channels);APP_CHECK_STATUS(status);qDebug(Number of available SPI channels %d\n,channels);2获取当前连接的设备通道的信息: FT2232 有两个通道使用SPI_GetChannelInfo 获取通道信息。 FT_DEVICE_LIST_INFO_NODE devList[2];status SPI_GetChannelInfo(0,devList[0]);APP_CHECK_STATUS(status);printf(Information on channel number %d:\n,0);/* print the dev info */qDebug( Flags0x%x\n,devList[0].Flags);qDebug( Type0x%x\n,devList[0].Type);qDebug( ID0x%x\n,devList[0].ID);qDebug( LocId0x%x\n,devList[0].LocId);qDebug( SerialNumber%s\n,devList[0].SerialNumber);qDebug( Description%s\n,devList[0].Description);qDebug( ftHandle0x%x\n,devList[0].ftHandle);/*is 0 unless open*/status SPI_GetChannelInfo(1,devList[1]);APP_CHECK_STATUS(status);printf(Information on channel number %d:\n,1);/* print the dev info */qDebug( Flags0x%x\n,devList[1].Flags);qDebug( Type0x%x\n,devList[1].Type);qDebug( ID0x%x\n,devList[1].ID);qDebug( LocId0x%x\n,devList[1].LocId);qDebug( SerialNumber%s\n,devList[1].SerialNumber);qDebug( Description%s\n,devList[1].Description);qDebug( ftHandle0x%x\n,devList[1].ftHandle);/*is 0 unless open*/Information on channel number 0: Flags0x2 Type0x6 ID0x4036010 LocId0x231 SerialNumberA DescriptionDual RS232-HS A ftHandle0x0 status ok! Information on channel number 1: Flags0x2 Type0x6 ID0x4036010 LocId0x232 SerialNumberB DescriptionDual RS232-HS B ftHandle0x03配置SPI的通道: 如下举例为SPI操作通道 A (0): uint32_t channels; channelConf.ClockRate 5000; channelConf.LatencyTimer 255; channelConf.configOptions SPI_CONFIG_OPTION_MODE0 | SPI_CONFIG_OPTION_CS_DBUS3; channelConf.Pin 0x00000000;/*FinalVal-FinalDir-InitVal-InitDir (for dir 0in, 1out)*/status SPI_GetNumChannels((DWORD *)channels); APP_CHECK_STATUS(status);qDebug(Number of available SPI channels %d\n,channels);/* Open the first available channel */ status SPI_OpenChannel(0,ftHandle[0]); APP_CHECK_STATUS(status); qDebug(\nhandle0x%x status0x%x\n,ftHandle[0],status); status SPI_InitChannel(ftHandle[0],channelConf); APP_CHECK_STATUS(status);********status SPI_CloseChannel(ftHandle[0]); 4如何设置GPIO: 方式一 libmpsse 库中提供的接口FT_WriteGPIO只能支持ACBUS(BCBUS) 即高字节操作。 FT_STATUS FT_WriteGPIO(FT_HANDLE handle, uint8 dir, uint8 value) dir: 0 out 1 in value:0 low 1 high FT_STATUS FT_ReadGPIO(FT_HANDLE handle, uint8 *value) 控制引脚AC3 AC4 BC3 BC4 FT2232H有两个MPSSE通道每个通道带有两个8位端口 即ADBUS和ACBUSBDBUS和BCBUS. 其中 【低字节】 ADBUS(BDBUS)用于同步串行通信I2C/SPI/JTAG 【高字节】 ACBUS(BCBUS)可以免费用作GPIO 初始化时候打开channel: /* Open the first available channel */status SPI_OpenChannel(0,ftHandle[0]);APP_CHECK_STATUS(status);qDebug(\nhandle0x%x status0x%x\n,ftHandle[0],status);status SPI_InitChannel(ftHandle[0],channelConf);APP_CHECK_STATUS(status);// status SPI_CloseChannel(ftHandle[0]);/* Open the first available channel */status SPI_OpenChannel(1,ftHandle[1]);APP_CHECK_STATUS(status);qDebug(\nhandle0x%x status0x%x\n,ftHandle[1],status);status SPI_InitChannel(ftHandle[1],channelConf);APP_CHECK_STATUS(status);// status SPI_CloseChannel(ftHandle[1]);void bsp_ft2232::bsp_ledA(enum typePinA chl, bool highlow) { uint8_t val0; FT_ReadGPIO(ftHandle[0],val); FT_WriteGPIO(ftHandle[0],gpio_setting[0], ( highlow ? (val|(0x1(chl)) ) : (val(~(0x1(chl))) ) ) ); }void bsp_ft2232::bsp_ledB(enum typePinB chl, bool highlow) {uint8_t val0;FT_ReadGPIO(ftHandle[1],val);FT_WriteGPIO(ftHandle[1],gpio_setting[1], ( highlow ? (val|(0x1(chl)) ) : (val(~(0x1(chl))) ) ) ); }方式二 使用ftd2xx 库中提供的接口。 调用FT_Write 库。 3.6.1 Set Data bits LowByte 0x80, 0xValue, 0xDirection This will setup the direction of the first 8 lines and force a value on the bits that are set as output. A 1 in the Direction byte will make that bit an output. 3.6.2 Set Data bits High Byte 0x82, 0xValue, 0xDirection This will setup the direction of the high 8 lines and force a value on the bits that are set as output. A 1 in the Direction byte will make that bit an output. 3.6.3 Read Data bits LowByte 0x81, This will read the current state of the first 8 pins and send back 1 byte. 3.6.4 Read Data bits HighByte 0x83, This will read the current state of the high 8 pins and send back 1 byte. void bsp_ft2232::bsp_ledtest(bool highlow) {if(highlow){dwNumBytesToSend 0; byOutputBuffer[dwNumBytesToSend] 0x82; byOutputBuffer[dwNumBytesToSend] 0xFF; byOutputBuffer[dwNumBytesToSend] 0xFF; status FT_Write(ftHandle[0], byOutputBuffer, dwNumBytesToSend, dwNumBytesSent);qDebug(on %d\r\n,dwNumBytesSent);dwNumBytesSent0;dwNumBytesToSend 0;}else{dwNumBytesToSend 0; byOutputBuffer[dwNumBytesToSend] 0x82; byOutputBuffer[dwNumBytesToSend] 0x00; byOutputBuffer[dwNumBytesToSend] 0xFF; status FT_Write(ftHandle[0], byOutputBuffer, dwNumBytesToSend, dwNumBytesSent);qDebug(off %d\r\n,dwNumBytesSent);dwNumBytesSent0;dwNumBytesToSend 0;} }5DEMO测试
http://www.dnsts.com.cn/news/170135.html

相关文章:

  • cms大型门户网站北京编程培训机构哪个好
  • 网站集约化建设的建议北京建设工程交易信息平台
  • html5微网站源码网站刷排名工具
  • 如何做网站搭桥链接保险网站 源码
  • 西部数码网站管理助手 xp建设网站里的会员系统
  • 怎么用网站赚钱创建网站的好处
  • 怎么在jsp网站做验证码wordpress给文章添加固定字段
  • 网站营销定义小米公司网站前建设分析
  • 手机网站建设的重要性网站后台登陆路径
  • html5 网站开发实战沈阳新民网站建设
  • 无锡电子商务网站建设积极加强网站建设
  • 网站建设当中的技术解决方案wordpress 博客下载
  • 2023年推广网站wordpress迁移网站
  • 免费申请一个不花钱网站企业级建站
  • 原型图网站专做写字楼出租的网站
  • 北海购物网站开发设计网络营销流程
  • 亚马逊店铺出售网站电影订票网站怎么做
  • 布吉商城网站建设基本流程建设网站对于电商的作用是?
  • 网站专题素材西安百度推广运营公司
  • 物流信息网站cms修改wordpress登陆用户名和密码
  • 游戏网站开发计划书案例目录在线玩网页游戏h5网站大全
  • wordpress站群目录收录北京网络销售公司
  • 网站建设的意义以及重要性重庆网站维护
  • 江门加盟网站建设一个app的运营成本
  • 永济市做网站大气网站特点
  • wordpress 不同站点自己开发一个app多少钱
  • 做ppt选小图案的网站江苏建设网站酒店装修合同范本
  • 做个外贸网站多少费用手机app开发工资高吗
  • 网站导航栏兼容性微网站怎么免费做
  • 品牌授权网站北京网站开发月薪