config.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef _CONFIG_H
  2. #define _CONFIG_H
  3. //ADC configuration
  4. #define ADC_CHAN_MSK 0b0000001001011111 //used AD channels bit mask (0,1,2,3,4,6,9)
  5. #define ADC_CHAN_CNT 7 //number of used channels)
  6. #define ADC_OVRSAMPL 16 //oversampling multiplier
  7. #define ADC_CALLBACK adc_ready //callback function ()
  8. //SWI2C configuration
  9. #define SWI2C
  10. //#define SWI2C_SDA 20 //SDA on P3
  11. //#define SWI2C_SCL 21 //SCL on P3
  12. #define SWI2C_A8
  13. #define SWI2C_DEL 20 //2us clock delay
  14. #define SWI2C_TMO 2048 //2048 cycles timeout
  15. //SM4 configuration
  16. #define SM4_DEFDELAY 500 //default step delay [us]
  17. //TMC2130 - Trinamic stepper driver
  18. //pinout - hardcoded
  19. //spi:
  20. #define TMC2130_SPI_RATE 0 // fosc/4 = 4MHz
  21. #define TMC2130_SPCR SPI_SPCR(TMC2130_SPI_RATE, 1, 1, 1, 0)
  22. #define TMC2130_SPSR SPI_SPSR(TMC2130_SPI_RATE)
  23. //W25X20CL configuration
  24. //pinout:
  25. #define W25X20CL_PIN_CS 32
  26. //spi:
  27. #define W25X20CL_SPI_RATE 0 // fosc/4 = 4MHz
  28. #define W25X20CL_SPCR SPI_SPCR(W25X20CL_SPI_RATE, 1, 1, 1, 0)
  29. #define W25X20CL_SPSR SPI_SPSR(W25X20CL_SPI_RATE)
  30. //LANG - Multi-language support
  31. //#define LANG_MODE 0 // primary language only
  32. #define LANG_MODE 1 // sec. language support
  33. #define LANG_SIZE_RESERVED 0x2400 // reserved space for secondary language (~12kb)
  34. //#define LANG_SIZE_RESERVED 0x1ef8 // reserved space for secondary language (~10kb)
  35. #endif //_CONFIG_H