diff options
author | Kenneth Bell <[email protected]> | 2021-03-20 21:39:04 -0700 |
---|---|---|
committer | Ron Evans <[email protected]> | 2021-03-24 08:35:34 +0100 |
commit | 46a7993fb876c91a37575608f87cffaaa6fcd9c7 (patch) | |
tree | 73450974b8d5ba629fcba5c9a4f1fae07c86caf0 /src/machine/machine_stm32l4x2.go | |
parent | 9f3dcf3733a1b1c89214a0be2891d6a6ca36386b (diff) | |
download | tinygo-46a7993fb876c91a37575608f87cffaaa6fcd9c7.tar.gz tinygo-46a7993fb876c91a37575608f87cffaaa6fcd9c7.zip |
stm32: i2c implementation for F7, L5 and L4 MCUs
Diffstat (limited to 'src/machine/machine_stm32l4x2.go')
-rw-r--r-- | src/machine/machine_stm32l4x2.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/machine/machine_stm32l4x2.go b/src/machine/machine_stm32l4x2.go index 0320e7648..8baf6e571 100644 --- a/src/machine/machine_stm32l4x2.go +++ b/src/machine/machine_stm32l4x2.go @@ -34,3 +34,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 80MHz PCLK1. + // TODO: Do calculations based on PCLK1 + return 0x10909CEC +} |