FT2232调试记录(3)

FT2232调试记录(1):
FT2232调试记录(2):
FT2232调试记录(3):

FT2232 SPI读写函数:

参照SPI提供的文档:
在这里插入图片描述

工程:在这里插入图片描述

SPI 写函数:

FT_STATUS write_byte(FT_HANDLE handle,uint8_t address, uint16_t data)
{
uint32_t sizeToTransfer = 0;
uint32_t sizeTransfered=0;
//bool writeComplete=0;
//uint32_t retry=0;
//bool state;
FT_STATUS status;
/* Write command EWEN(with CS_High -> CS_Low) */
sizeToTransfer=11;
sizeTransfered=0;
byOutputBuffer[0]=0x9F;/* SPI_EWEN -> binary 10011xxxxxx (11bits) */
byOutputBuffer[1]=0xFF;
status = SPI_Write(handle, byOutputBuffer, sizeToTransfer, ( (unsigned long *)(&sizeTransfered) ),
SPI_TRANSFER_OPTIONS_SIZE_IN_BITS|
SPI_TRANSFER_OPTIONS_CHIPSELECT_ENABLE|
SPI_TRANSFER_OPTIONS_CHIPSELECT_DISABLE);
APP_CHECK_STATUS(status);/* CS_High + Write command + Address */
sizeToTransfer=1;
sizeTransfered=0;
byOutputBuffer[0] = 0xA0;/* Write command (3bits) */
byOutputBuffer[0] = byOutputBuffer[0] | ( ( address >> 3) & 0x0F );/*5 most significant add bits*/
status = SPI_Write(handle, byOutputBuffer, sizeToTransfer, ( (unsigned long *)(&sizeTransfered) ),
SPI_TRANSFER_OPTIONS_SIZE_IN_BYTES|
SPI_TRANSFER_OPTIONS_CHIPSELECT_ENABLE);
APP_CHECK_STATUS(status);
/*Write 3 least sig address bits */
sizeToTransfer=3;
sizeTransfered=0;
byOutputBuffer[0] = ( address & 0x07 ) << 5; /* least significant 3 address bits */
status = SPI_Write(handle, byOutputBuffer, sizeToTransfer, ( (unsigned long *)(&sizeTransfered) ),
SPI_TRANSFER_OPTIONS_SIZE_IN_BITS);
APP_CHECK_STATUS(status);
/* Write 2 byte data + CS_Low */
sizeToTransfer=2;
sizeTransfered=0;
byOutputBuffer[0] = (uint8_t)(data & 0xFF);
byOutputBuffer[1] = (uint8_t)((data & 0xFF00)>>8);
status = SPI_Write(handle, byOutputBuffer, sizeToTransfer, ( (unsigned long *)(&sizeTransfered) ),
SPI_TRANSFER_OPTIONS_SIZE_IN_BYTES|
SPI_TRANSFER_OPTIONS_CHIPSELECT_DISABLE);
APP_CHECK_STATUS(status);/* Wait until D0 is high */
#if 1/* Strobe Chip Select */
sizeToTransfer=0;
sizeTransfered=0;
status = SPI_Write(handle, byOutputBuffer, sizeToTransfer, ( (unsigned long *)(&sizeTransfered) ),
SPI_TRANSFER_OPTIONS_SIZE_IN_BITS|
SPI_TRANSFER_OPTIONS_CHIPSELECT_ENABLE);
APP_CHECK_STATUS(status);
#ifndef __linux__
Sleep(10);
#endif
sizeToTransfer=0;
sizeTransfered=0;
status = SPI_Write(handle, byOutputBuffer, sizeToTransfer, ( (unsigned long *)(&sizeTransfered) ),
SPI_TRANSFER_OPTIONS_SIZE_IN_BITS|
SPI_TRANSFER_OPTIONS_CHIPSELECT_DISABLE);
APP_CHECK_STATUS(status);
#else
retry=0;
state=FALSE;
SPI_IsBusy(handle,&state);
while((FALSE==state) && (retry<SPI_WRITE_COMPLETION_RETRY))
{
printf("SPI device is busy(%u)\n",(unsigned)retry);
SPI_IsBusy(ftHandle,&state);
retry++;
}
#endif/* Write command EWEN(with CS_High -> CS_Low) */
sizeToTransfer=11;
sizeTransfered=0;
byOutputBuffer[0]=0x8F;/* SPI_EWEN -> binary 10011xxxxxx (11bits) */
byOutputBuffer[1]=0xFF;
status = SPI_Write(handle, byOutputBuffer, sizeToTransfer, ( (unsigned long *)(&sizeTransfered) ),
SPI_TRANSFER_OPTIONS_SIZE_IN_BITS|
SPI_TRANSFER_OPTIONS_CHIPSELECT_ENABLE|
SPI_TRANSFER_OPTIONS_CHIPSELECT_DISABLE);
APP_CHECK_STATUS(status);
return status;
}

SPI 读函数:

FT_STATUS read_byte(FT_HANDLE handle, uint8_t address, uint16_t *data)
{
uint32_t sizeToTransfer = 0;
uint32_t sizeTransfered;
//bool writeComplete=0;
//uint32_t retry=0;
//bool state;
FT_STATUS status;
/* CS_High + Write command + Address */
sizeToTransfer=1;
sizeTransfered=0;
byOutputBuffer[0] = 0xC0;/* Write command (3bits)*/
byOutputBuffer[0] = byOutputBuffer[0] | ( ( address >> 3) & 0x0F );/*5 most significant add bits*/
status = SPI_Write(handle, byOutputBuffer, sizeToTransfer, ( (unsigned long *)(&sizeTransfered) ),
SPI_TRANSFER_OPTIONS_SIZE_IN_BYTES|
SPI_TRANSFER_OPTIONS_CHIPSELECT_ENABLE);
APP_CHECK_STATUS(status);
/*Write partial address bits */
sizeToTransfer=4;
sizeTransfered=0;
byOutputBuffer[0] = ( address & 0x07 ) << 5; /* least significant 3 address bits */
status = SPI_Write(handle, byOutputBuffer, sizeToTransfer, ( (unsigned long *)(&sizeTransfered) ),
SPI_TRANSFER_OPTIONS_SIZE_IN_BITS);
APP_CHECK_STATUS(status);
/*Read 2 bytes*/
sizeToTransfer=2;
sizeTransfered=0;
status = SPI_Read(handle, byOutputBuffer, sizeToTransfer, ( (unsigned long *)(&sizeTransfered) ),
SPI_TRANSFER_OPTIONS_SIZE_IN_BYTES|
SPI_TRANSFER_OPTIONS_CHIPSELECT_DISABLE);
APP_CHECK_STATUS(status);
*data = (uint16_t)(byOutputBuffer[1]<<8);
*data = (*data & 0xFF00) | (0x00FF & (uint16_t)byOutputBuffer[0]);
return status;
}

SPI flash读写实验:

在这里插入图片描述

相关源码

bsp_ft2232.h

#ifndef BSP_FT2232_H
#define BSP_FT2232_H#include "mainwindow.h"
//#include "ui_mainwindow.h"#include<stdio.h>
#include<stdlib.h>
///* OS specific libraries */
#ifdef _WIN32
#include<windows.h>
#endif#include <windows.h>#include "../lib/ftd2xx.h"
#include "../lib/libmpsse_spi.h"
//#include "../lib/libmpsse_i2c.h"class bsp_ft2232
{
private:public:enum typePinA{pinA3=3,pinA4=4};enum typePinB{pinB3=3,pinB4=4};bsp_ft2232();int bsp_GetDevcieNumber();void bsp_ledA(enum typePinA chl,bool highlow);void bsp_ledB(enum typePinB chl,bool highlow);void bsp_ledtest(bool highlow);
};#endif // BSP_FT2232_H

bsp_ft2232.c

#include "bsp_ft2232.h"/******************************************************************************/
/* Macro and type defines*/
/******************************************************************************/
/* Helper macros */
#define APP_CHECK_STATUS(exp) {                                                                              \if(exp!=FT_OK){                                                                                          \qDebug("%s:%d:%s(): status(0x%x) != FT_OK\n",__FILE__, __LINE__, __FUNCTION__,exp);          \exit(1);                                                                                     \}else{ qDebug ("status ok!");                                                              \}                                                                                           \
};
#define CHECK_NULL(exp){                                                                                     \if(exp==NULL){                                                                                           \qDebug("%s:%d:%s(): NULL expression encountered \n",__FILE__, __LINE__, __FUNCTION__);       \exit(1);                                                                                     \}else{   qDebug ("not null !");                                                              \}                                                                                            \
};#define SPI_DEVICE_BUFFER_SIZE 256
FT_HANDLE ftHandle[2];
FT_STATUS status;
DWORD     numDevs;
ChannelConfig channelConf;
uint8_t gpio_setting[2]={0xff,0xff}; //0001 1000 =0x18;
uint8_t byOutputBuffer[SPI_DEVICE_BUFFER_SIZE];DWORD dwNumBytesToSend = 0; //Index of output buffer
DWORD dwNumBytesSent = 0;
DWORD dwNumBytesRead = 0;
DWORD dwNumInputBuffer = 0;FT_STATUS read_byte(FT_HANDLE handle, uint8_t address, uint16_t *data)
{
uint32_t sizeToTransfer = 0;
uint32_t sizeTransfered;
//bool writeComplete=0;
//uint32_t retry=0;
//bool state;
FT_STATUS status;
/* CS_High + Write command + Address */
sizeToTransfer=1;
sizeTransfered=0;
byOutputBuffer[0] = 0xC0;/* Write command (3bits)*/
byOutputBuffer[0] = byOutputBuffer[0] | ( ( address >> 3) & 0x0F );/*5 most significant add bits*/
status = SPI_Write(handle, byOutputBuffer, sizeToTransfer, ( (unsigned long *)(&sizeTransfered) ),
SPI_TRANSFER_OPTIONS_SIZE_IN_BYTES|
SPI_TRANSFER_OPTIONS_CHIPSELECT_ENABLE);
APP_CHECK_STATUS(status);
/*Write partial address bits */
sizeToTransfer=4;
sizeTransfered=0;
byOutputBuffer[0] = ( address & 0x07 ) << 5; /* least significant 3 address bits */
status = SPI_Write(handle, byOutputBuffer, sizeToTransfer, ( (unsigned long *)(&sizeTransfered) ),
SPI_TRANSFER_OPTIONS_SIZE_IN_BITS);
APP_CHECK_STATUS(status);
/*Read 2 bytes*/
sizeToTransfer=2;
sizeTransfered=0;
status = SPI_Read(handle, byOutputBuffer, sizeToTransfer, ( (unsigned long *)(&sizeTransfered) ),
SPI_TRANSFER_OPTIONS_SIZE_IN_BYTES|
SPI_TRANSFER_OPTIONS_CHIPSELECT_DISABLE);
APP_CHECK_STATUS(status);
*data = (uint16_t)(byOutputBuffer[1]<<8);
*data = (*data & 0xFF00) | (0x00FF & (uint16_t)byOutputBuffer[0]);
return status;
}FT_STATUS write_byte(FT_HANDLE handle,uint8_t address, uint16_t data)
{
uint32_t sizeToTransfer = 0;
uint32_t sizeTransfered=0;
//bool writeComplete=0;
//uint32_t retry=0;
//bool state;
FT_STATUS status;
/* Write command EWEN(with CS_High -> CS_Low) */
sizeToTransfer=11;
sizeTransfered=0;
byOutputBuffer[0]=0x9F;/* SPI_EWEN -> binary 10011xxxxxx (11bits) */
byOutputBuffer[1]=0xFF;
status = SPI_Write(handle, byOutputBuffer, sizeToTransfer, ( (unsigned long *)(&sizeTransfered) ),
SPI_TRANSFER_OPTIONS_SIZE_IN_BITS|
SPI_TRANSFER_OPTIONS_CHIPSELECT_ENABLE|
SPI_TRANSFER_OPTIONS_CHIPSELECT_DISABLE);
APP_CHECK_STATUS(status);/* CS_High + Write command + Address */
sizeToTransfer=1;
sizeTransfered=0;
byOutputBuffer[0] = 0xA0;/* Write command (3bits) */
byOutputBuffer[0] = byOutputBuffer[0] | ( ( address >> 3) & 0x0F );/*5 most significant add bits*/
status = SPI_Write(handle, byOutputBuffer, sizeToTransfer, ( (unsigned long *)(&sizeTransfered) ),
SPI_TRANSFER_OPTIONS_SIZE_IN_BYTES|
SPI_TRANSFER_OPTIONS_CHIPSELECT_ENABLE);
APP_CHECK_STATUS(status);
/*Write 3 least sig address bits */
sizeToTransfer=3;
sizeTransfered=0;
byOutputBuffer[0] = ( address & 0x07 ) << 5; /* least significant 3 address bits */
status = SPI_Write(handle, byOutputBuffer, sizeToTransfer, ( (unsigned long *)(&sizeTransfered) ),
SPI_TRANSFER_OPTIONS_SIZE_IN_BITS);
APP_CHECK_STATUS(status);
/* Write 2 byte data + CS_Low */
sizeToTransfer=2;
sizeTransfered=0;
byOutputBuffer[0] = (uint8_t)(data & 0xFF);
byOutputBuffer[1] = (uint8_t)((data & 0xFF00)>>8);
status = SPI_Write(handle, byOutputBuffer, sizeToTransfer, ( (unsigned long *)(&sizeTransfered) ),
SPI_TRANSFER_OPTIONS_SIZE_IN_BYTES|
SPI_TRANSFER_OPTIONS_CHIPSELECT_DISABLE);
APP_CHECK_STATUS(status);/* Wait until D0 is high */
#if 1/* Strobe Chip Select */
sizeToTransfer=0;
sizeTransfered=0;
status = SPI_Write(handle, byOutputBuffer, sizeToTransfer, ( (unsigned long *)(&sizeTransfered) ),
SPI_TRANSFER_OPTIONS_SIZE_IN_BITS|
SPI_TRANSFER_OPTIONS_CHIPSELECT_ENABLE);
APP_CHECK_STATUS(status);
#ifndef __linux__
Sleep(10);
#endif
sizeToTransfer=0;
sizeTransfered=0;
status = SPI_Write(handle, byOutputBuffer, sizeToTransfer, ( (unsigned long *)(&sizeTransfered) ),
SPI_TRANSFER_OPTIONS_SIZE_IN_BITS|
SPI_TRANSFER_OPTIONS_CHIPSELECT_DISABLE);
APP_CHECK_STATUS(status);
#else
retry=0;
state=FALSE;
SPI_IsBusy(handle,&state);
while((FALSE==state) && (retry<SPI_WRITE_COMPLETION_RETRY))
{
printf("SPI device is busy(%u)\n",(unsigned)retry);
SPI_IsBusy(ftHandle,&state);
retry++;
}
#endif/* Write command EWEN(with CS_High -> CS_Low) */
sizeToTransfer=11;
sizeTransfered=0;
byOutputBuffer[0]=0x8F;/* SPI_EWEN -> binary 10011xxxxxx (11bits) */
byOutputBuffer[1]=0xFF;
status = SPI_Write(handle, byOutputBuffer, sizeToTransfer, ( (unsigned long *)(&sizeTransfered) ),
SPI_TRANSFER_OPTIONS_SIZE_IN_BITS|
SPI_TRANSFER_OPTIONS_CHIPSELECT_ENABLE|
SPI_TRANSFER_OPTIONS_CHIPSELECT_DISABLE);
APP_CHECK_STATUS(status);
return status;
}bsp_ft2232::bsp_ft2232()
{FT_STATUS status;#ifdef _MSC_VER
//Init_libMPSSE();
#endifuint32_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 0=in, 1=out)*/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("\nhandle=0x%x status=0x%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("\nhandle=0x%x status=0x%x\n",ftHandle[1],status);status = SPI_InitChannel(ftHandle[1],&channelConf);APP_CHECK_STATUS(status);//    status = SPI_CloseChannel(ftHandle[1]);//    FT_DEVICE_LIST_INFO_NODE devList[2];
//    status = SPI_GetChannelInfo(0,&devList[0]);
//    APP_CHECK_STATUS(status);
//    qDebug("Information on channel number %d:\n",0);
//    /* print the dev info */
//    qDebug(" Flags=0x%x\n",devList[0].Flags);
//    qDebug(" Type=0x%x\n",devList[0].Type);
//    qDebug(" ID=0x%x\n",devList[0].ID);
//    qDebug(" LocId=0x%x\n",devList[0].LocId);
//    qDebug(" SerialNumber=%s\n",devList[0].SerialNumber);
//    qDebug(" Description=%s\n",devList[0].Description);
//    qDebug(" ftHandle=0x%x\n",devList[0].ftHandle);/*is 0 unless open*///    status = SPI_GetChannelInfo(1,&devList[1]);
//    APP_CHECK_STATUS(status);
//    qDebug("Information on channel number %d:\n",1);
//    /* print the dev info */
//    qDebug(" Flags=0x%x\n",devList[1].Flags);
//    qDebug(" Type=0x%x\n",devList[1].Type);
//    qDebug(" ID=0x%x\n",devList[1].ID);
//    qDebug(" LocId=0x%x\n",devList[1].LocId);
//    qDebug(" SerialNumber=%s\n",devList[1].SerialNumber);
//    qDebug(" Description=%s\n",devList[1].Description);
//    qDebug(" ftHandle=0x%x\n",devList[1].ftHandle);/*is 0 unless open*/}int bsp_ft2232::bsp_GetDevcieNumber()
{status = FT_CreateDeviceInfoList(&numDevs);		// Get the number of FTDI devicesAPP_CHECK_STATUS(status);qDebug("%d FTDI devices found - the count includes individual ports on a single chip\n", (int)numDevs);return  numDevs;
}void bsp_ft2232::bsp_ledA(enum typePinA chl, bool highlow)
{
uint8_t val=0;
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 val=0;FT_ReadGPIO(ftHandle[1],&val);FT_WriteGPIO(ftHandle[1],gpio_setting[1], ( highlow ? (val|(0x1<<(chl)) ) : (val&(~(0x1<<(chl))) ) ) );
}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);dwNumBytesSent=0;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);dwNumBytesSent=0;dwNumBytesToSend = 0;}
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/257356.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

tkinter-TinUI-xml实战(10)展示画廊

tkinter-TinUI-xml实战&#xff08;10&#xff09;展示画廊 引言声明文件结构核心代码主界面统一展示控件控件展示界面单一展示已有展示多类展示 最终效果在这里插入图片描述 ![](https://img-blog.csdnimg.cn/direct/286fcaa2fa5648a992a0ac79b4efad82.png) ………… 结语 引言…

问题:3【单选题】实现职业理想的一般步骤是()。 #媒体#媒体

问题&#xff1a;3【单选题】实现职业理想的一般步骤是()。 A、创业-立业-择业 B、择业-创业-立业 C、择业-立业-创业 D、立业-择业-创业 参考答案如图所示

Zabbix图形中文乱码问题(显示口口)解决办法

一 切换到zabbix安装目录assets/fonts下&#xff0c;下载字体 这里使用是nginxphp作为zabbix-web展示&#xff0c;使用find 命令查找 进入目录下&#xff0c;将原有字体备份&#xff0c;下载msyh字体 wget https://www.xxshell.com/download/sh/zabbix/ttf/msyh.ttf 二 修改配…

华为OD机试 - 分配土地( Python C C++ JavaGo JS PHP)

题目描述 从前有个村庄&#xff0c;村民们在各种田地上插上小旗子&#xff0c;每个旗子上都标识了一个数字。现在&#xff0c;村民们想要找出一个包含相同数字的最小矩形区域&#xff0c;并将这块土地分配给对村庄做出巨大贡献的村民。我们需要找出这个矩形区域的最大面积。 …

修改npm 的运行命令详解

在Node.js和npm中&#xff0c;你可以通过修改package.json文件中的scripts部分来定义和运行自定义的npm脚本。这些脚本可以是任何你希望在项目中运行的命令&#xff0c;包括启动服务器、运行测试、构建项目等。下面是一些修改npm运行命令的详解和代码示例。 修改npm运行命令的…

python 基础知识点(蓝桥杯python科目个人复习计划41)

今日复习内容&#xff1a;动态规划&#xff08;基础&#xff09; 动态规划是一种解决多阶段决策过程中最优化问题的数学方法和算法思想。它通常用于解决具有重叠子问题和最优子结构性质的问题&#xff0c;通常将问题划分为相互重叠的子问题&#xff0c;利用子问题的解来求解原…

Git分支和迭代流程

Git分支 feature分支&#xff1a;功能分支 dev分支&#xff1a;开发分支 test分支&#xff1a;测试分支 master分支&#xff1a;生产环境分支 hotfix分支&#xff1a;bug修复分支。从master拉取&#xff0c;修复并测试完成merge回master和dev。 某些团队可能还会有 reale…

移动机器人激光SLAM导航(五):Cartographer SLAM 篇

参考 Cartographer 官方文档Cartographer 从入门到精通 1. Cartographer 安装 1.1 前置条件 推荐在刚装好的 Ubuntu 16.04 或 Ubuntu 18.04 上进行编译ROS 安装&#xff1a;ROS学习1&#xff1a;ROS概述与环境搭建 1.2 依赖库安装 资源下载完解压并执行以下指令 https://pa…

Vue项目创建和nodejs使用

Vue项目创建和nodejs使用 一、环境准备1.1.安装 node.js【下载历史版本node-v14.21.3-x64】1.2.安装1.3.检查是否安装成功&#xff1a;1.4.在Node下新建两个文件夹 node_global和node_cache并设置权限1.5.配置npm在安装全局模块时的路径和缓存cache的路径1.6.配置系统变量&…

Linux多线程[二]

引入知识 进程在线程内部执行是OS的系统调度单位。 内核中针对地址空间&#xff0c;有一种特殊的结构&#xff0c;VM_area_struct。这个用来控制虚拟内存中每个malloc等申请的空间&#xff0c;来区别每个malloc的是对应的堆区哪一段。OS可以做到资源的精细度划分。 对于磁盘…

C#调用WechatOCR.exe实现本地OCR文字识别

最近遇到一个需求&#xff1a;有大量的扫描件需要还原为可编辑的文本&#xff0c;很显然需要用到图片OCR识别为文字技术。本来以为这个技术很普遍的&#xff0c;结果用了几个开源库&#xff0c;效果不理想。后来&#xff0c;用了取巧的方法&#xff0c;直接使用了WX的OCR识别模…

算法与数据结构

算法与数据结构 前言 什么是算法和数据结构&#xff1f; 你可能会在一些教材上看到这句话&#xff1a; 程序 算法 数据结构 算法&#xff08;Algorithm&#xff09;&#xff1a;是指解题方案的准确而完整的描述&#xff0c;是一系列解决问题的清晰指令&#xff0c;算法代…

【Tomcat】:One or more listeners failed to start.报错解决方案

报错信息:One or more listeners failed to start. Full details will be found in the appropriate container log file. 具体就是web.xml此配置报错: 服务器启动错误Tomcat:One or more listeners failed to start.报错解决方案 IDEA:在使用IDEA运行SSM项目的时候 , Tomcat运…

ChatGpt报错:We ran into an issue while authenticating you解决办法

在登录ChatGpt时报错&#xff1a;Oops&#xff01;,We ran into an issue while authenticating you.(我们在验证您时遇到问题)&#xff0c;记录一下解决过程。 完整报错&#xff1a; We ran into an issue while authenticating you. If this issue persists, please contact…

怎么使用ChatGPT提高工作效率?

怎么使用ChatGPT提高工作效率&#xff0c;这是一个有趣的话题。 相信不同的人有不同的观点&#xff0c;大家的知识背景和从事的工作都不完全相同&#xff0c;所以最终ChatGPT能起到的作用也不一样。 在编程过程中&#xff0c;如果我们要找一个库&#xff0c;我们最先做的肯定…

[缓存] - 2.分布式缓存重磅中间件 Redis

1. 高性能 尽量使用短key 不要存过大的数据 避免使用keys *&#xff1a;使用SCAN,来代替 在存到Redis之前压缩数据 设置 key 有效期 选择回收策略(maxmemory-policy) 减少不必要的连接 限制redis的内存大小&#xff08;防止swap&#xff0c;OOM&#xff09; slowLog …

C语言第二十三弹---指针(七)

✨个人主页&#xff1a; 熬夜学编程的小林 &#x1f497;系列专栏&#xff1a; 【C语言详解】 【数据结构详解】 指针 1、sizeof和strlen的对比 1.1、sizeof 1.2、strlen 1.3、sizeof 和 strlen的对比 2、数组和指针笔试题解析 2.1、⼀维数组 2.2、二维数组 总结 1、si…

每日五道java面试题之java基础篇(八)

第一题.CopyOnWriteArrayList的底层原理是怎样的 ⾸先CopyOnWriteArrayList内部也是⽤过数组来实现的&#xff0c;在向CopyOnWriteArrayList添加元素时&#xff0c;会复制⼀个新的数组&#xff0c;写操作在新数组上进⾏&#xff0c;读操作在原数组上进⾏并且&#xff0c;写操作…

OpenGL-ES 学习(1)---- AlphaBlend

AlphaBlend OpenGL-ES 混合本质上是将 2 个片元的颜色进行调和(一般是求和操作)&#xff0c;产生一个新的颜色 OpenGL ES 混合发生在片元通过各项测试之后&#xff0c;准备进入帧缓冲区的片元和原有的片元按照特定比例加权计算出最终片元的颜色值&#xff0c;不再是新&#xf…

Prometheus服务器、Prometheus被监控端、Grafana、监控MySQL数据库、自动发现概述、配置自动发现、Alertmanager

目录 Prometheus概述 部署Prometheus服务器 环境说明&#xff1a; 配置时间 安装Prometheus服务器 添加被监控端 部署通用的监控exporter Grafana 概述 部署Grafana 展示node1的监控信息 监控MySQL数据库 配置MySQL 配置mysql exporter 配置mysql exporter 配置…