config.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. #ifndef _CONFIG_H
  2. #define _CONFIG_H
  3. #include "Configuration_var.h"
  4. #include "pins.h"
  5. #if (defined(VOLT_IR_PIN) && defined(IR_SENSOR))
  6. // TODO: IR_SENSOR_ANALOG currently disabled as being incompatible with the new thermal regulation
  7. // # define IR_SENSOR_ANALOG
  8. #endif
  9. //ADC configuration
  10. #ifndef IR_SENSOR_ANALOG
  11. #define ADC_CHAN_MSK 0b0000001001011111 //used AD channels bit mask (0,1,2,3,4,6,9)
  12. #define ADC_DIDR_MSK 0b0000001001011111 //AD channels DIDR mask (1 ~ disabled digital input)
  13. #define ADC_CHAN_CNT 7 //number of used channels)
  14. #else //!IR_SENSOR_ANALOG
  15. #define ADC_CHAN_MSK 0b0000001101011111 //used AD channels bit mask (0,1,2,3,4,6,8,9)
  16. #define ADC_DIDR_MSK 0b0000001001011111 //AD channels DIDR mask (1 ~ disabled digital input)
  17. #define ADC_CHAN_CNT 8 //number of used channels)
  18. #endif //!IR_SENSOR_ANALOG
  19. #define ADC_OVRSAMPL 16 //oversampling multiplier
  20. #define ADC_CALLBACK adc_callback //callback function ()
  21. //SWI2C configuration
  22. //#define SWI2C_SDA 20 //SDA on P3
  23. //#define SWI2C_SCL 21 //SCL on P3
  24. #define SWI2C_A8
  25. #define SWI2C_DEL 20 //2us clock delay
  26. #define SWI2C_TMO 2048 //2048 cycles timeout
  27. //PAT9125 configuration
  28. #ifdef SWI2C_SCL
  29. #define PAT9125_SWI2C // software I2C mode
  30. #else
  31. #define PAT9125_I2C // hardware I2C mode
  32. #endif
  33. #define PAT9125_I2C_ADDR 0x75 //ID=LO
  34. //#define PAT9125_I2C_ADDR 0x79 //ID=HI
  35. //#define PAT9125_I2C_ADDR 0x73 //ID=NC
  36. #define PAT9125_XRES 0
  37. #define PAT9125_YRES 240 // maximum resolution (5*X cpi)
  38. #define PAT9125_YRES_MM (5*PAT9125_YRES/25.4) // counts per mm
  39. #define PAT9125_INVERT_X 0 //1 means flipped
  40. #define PAT9125_INVERT_Y 1 //1 means flipped
  41. #define PAT9125_SWAP_XY 0 //X is Y and Y is X
  42. #define PAT9125_12B_RES 1 //8bit or 12bit signed motion data
  43. #define PAT9125_NEW_INIT 1 //set to 1 to use the magic sequence provided by pixart.
  44. //SM4 configuration
  45. #define SM4_DEFDELAY 500 //default step delay [us]
  46. //TMC2130 - Trinamic stepper driver
  47. //pinout - hardcoded
  48. //spi:
  49. #define TMC2130_SPI_RATE 0 // fosc/4 = 4MHz
  50. #define TMC2130_SPCR SPI_SPCR(TMC2130_SPI_RATE, 1, 1, 1, 0)
  51. #define TMC2130_SPSR SPI_SPSR(TMC2130_SPI_RATE)
  52. // This is set by the cmake build to be able to take control of
  53. // the language flag, without breaking existing build mechanisms.
  54. #ifndef CMAKE_CONTROL
  55. //LANG - Multi-language support
  56. //#define LANG_MODE 0 // primary language only
  57. #define LANG_MODE 1 // sec. language support
  58. #endif
  59. #define LANG_SIZE_RESERVED 0x3500 // reserved space for secondary language (13568 bytes).
  60. // 0x3D00 Maximum 15616 bytes as it depends on xflash_layout.h
  61. // 16 Languages max. per group including stock
  62. #if (LANG_SIZE_RESERVED % 256)
  63. #error "LANG_SIZE_RESERVED should be a multiple of a page size"
  64. #endif
  65. //Community language support
  66. #define COMMUNITY_LANG_GROUP 1
  67. #if (COMMUNITY_LANG_GROUP == 1)
  68. #define COMMUNITY_LANG_GROUP1_NL // Community Dutch language
  69. #define COMMUNITY_LANG_GROUP1_RO // Community Romanian language
  70. #define COMMUNITY_LANG_GROUP1_HU // Community Hungarian language
  71. #define COMMUNITY_LANG_GROUP1_HR // Community Croatian language
  72. #define COMMUNITY_LANG_GROUP1_SK // Community Slovak language
  73. #define COMMUNITY_LANG_GROUP1_SV // Community Swedish language
  74. #define COMMUNITY_LANG_GROUP1_NO // Community Norwegian language
  75. //#define COMMUNITY_LANG_GROUP1_DA // Community Danish language
  76. //#define COMMUNITY_LANG_GROUP1_SL // Community Slovanian language
  77. //#define COMMUNITY_LANG_GROUP1_LB // Community Luxembourgish language
  78. #endif //COMMUNITY_LANG_GROUP 1
  79. #if (COMMUNITY_LANG_GROUP == 2)
  80. #define COMMUNITY_LANG_GROUP2_LT // Community Lithuanian language
  81. //#define COMMUNITY_LANG_GROUP1_QR // Community new language //..use this as a template and replace 'QR'
  82. #endif //COMMUNITY_LANG_GROUP 2
  83. #if (COMMUNITY_LANG_GROUP >=1 )
  84. #define COMMUNITY_LANGUAGE_SUPPORT
  85. #endif
  86. // Sanity checks for correct configuration of XFLASH_DUMP options
  87. #if defined(XFLASH_DUMP) && !defined(XFLASH)
  88. #error "XFLASH_DUMP requires XFLASH support"
  89. #endif
  90. #if (defined(MENU_DUMP) || defined(EMERGENCY_DUMP)) && !defined(XFLASH_DUMP)
  91. #error "MENU_DUMP and EMERGENCY_DUMP require XFLASH_DUMP"
  92. #endif
  93. // Support for serial dumps is mutually exclusive with XFLASH_DUMP features
  94. #if defined(EMERGENCY_DUMP) && defined(EMERGENCY_SERIAL_DUMP)
  95. #error "EMERGENCY_DUMP and EMERGENCY_SERIAL_DUMP are mutually exclusive"
  96. #endif
  97. #if defined(MENU_DUMP) && defined(MENU_SERIAL_DUMP)
  98. #error "MENU_DUMP and MENU_SERIAL_DUMP are mutually exclusive"
  99. #endif
  100. // Reduce internal duplication
  101. #if defined(EMERGENCY_DUMP) || defined(EMERGENCY_SERIAL_DUMP)
  102. #define EMERGENCY_HANDLERS
  103. #endif
  104. //FARM_MODE
  105. #if ( LANG_MODE == 0 ) && defined(XFLASH) //Save resources on EINSY and disable FARM_MODE on multi-language version
  106. #define PRUSA_FARM
  107. #endif //PRUSA_FARM only in english on EINSYs
  108. #ifndef XFLASH //enable FARM_MODE on miniRAMBo boards
  109. #define PRUSA_FARM
  110. #endif
  111. #endif //_CONFIG_H