Update History
Main Changes
- ADC
- Fixed ADC_DATA_ALIGN_LEFT / ADC_DATA_ALIGN_RIGHT values to match CTRL2.DAM (0 = right, 1 = left).
- Fixed ADC_ReadData / ADC_ReadBufferData high/low byte assemble order for left and right alignment.
- Fixed ADC_SetChannel: write CSTS.CHSEL only; no longer toggles CTRL2.SMEN.
- Fixed ADC_Config: set CTRL4.GCMP when fADC ≤ 14 MHz.
- Added ADC_ClearAnalogWatchdogStatus to clear AWDS0 / AWDS1.
- EINT
- Fixed EINT_Reset: CTRL2 now uses EINT_CTRL2_RESET_VALUE.
- Fixed EINT_Config (EINT_PORT_TLI): configure 1-bit NMIT for rising/falling; clear GPIOC.CTRL2.CR3; ignore EINT_TRIGGER_FALLING_RISING.
- FMC
- Fixed option-byte APIs (FMC_EraseOptionByte, FMC_ProgramOptionByte, FMC_EnableWriteProtection, FMC_ConfigReadOutProtection, FMC_ConfigOptionByteUser, FMC_ConfigOptionByteAFR, FMC_ConfigOptionByteClk, FMC_ConfigOptionByteHXTCNT): set CTRL2.OBWEN around the access.
- Fixed erase/program APIs (FMC_ErasePage, FMC_EraseAllPages, FMC_ProgramWord, FMC_ProgramHalfWord and the option-byte APIs above): clear STS PE / WPE / OC before the operation.
- Fixed FMC_ReadState: busy check uses status & FMC_FLAG_BUSY.
- Fixed FMC_ClearStatusFlag: only write clearable bits FMC_FLAG_PE / FMC_FLAG_WPE / FMC_FLAG_OC.
- Fixed FMC_EnablePowerDownHaltMode / FMC_DisablePowerDownHaltMode: correct LPM.HALT polarity (0 = power-down, 1 = keep active).
- Updated FMC_LATENCY_T: removed unsupported FMC_LATENCY_2.
- I2C
- Fixed I2C_Config: clear CLKCTRL2.FASTMODE in Standard mode.
- Fixed I2C_INT_FLAG_TXBE / I2C_INT_FLAG_RXBNE masks to require both EVTIE and BUFIE.
- Fixed I2C_ReadIntFlag: buffer flags require the full enable mask to match.
- SPI
- Fixed SPI_Config: clear CTRL1.SPIEN before writing CLKPHA / CLKPOL / BRC / LSBF / MSTMODE.
- Fixed SPI_ConfigStructInit: default polarity is SPI_CLKPOL_LOW.
- USART
- Fixed USART_ClearStatusFlag: write 0 for RXBNE / TXC; read STS then DATA for PE / FE / NE / OVREE / IDLEE; write 0 to CTRL4.LMBDF for USART_FLAG_LBD.
- Fixed USART_ClearIntFlag: clear STS by write-0 instead of read-modify-write.
- TMR2
- Fixed TMR2_ConfigTimerBase: write only PSC[3:0] (divider & 0x0F).