| Electronic Components Datasheet Search |
|
AN3139 Datasheet(PDF) 12 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN3139 Datasheet(HTML) 12 Page - STMicroelectronics |
|
12 / 63 page ![]() STM8L family compatibility AN3139 12/63 Doc ID 16993 Rev 3 however essential during development time. Extensive software libraries are available for both STM8L10x, STM8L15x and STM8L16x devices, providing the user with a hardware abstraction layer (HAL) for all MCU resources. Moreover, there is not a single control/status bit that is not covered by a C function or an API. The software library covers three abstraction levels, and it includes: 1. A complete register address map with all bits, bit fields and registers declared in C. By providing this map, the software library makes the designers’ task much lighter and, even more importantly so, it gives all the benefits of a bug-free reference mapping file, thus speeding up the early project phase. 2. A collection of routines and data structures in API form, that covers all peripheral functions. This collection can directly be used as a reference framework, since it also includes macros for supporting core-related intrinsic features and common constant and data type definition. Moreover, it is compiler agnostic and can therefore be used with any existing or future toolchain. It was developed using the MISRA C automotive standard. 3. A set of examples covering all available peripherals (35 examples so far for the STM8L10x sub-family, 35 for the STM8L15x sub-family), with template projects for the most common development toolchains. With the appropriate hardware evaluation board, only a few hours are needed to get started with a brand new microcontroller. It is then up to you to choose how to use the library. You can either pick up the files useful for the design, use examples to get trained or quickly evaluate the product. You can also use the API to save development time. Let us now have a look at the few key files and concepts. Two separate libraries support the STM8L10x and STM8L15x devices. In the file names below, you simply need to replace the “stm8l1xx_” prefix by “stm8l10x” or “stm8l15x” depending on the chosen product. ● stm8l1xx_.h This file is the only header file that must be included in the C source code, usually in main.c. This file contains: – data structures and address mapping for all peripherals – macros to access peripheral register hardware (for bit manipulation for instance), plus STM8 core intrinsics – a configuration section used to select the device implemented in the target application. You also have the choice to use or not the peripheral drivers in the application code (that is code based on direct access to registers rather than through API drivers) ● stm8l1xx_conf.h This is the peripheral driver configuration file, where you specify the peripherals you want to use in your application, plus a few application-specific parameters such as the crystal fre- quency. ● stm8l1xxx_it.c This file contains the template IRQ handler to be filled, but this is already the first development step. Once you have understood the above operating principle and file organization, for simple applications, you could virtually switch from one product to the other without referring to the reference manual. Figure 2: STM8L10x code example and Figure 3: STM8L15x code exam- ple show the initialization code (using the firmware library) for STM8L10x and STM8L15x products, respectively. |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |