board.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef board_h
  2. #define board_h
  3. //{{{ Define
  4. #define __inline static inline // Definition for inline funtions
  5. #ifndef NULL
  6. #define NULL '\0'
  7. #endif
  8. #define TRUE 1
  9. #define FALSE 0
  10. #define true 1
  11. #define false 0
  12. #define uchar unsigned char
  13. #define uint unsigned int
  14. #define ulong unsigned long
  15. #define ushort unsigned short
  16. //}}}
  17. #include <AT91SAM7S.H> /* AT91SAMT7S definitions */
  18. #include <lib_AT91SAM7S.H> /* Inline library of function */
  19. #include <stdint.h> /* Exact-width integer types. WG14/N843 C99 Standard */
  20. /* External Oscillator MAINCK [Hz] */
  21. #define MAINCK 18432000
  22. /* Master Clock [Hz] */
  23. #define BOARD_MCK 47923200
  24. /* Configure bootloader 0=US0 or 1=US1 2=DBGU */
  25. #define BOOTLOADER_UART 0
  26. #define BOOTLOADER_BAUDRATE 115200
  27. #define CODE_START ((unsigned int)AT91C_IFLASH + 2048) // Must be multiple of page (128 or 256, check CPU)
  28. /* interrupt locking policy */
  29. #define ARM_INT_KEY_TYPE unsigned int
  30. #if BOOTLOADER_UART == 0
  31. #define BOOTLOADER_UART_BASE AT91C_BASE_US0
  32. #endif
  33. #if BOOTLOADER_UART == 1
  34. #define BOOTLOADER_UART_BASE AT91C_BASE_US1
  35. #endif
  36. #if BOOTLOADER_UART == 2
  37. #define BOOTLOADER_UART_BASE AT91C_BASE_DBGU
  38. #endif
  39. #endif /* bsp_h */