stm32: i2c implementation for F7, L5 and L4 MCUs

This commit is contained in:
Kenneth Bell
2021-03-20 21:39:04 -07:00
committed by Ron Evans
parent 9f3dcf3733
commit 46a7993fb8
12 changed files with 421 additions and 9 deletions
+10
View File
@@ -41,3 +41,13 @@ func (uart *UART) setRegisters() {
uart.statusReg = &uart.Bus.ISR
uart.txEmptyFlag = stm32.USART_ISR_TXE
}
//---------- I2C related code
// Gets the value for TIMINGR register
func (i2c I2C) getFreqRange() uint32 {
// This is a 'magic' value calculated by STM32CubeMX
// for 27MHz PCLK1 (216MHz CPU Freq / 8).
// TODO: Do calculations based on PCLK1
return 0x00606A9B
}