-
Notifications
You must be signed in to change notification settings - Fork 160
feat: STM32 add SPIv2 and add Digital_IO for pinv2 to drive NSS #776
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
base: main
Are you sure you want to change the base?
Conversation
|
@mathk if you accept your invitation to the org, CI should run automatically for you now. |
mattnite
left a comment
There was a problem hiding this 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) { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| pub const UARTType = enum(usize) { | |
| pub const UART_Type = enum(usize) { |
| I2C2, | ||
| }; | ||
|
|
||
| pub const SPIType = util.create_peripheral_enum("SPI", "spi_v2"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| fn check_RX(self: *const SPI) bool { | |
| fn check_rx(self: *const SPI) bool { |
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.