config.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef _CONFIG_H
  2. #define _CONFIG_H
  3. #include "Configuration_prusa.h"
  4. #include "pins.h"
  5. #define IR_SENSOR_ANALOG (defined(VOLT_IR_PIN) && defined(IR_SENSOR))
  6. //ADC configuration
  7. #if !IR_SENSOR_ANALOG
  8. #define ADC_CHAN_MSK 0b0000001001011111 //used AD channels bit mask (0,1,2,3,4,6,9)
  9. #define ADC_DIDR_MSK 0b0000001001011111 //AD channels DIDR mask (1 ~ disabled digital input)
  10. #define ADC_CHAN_CNT 7 //number of used channels)
  11. #else //!IR_SENSOR_ANALOG
  12. #define ADC_CHAN_MSK 0b0000001101011111 //used AD channels bit mask (0,1,2,3,4,6,8,9)
  13. #define ADC_DIDR_MSK 0b0000001001011111 //AD channels DIDR mask (1 ~ disabled digital input)
  14. #define ADC_CHAN_CNT 8 //number of used channels)
  15. #endif //!IR_SENSOR_ANALOG
  16. #define ADC_OVRSAMPL 16 //oversampling multiplier
  17. #define ADC_CALLBACK adc_ready //callback function ()
  18. //SWI2C configuration
  19. #define SWI2C
  20. //#define SWI2C_SDA 20 //SDA on P3
  21. //#define SWI2C_SCL 21 //SCL on P3
  22. #define SWI2C_A8
  23. #define SWI2C_DEL 20 //2us clock delay
  24. #define SWI2C_TMO 2048 //2048 cycles timeout
  25. //PAT9125 configuration
  26. #define PAT9125_SWI2C
  27. #define PAT9125_I2C_ADDR 0x75 //ID=LO
  28. //#define PAT9125_I2C_ADDR 0x79 //ID=HI
  29. //#define PAT9125_I2C_ADDR 0x73 //ID=NC
  30. #define PAT9125_XRES 0
  31. #define PAT9125_YRES 240 // maximum resolution (5*X cpi)
  32. #define PAT9124_YRES_MM (5*PAT9125_YRES/25.4) // counts per mm
  33. //SM4 configuration
  34. #define SM4_DEFDELAY 500 //default step delay [us]
  35. //TMC2130 - Trinamic stepper driver
  36. //pinout - hardcoded
  37. //spi:
  38. #define TMC2130_SPI_RATE 0 // fosc/4 = 4MHz
  39. #define TMC2130_SPCR SPI_SPCR(TMC2130_SPI_RATE, 1, 1, 1, 0)
  40. #define TMC2130_SPSR SPI_SPSR(TMC2130_SPI_RATE)
  41. //W25X20CL configuration
  42. //pinout:
  43. #define W25X20CL_PIN_CS 32
  44. //spi:
  45. #define W25X20CL_SPI_RATE 0 // fosc/4 = 4MHz
  46. #define W25X20CL_SPCR SPI_SPCR(W25X20CL_SPI_RATE, 1, 1, 1, 0)
  47. #define W25X20CL_SPSR SPI_SPSR(W25X20CL_SPI_RATE)
  48. //LANG - Multi-language support
  49. //define LANG_MODE 0 // primary language only
  50. #define LANG_MODE 1 // sec. language support
  51. #define LANG_SIZE_RESERVED 0x3000 // reserved space for secondary language (12288 bytes)
  52. #endif //_CONFIG_H