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

网站到期请续费宁波网站建设制作网络公司

网站到期请续费,宁波网站建设制作网络公司,上海建网站公司排名,湖南营销型网站建设报价FT2232调试记录 #xff08;1#xff09;获取当前连接的FTDI设备通道个数:#xff08;2#xff09;获取当前连接的设备通道的信息:#xff08;3#xff09;配置SPI的通道:#xff08;4#xff09;如何设置GPIO:#xff08;5#xff09;DEMO测试#xff1a; #参考文档… FT2232调试记录 1获取当前连接的FTDI设备通道个数:2获取当前连接的设备通道的信息:3配置SPI的通道:4如何设置GPIO:5DEMO测试 #参考文档 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.pierceye.com/news/386014/

相关文章:

  • c 网站开发用的人多吗做it行业招标网站有哪些
  • 招聘做牙技工的网站用html框架做网站
  • 本地wordpress站点上传央企网站群建设
  • 广州免费自助建站开发wordpress公园
  • 淘宝客建网站简单网站建设优化推广
  • 长沙做网站找哪家好毕业设计开题报告网站开发
  • 可以写代码的网站有哪些问题吗网页设计与网站建设期末考试试卷
  • 美工做网站怎么收费网站设计规范
  • 建网站需要注意的问题企业整合营销
  • 2018网站开发的革新wordpress 更新数据库
  • 做现金贷的网站有哪些如何自己建立一个网站
  • 网站制作公司前十名wordpress保存的字体大小
  • 网站设计思路方案海外购物网站哪个最好
  • 哪个网站做课件能赚钱青岛制作网站的
  • 深圳做网站排名公司哪家好html网页设计实训报告范文
  • 外贸网站开发做动画 的 网站有哪些软件下载
  • 中国建设银行吉林省分行官网站wordpress形式
  • 做门户网站可以用的字体黑龙江建设教育网站
  • 怎么做网站建设赚钱知名品牌设计logo解析
  • wordpress全站静态化做公司网站 找谁做
  • 广安网站建设哪家好网站模板下载网站
  • 游戏怎么做充值网站wordpress 预约主题
  • 珠海做网站三年多少钱免费ai写作网站3000字
  • 陕西建设网综合服务中心网站跨境电商怎么搞
  • 青岛做网站需要多少钱怎么在网上卖东西赚差价
  • 永康网站设计新闻门户网站建设方案
  • 个人做网站被骗洛阳电商网站建设公司排名
  • 蒙文网站建设情况汇报设计素材网站照片
  • 南京网站设计费用wordpress讨论
  • 可以做防盗水印的网站工业设计专业最好的大学