{"id":15043645,"url":"https://github.com/abt8601/raspi-pacs","last_synced_at":"2025-04-14T23:12:13.975Z","repository":{"id":144719315,"uuid":"615616044","full_name":"abt8601/raspi-pacs","owner":"abt8601","description":"Peripheral access crates for the Broadcom microprocessors used in the Raspberry Pi boards","archived":false,"fork":false,"pushed_at":"2025-01-23T01:57:43.000Z","size":1593,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T23:12:04.846Z","etag":null,"topics":["bcm2711","bcm2835","bcm2837","raspberry-pi","rust"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abt8601.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}},"created_at":"2023-03-18T06:50:00.000Z","updated_at":"2025-01-22T17:02:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"9c9bd770-89e7-4ff0-80d1-0022788de028","html_url":"https://github.com/abt8601/raspi-pacs","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/abt8601%2Fraspi-pacs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abt8601%2Fraspi-pacs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abt8601%2Fraspi-pacs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abt8601%2Fraspi-pacs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abt8601","download_url":"https://codeload.github.com/abt8601/raspi-pacs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975329,"owners_count":21192210,"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":["bcm2711","bcm2835","bcm2837","raspberry-pi","rust"],"created_at":"2024-09-24T20:49:22.734Z","updated_at":"2025-04-14T23:12:13.946Z","avatar_url":"https://github.com/abt8601.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# raspi-pacs\n\n[![crates.io](https://img.shields.io/crates/v/bcm2835-lpa.svg?label=crates.io%20%28bcm2835-lpa%29)](https://crates.io/crates/bcm2835-lpa)\n[![docs.rs](https://img.shields.io/docsrs/bcm2835-lpa?label=docs%20%28bcm2835-lpa%29)](https://docs.rs/bcm2835-lpa)\n\n[![crates.io](https://img.shields.io/crates/v/bcm2837-lpa.svg?label=crates.io%20%28bcm2837-lpa%29)](https://crates.io/crates/bcm2837-lpa)\n[![docs.rs](https://img.shields.io/docsrs/bcm2837-lpa?label=docs%20%28bcm2837-lpa%29)](https://docs.rs/bcm2837-lpa)\n\n[![crates.io](https://img.shields.io/crates/v/bcm2711-lpa.svg?label=crates.io%20%28bcm2711-lpa%29)](https://crates.io/crates/bcm2711-lpa)\n[![docs.rs](https://img.shields.io/docsrs/bcm2711-lpa?label=docs%20%28bcm2711-lpa%29)](https://docs.rs/bcm2711-lpa)\n\nPeripheral access crates\nfor the Broadcom microprocessors used in the Raspberry Pi boards.\n\nThis repository contains the scripts\nto generate the PACs for the following MCUs:\n\n- BCM2835, found in the Raspberry Pi 1 and Zero\n- BCM2837, found in the Raspberry Pi 3 and Zero 2W\n- BCM2711, found in the Raspberry Pi 4\n\nThese PACs are generated by [`svd2rust`](https://crates.io/crates/svd2rust)\nfrom the\n[SVD files](https://github.com/adafruit/broadcom-peripherals/tree/main-build/svd/gen)\nin\n[adafruit/broadcom-peripherals](https://github.com/adafruit/broadcom-peripherals),\nsave that [patches](svd-patches/) are applied\nto add the missing tags required by `svd2rust`.\n\n## A Note on Virtual Memory\n\nThe PACs expect the memory-mapped registers of the peripherals\nto be present on their physical addresses;\ntherefore, the PACs integrate poorly with virtual memory.\nIf the register files are offset-mapped to a different base address,\nit is advised to generate the PACs by yourself from\n[our patched SVD files](https://github.com/abt8601/raspi-pacs/tree/main-build/build/svds)\nand using the `--base-address-shift` option of `svd2rust`.\n\n## Feature Flags of the PACs\n\n- `atomic`:\n  Extends the register API with operations\n  to atomically set, clear, and toggle specific bits.\n- `defmt`:\n  Include `defmt::Format` implementations.\n\n## Generating the PACs\n\n### Prerequisites for the PACs\n\n- `make`\n- `patch`\n- [Jinja2 CLI](https://pypi.python.org/pypi/jinja2-cli)\n- A Rust toolchain with `cargo` and `rustfmt`\n- [`svd2rust`](https://crates.io/crates/svd2rust)\n  (The latest version that works with our SVD files is 0.31.5.)\n- [`form`](https://crates.io/crates/form)\n  (≥ 0.11 is required for the generated PACs to be compilable on Windows.)\n\nAlso, the submodule `broadcom-peripherals` must be checked out.\n\n### Steps to Generate the PACs\n\nTo generate the PAC for a particular MCU, run:\n\n```sh\nmake build/pacs/\u003cmcu_name\u003e-lpa\n```\n\nwhere `\u003cmcu_name\u003e` is one of `bcm2835`, `bcm2837`, or `bcm2711`.\nThe generated PAC will be located in `build/pacs/\u003cmcu_name\u003e-lpa`.\nThis step also generates the patched SVD file,\nwhich is located in `build/svds/\u003cmcu_name\u003e.svd`.\n\nOr, to generate the PACs for all MCUs at once, run:\n\n```sh\nmake pacs\n```\n\n## Generating Just the SVD Files\n\n### Prerequisites for the SVD Files\n\n- `make`\n- `patch`\n\nAlso, the submodule `broadcom-peripherals` must be checked out.\n\n### Steps to Generate the SVD Files\n\nTo generate the SVD file for a particular MCU, run:\n\n```sh\nmake build/svds/\u003cmcu_name\u003e.svd\n```\n\nwhere `\u003cmcu_name\u003e` is one of `bcm2835`, `bcm2837`, or `bcm2711`.\nThe generated SVD file will be located in `build/svds/\u003cmcu_name\u003e.svd`.\n\nOr, to generate the SVD files for all MCUs at once, run:\n\n```sh\nmake svds\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabt8601%2Fraspi-pacs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabt8601%2Fraspi-pacs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabt8601%2Fraspi-pacs/lists"}