Parcourir la source

Ensure clock line is in the idle state before asserting chip select.

tags/v0.9.3
Michael Brown il y a 17 ans
Parent
révision
ca41159f57
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4
    0
      src/drivers/bitbash/spi_bit.c

+ 4
- 0
src/drivers/bitbash/spi_bit.c Voir le fichier

@@ -153,6 +153,10 @@ static int spi_bit_rw ( struct spi_bus *bus, struct spi_device *device,
153 153
 		= container_of ( bus, struct spi_bit_basher, bus );
154 154
 	uint32_t tmp;
155 155
 
156
+	/* Set clock line to idle state */
157
+	write_bit ( &spibit->basher, SPI_BIT_SCLK, 
158
+		    ( bus->mode & SPI_MODE_CPOL ) );
159
+
156 160
 	/* Assert chip select on specified slave */
157 161
 	spi_bit_set_slave_select ( spibit, device->slave, SELECT_SLAVE );
158 162
 

Chargement…
Annuler
Enregistrer