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