fork download
  1. #include <stdint.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. #define __IO volatile /*!< Defines 'read / write' permissions */
  6. /**
  7. * @brief General Purpose I/O
  8.   */
  9.  
  10. typedef struct
  11. {
  12. __IO uint32_t CRL;
  13. __IO uint32_t CRH;
  14. __IO uint32_t IDR;
  15. __IO uint32_t ODR;
  16. __IO uint32_t BSRR;
  17. __IO uint32_t BRR;
  18. __IO uint32_t LCKR;
  19. } GPIO_TypeDef;
  20.  
  21. #define PERIPH_BASE 0x40000000UL /*!< Peripheral base address in the alias region */
  22. #define APB1PERIPH_BASE PERIPH_BASE
  23. #define APB2PERIPH_BASE (PERIPH_BASE + 0x00010000UL)
  24. #define GPIOA_BASE (APB2PERIPH_BASE + 0x00000800UL)
  25. #define GPIOA ((GPIO_TypeDef *)GPIOA_BASE)
  26.  
  27. int main()
  28. {
  29. printf ("%x",GPIOA);
  30. return 0;
  31. }
Success #stdin #stdout 0s 4464KB
stdin
Standard input is empty
stdout
40010800