config.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #ifndef _CONFIG_H
  2. #define _CONFIG_H
  3. #include "autoconf.h"
  4. // #define DEBUG_FS
  5. // #define DEBUG_SD
  6. // #define DEBUG_IRQ
  7. // #define DEBUG_MSU1
  8. #define IN_AHBRAM __attribute__ ((section(".ahbram")))
  9. #define SD_DT_INT_SETUP() do {\
  10. BITBAND(LPC_GPIOINT->IO2IntEnR, SD_DT_BIT) = 1;\
  11. BITBAND(LPC_GPIOINT->IO2IntEnF, SD_DT_BIT) = 1;\
  12. } while(0)
  13. #define SD_CHANGE_DETECT (BITBAND(LPC_GPIOINT->IO2IntStatR, SD_DT_BIT)\
  14. |BITBAND(LPC_GPIOINT->IO2IntStatF, SD_DT_BIT))
  15. #define SD_CHANGE_CLR() do {LPC_GPIOINT->IO2IntClr = BV(SD_DT_BIT);} while(0)
  16. #define SD_DT_REG LPC_GPIO0
  17. #define SD_DT_BIT 8
  18. #define SD_WP_REG LPC_GPIO0
  19. #define SD_WP_BIT 6
  20. #define SDCARD_DETECT (!(BITBAND(SD_DT_REG->FIOPIN, SD_DT_BIT)))
  21. #define SDCARD_WP (BITBAND(SD_WP_REG->FIOPIN, SD_WP_BIT))
  22. #define SD_SUPPLY_VOLTAGE (1L<<21) /* 3.3V - 3.4V */
  23. #define CONFIG_SD_BLOCKTRANSFER 1
  24. #define CONFIG_SD_AUTO_RETRIES 10
  25. // #define SD_CHANGE_VECT
  26. // #define CONFIG_SD_DATACRC 1
  27. #define CONFIG_UART_NUM 3
  28. // #define CONFIG_CPU_FREQUENCY 90315789
  29. #define CONFIG_CPU_FREQUENCY 88000000
  30. //#define CONFIG_CPU_FREQUENCY 46000000
  31. #define CONFIG_UART_PCLKDIV 1
  32. #define CONFIG_UART_TX_BUF_SHIFT 8
  33. //#define CONFIG_UART_BAUDRATE 921600
  34. #define CONFIG_UART_BAUDRATE 115200
  35. #define CONFIG_UART_DEADLOCKABLE
  36. #define SSP_CLK_DIVISOR 2
  37. #define SNES_RESET_REG LPC_GPIO1
  38. #define SNES_RESET_BIT 26
  39. #define SNES_CIC_D0_REG LPC_GPIO0
  40. #define SNES_CIC_D0_BIT 1
  41. #define SNES_CIC_D1_REG LPC_GPIO0
  42. #define SNES_CIC_D1_BIT 0
  43. #define SNES_CIC_STATUS_REG LPC_GPIO1
  44. #define SNES_CIC_STATUS_BIT 29
  45. #define SNES_CIC_PAIR_REG LPC_GPIO1
  46. #define SNES_CIC_PAIR_BIT 25
  47. #define FPGA_MCU_RDY_REG LPC_GPIO2
  48. #define FPGA_MCU_RDY_BIT 9
  49. #define QSORT_MAXELEM 2048
  50. #define SORT_STRLEN 256
  51. #define CLTBL_SIZE 100
  52. #define DIR_FILE_MAX 16380
  53. #define SSP_REGS LPC_SSP0
  54. #define SSP_PCLKREG PCLKSEL1
  55. // 1: PCLKSEL0
  56. #define SSP_PCLKBIT 10
  57. // 1: 20
  58. #define SSP_DMAID_TX 0
  59. // 1: 2
  60. #define SSP_DMAID_RX 1
  61. // 1: 3
  62. #define SSP_DMACH LPC_GPDMACH0
  63. #define SD_CLKREG LPC_GPIO0
  64. #define SD_CMDREG LPC_GPIO0
  65. #define SD_DAT0REG LPC_GPIO2
  66. #define SD_DAT1REG LPC_GPIO2
  67. #define SD_DAT2REG LPC_GPIO2
  68. #define SD_DAT3REG LPC_GPIO2
  69. #define SD_CLKPIN (7)
  70. #define SD_CMDPIN (9)
  71. #define SD_DAT0PIN (0)
  72. #define SD_DAT1PIN (1)
  73. #define SD_DAT2PIN (2)
  74. #define SD_DAT3PIN (3)
  75. #define SD_DAT (LPC_GPIO2->FIOPIN0)
  76. #endif