Merge pull request #3829 from DipSwitch/spi_set_pin_speed

cpu/stm32l1-f0/spi: Configure the SPI pins as highspeed
dev/timer
Peter Kietzmann 8 years ago
commit 0f740f611c

@ -151,6 +151,7 @@ int spi_conf_pins(spi_t dev)
for (int i = 0; i < 3; i++) {
port->MODER &= ~(3 << (pin[i] * 2));
port->MODER |= (2 << (pin[i] * 2));
port->OSPEEDR |= (3 << (pin[i] * 2));
int hl = (pin[i] < 8) ? 0 : 1;
port->AFR[hl] &= ~(0xf << ((pin[i] - (hl * 8)) * 4));
port->AFR[hl] |= (af << ((pin[i] - (hl * 8)) * 4));

@ -147,6 +147,7 @@ int spi_conf_pins(spi_t dev)
for (int i = 0; i < 3; i++) {
port->MODER &= ~(3 << (pin[i] * 2));
port->MODER |= (2 << (pin[i] * 2));
port->OSPEEDR |= (3 << (pin[i] * 2));
int hl = (pin[i] < 8) ? 0 : 1;
port->AFR[hl] &= ~(0xf << ((pin[i] - (hl * 8)) * 4));
port->AFR[hl] |= (af << ((pin[i] - (hl * 8)) * 4));

Loading…
Cancel
Save