{"id":21175192,"url":"https://github.com/mgoblin/stc15lib","last_synced_at":"2026-06-10T05:01:00.371Z","repository":{"id":255128406,"uuid":"848626088","full_name":"mgoblin/STC15lib","owner":"mgoblin","description":"STC15W408AS hardware abstraction layer","archived":false,"fork":false,"pushed_at":"2026-06-08T06:06:13.000Z","size":53868,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-08T06:09:16.513Z","etag":null,"topics":["8051","8051-microcontroller","mcs8051","stc","stc-mcu","stc15w408as"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mgoblin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-08-28T05:30:52.000Z","updated_at":"2026-06-08T06:06:16.000Z","dependencies_parsed_at":"2025-09-03T06:18:38.194Z","dependency_job_id":"9cfd9581-86b7-4f72-8f8d-007a84722de9","html_url":"https://github.com/mgoblin/STC15lib","commit_stats":null,"previous_names":["mgoblin/stc15lib"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/mgoblin/STC15lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgoblin%2FSTC15lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgoblin%2FSTC15lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgoblin%2FSTC15lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgoblin%2FSTC15lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mgoblin","download_url":"https://codeload.github.com/mgoblin/STC15lib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgoblin%2FSTC15lib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34137570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["8051","8051-microcontroller","mcs8051","stc","stc-mcu","stc15w408as"],"created_at":"2024-11-20T16:57:23.600Z","updated_at":"2026-06-10T05:01:00.352Z","avatar_url":"https://github.com/mgoblin.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PlatformIO Registry](https://badges.registry.platformio.org/packages/mgoblin/library/STC15%20hardware.svg)](https://registry.platformio.org/libraries/mgoblin/STC15%20hardware)\n\n![build workflow](https://github.com/mgoblin/STC15lib/actions/workflows/pages/pages-build-deployment/badge.svg)\n# What it is\nThis C-library contains hardware abstraction layer (HAL) for STC15W408AS. \n\nSTC15W408AS is a micro chip compatible with 8051 architecture.\n\n# How to use it\nThis code is published as [Platformio](https://platformio.org/) library named STC15 hardware.\n\n## Add library to your project\nAfter create Platformio project for STC15408AS add to platformio.ini line with library depandency\n\n```ini\n[env:STC15W408AS]\nplatform = intel_mcs51\nboard = STC15W408AS\nlib_deps = mgoblin/STC15 hardware@^0.17.0\n```\nWhere is 0.17.0 STC15 hardware library version.\n\nAs alternative in lib_deps line github link could be used.\n\n```ini\n[env:STC15W408AS]\nplatform = intel_mcs51\nboard = STC15W408AS\nlib_deps = https://github.com/mgoblin/STC15lib#\n```\n\nWhere is 0.17.0 STC15 hardware library github tag version.\n\nEach released library version has the tag in github repository. \n\n## Low level STC15 prorgamming\nYou can directly manipulate to MCU registers from C-code. \nSTC15Fxx.h should be included. \n\n```C\n#include \u003cSTC15Fxx.h\u003e // MCU SFR declarations\n\nvoid main()\n{\n    // Use SFR declaration to change MCU state here\n\n    P10 = 0; // As example put LED on. Pin P1.0 connected to onboard LED\n}\n```\n\n## Use STC15 HAL functions\nThis library provides hardware astraction laywer (HAL) for high level development tasks.\nPlease read the docs for library modules in Library documentation section (see the docs link).\n\nMost of HAL functionality is C-macros. \n\nThe advantage is small firmware code size because \nmacroses are expanded into application.\n\nC-Macroses have some drawbacks.\n\n1. No compiler typechecks\n2. No function call optimizations. Macroses code inlined.\n\nIf you need to use one HAL macros many times the good idea is to wrap macros by C-function.\n\n```C\n#include \u003cdelay.h\u003e\n\n#define LED P10\n#define ON 0\n#define OFF 1\n\n// Wrap delay_ms HAL macros call to C-function\nvoid f_delay_ms(uint16_t ms)\n{\n    delay_ms(ms); // This is a macros \n} \n\nvoid main()\n{\n    while(1)\n    {\n        LED = ON;\n        f_delay_ms(500);\n        LED = OFF;\n        f_delay_ms(1000);\n    }\n}\n```\n\n# Library modules maturity\n| Module name  | Description                      | Maturity           |\n|------------- |----------------------------------|--------------------|\n| ChipID       | Get chip id from ROM             | READY              |\n| Delay        | CPU cycles based delay           | READY              |\n| CPU frequency| CPU frequency slowdown           | READY              |\n| Interrupt    | Enable and disable interrupts    | READY              |\n| Power management | idle, powerdown and wakeup timer, low voltage flag        | READY              |\n| Reset        | Software reset                   | READY              |\n| Timer        | Timer control routines           | READY              |\n| Counter      | Counter control routines         | READY              |\n| UART         | Serial port **p-2-p** routines   | READY              |\n| Watchdog timer | Watchdog timer routines        | READY              |\n| GPIO          | Pin as digital in/out routines  | READY              |\n| EEPROM        | Non volatile flash memory routines   | READY         |\n| ADC           | Analog to digital converstions  | READY              |\n| Comparator    | Analog voltage comparator       | INITIAL SUPPORT    |\n\nOther modules does not implemented yet.\n\nSee examples in [https://github.com/mgoblin/STC15lib/tree/main/examples](https://github.com/mgoblin/STC15lib/tree/main/examples)\n\n# Library documentation\n[Docs](https://mgoblin.github.io/STC15lib/docs/html/index.html)\n\n# Change log\n[Change log](https://mgoblin.github.io/STC15lib/CHANGELOG.html)\n\n# References\n\n* STC datasheets: [http://stcmicro.com/sjsc.html](http://stcmicro.com/sjsc.html)\n* SDCC User Guide (PDF): [http://sdcc.sourceforge.net/doc/sdccman.pdf](http://sdcc.sourceforge.net/doc/sdccman.pdf)\n* STC programmator [https://github.com/mgoblin/STC-programmatorhttps://github.com/mgoblin/STC-programmator](https://github.com/mgoblin/STC-programmatorhttps://github.com/mgoblin/STC-programmator)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgoblin%2Fstc15lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmgoblin%2Fstc15lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgoblin%2Fstc15lib/lists"}