@@ -18,35 +18,42 @@ and will be strengthened as other people use it.
1818Using
1919======
2020First, add the samd-peripherals repo as a submodule within your own. For example:
21- `git submodule add https://github.com/adafruit/samd-peripherals.git peripherals `
21+
22+ .. code-block ::
23+
24+ git submodule add https://github.com/adafruit/samd-peripherals.git peripherals
2225
2326 This will place the files from the repo in a peripherals directory. When your repo is checked out
2427or updated from before people will need to:
2528
26- `git submodule update --init --recursive `
29+ .. code-block ::
30+
31+ git submodule update --init --recursive
2732
2833 The header files in `samd ` define the common API between the two series. Logic with most code shared
2934lives in a corresponding .c file. Functions with mostly different implementations are in a .c file
3035of the same name under the series specific directory, such as `samd21 `. Includes are relative to the
3136top of the repo so make sure to add the location of the library to your includes path with something
3237like:
3338
34- `-Iperipherals/ `
39+ .. code-block ::
40+
41+ -Iperipherals/
3542
3643 In your Makefile create a variable which stores the series such as `CHIP_FAMILY ` and alter the
3744source files depending on it. For example (from [here](https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/Makefile)):
3845
39- ```
40- SRC_C = \
41- peripherals/samd/clocks.c \
42- peripherals/samd/dma .c \
43- peripherals/samd/events .c \
44- peripherals/samd/external_interrupts .c \
45- peripherals/samd/sercom .c \
46- peripherals/samd/timers .c \
47- peripherals/samd/$(CHIP_FAMILY)/adc .c \
48- peripherals/$(CHIP_FAMILY)/cache.c
49- ```
46+ .. code-block ::
47+
48+ SRC_C = \
49+ peripherals/samd/clocks .c \
50+ peripherals/samd/dma .c \
51+ peripherals/samd/events .c \
52+ peripherals/samd/external_interrupts .c \
53+ peripherals/samd/sercom .c \
54+ peripherals/samd/timers .c \
55+ peripherals/samd/ $(CHIP_FAMILY)/adc.c \
56+ peripherals/$(CHIP_FAMILY)/cache.c
5057
5158 Contributing
5259============
0 commit comments