在线时间411 小时
UID3313981
注册时间2019-7-22
NXP金币3419
TA的每日心情 | 开心 3 天前 |
---|
签到天数: 750 天 连续签到: 2 天 [LV.10]以坛为家III
金牌会员
 
- 积分
- 4741
- 最后登录
- 2025-9-28
|
使用MCX N947 开发板驱动 HC35001 显示屏 显示,下面是详细的硬件连接、驱动配置和性能优化方案:
了解一下屏的相关知识
HC35001 屏幕规格
分辨率:320x480 (常见于3.5寸屏)
接口类型:RGB 并行接口(16/18位,需确认)或 8080 并行接口
供电电压:3.3V(逻辑电平) + 5V(背光)
控制芯片:可能为 ILI9488 或类似(需确认初始化序列)
MCX N947 接口选择
显示结果 :
图1
图2
下面开始软件操作:
打样示例导入示例
lmport sDK example(s)..
找到frdmmcxn947,前提是要安装frdmmcxn947的SDK才会有。
找到相关的Ivgl_demo.
打开后,并调试,再运行。
参考代码:
- void DEMO_LCD_I2C_Init(void)
- {
- BOARD_LPI2C_Init(BOARD_TOUCH_I2C, BOARD_TOUCH_I2C_CLOCK_FREQ);
- }
- status_t DEMO_LCD_I2C_Send(
- uint8_t deviceAddress, uint32_t subAddress, uint8_t subaddressSize, const uint8_t *txBuff, uint8_t txBuffSize)
- {
- return BOARD_LPI2C_Send(BOARD_TOUCH_I2C, deviceAddress, subAddress, subaddressSize, (uint8_t *)txBuff, txBuffSize);
- }
- status_t DEMO_LCD_I2C_Receive(
- uint8_t deviceAddress, uint32_t subAddress, uint8_t subaddressSize, uint8_t *rxBuff, uint8_t rxBuffSize)
- {
- return BOARD_LPI2C_Receive(BOARD_TOUCH_I2C, deviceAddress, subAddress, subaddressSize, rxBuff, rxBuffSize);
- }
复制代码- // 配置 FlexIO 为 8080 写时序
- void FLEXIO_8080_Init(void) {
- CLOCK_EnableClock(kCLOCK_Flexio0);
- FLEXIO_Reset(FLEXIO0);
-
- // 数据线配置为输出
- for (uint8_t i = 0; i < 16; i++) {
- FLEXIO_SetPinMux(FLEXIO0, i, kFLEXIO_PinEnableOutput);
- }
-
- // WR 信号配置
- const flexio_timer_config_t timerConfig = {
- .triggerSelect = kFLEXIO_TimerTriggerOnPinActive,
- .timerMode = kFLEXIO_TimerModeDual8BitBaudBit,
- .timerOutput = kFLEXIO_TimerOutputToggleOnTimerDisable,
- .timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClock,
- .timerCompare = 1 // WR 脉冲宽度 = 2*(compare+1)/FlexIO_clock
- };
- FLEXIO_SetTimerConfig(FLEXIO0, 0, &timerConfig);
- FLEXIO_StartTimer(FLEXIO0, 1U << 0);
- }
复制代码- void HC35001_Init(void) {
- // 硬件复位
- GPIO_WritePinOutput(RESET_PIN, 0);
- delay_ms(50);
- GPIO_WritePinOutput(RESET_PIN, 1);
- delay_ms(120);
-
- // 初始化命令序列 (以 ILI9488 为例)
- SendCmd(0x11); // Sleep out
- delay_ms(20);
- SendCmd(0x3A); // Pixel format
- SendData(0x55); // 16-bit/pixel
- SendCmd(0x36); // Memory Access Control
- SendData(0x48); // BGR order, Horizontal flip
- SendCmd(0x21); // Display Inversion On
- SendCmd(0x29); // Display On
- }
复制代码
|
|