| Electronic Components Datasheet Search |
|
UM0097 Datasheet(PDF) 9 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0097 Datasheet(HTML) 9 Page - STMicroelectronics |
|
9 / 229 page ![]() UM0097 Document and library rules 9/229 Peripherals are declared in 71x_map.h file. This example shows the declaration of the GPIO peripheral: #ifndef EXT #define EXT extern #endif ... /* APB2 Base Address definition */ #define APB2_BASE 0xE0000000 #define GPIO0_BASE (APB2_BASE + 0x3000) #define GPIO1_BASE (APB2_BASE + 0x4000) /* GPIO0 and GPIO1 peripherals declaration */ #ifndef DEBUG ... #ifdef _GPIO0 #define GPIO0 ((GPIO_TypeDef *)GPIO0_BASE) #endif /*GPIO0*/ #ifdef _GPIO1 #define GPIO1 ((GPIO_TypeDef *)GPIO1_BASE) #endif /*GPIO1*/ ... #else /* DEBUG */ #ifdef _GPIO0 EXT GPIO_TypeDef *GPIO0; #endif /*GPIO0*/ #ifdef _GPIO1 EXT GPIO_TypeDef *GPIO1; #endif /*GPIO1*/ ... #endif /* DEBUG */ To enter debug mode you have to define the label DEBUG in 71X_conf.h file. Debug mode allows you to watch the peripheral registers in a debugger window, but it uses up some additional memory space and makes the code less efficient. In both cases GPIO0 is a pointer to the first address of GPIO0 port. EXT variable is defined in the file 71x_lib.c as follows: #define EXT DEBUG mode is initialized as follows in the 71x_lib.c file: #define DEBUG #ifdef DEBUG void debug(void) { #ifdef _GPIO0 GPIO0 = (GPIO_TypeDef *)GPIO0_BASE; #endif |
|
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 |