Skip to content

Conversation

iabdalkader
Copy link

@iabdalkader iabdalkader commented Sep 17, 2025

Requires:

Example:

#include <SPI.h>

SPISettings mySettings(1000000, MSBFIRST, SPI_MODE0, SPI_PERIPHERAL);

void setup() {
  Serial.begin(115200);
  while (!Serial);
  SPI.begin();
}

void loop() {
  uint8_t buf[] = {0x01, 0x02, 0x03, 0x04};

  SPI.beginTransaction(mySettings);
  SPI.transfer(buf, sizeof(buf));
  SPI.endTransaction();
  
  Serial.println("Received:");
  for (int i=0; i<sizeof(buf); i++) {
    Serial.print("0x"); Serial.println(buf[0], HEX);
  }
  
  delay(100);
}

@iabdalkader iabdalkader force-pushed the spi_controller_mode branch 3 times, most recently from 80c2002 to 1e6e8bd Compare September 18, 2025 10:34
@iabdalkader iabdalkader changed the title libraries/SPI: Add support for controller mode. libraries/SPI: Add support for peripheral mode. Sep 18, 2025
@iabdalkader iabdalkader requested a review from pennam September 19, 2025 07:17
@iabdalkader iabdalkader force-pushed the spi_controller_mode branch 2 times, most recently from 27e7766 to d403c4c Compare September 19, 2025 07:54
Copy link
Member

@facchinm facchinm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just add SPI_HAS_PERIPHERAL_MODE define and we are good to go 🚀

@iabdalkader
Copy link
Author

Let's just add SPI_HAS_PERIPHERAL_MODE define and we are good to go 🚀

Added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants