config.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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
  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. #define PAT9125_SWI2C
  29. #define PAT9125_I2C_ADDR 0x75 //ID=LO
  30. //#define PAT9125_I2C_ADDR 0x79 //ID=HI
  31. //#define PAT9125_I2C_ADDR 0x73 //ID=NC
  32. #define PAT9125_XRES 0
  33. #define PAT9125_YRES 240
  34. //SM4 configuration
  35. #define SM4_DEFDELAY 500 //default step delay [us]
  36. //TMC2130 - Trinamic stepper driver
  37. //pinout - hardcoded
  38. //spi:
  39. #define TMC2130_SPI_RATE 0 // fosc/4 = 4MHz
  40. #define TMC2130_SPCR SPI_SPCR(TMC2130_SPI_RATE, 1, 1, 1, 0)
  41. #define TMC2130_SPSR SPI_SPSR(TMC2130_SPI_RATE)
  42. //W25X20CL configuration
  43. //pinout:
  44. #define W25X20CL_PIN_CS 32
  45. //spi:
  46. #define W25X20CL_SPI_RATE 0 // fosc/4 = 4MHz
  47. #define W25X20CL_SPCR SPI_SPCR(W25X20CL_SPI_RATE, 1, 1, 1, 0)
  48. #define W25X20CL_SPSR SPI_SPSR(W25X20CL_SPI_RATE)
  49. //LANG - Multi-language support
  50. //#define LANG_MODE 0 // primary language only
  51. #define LANG_MODE 1 // sec. language support
  52. #define LANG_SIZE_RESERVED 0x3000 // reserved space for secondary language (12288 bytes)
  53. #endif //_CONFIG_H