STM8L10x Standard Peripherals Library: Peripheral’s examples Copyright 2014 STMicroelectronics
The STM8L10x Standard Peripherals library provides a rich set of examples covering the main features of each peripheral. Almost exmaples run on all supported STM8L10x devices. All the examples are independent from the software toolchain. These examples run on STMicroelectronics STM8L101-EVAL evaluation board and can be easily tailored to any other supported device and development board. Only source files are provided for each example and user can tailor the provided project template to run the selected example with his preferred toolchain. ## How to proceed? Copy the files main.c, main.h (if exists), stm8l10x_it.c, s, stm8l10x_it.h, stm8l10_conf.h and any other source files from the specified example to your toolchain folder under Project\STM8L10x_StdPeriph_Templates. This project folder contains already all toolchain files needed for creating projects for STM8L10x microcontrollers. Open your preferred toolchain If needed, add in the project list the additional files required to run the example (refer to your example readme file) Rebuild all files and load your image into the target memory Run the example ## STM8L10x StdPeriph_Lib Examples The package contains the following examples: AWU - BEEP - COMP - CLK - EXTI - FLASH - GPIO - I2C - ITC - IWDG - RST - SPI - TIM - USART - WFE - IRTIM
IP/Module | Example |
Name | Brief Description |
AWU | AWU_ActiveHaltMode | This example provides a short description of how to use the AWU peripheral: Pressing Key button will enter MCU in Halt mode. The MCU will then exit from halt mode thanks to the AWU. The wake up time depends on the AWU peripheral configuration. |
BEEP | BEEP_3SignalsGeneration | This example provides a short description of how to use the BEEP peripheral: Each time the key button is pressed the Beeper frequency changes and a corresponding led will be switched on. |
COMP | COMP_Interrupt | This example is demonstrating the comparator interrupt capability on the detection of an input voltage applied to the COMP2 Channel 3, higher than its reference . |
CLK | CLK_MasterClock | This example demonstrates the different Master Prescaler configuartions, using the joystick available on the evaluation board. |
EXTI | EXTI_IOControl | This example provides a short description of how to use the EXTI peripheral |
FLASH | FLASH_ByteReadWriteOperation | This example provides a short description on how to use FLASH Read/Write/Erase operations on byte |
FLASH_WriteWordOperation | This example provides a short description on how to use FLASH Program word mode |
FLASH_DataProgram | This example provides a description of how to use FLASH Write/Erase Block mode on data eeprom memory. |
GPIO | GPIO_IOToggle | This example provides a short description of how to use the GPIO peripheral to toggle Ports Pins infinitely |
I2C | I2C_EEPROM | This firmware provides a basic example of how to use the I2C firmware library and an associate I2C EEPROM driver to communicate with an I2C EEPROM device |
I2C_DataExchange | This is a typical example of how to use the I2C software library to ensure the steps of an I2C communication between slave Receiver/transmitter and master transmitter/receiver using interrupts. |
ITC | ITC_SoftwarePriority | This example shows how to change the software priority of two external interrupt lines to allow nested interrupt management. |
IWDG | IWDG_Example | This example shows how to update at regular period the IWDG reload counter and how to simulate a software fault generating an MCU IWDG reset on expiry of a programmed time period. |
RST | RST_IllegalOpcode | This example provides a short description of how to generate detect and manage an illegal opcode reset. |
SPI | SPI_MSD | This example provides a short description of how to make a communication (Write & Read data) between the SPI and a MicroSD memory card like the one present on the STM8L101-EVAL evaluation board. |
SPI_FullDuplexUART | This example provides a short description of how to make a master/slave full duplex communication between the SPI and the UART1, the last is configured in master synchronous mode. |
SPI_SimplexLCD | This example provides a short description of how to use the SPI firmware library in order to communicate with a monochrome LCD like the one present on the STM8L101-EVAL eval-board by the mean of the associated eval LCD driver. |
TIM | TIM2_InputCapture | This example shows how to configure the TIM1 peripheral to capture the internal clock source (LSI). |
TIM2_SinewaveGeneration | This example shows how to use TIM1 to get the variation in sine wave frequency from 65Hz to 45Hz. |
TIM2_OCActiveMode | This example shows how to configure the TIM2 peripheral to generate three different signals with three different delays |
TIM2_OCInactiveMode | This example shows how to configure the TIM2 peripheral to generate 3 different signals with 3 different delays. |
TIM2_PWM_DutyCycleConfiguration | This example shows how to configure the TIM2 peripheral in Pulse Width Modulation mode (PWM). |
TIM4_TimeBase | This example provides a short description of how to use the TIM4 peripheral to generate time base equal to 1 ms. In this example a "Delay" function is implemented based on the TIM4 time base. |
TIM3_SynchronisationwithTIM4 | This example provides a short description of how to use the TIM3 peripheral synchronized by TIM4. TIM3 is configured as a slave of TIM4. |
USART | USART_HyperTerminalInterrupt | This example provides a description of how to use the UART1 Transmit and Receive interrupts to communicate with the hyperterminal. |
USART_MultiProcessor | This example provides a description of how to use the UART1 in multi-processor mode. |
USART_Printf | This example shows how to retarget the C library printf function to the UART. This implementation output the printf message on the Hyperterminal using UART. |
USART_Synchronous | This example provides a basic communication between UART1 (Synchronous mode) and SPI using flags. |
WFE | WFE_WakeUp | How the CPU operates when entering in wait for event mode. |
IRTIM | IR_SignalGeneration | How to use the IRTIM peripheral. |
Back to Top
For complete documentation on STM8 8-bit Microcontrollers platform visit www.st.com