config.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #ifndef _CONFIG_H
  2. #define _CONFIG_H
  3. #include "Configuration_prusa.h"
  4. #include "pins.h"
  5. #if (defined(VOLT_IR_PIN) && defined(IR_SENSOR))
  6. # define IR_SENSOR_ANALOG
  7. #endif
  8. //ADC configuration
  9. #ifndef IR_SENSOR_ANALOG
  10. #define ADC_CHAN_MSK 0b0000001001011111 //used AD channels bit mask (0,1,2,3,4,6,9)
  11. #define ADC_DIDR_MSK 0b0000001001011111 //AD channels DIDR mask (1 ~ disabled digital input)
  12. #define ADC_CHAN_CNT 7 //number of used channels)
  13. #else //!IR_SENSOR_ANALOG
  14. #define ADC_CHAN_MSK 0b0000001101011111 //used AD channels bit mask (0,1,2,3,4,6,8,9)
  15. #define ADC_DIDR_MSK 0b0000001001011111 //AD channels DIDR mask (1 ~ disabled digital input)
  16. #define ADC_CHAN_CNT 8 //number of used channels)
  17. #endif //!IR_SENSOR_ANALOG
  18. #define ADC_OVRSAMPL 16 //oversampling multiplier
  19. #define ADC_CALLBACK adc_ready //callback function ()
  20. //SWI2C configuration
  21. //#define SWI2C_SDA 20 //SDA on P3
  22. //#define SWI2C_SCL 21 //SCL on P3
  23. #define SWI2C_A8
  24. #define SWI2C_DEL 20 //2us clock delay
  25. #define SWI2C_TMO 2048 //2048 cycles timeout
  26. //PAT9125 configuration
  27. //#define PAT9125_SWSPI // software SPI mode (incomplete)
  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 PAT9124_YRES_MM (5*PAT9125_YRES/25.4) // counts per mm
  39. //SM4 configuration
  40. #define SM4_DEFDELAY 500 //default step delay [us]
  41. //TMC2130 - Trinamic stepper driver
  42. //pinout - hardcoded
  43. //spi:
  44. #define TMC2130_SPI_RATE 0 // fosc/4 = 4MHz
  45. #define TMC2130_SPCR SPI_SPCR(TMC2130_SPI_RATE, 1, 1, 1, 0)
  46. #define TMC2130_SPSR SPI_SPSR(TMC2130_SPI_RATE)
  47. //LANG - Multi-language support
  48. //#define LANG_MODE 0 // primary language only
  49. #define LANG_MODE 1 // sec. language support
  50. #define LANG_SIZE_RESERVED 0x3000 // reserved space for secondary language (12288 bytes)
  51. //Community language support
  52. #define COMMUNITY_LANG_NL // Community Dutch language
  53. //#define COMMUNITY_LANG_QR // Community new language //..use this as a template and replace 'QR'
  54. #if defined(COMMUNITY_LANG_NL) //|| defined(COMMUNITY_LANG_QR) //..use last part as a template and replace 'QR'
  55. #define COMMUNITY_LANG_SUPPORT
  56. #endif
  57. // Sanity checks for correct configuration of XFLASH_DUMP options
  58. #if defined(XFLASH_DUMP) && !defined(XFLASH)
  59. #error "XFLASH_DUMP requires XFLASH support"
  60. #endif
  61. #if (defined(MENU_DUMP) || defined(EMERGENCY_DUMP)) && !defined(XFLASH_DUMP)
  62. #error "MENU_DUMP and EMERGENCY_DUMP require XFLASH_DUMP"
  63. #endif
  64. // Support for serial dumps is mutually exclusive with XFLASH_DUMP features
  65. #if defined(EMERGENCY_DUMP) && defined(EMERGENCY_SERIAL_DUMP)
  66. #error "EMERGENCY_DUMP and EMERGENCY_SERIAL_DUMP are mutually exclusive"
  67. #endif
  68. #if defined(MENU_DUMP) && defined(MENU_SERIAL_DUMP)
  69. #error "MENU_DUMP and MENU_SERIAL_DUMP are mutually exclusive"
  70. #endif
  71. // Reduce internal duplication
  72. #if defined(EMERGENCY_DUMP) || defined(EMERGENCY_SERIAL_DUMP)
  73. #define EMERGENCY_HANDLERS
  74. #endif
  75. #endif //_CONFIG_H