MG32F157 Standard Peripherals Firmware Library
MG32F157 StdPeriph_Lib Examples
This package contains the following examples:
Note: All examples assume the selected model has a maximum frequency of 96MHz, a flash size of 256KB, and a sram size of 36KB. When using an example, please make corresponding adjustments according to the actual model used.
IP/Module Example
Name Brief description
ADC ADC_AnalogWatchdog This example describes how to use the ADC analog watchdog to guard continuously an ADC channel.
ADC_ADC1_DMA This example describes how to use the ADC and DMAC to transfer continuously converted data of regular group from ADC to memory.
ADC_3ADCs_DMA This example describes how to use the 3 ADCs in independent conversions.
ADC_RegSimul_DualMode This example describes how to use ADC1 and ADC2 in regular simultaneous dual mode.
ADC_ExtLinesTrigger This example describes how to trigger ADC regular and injected groups channels conversion using two external line events.
ADC_TIMTrigger_AutoInjection This example describes how to convert ADC regular group channels continuously using TIM1 external trigger and injected group channels using the auto-injected feature.
AES AES_CBC_Decryption_Derivation This example describes how to use AES peripheral to decrypt with derivation in CBC channing mode.
AES_CTR_Encryption_DMA This example describes how to use AES peripheral to encrypt with DMA transfer in CTR channing mode.
AES_ECB_Encryption This example describes how to use AES peripheral to encrypt in ECB channing mode.
BKP BKP_Backup_Data This example describes how to store user data in the Backup data registers.
BKP_Tamper This example shows how to write/read data to/from Backup data registers and demonstrates the Tamper detection feature.
CAN CAN_ClassCommunication This example shows how to use the controller Local Area Network (CAN) Class standard for communication and how to set the CAN filter.
CAN_FDCommunication This example shows how to use of the controller Local Area network (CAN) FD standard communication method, and how to set the CAN filter.
CAN_LoopBack This example shows how to use of the controller Local Area network (CAN) Class standard loopback communication method, and how to set the CAN filter.
CRC CRC_Calculation This example describes how to use CRC peripheral to calculate.
DAC DAC_DualModeDMA_SineWave This example describes how to use DAC dual channel mode with DMA to generate sine waves on both DAC channels outputs.
DAC_OneChannel_NoiseWave This example describes how to use one DAC channel to generate a signal with noise waves on DAC Channel1 output.
DAC_TwoChannels_TriangleWave This example describes how to use two DAC channels to generate two different signals with triangle waves on each DAC Channel output.
EXTI EXTI_Config This example describes how to configure external interrupt lines.
FLASH FLASH_Program This example describes how to program the on-chip FLASH.
GPIO GPIO_InputOutput This example describes how to read GPIO input and control GPIO output.
GPIO_IOToggle This example describes how to toggle the GPIO output.
I2C I2C_24C02 This example describes how to use the I2C firmware library and an driver to communicate with an EEPROM 24C02 device.
I2C_24C02_Interrupt This example describes how to use the I2C firmware library and an driver to communicate with an EEPROM 24C02 device.(Achieved by interruption).
I2C_MasterDMARx_SlaveDMATx This example describes The I2C Master receives data using DMA and The I2C slave transmits data using DMA.
I2C_MasterDMATx_SlaveDMARx This example describes The I2C Master transmits data using DMA and The I2C slave receives data using DMA.
I2C_Simulate_24C02 This example describes how to use I2C slave mode to simulate a 24C02 (EEPROM).
I2C_SMBus_Master This example describes how to use the I2C SMBus mode.
IWDG IWDG_Reset This example describes how to use the IWDG.
OPA OPA_Basic This example describes how to use OPA peripheral.
NVIC NVIC_DMA_WFIMode This example describes how to wake up from this mode through the DMA transfer end interrupt,when DMA transfer is enabled and the system enters WFI mode.
NVIC_IRQ_Mask This example describes the use of the Nested Vectored Interrupt Controller (NVIC) IRQ Channels configuration and how to mask/activate different IRQs.
NVIC_IRQ_Priority This example describes the use of the Nested Vectored Interrupt Controller (NVIC).
PWR PWR_PVD This example describes how to use the the programmable voltage detector (PVD) function.
PWR_SLEEP This example describes how to enters the SLEEP mode and wake-up from this mode using external interrupt.
PWR_STANDBY This example describes how to enters the system to STANDBY mode and wake-up from this mode.
PWR_STOP_RegulatorLowPower This example describes how to enters the STOP regulator low power mode and wake-up from this mode using external interrupt.
PWR_STOP_RegulatorOn This example describes how to enters the STOP regulator on mode and wake-up from this mode using external interrupt.
QSPI QSPI_QuadSPI_FLASH This example describes how to use QSPI to drive SPI Flash.
QSPI_QuadSPI_FLASH_IT This example describes how to drive SPI Flash using QSPI interrupts.
RCC RCC_ClockConfig This example describes how to configure the system clock (external 8MHz crystal oscillator is multiplied to 96MHz by PLL).
RTC RTC_Calendar This example describes how to use the RTC peripheral to make a easy calendar.
RTC_LSI_Calib This example describes how to calibrate LSI with Timer5.
SDIO SDIO_ReadWrite This example describes how to read and write an SD card using SDIO.
SPI SPI_Flash This example describes how to use the SPI firmware library communicate with a SPI FLASH.
SPI_SimplexInterrupt This example describes how to use the SPI firmware library communication in simplex mode with spi master device and slave device, spi master and slave user spi interrupt.
SPI_Slave This example describes how to use the SPI firmware library communication in full duplex mode with spi master device and slave device, spi master and slave user spi interrupt.
I2S_PlayAudio This example describes how to use the SPI firmware library communication i2s mode play audio.
SysTick SysTick_Example This example describes how to configure the SysTick to generate a time base equal to 1 ms.
TIM TIM_6Steps This example shows how to configure the TIM1 peripheral to generate 6 Steps.
TIM_7PWM_Output This example shows how to configure the TIM1 peripheral to generate 7 PWM signals with 4 different duty cycles (50%, 37.5%, 25% and 12.5%).
TIM_Base This example describes how to use the TIM peripheral to generate 500ms timer interrupt.
TIM_CascadeSynchro This example shows how to synchronize TIM peripherals in cascade mode.
TIM_ComplementarySignals This example shows how to configure the TIM1 peripheral to generate three complementary TIM1 signals, to insert a defined dead time value, to use the break feature and to lock the desired parameters.
TIM_DMA This example describes how to use DMA and TIM1 update request to transfer data from memory to TIM1->CCR2.
TIM_ExtTrigger_Synchro This example shows how to synchronize TIM peripherals with external triggers in cascade mode.
TIM_InputCapture This example shows how to use the TIM peripheral to measure the frequency of an external signal.
TIM_OCActive This example shows how to configure the TIM peripheral to generate four different signals with four different delays.
TIM_OCInactive This example shows how to configure the TIM peripheral in Output Compare Inactive mode with the corresponding Interrupt requests for each channel.
TIM_OnePulse This example shows how to use the TIM peripheral to generate a One pulse Mode after a Rising edge of an external signal is received in Timer Input pin.
TIM_ParallelSynchro This example shows how to synchronize TIM peripherals in parallel mode.
TIM_PWM_Input This example shows how to use the TIM peripheral to measure the frequency and duty cycle of an external signal.
TIM_PWM_Output This example shows how to configure the TIM peripheral in PWM (Pulse Width Modulation) mode.
TIM_TIM1_OCToggle This example shows how to configure the TIM1 peripheral to generate two different signals with two different frequencies.
TIM_TIM1_PWMOutput This example shows how to configure the TIM peripheral in PWM (Pulse Width Modulation) mode.
TIM_TIM1ComplementarySignals This example shows how to configure the TIM1 peripheral to generate one complementary TIM1 signal, to insert a defined dead time value, to use the break feature and to lock the desired parameters.
TRNG TRNG_Basic This example describes how to use TRNG to generate true random data.
USART USART_DMA This example describes how to send data using USART's DMA capabilities.
USART_Interrupt This example describes how to receive interrupts using USART.
USART_Polling This example shows how to transmit and receive serial data by polling USART flag bits.
USART_Printf This example shows how to retarget the standard input and output function to the USART1.
USART_Synchronous This example describes how to use the synchronous communication feature of USART.
USB USB_CDC_Echo This example describes how to use USB module to implement a Virtual COM Port.
USB_HID_KeyBoard This example describes how to use USB module to implement a keyboard.
USB_HID_Mouse This example describes how to use USB module to implement a mouse.
WWDG WWDG_Reset This example describes how to use the WWDG.

© COPYRIGHT 2023 Megawin Technology