mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 18:53:29 +00:00
machine/spi: use interface to ensure uniformity for all machine implementations
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
@@ -21,7 +21,7 @@ type SPIConfig struct {
|
||||
}
|
||||
|
||||
// Configure is intended to setup the STM32 SPI1 interface.
|
||||
func (spi SPI) Configure(config SPIConfig) {
|
||||
func (spi SPI) Configure(config SPIConfig) error {
|
||||
|
||||
// -- CONFIGURING THE SPI IN MASTER MODE --
|
||||
//
|
||||
@@ -93,6 +93,8 @@ func (spi SPI) Configure(config SPIConfig) {
|
||||
|
||||
// enable SPI
|
||||
spi.Bus.CR1.SetBits(stm32.SPI_CR1_SPE)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Transfer writes/reads a single byte using the SPI interface.
|
||||
|
||||
Reference in New Issue
Block a user