Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAMD51 SPI Secondary Mode #9385

Merged
merged 62 commits into from
Feb 14, 2025
Merged
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
639fed2
Add slave_mode parameter to the SPI bus constructor
Randall-Scharpf Nov 7, 2023
b459802
Update SPI construction usages
Randall-Scharpf Nov 7, 2023
58e1ee7
Attempt to change MODE to peripheral
Randall-Scharpf Nov 7, 2023
8444193
fix inversion bitmath error
Randall-Scharpf Dec 4, 2023
b98ff01
add build script
Randall-Scharpf Dec 4, 2023
c969a64
working edits to spi and can attempts
Randall-Scharpf Dec 4, 2023
82a6f95
SPI responds to clock with this change, data transfer still ununcerta…
Randall-Scharpf Dec 6, 2023
9c8401b
build interpreter (mac version)
anniexiang01 Dec 6, 2023
8a552f1
potential fix for busio SPI parameters
anniexiang01 Dec 6, 2023
b983bf9
add SS pin and fix DIPO/DOPO assignment
Randall-Scharpf Apr 2, 2024
1728222
Merge branch '9.0.x' of https://github.com/adafruit/circuitpython int…
Randall-Scharpf Apr 12, 2024
09d2c66
Merge branch 'adafruit-9.0.x' into main
Randall-Scharpf Apr 12, 2024
c06f9e1
hey wait we dont need a crystal
Randall-Scharpf May 4, 2024
bd10666
update dma code to use new allocation interface
Randall-Scharpf May 4, 2024
5490a82
add async spi interface
Randall-Scharpf May 4, 2024
cfa4425
enable preloading data register
Randall-Scharpf May 6, 2024
5c21495
update samd-peripherals submodule to point to a bruinspace-owned fork
Randall-Scharpf May 20, 2024
4d151a0
update reference submodule commit hash
Randall-Scharpf May 20, 2024
26e838b
added board configurations for RAPID-0 CDH, ADCS, and EPS boards. rev…
anniexiang01 May 20, 2024
0ae5be8
corrected board family on rapid0_adcs mpconfigboard.mk file
anniexiang01 May 21, 2024
a73df58
Updated USB VID, PID, and PRODUCT to reflect sublicense given by Micr…
anniexiang01 May 21, 2024
d4df61e
updated adcs board files to be based on the bdmicro vina d51, new bui…
anniexiang01 May 24, 2024
dcc97d7
fixed rapid0-cdh pin error
anniexiang01 May 25, 2024
14136fc
restore metro_m4_express configuration
Randall-Scharpf Jun 30, 2024
555f1a3
remove extraneous build files
Randall-Scharpf Jun 30, 2024
d048667
remove extraneous build files
Randall-Scharpf Jun 30, 2024
4696d07
set SPI drive strength to high
Randall-Scharpf Jul 28, 2024
1fc4d72
haha! adcs works now
Randall-Scharpf Oct 18, 2024
2ba0b56
add annie's new rapid-0 firmware build workflow
Randall-Scharpf Oct 31, 2024
a7b3de4
add SPITarget interface (HAL still unimplemented)
Randall-Scharpf Nov 1, 2024
289f420
implement the spitarget methods
Randall-Scharpf Nov 1, 2024
616ec37
fix the type of self within spitarget
Randall-Scharpf Nov 1, 2024
114d49e
fix import errors and transfer_close return typing
Randall-Scharpf Nov 1, 2024
5657f8a
fix typing and naming mismatches
Randall-Scharpf Nov 1, 2024
1aad399
ok this is the one
Randall-Scharpf Nov 1, 2024
ff2fb90
fix function name mismatch between call and declaration
Randall-Scharpf Nov 1, 2024
dd7056b
return none from bound functions
Randall-Scharpf Nov 1, 2024
1875e70
fix buffer mishandling in spitarget bindings
Randall-Scharpf Nov 5, 2024
0a68f43
remove busio.SPI
Randall-Scharpf Nov 6, 2024
ea344c3
repair constructors referencing old API
Randall-Scharpf Nov 6, 2024
100a045
remove asynchronous interface under busio.SPI
Randall-Scharpf Nov 6, 2024
821b7f2
merge implementation of new spitarget api
Randall-Scharpf Nov 14, 2024
022e191
add missing files not found by wildcard
Randall-Scharpf Nov 14, 2024
d059736
push samd-peripherals to merge commit in adafruit repository
Randall-Scharpf Nov 26, 2024
cd3c95b
update docs and names for consistency and completeness
Randall-Scharpf Feb 10, 2025
193f700
fix typo in documentation comment
Randall-Scharpf Feb 10, 2025
1942d05
Merge branch 'upstream/main' (from adafruit/circuitpython) into main
Randall-Scharpf Feb 10, 2025
dd7acd5
apply pre-commit formatting and translations
Randall-Scharpf Feb 10, 2025
137c2c5
fix buffer storage declaration
Randall-Scharpf Feb 10, 2025
62c2107
add manually the pre-commit formatting that could not be automaticall…
Randall-Scharpf Feb 10, 2025
d64ce00
Merge remote-tracking branch 'upstream/main' into main
Randall-Scharpf Feb 10, 2025
a4a5632
limit spitarget to only boards with enough memory for an additional m…
Randall-Scharpf Feb 10, 2025
84f9849
rebuild zephyr boards
Randall-Scharpf Feb 11, 2025
b085b79
save some flash by configuring each busio.SPI pin with a helper function
Randall-Scharpf Feb 11, 2025
186d691
save some flash by configuring each busio.SPI pin with a helper function
Randall-Scharpf Feb 11, 2025
f3c144e
slightly increase board firmware size to fit
Randall-Scharpf Feb 11, 2025
2504cd2
rollout spitarget to more boards
Randall-Scharpf Feb 11, 2025
d937221
remove spitarget from specific samd51 boards that are already tight o…
Randall-Scharpf Feb 11, 2025
00a831f
update spitarget documentation example to be more complete and respon…
Randall-Scharpf Feb 11, 2025
ee6bbec
Merge remote-tracking branch 'upstream/main' into main
Randall-Scharpf Feb 13, 2025
3b864ae
restore pixel_trinkey filesystem size
Randall-Scharpf Feb 13, 2025
3b0b4d3
Merge remote-tracking branch 'upstream/main' into main git diff main …
Randall-Scharpf Feb 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix typing and naming mismatches
Randall-Scharpf committed Nov 1, 2024
commit 5657f8aa670fdaff6f555ea4b45df32e40ecea6e
16 changes: 8 additions & 8 deletions ports/atmel-samd/common-hal/spitarget/SPITarget.c
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ void common_hal_spitarget_spi_target_construct(spitarget_spi_target_obj_t *self,
// Special case for SAMR21 boards. (feather_radiofruit_zigbee)
#if defined(PIN_PC19F_SERCOM4_PAD0)
if (miso == &pin_PC19) {
if (mosi == &pin_PB30 && clock == &pin_PC18) {
if (mosi == &pin_PB30 && sck == &pin_PC18) {
sercom = SERCOM4;
sercom_index = 4;
clock_pinmux = MUX_F;
@@ -59,7 +59,7 @@ void common_hal_spitarget_spi_target_construct(spitarget_spi_target_obj_t *self,
continue;
}
clock_pinmux = PINMUX(sck->number, (i == 0) ? MUX_C : MUX_D);
clock_pad = clock->sercom[i].pad;
clock_pad = sck->sercom[i].pad;
if (!samd_peripherals_valid_spi_clock_pad(clock_pad)) {
continue;
}
@@ -128,11 +128,11 @@ void common_hal_spitarget_spi_target_construct(spitarget_spi_target_obj_t *self,
mp_raise_OSError(MP_EIO);
}

gpio_set_pin_direction(clock->number, GPIO_DIRECTION_IN);
gpio_set_pin_pull_mode(clock->number, GPIO_PULL_OFF);
gpio_set_pin_function(clock->number, clock_pinmux);
gpio_set_pin_direction(sck->number, GPIO_DIRECTION_IN);
gpio_set_pin_pull_mode(sck->number, GPIO_PULL_OFF);
gpio_set_pin_function(sck->number, clock_pinmux);
claim_pin(sck);
self->clock_pin = clock->number;
self->clock_pin = sck->number;

gpio_set_pin_direction(mosi->number, GPIO_DIRECTION_IN);
gpio_set_pin_pull_mode(mosi->number, GPIO_PULL_OFF);
@@ -172,12 +172,12 @@ void common_hal_spitarget_spi_target_deinit(spitarget_spi_target_obj_t *self) {
self->clock_pin = NO_PIN;
}

void common_hal_spitarget_spi_target_deinited(spitarget_spi_target_obj_t *self) {
bool common_hal_spitarget_spi_target_deinited(spitarget_spi_target_obj_t *self) {
return self->clock_pin == NO_PIN;
}

void common_hal_spitarget_spi_target_transfer_start(spitarget_spi_target_obj_t *self,
uint8_t *miso_packet, uint8_t *mosi_packet, size_t len) {
uint8_t *mosi_packet, const uint8_t *miso_packet, size_t len) {
if (len == 0) {
return;
}
2 changes: 1 addition & 1 deletion shared-bindings/spitarget/SPITarget.h
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ extern void common_hal_spitarget_spi_target_deinit(spitarget_spi_target_obj_t *s
extern bool common_hal_spitarget_spi_target_deinited(spitarget_spi_target_obj_t *self);

extern void common_hal_spitarget_spi_target_transfer_start(spitarget_spi_target_obj_t *self,
const uint8_t *mosi_packet, uint8_t *miso_packet, size_t len);
uint8_t *mosi_packet, const uint8_t *miso_packet, size_t len);
extern bool common_hal_spitarget_spi_target_transfer_is_finished(spitarget_spi_target_obj_t *self);
extern int common_hal_spitarget_spi_target_transfer_close(spitarget_spi_target_obj_t *self);