Skip to content

Conversation

@mathk
Copy link
Collaborator

@mathk mathk commented Dec 23, 2025

There is a limitation as spi_v2 only generate teh DR8 register. I will plan a fix for embassy to have both DR8 and DR16. For now it only support less than 8bit data read.

@mathk mathk marked this pull request as ready for review December 23, 2025 11:19
@mathk mathk changed the title feat: STM32 add SPIv2 and add Digital_IO for pinv2 feat: STM32 add SPIv2 and add Digital_IO for pinv2 to drive NSS Dec 23, 2025
@mattnite
Copy link
Contributor

@mathk if you accept your invitation to the org, CI should run automatically for you now.

Copy link
Contributor

@mattnite mattnite left a comment

Choose a reason for hiding this comment

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

Looks good! just have some naming nits

@@ -1,3 +1,4 @@
const util = @import("../common/util.zig");
pub const UARTType = enum(usize) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pub const UARTType = enum(usize) {
pub const UART_Type = enum(usize) {

I2C2,
};

pub const SPIType = util.create_peripheral_enum("SPI", "spi_v2");
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pub const SPIType = util.create_peripheral_enum("SPI", "spi_v2");
pub const SPI_Type = util.create_peripheral_enum("SPI", "spi_v2");

@@ -0,0 +1,3 @@
const spi = @import("../common/spi_v2.zig");
pub const SPI = spi.SPI;
pub const SPIConfig = spi.Config;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pub const SPIConfig = spi.Config;
pub const SPI_Config = spi.Config;

std.log.info("SPI status {}", .{self.spi.SR.read()});
}

fn check_TX(self: *const SPI) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
fn check_TX(self: *const SPI) bool {
fn check_tx(self: *const SPI) bool {

return self.spi.SR.read().TXE != 0;
}

fn check_RX(self: *const SPI) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
fn check_RX(self: *const SPI) bool {
fn check_rx(self: *const SPI) bool {

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