Skip to content

Commit 821b7f2

Browse files
merge implementation of new spitarget api
2 parents 4696d07 + 100a045 commit 821b7f2

File tree

66 files changed

+668
-450
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+668
-450
lines changed

.github/workflows/build-rapid-0.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build RAPID-0 Boards
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
board: [rapid0_adcs, rapid0_cdh, rapid0_eps]
12+
steps:
13+
- name: Set up repository
14+
uses: actions/checkout@v4
15+
with:
16+
submodules: false
17+
show-progress: false
18+
fetch-depth: 1
19+
- name: Set up python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: 3.x
23+
- name: Set up ports
24+
id: set-up-port
25+
uses: ./.github/actions/deps/ports
26+
with:
27+
board: ${{ matrix.board }}
28+
- name: Set up submodules
29+
id: set-up-submodules
30+
uses: ./.github/actions/deps/submodules
31+
with:
32+
action: cache
33+
version: true
34+
- name: Set up external
35+
uses: ./.github/actions/deps/external
36+
with:
37+
action: cache
38+
port: ${{ steps.set-up-port.outputs.port }}
39+
- name: Set up mpy-cross
40+
if: steps.set-up-submodules.outputs.frozen == 'True'
41+
uses: ./.github/actions/mpy_cross
42+
with:
43+
cp-version: ${{ steps.set-up-submodules.outputs.version }}
44+
download: false
45+
- name: Build boards
46+
run: make -j4 -C ports/atmel-samd BOARD=${{ matrix.board }}
47+
- name: Upload artifacts
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: ${{ matrix.board }}
51+
path: ports/atmel-samd/build-${{ matrix.board }}/firmware.*
52+
overwrite: true
53+

build-rapid0-mac

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
if echo $PATH | grep "gcc-arm-none-eabi" >/dev/null; then
2+
true
3+
else
4+
export PATH=/Volumes/Circuit_Python_Case_Sensitive_Disk/bruinspace-circuitpython/gcc-arm-none-eabi-10-2020-q4-major/bin:$PATH
5+
fi
6+
7+
cd ports/atmel-samd
8+
make --debug -j8 BOARD=rapid0_adcs
9+
make --debug -j8 BOARD=rapid0_cdh
10+
make --debug -j8 BOARD=rapid0_eps
11+
cd ../..
12+
13+
echo "Compilation complete! Press ^C to confirm and exit."
14+
15+
while true; do
16+
afplay /System/Library/Sounds/Ping.aiff
17+
sleep 5s
18+
done

build-rapid0-ubuntu

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
if echo $PATH | grep "gcc-arm-none-eabi" >/dev/null
2+
then
3+
true
4+
else
5+
export PATH=/mnt/d/Files/Documents/School/UCLA/Organizations/BruinSpace/Rapid-CDH/gcc-arm-none-eabi-10-2020-q4-major/bin:$PATH
6+
fi
7+
cd ports/atmel-samd
8+
make --debug -j8 BOARD=rapid0_adcs
9+
make --debug -j8 BOARD=rapid0_cdh
10+
make --debug -j8 BOARD=rapid0_eps
11+
cd ../..
12+
echo "Compilation complete! Press ^C to confirm and exit."
13+
while true;
14+
do
15+
paplay /usr/share/sounds/freedesktop/stereo/complete.oga
16+
sleep 5s
17+
done

docs/porting.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ as a natural "TODO" list. An example minimal build list is shown below:
7272
CIRCUITPY_FRAMEBUFFERIO = 0
7373
CIRCUITPY_FREQUENCYIO = 0
7474
CIRCUITPY_I2CTARGET = 0
75+
CIRCUITPY_SPITARGET = 0
7576
# Requires SPI, PulseIO (stub ok):
7677
CIRCUITPY_DISPLAYIO = 0
7778

locale/circuitpython.pot

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,10 +1055,6 @@ msgstr ""
10551055
msgid "Hard fault: memory access or instruction error."
10561056
msgstr ""
10571057

1058-
#: shared-bindings/busio/SPI.c
1059-
msgid "Hardware SS pin only supported for slave mode"
1060-
msgstr ""
1061-
10621058
#: ports/mimxrt10xx/common-hal/busio/SPI.c
10631059
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/I2C.c
10641060
#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/busio/UART.c
@@ -1343,10 +1339,6 @@ msgstr ""
13431339
msgid "Must provide MISO or MOSI pin"
13441340
msgstr ""
13451341

1346-
#: shared-bindings/busio/SPI.c
1347-
msgid "Must provide SS pin to operate in slave mode"
1348-
msgstr ""
1349-
13501342
#: shared-bindings/rgbmatrix/RGBMatrix.c
13511343
#, c-format
13521344
msgid "Must use a multiple of 6 rgb pins, not %d"
@@ -1891,12 +1883,6 @@ msgstr ""
18911883
msgid "Size not supported"
18921884
msgstr ""
18931885

1894-
#: ports/cxd56/common-hal/busio/SPI.c ports/espressif/common-hal/busio/SPI.c
1895-
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c
1896-
#: ports/raspberrypi/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c
1897-
msgid "Slave mode SPI is not implemented"
1898-
msgstr ""
1899-
19001886
#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c
19011887
#: shared-bindings/nvm/ByteArray.c
19021888
msgid "Slice and value different lengths."

ports/atmel-samd/boards/hallowing_m4_express/board.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ uint8_t display_init_sequence[] = {
5050
void board_init(void) {
5151
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
5252
busio_spi_obj_t *spi = &bus->inline_bus;
53-
common_hal_busio_spi_construct(spi, &pin_PA01, &pin_PA00, NULL, NULL, false, false);
53+
common_hal_busio_spi_construct(spi, &pin_PA01, &pin_PA00, NULL, false);
5454
common_hal_busio_spi_never_reset(spi);
5555

5656
bus->base.type = &fourwire_fourwire_type;

ports/atmel-samd/boards/monster_m4sk/board.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ uint8_t display_init_sequence[] = {
5050
void board_init(void) {
5151
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
5252
busio_spi_obj_t *spi = &bus->inline_bus;
53-
common_hal_busio_spi_construct(spi, &pin_PA13, &pin_PA12, NULL, NULL, false, false);
53+
common_hal_busio_spi_construct(spi, &pin_PA13, &pin_PA12, NULL, false);
5454
common_hal_busio_spi_never_reset(spi);
5555

5656
bus->base.type = &fourwire_fourwire_type;

ports/atmel-samd/boards/openbook_m4/board.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ uint8_t refresh_sequence[] = {
5959
void board_init(void) {
6060
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
6161
busio_spi_obj_t *spi = &bus->inline_bus;
62-
common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, NULL, NULL, false, false);
62+
common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, NULL, false);
6363
common_hal_busio_spi_never_reset(spi);
6464

6565
bus->base.type = &fourwire_fourwire_type;

ports/atmel-samd/boards/pewpew_lcd/board.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ uint8_t display_init_sequence[] = {
7070
void board_init(void) {
7171
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
7272
busio_spi_obj_t *spi = &bus->inline_bus;
73-
common_hal_busio_spi_construct(spi, &pin_PA23, &pin_PA22, NULL, NULL, false, false);
73+
common_hal_busio_spi_construct(spi, &pin_PA23, &pin_PA22, NULL, false);
7474
common_hal_busio_spi_never_reset(spi);
7575

7676
bus->base.type = &fourwire_fourwire_type;

ports/atmel-samd/boards/pewpew_m4/board.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ uint8_t display_init_sequence[] = {
9999
void board_init(void) {
100100
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
101101
busio_spi_obj_t *spi = &bus->inline_bus;
102-
common_hal_busio_spi_construct(spi, &pin_PA13, &pin_PA15, NULL, NULL, false, false);
102+
common_hal_busio_spi_construct(spi, &pin_PA13, &pin_PA15, NULL, false);
103103
common_hal_busio_spi_never_reset(spi);
104104

105105
bus->base.type = &fourwire_fourwire_type;

0 commit comments

Comments
 (0)