{"id":24091831,"url":"https://github.com/luhuadong/rtt-ssd1306","last_synced_at":"2025-05-07T00:41:54.698Z","repository":{"id":46077280,"uuid":"312987478","full_name":"luhuadong/rtt-ssd1306","owner":"luhuadong","description":"RT-Thread package for working with  OLEDs based on SSD1306, SH1106, SH1107 and SSD1309, supports I2C and SPI. Inspired by stm32-ssd1306.","archived":false,"fork":false,"pushed_at":"2022-08-03T07:56:44.000Z","size":29,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-03-05T02:18:37.825Z","etag":null,"topics":["rt-thread"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luhuadong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-15T08:21:10.000Z","updated_at":"2022-08-03T08:01:35.000Z","dependencies_parsed_at":"2022-08-24T02:11:24.413Z","dependency_job_id":null,"html_url":"https://github.com/luhuadong/rtt-ssd1306","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luhuadong%2Frtt-ssd1306","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luhuadong%2Frtt-ssd1306/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luhuadong%2Frtt-ssd1306/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luhuadong%2Frtt-ssd1306/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luhuadong","download_url":"https://codeload.github.com/luhuadong/rtt-ssd1306/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233312324,"owners_count":18657026,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rt-thread"],"created_at":"2025-01-10T07:44:44.178Z","updated_at":"2025-01-10T07:45:41.856Z","avatar_url":"https://github.com/luhuadong.png","language":"C","funding_links":[],"categories":["Packages"],"sub_categories":["Peripherals"],"readme":"# rtt-ssd1306\nRT-Thread package for working with  OLEDs based on SSD1306, SH1106, SH1107 and SSD1309, supports I2C and SPI. Inspired by stm32-ssd1306.\n\n\n\n## 1、介绍\n\nssd1306 是兼容基于 SSD1306、SH1106、SH1107 和 SSD1309 的 OLED 驱动软件包，支持 I2C 和 SPI 接口。参考 afiskon 的 [stm32-ssd1306](git@github.com:afiskon/stm32-ssd1306.git) 项目进行移植，对接 RT-Thread 操作系统。\n\n目前支持 RT-Thread 软件 I2C 接口，后续将完善对硬件 I2C 和 SPI 的支持。\n\n\n\n### 1.1 目录结构\n\n| 名称     | 说明       |\n| -------- | ---------- |\n| examples | 例子目录   |\n| inc      | 头文件目录 |\n| src      | 源代码目录 |\n| tools    | 工具目录   |\n\n\n\n### 1.2 许可证\n\nssd1306 软件包遵循 MIT 许可，详见 `LICENSE` 文件。\n\n\n\n## 2、获取 ssd1306 软件包\n\n使用 ssd1306 package 需要在 RT-Thread 的包管理器中选择它，具体路径如下：\n\n```\nRT-Thread online packages ---\u003e\n    peripheral libraries and drivers ---\u003e\n        [*] ssd1306: OLEDs based on SSD1306, SH1106, SH1107 and SSD1309 driver  ---\u003e\n```\n\n然后让 RT-Thread 的包管理器自动更新，或者使用 `pkgs --update` 命令更新包到 BSP 中。\n\n\n\n## 3、API 说明\n\n### 初始化\n\n```c\nvoid ssd1306_Init(void);\n```\n\n### 填充\n\n```c\nvoid ssd1306_Fill(SSD1306_COLOR color);\n```\n\n### 刷新屏幕\n\n```c\nvoid ssd1306_UpdateScreen(void);\n```\n\n### 画像素\n\n```c\nvoid ssd1306_DrawPixel(uint8_t x, uint8_t y, SSD1306_COLOR color);\n```\n\n### 打印字符\n\n```c\nchar ssd1306_WriteChar(char ch, FontDef Font, SSD1306_COLOR color);\n```\n\n### 打印字符串\n\n```c\nchar ssd1306_WriteString(char* str, FontDef Font, SSD1306_COLOR color);\n```\n\n### 设置光标\n\n```c\nvoid ssd1306_SetCursor(uint8_t x, uint8_t y);\n```\n\n### 画直线\n\n```c\nvoid ssd1306_Line(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, SSD1306_COLOR color);\n```\n\n### 画弧线\n\n```c\nvoid ssd1306_DrawArc(uint8_t x, uint8_t y, uint8_t radius, uint16_t start_angle, uint16_t sweep, SSD1306_COLOR color);\n```\n\n### 画圆\n\n```c\nvoid ssd1306_DrawCircle(uint8_t par_x, uint8_t par_y, uint8_t par_r, SSD1306_COLOR color);\n```\n\n### 画折线\n\n```c\nvoid ssd1306_Polyline(const SSD1306_VERTEX *par_vertex, uint16_t par_size, SSD1306_COLOR color);\n```\n\n### 画矩形\n\n```c\nvoid ssd1306_DrawRectangle(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, SSD1306_COLOR color);\n```\n\n\n\n## 4、联系方式\n\n- 维护：luhuadong@163.com\n- 主页：\u003chttps://github.com/luhuadong/rtt-ssd1306\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluhuadong%2Frtt-ssd1306","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluhuadong%2Frtt-ssd1306","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluhuadong%2Frtt-ssd1306/lists"}