Browse Source

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

tags/v0.9.3
Michael Brown 17 years ago
parent
commit
ca41159f57
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      src/drivers/bitbash/spi_bit.c

+ 4
- 0
src/drivers/bitbash/spi_bit.c View File

@@ -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
 

Loading…
Cancel
Save