Update History
Main Changes
- StdPeriph Driver
- 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).
- Fixed TMR2_DIV_B.PSC bit-field width in apm32f00x.h (4 bits).
- System
- Added SystemCoreClockUpdate declaration in system_apm32f00x.h.
- Updated ConfigMasterClock: made non-static and calls SystemCoreClockUpdate after clock setup.
- Examples
- Fixed IWDT: 0.5 s reload uses CNTRLD = freqLIRC / 1024 - 1 (P = 256).
- Fixed TMR2_PWMOutput: PC5 3 kHz / 50% PWM via TMR2_ConfigTimerBase(4, 499), CCR = 250.
- Fixed TMR2_PWMOutput / TMR2_SinglePulse: correct PSC argument for TMR2_ConfigTimerBase.
- Fixed WUPT: enable LIRC and wait LIRCRDY before WUPT init under HIRC.
- Fixed ADC_ContinuousConversion / ADC_DiffMode / TMR1_ADC_Trigger_Sampling: delay after ADC_Enable before ADC_StartConversion.
- Fixed NVIC_EnableIRQRequest priorities (valid 0–3) in board key, TMR1_InputCapture, TMR2_OCInactive, USART_LIN and FreeRTOS examples.
- Fixed I2C examples: inputClkFreqMhz = 24, configure GPIOB open-drain pins, and correct Eclipse library link paths.