STM32 Releasing your creativity

注:在Firmware Lib on EKSTM32F中,所有例程,除在对应的文件“Readme.txt”中声明以外,均已经修改并经测试,可以在EK-STM32F上运行。其中程序被修改的部分,也在程序中及对应的文件“Readme.txt”中注明。
Easy-to-use firmware libraries for STM32

The standard firmware library for the STM32 ARM™ Cortex-M3™ core-based microcontrollers is complete package consisting of device drivers for all of the standard device peripherals. Each device driver includes a set of functions covering full peripheral functionality. The source code, developed in C language, is highly documented and thoroughly tested.

Links below connect to example folder. The package contains the following examples:

Note: These examples run on STMicroelectronics STM3210B-EVAL board and can be easily tailored to any other hardware.

       
ADC Example1 Use the ADC and DMA to transfer continuously converted data from ADC to a data buffer.
  Example2 Convert ADC regular group channels continuously using TIM1 external trigger and injected group channels using the auto-injected feature.
  Example3 Use the ADC analog watchdog to guard continuously an ADC channel.
  Example4 Trigger ADC regular and injected groups channel conversion using two external line event.
  Example5 Use ADC1 and ADC2 in regular simultaneous dual mode.
       
BKP Example1 Write/read data to/from Backup data registers and demonstrates the Tamper detection feature.
  Example2 Store user data in the Backup data registers.
       
CAN Example1 Set a communication with the bxCAN in loopback mode
ARM7 STR7 Software Library Folder Example
CortexM3 Example1 Use CortexM3 Bit-Band access to perform atomic read-modify-write and read operations on a variable in SRAM.
  Example2 Modify CortexM3 Thread mode privilege access and stack.
       
DEBUG Example1 Demonstrates the STM32F10x Firmware Library DEBUG mode. When the Debug mode is selected, the assert macro is expanded and run time checking is enabled in the firmware library code. The run-time checking allows checking that all the library functions input value lies within the parameter allowed values.
       
DMA Example1 Use a DMA channel to transfer a word data buffer from memory (Flash) to memory (RAM).
  Example2 Use two DMA channels to transfer a data buffer from memory to I2C2 through I2C1.
  Example3 Use four DMA channels to transfer a data buffer from memory to SPI2 through SPI1 and a second data buffer from memory to SPI1 through SPI2 in full-duplex mode.
  Example4 Use a DMA channel to transfer continuously a data from a peripheral (ADC) to another (TIM1) supporting DMA transfer.
       
EXTI Example1 Configure an external interrupt line.
       
FLASH Example1 Program the STM32F10x FLASH.
  Example2 Enable and disable the write protection for the STM32F10x FLASH.
       
GPIO Example1 Use the GPIO BSRR (Port bit set/reset register) and BRR (Port bit reset register) for IO toggling. These registers allow modifying only one or several GPIO pins in a single atomic write access.
  Example2 Use the JTAG IOs as standard GPIOs and gives a configuration sequence.
       
I2C Example1 Transfer a data buffer from I2C1 to I2C2 using interrupts.
  Example2 Transfer two data buffer from I2C1 to I2C2 through its two addresses in the same application.
  Example3 Send an ARP command from I2C1 to I2C2 in SMBus mode.
  Example4 Transfer a data buffer from I2C1 to I2C2 in 10-bit addressing mode..
  Example5 Use the I2C firmware library and an associate I2C EEPROM driver to communicate with an M24C08 EEPROM.
       
IWDG Example1 Reload at regulate period the IWDG counter using the SysTick interrupt.
       
NVIC Example1 Use of the Nested Vectored Interrupt Controller (NVIC) and priority mechanism (PreemptionPriority , SubPriority)
  Example2 Use of the Nested Vectored Interrupt Controller (NVIC) and IRQ Channels configuration
  Example3 Use of the Nested Vectored Interrupt Controller (NVIC) and system handlers
  Example4 Use the NVIC firmware library to demonstrate the Cortex-M3 low power modes capabilities (WFE and WFI).
  Example5 Enter the system to WFI mode with DMA transfer enabled and wake-up from this mode by the DMA End of Transfer interrupt.
  Example6 Use the NVIC firmware library to set the CortexM3 vector table in a specific address other than default.
This can be used to build program which will be loaded into Flash memory by an application previously programmed in the sector0 of the Flash memory. Such application can be In-Application Programming (IAP, through USART) or Device Firmware Upgrade (DFU, through USB).
       
PWR Example1 Enter the system to STOP mode and wake-up using EXTI Line interrupts. The EXTI Line sources are PB.09 and RTC Alarm.
  Example2 Enter the system to STANDBY mode and wake-up from this mode using: external RESET, RTC Alarm or WKUP pin.
       
RCC Example1 Configure the system clock source, AHB, APB2 and APB1 prescaler. It demonstrates also the Clock Security System (CSS) which handles the High Speed External clock (HSE) failure detection and system clock back-up.
       
RTC Example1 Explains how to use the RTC peripheral. As an application example, it demonstrates how to setup the RTC peripheral, in terms of prescaler and interrupts, to be used to keep time and to generate Second interrupt.
       
SPI Example1 Set a communication between the two SPIs in full-duplex mode and performs a transfer from Master to Slave and then Slave to Master in the same application with software NSS management.
  Example2 Set a communication between two SPIs in simplex mode and performs a data buffer transfer from Master to Slave
using TxE interrupt for master and RxNE interrupt for slave.
  Example3 set a communication between two SPIs in full-duplex mode and performs a transfer from Master to Slave and
Slave to Master followed by CRC transmission.
  Example4 Set a communication between the two SPIs in simplex mode and performs a transfer from Master in polling mode to the Slave in DMA receive mode. The NSS pin is managed by hardware.
  Example5 Use the SPI firmware library and an associated SPI FLASH driver to communicate with an M25P64 FLASH.
       
SysTick Example1 Configure the SysTick to generate a time base equal to 1ms.
       
TIM Example1 Configure the TIM peripheral to generate four different signals with four different frequencies.
  Example2 Configure the TIM peripheral to generate four different signals with four different delays.
  Example3 Configure the TIM peripheral in Output Compare Inactive mode with the corresponding Interrupt requests for each channel.
  Example4 Configure the TIM peripheral in PWM (Pulse Width Modulation) mode.
  Example5 Configure the TIM peripheral in Output Compare Timing mode with the corresponding Interrupt requests for each channel in order to generate 4 different time bases.
  Example6 Use the TIM peripheral to measure the frequency and duty cycle of an external signal.
  Example7 Use the TIM peripheral to generate One pulse after a Rising edge of an external signal is received in Timer Input pin.
  Example8 Synchronize TIM peripherals in parallel mode.
  Example9 Synchronize TIM peripherals in cascade mode.
  Example10 Synchronize TIM peripherals in cascade mode with an external trigger.
       
TIM1 Example1 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.
  Example2 Configure the TIM1 peripheral to generate 7 PWM signals with 4 different duty cycles.
  Example3 Configure the TIM1 peripheral to generate 6 Steps.
  Example4 Synchronize TIM1 and Timers (TIM3 and TIM4) in parallel mode.
  Example5 Use DMA with TIM1 Update request to transfer Data from memory to TIM1 Capture Compare Register3.
       
USART Example1 Use the USART with hardware flow control and communicate with the Hyperterminal.
  Example2 Use the USART1 interrupts to communicate with the hyperterminal.
  Example3 Provide a basic communication between USART1 and USART2 using flags.
  Example4 Provide a basic communication between USART1 and USART2 using interrupts.
  Example5 Provide a basic communication between USART1 and USART2 using DMA capability.
  Example6 Provide a basic communication between USART1 and USART2 using DMA capability, flags and interrupts.
  Example7 Retarget the C library printf function to the USART.
  Example8 Provide a basic communication between USART1 (Synchronous mode) and SPI1 using flags.
  Example9 Provide a basic communication between USART1 and USART2 in Half-Duplex mode using flags.
  Example10 Use IrDA mode. Two projects are provided: one for IrDA transmitter and the second for IrDA receiver
  Example11 Use the USART in multi-processor mode.
  Example12 Use the USART in Smart Card mode.
       
WWDG Example1 Update at regulate period the WWDG counter using the Early Wakeup interrupt (EWI).
       

Software and documents
For complete documentation refer to www.st.com/STM32