您尚未登录。

#2 Re: 全志 SOC » 模仿stm32标准库风格写的库文件(f1c100s/f1c200s),且已移植了rt-thread、lvgl、fatfs、cherryusb » 2024-03-16 22:24:42

cqwangsf wrote:

cqwangsf wrote:

有偿求助!
有偿求助!
有偿求助!
在这个工程里面调试通了freetype。通过SD卡的字体文件来显示汉字!

有朋友用这个工程的SDIO的驱动么,我这边发现SDIO初始化出错了。有偿求助!QQ、WX:910887181

顶一下,为了让大佬看到

#4 Re: 全志 SOC » 模仿stm32标准库风格写的库文件(f1c100s/f1c200s),且已移植了rt-thread、lvgl、fatfs、cherryusb » 2024-03-09 14:52:34

cqwangsf wrote:

有偿求助!
有偿求助!
有偿求助!
在这个工程里面调试通了freetype。通过SD卡的字体文件来显示汉字!

有朋友用这个工程的SDIO的驱动么,我这边发现SDIO初始化出错了。有偿求助!QQ、WX:910887181

#5 Re: 全志 SOC » 模仿stm32标准库风格写的库文件(f1c100s/f1c200s),且已移植了rt-thread、lvgl、fatfs、cherryusb » 2024-03-06 11:09:39

有偿求助!
有偿求助!
有偿求助!
在这个工程里面调试通了freetype。通过SD卡的字体文件来显示汉字!

#6 Re: 全志 SOC » 模仿stm32标准库风格写的库文件(f1c100s/f1c200s),且已移植了rt-thread、lvgl、fatfs、cherryusb » 2024-03-06 11:07:42

cqwangsf wrote:

有朋友把这触摸改成电阻屏么如NS2009

经过2天努力终于把NS2009搞通了。 为了简单直接在gt911里面修改的!

共享一下代码:

修改GT911.C的GT911_Read_XY

void GT911_Read_XY(tp_dev_t * tp_devx)
{

#ifdef USE_NS2009 //NS2009 电阻屏

uint16_t x, y, z1;

z1=ns2009_read(NS2009_READ_Z1_LOW_POWER_12BIT);
//if ((z1 >= NS2009_PEN_UP_Z1_ERR) &&(z1 <2000))
if ((z1 >= NS2009_PEN_UP_Z1_ERR))
{
x=ns2009_read(NS2009_READ_X_LOW_POWER_12BIT);
y=ns2009_read(NS2009_READ_Y_LOW_POWER_12BIT);
tp_devx->status = 1;
tp_devx->x=(x-X_Origin)*X_Adapt_Width/X_Width;
tp_devx->y=(y-Y_Origin)*Y_Adapt_Heigth/Y_Heigth;
}
else
{
tp_devx->status = 0;
}

#else//gt911 电容屏

uint8_t touch_status, touch_num, temp, buf[5];
GT911_Read_Reg(GT_GSTID_REG, &touch_status, 1);
touch_num = touch_status & 0x0F;
if(touch_status)
{
if(touch_num)
{
tp_devx->status = 1;

GT911_Read_Reg(GT9x_TP1, buf, 4); //读取XY坐标值
tp_devx->x = (((uint16_t)buf[1] << 8) + buf[0]);
tp_devx->y = (((uint16_t)buf[3] << 8) + buf[2]);
}
else
{
tp_devx->status = 0;
}
temp = 0;
GT911_Write_Reg(GT_GSTID_REG, &temp, 1); // 清除READY标志
}

#endif

}

在gt911.h

增加

#define USE_NS2009 1

#ifdef USE_NS2009

#define POLL_INTERVAL 30

/ this driver uses 12-bit readout /
#define MAX_12BIT 0xfff

#define TOUCH_I2C_NAME "i2c0"
#define NS2009_Device_ID "ns2009"

#define NS2009_READ_X_LOW_POWER_12BIT 0xc0
#define NS2009_READ_Y_LOW_POWER_12BIT 0xd0
#define NS2009_READ_Z1_LOW_POWER_12BIT 0xe0
#define NS2009_READ_Z2_LOW_POWER_12BIT 0xf0

#define NS2009_DEF_X_FUZZ 32
#define NS2009_DEF_Y_FUZZ 16

#define NS2009_PEN_UP_Z1_ERR 60

#define NS2009_Addr (0x90>>1)

#define TP_THREAD_PRIORITY 25
#define TP_THREAD_STACK_SIZE 512
#define TP_THREAD_TIMESLICE 5

#define X_Origin 300
#define X_Width (3870-300)
#define X_Adapt_Width 800

#define Y_Origin 380
#define Y_Heigth (3900-380)
#define Y_Adapt_Heigth 480

#endif

在f1cx00s_i2c.c增加一个 ns2009_read

uint16_t ns2009_read(uint8_t _cmd)
{
uint8_t Data[2];
uint16_t tp_adc;
I2C_Start(I2C0);
I2C_Send_Data(I2C0, NS2009_ADDR_WRITE);
I2C_Send_Data(I2C0, _cmd);
I2C_Stop(I2C0);
I2C_Start(I2C0);
I2C_Send_Data(I2C0, NS2009_ADDR_READ);
I2C_Receive_Data(I2C0, &Data, 2);
I2C_Stop(I2C0);
tp_adc=((uint16_t)Data[0]<<8)+Data[1];
tp_adc=(tp_adc>>4)&0xfff;
return tp_adc;
}

通过这个 #define USE_NS2009 1 控制使用NS2009 还是GT911

#8 Re: 全志 SOC » 模仿stm32标准库风格写的库文件(f1c100s/f1c200s),且已移植了rt-thread、lvgl、fatfs、cherryusb » 2024-02-02 18:21:05

cqwangsf wrote:

有偿求助
有偿求助
有偿求助

1这个好牛呀,我也想用这个方式开发,不过我是新手,我按说明装了编译不了,有朋友能帮助指导完成编译么,有偿求助,QQ910887181

在国际友人的帮助下,编译成功,非常感谢。等待板子到手试试速度!

#9 Re: 全志 SOC » 模仿stm32标准库风格写的库文件(f1c100s/f1c200s),且已移植了rt-thread、lvgl、fatfs、cherryusb » 2024-02-01 12:31:32

有偿求助
有偿求助
有偿求助

1这个好牛呀,我也想用这个方式开发,不过我是新手,我按说明装了编译不了,有朋友能帮助指导完成编译么,有偿求助,QQ910887181

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn


东莞哇酷科技有限公司开发