esp32驱动SSD1351(中景园OLED)
方案一:Arduino esp32
经过一番折腾,终于运行了。
参考:Arduino
方案二:esp-idf
分支一:使用esp官方spi库
报错
` > Executing task: cmake --build . <
[1/5] Performing build step for 'bootloader'
ninja: no work to do.
[2/3] Linking CXX executable spi_master.elf
FAILED: spi_master.elf省略
-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: esp-idf/freertos/libfreertos.a(port_common.c.obj)😦.literal.main_task+0x10): undefined reference to 'app_main'
/Users/workspace/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: esp-idf/freertos/libfreertos.a(port_common.c.obj): in function 'main_task':
/Users/workspace/esp/esp-idf/components/freertos/port/port_common.c:122: undefined reference to 'app_main'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
终端进程已终止,退出代码: 1
For the ESP-IDF framework, the main() function needs to be named app_main()
查了esp官方文档,需要main文件夹及component文件,参考官方example
分支二:软件模拟spi
spi要用到的管脚:cs,dc,scl,sda
把uint8_t拆分成8个位,分别对管脚使能0/1
伪代码for(i=0;i<8;i++) //传送8bit数据 { if(dat&0x80) SDIN = 1;} else {SDIN = 0;} SCLK = 0; dat = dat << 1; SCLK = 1;
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」