{"id":28650561,"url":"https://github.com/cmst0us/u8g2kit","last_synced_at":"2026-04-24T22:38:05.098Z","repository":{"id":294058580,"uuid":"777252645","full_name":"CmST0us/U8g2Kit","owner":"CmST0us","description":"Swift Package For U8g2","archived":false,"fork":false,"pushed_at":"2025-12-28T07:36:36.000Z","size":12595,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-30T14:51:07.347Z","etag":null,"topics":["display","oled","swift","swift-package","u8g2"],"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/CmST0us.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-25T13:57:19.000Z","updated_at":"2025-12-28T07:36:39.000Z","dependencies_parsed_at":"2025-05-18T18:49:12.220Z","dependency_job_id":null,"html_url":"https://github.com/CmST0us/U8g2Kit","commit_stats":null,"previous_names":["cmst0us/u8g2kit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CmST0us/U8g2Kit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CmST0us%2FU8g2Kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CmST0us%2FU8g2Kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CmST0us%2FU8g2Kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CmST0us%2FU8g2Kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CmST0us","download_url":"https://codeload.github.com/CmST0us/U8g2Kit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CmST0us%2FU8g2Kit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32243792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["display","oled","swift","swift-package","u8g2"],"created_at":"2025-06-13T05:06:28.334Z","updated_at":"2026-04-24T22:38:05.062Z","avatar_url":"https://github.com/CmST0us.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# U8g2Kit\n\n[![Swift](https://img.shields.io/badge/Swift-5.10-orange.svg)](https://swift.org)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\nU8g2Kit 是一个用于 Swift 的 U8g2 图形库封装，它提供了简单易用的 API 来驱动各种 OLED 显示屏。本项目基于著名的 [U8g2](https://github.com/olikraus/u8g2) 库，并添加了 Swift 的原生支持。\n\n## ✨ 特性\n\n- 🚀 完整的 U8g2 功能支持\n- 📱 支持多种 OLED 显示屏\n- 🎮 内置 SDL2 模拟器，方便开发和调试\n- 🛠 简单易用的 Swift API\n- 📦 Swift Package Manager 支持\n\n## 📋 系统要求\n\n- Swift 5.10 或更高版本\n- Linux\n- 支持 SDL2 的系统环境\n\n## 📦 安装\n\n### Swift Package Manager\n\n在您的 `Package.swift` 文件中添加以下依赖：\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/CmST0us/U8g2Kit.git\", branch: \"main\")\n]\n```\n\n## 🚀 快速开始\n\n```swift\nimport U8g2Kit\nimport CU8g2\n\n// 创建自定义驱动\nclass MyDriver: Driver {\n    init() {\n        // 使用 u8g2_SetupBuffer_SDL_256x128 作为示例\n        super.init(u8g2_SetupBuffer_SDL_256x128, \u0026u8g2_cb_r0)\n    }\n}\n\n// 初始化驱动\nlet driver = MyDriver()\n\n// 初始化显示\ndriver.withUnsafeU8g2 { u8g2 in\n    u8g2_InitDisplay(u8g2)\n}\n\n// 绘制内容\ndriver.withUnsafeU8x8 { u8x8 in\n    u8x8_ClearDisplay(u8x8)\n    u8x8_SetFont(u8x8, u8x8_font_7x14_1x2_f)\n    u8x8_Draw1x2String(u8x8, 0, 0, \"Hello World!\")\n    u8x8_Draw2x2String(u8x8, 0, 4, \"Hello World!\")\n}\n```\n\n## 🎮 模拟器\n\nU8g2Kit 包含一个基于 SDL2 的模拟器，可以帮助您在开发过程中进行调试。模拟器提供了一个 256x128 的显示窗口，并支持基本的显示功能：\n\n```swift\nimport U8g2Kit\nimport CU8g2\nimport SDL2\n\n// 创建 SDL2 驱动\nclass SDL2Driver: Driver {\n    init() {\n        super.init(u8g2_SetupBuffer_SDL_256x128, \u0026u8g2_cb_r0)\n    }\n}\n\n// 初始化并运行模拟器\nlet driver = SDL2Driver()\ndriver.withUnsafeU8g2 { u8g2 in\n    u8g2_InitDisplay(u8g2)\n}\n\n// 在模拟器中绘制内容\ndriver.withUnsafeU8x8 { u8x8 in\n    u8x8_ClearDisplay(u8x8)\n    u8x8_SetFont(u8x8, u8x8_font_7x14_1x2_f)\n    u8x8_Draw1x2String(u8x8, 0, 0, \"Hello World!\")\n    u8x8_Draw2x2String(u8x8, 0, 4, \"Hello World!\")\n}\n```\n\n## 📚 文档\n\n详细的 API 文档请参考 [Documentation](docs/API.md)。\n\n## 🤝 贡献\n\n欢迎提交 Pull Request 和 Issue！\n\n## 📄 许可证\n\n本项目采用 MIT 许可证 - 详见 [LICENSE](LICENSE) 文件。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmst0us%2Fu8g2kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmst0us%2Fu8g2kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmst0us%2Fu8g2kit/lists"}