{"id":13819772,"url":"https://github.com/madmachineio/SwiftIO","last_synced_at":"2025-05-16T07:32:02.905Z","repository":{"id":38256803,"uuid":"194072871","full_name":"madmachineio/SwiftIO","owner":"madmachineio","description":"A Swift framework for microcontrollers abstraction layer.","archived":false,"fork":false,"pushed_at":"2025-05-04T09:02:46.000Z","size":8387,"stargazers_count":190,"open_issues_count":2,"forks_count":17,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-05-11T15:52:20.359Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://madmachineio.github.io/SwiftIO/documentation/swiftio","language":"Swift","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/madmachineio.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}},"created_at":"2019-06-27T10:15:13.000Z","updated_at":"2025-04-21T01:29:07.000Z","dependencies_parsed_at":"2023-01-21T00:45:40.505Z","dependency_job_id":"7fae5111-76b7-495d-87be-c3ee04e339e2","html_url":"https://github.com/madmachineio/SwiftIO","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madmachineio%2FSwiftIO","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madmachineio%2FSwiftIO/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madmachineio%2FSwiftIO/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madmachineio%2FSwiftIO/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madmachineio","download_url":"https://codeload.github.com/madmachineio/SwiftIO/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254488331,"owners_count":22079406,"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":[],"created_at":"2024-08-04T08:00:52.847Z","updated_at":"2025-05-16T07:32:02.364Z","avatar_url":"https://github.com/madmachineio.png","language":"Swift","readme":"# SwiftIO\n\n![build](https://github.com/madmachineio/SwiftIO/actions/workflows/build.yml/badge.svg)\n[![Discord](https://img.shields.io/discord/592743353049808899?\u0026logo=Discord\u0026colorB=7289da)](https://madmachine.io/discord)\n[![twitter](https://img.shields.io/twitter/follow/madmachineio?label=%40madmachineio\u0026style=social)](https://twitter.com/madmachineio)\n\nA Swift framework for microcontrollers. You can program microcontrollers easily without worrying about complicated low-level stuff. After downloading your project to your board, you'll get the results in real time.\n\n\n## Documentation\n\nSwiftIO library provides easy access to communicate with the external circuits simply by invoking the related classes/methods. You can read or write digital and analog signals, as well as use communication protocols.\n\nGo to [API Documentation](https://madmachineio.github.io/SwiftIO/documentation/swiftio/) for more detailed usage of all the functionalities.\n\n\n## Library structure\n\nSwiftIO contains several classes to access different functionalities of the board:\n\n* AnalogIn - read analog input\n* Counter - count the number of clock ticks\n* DigitalIn - read digital input\n* DigitalOut - set high/low digital output\n* DigitalInOut - set a digital pin as both input and output\n* FileDescriptor - perform low-level file operations\n* I2C - use the I2C protocol to communicate with other devices\n* I2SIn - receive audio data from external devices\n* I2SOut - send audio data to external devices\n* KernelTiming - global functions related to time\n* PWMOut - modulate the pulse width of signal\n* SPI - use the SPI protocol to communicate with other devices\n* Timer - set a time interval to do a specified task\n* UART - use the UART protocol to communicate with other devices\n\n\n## Usage example\n\n```swift\n// Import the SwiftIO to use the related board functions.\nimport SwiftIO\n// Import the MadBoard to decide which pin is used for the specific function.\nimport MadBoard\n\n// Initialize the onboard blue LED to control it by setting output signal.\nlet led = DigitalOut(Id.BLUE)\n​\nwhile true {\n    // Set a high voltage to turn off the onboard LED.\n    // The onboard LED needs a low voltage to be turned on due to circuit connection.\n    led.write(true)\n    sleep(ms: 1000)\n\n    // Set a low voltage to turn on the onboard LED.\n    led.write(false)\n    sleep(ms: 1000)\n}\n```\n\n## Examples\n\nBefore starting to create your project, let's start with these examples to get familiar with library usage.\n\n* [GetStarted](https://docs.madmachine.io/projects/general/getting-started/overview) - get started and learn basic skills\n* [SimpleIO](https://docs.madmachine.io/projects/general/simpleio/overview) - dive deeper into the microcontroller world and strengthen your programming skills\n\n\n## Preparation\n\nWe created the MadMachine extension for Visual Studio Code for easier usage. Please install and configure it following [this instruction](https://docs.madmachine.io/overview/getting-started/software-prerequisite).\n\nBesides, if you are more comfortable with the command line, welcome to try [mm sdk](https://github.com/madmachineio/mm-sdk).\n","funding_links":[],"categories":["Micro Controller","Swift"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadmachineio%2FSwiftIO","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadmachineio%2FSwiftIO","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadmachineio%2FSwiftIO/lists"}