Skip to content

A thin unifying API atop the peripherals in the Broadcom microprocessors used in the Raspberry Pi boards.

License

Notifications You must be signed in to change notification settings

cleverca22/broadcom-peripherals

 
 

Repository files navigation

Introduction

Discord Build Status

A thin unifying API atop the peripherals in the Broadcom microprocessors used in the Raspberry Pi boards. It supports the BCM2711 currently.

Branches

This repo has two primary branches:

  • main - Maintained source files.
  • main-build - auto-updated branch with generated files. Useful for submoduling the generated files into your own repo.

Using

First, add the broadcom-peripherals repo as a submodule within your own repo. For example:

git submodule add -b built https://github.com/adafruit/broadcom-peripherals.git peripherals

This will place the files from the repo in a peripherals directory. When your repo is checked out or updated from before people will need to:

git submodule update --init --recursive

The header files in broadcom define the common API between the two series. Logic with most code shared lives in a corresponding .c file. Includes are relative to the top of the repo so make sure to add the location of the library to your includes path with something like:

-Iperipherals/

In your Makefile create a variable which stores the series such as CHIP_FAMILY and alter the source files depending on it. For example:

SRC_C = \
    peripherals/samd/clocks.c \
    peripherals/samd/dma.c \
    peripherals/samd/events.c \
    peripherals/samd/external_interrupts.c \
    peripherals/samd/sercom.c \
    peripherals/samd/timers.c \
    peripherals/samd/$(CHIP_FAMILY)/adc.c \
    peripherals/$(CHIP_FAMILY)/cache.c

Building

To build the generated svd files you'll need some Python dependencies. To install them do:

pip install -r requirements.txt

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

About

A thin unifying API atop the peripherals in the Broadcom microprocessors used in the Raspberry Pi boards.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jinja 79.5%
  • C 10.9%
  • Python 7.8%
  • Assembly 1.8%