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