drivers: spi: sam0: Reset SPI peripheral on init
Reset the SPI peripheral to its default state and register values on init by setting its SWRST bit. This is important since the driver assumes that certain registers are at their default values. Signed-off-by: Pete Dietl <petedietl@gmail.com>
This commit is contained in:
parent
3b40a91dbc
commit
c9e48c8c01
1 changed files with 4 additions and 0 deletions
|
@ -679,6 +679,10 @@ static int spi_sam0_init(const struct device *dev)
|
|||
| GCLK_CLKCTRL_ID(cfg->gclk_id);
|
||||
#endif
|
||||
|
||||
/* Ensure all registers are at their default values */
|
||||
regs->CTRLA.bit.SWRST = 1;
|
||||
wait_synchronization(regs);
|
||||
|
||||
/* Disable all SPI interrupts */
|
||||
regs->INTENCLR.reg = SERCOM_SPI_INTENCLR_MASK;
|
||||
wait_synchronization(regs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue