mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-12 06:53:40 +00:00
stm32: i2c implementation for F7, L5 and L4 MCUs
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user