| Electronic Components Datasheet Search |
|
UM0097 Datasheet(PDF) 14 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0097 Datasheet(HTML) 14 Page - STMicroelectronics |
|
14 / 229 page ![]() Firmware library UM0097 14/229 One memory mapping file 71x_map.h is supplied for all peripherals. This file contains all the register declarations for both development and debug modes. The header file 71x_lib.h includes all the peripheral header files. This is the only file that has to be included in the user application to interface with the library. You can modify the 71x_conf.h to define which peripherals need to be included in the application to make it run. Other files are also provided: 71x_it.h and 71x_it.c. These files contain all the firmware functions required to handle the STR71x interrupts. If you want to handle an interrupt routine, you should modify the appropriate function in the file 71x_it.c (the body of each function is empty by default). Note: Only the 71x_conf.h and 71x_it.c files should be modified to link the application with the library. 2.3 How to use the STR71x library This section describes how to implement an application using the STR71x firmware library. Example: The application initializes and starts two timer overflow interrupts. When a timer expires, an interrupt, handled in 71x_it.c, is generated. Timer 0 generates an overflow interrupt every 130 ms and toggles the GPIO0 pin level on/off. Timer 1 is configured to generate an interrupt every 2.1s and to set GPIO1 pin to high level for 1.05 s. The chip is clocked by an external oscillator at a frequency of 16 MHz. Timer 0 interrupt priority is set to be higher than Timer 1 interrupt priority to allow the Timer 0 T0TIMI_IRQHandler interrupt routine to be served during the execution of the Timer 1 interrupt routine. The following figure shows the behavior of the GPIO0 and GPIO1 pins and Timer 0 and Timer 1 interrupts. Figure 3. Timer0 and Timer1 interrupt handling The following steps explain how to use the STR71x library to build the user application ● Edit the 71x_conf.h file and uncomment the _GPIO and _TIM labels, this allows you to include the firmware libraries of the GPIO and the TIM peripherals in your firmware. Uncomment the _GPIO0, _GPIO1, _TIM0 and _TIM1 labels to be able to access the peripheral registers. Uncomment the DEBUG label, this allows you to see the peripheral registers content in the watch window. GPIO0 pin GPIO1 pin Timer0 interrupt Timer1 interrupt |
|
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 |