HAL_ChibiOS: adjust SPI pin speeds

This commit is contained in:
Andrew Tridgell 2018-01-20 16:56:56 +11:00
parent 36f0b429fb
commit a5bafb399f
2 changed files with 3 additions and 6 deletions

View File

@ -99,7 +99,7 @@ PD7 BARO_CS CS
# USART3 serial3 telem2 # USART3 serial3 telem2
PD8 USART3_TX USART3 PD8 USART3_TX USART3
PD9 USART3_RX USART3 PD9 USART3_RX USART3
PD10 FRAM_CS CS SPEED_LOW PD10 FRAM_CS CS SPEED_VERYLOW
PD11 USART3_CTS USART3 PD11 USART3_CTS USART3
PD12 USART3_RTS USART3 PD12 USART3_RTS USART3
PD13 TIM4_CH2 TIM4 PWM(5) GPIO(54) PD13 TIM4_CH2 TIM4 PWM(5) GPIO(54)

View File

@ -169,12 +169,9 @@ class generic_pin(object):
def get_OSPEEDR(self): def get_OSPEEDR(self):
'''return one of SPEED_VERYLOW, SPEED_LOW, SPEED_MEDIUM, SPEED_HIGH''' '''return one of SPEED_VERYLOW, SPEED_LOW, SPEED_MEDIUM, SPEED_HIGH'''
# on STM32F4 these speeds correspond to 2MHz, 25MHz, 50MHz and 100MHz
values = ['SPEED_VERYLOW', 'SPEED_LOW', 'SPEED_MEDIUM', 'SPEED_HIGH'] values = ['SPEED_VERYLOW', 'SPEED_LOW', 'SPEED_MEDIUM', 'SPEED_HIGH']
v = 'SPEED_HIGH' v = 'SPEED_MEDIUM'
if self.is_CS():
v = "SPEED_MEDIUM"
if self.type.startswith("I2C"):
v = "SPEED_MEDIUM"
for e in self.extra: for e in self.extra:
if e in values: if e in values:
v = e v = e