diff --git a/lambda-test/lambda-test.c b/lambda-test/lambda-test.c index ef3d450..f41315a 100644 --- a/lambda-test/lambda-test.c +++ b/lambda-test/lambda-test.c @@ -29,6 +29,7 @@ #include "integers.h" #include "sensors.h" #include "display.h" +#include "pins.h" #include "avrjunit.h" static const tableEntry testTable[] = { diff --git a/lambda/adc.c b/lambda/adc.c index f690ac2..da9db13 100644 --- a/lambda/adc.c +++ b/lambda/adc.c @@ -12,6 +12,7 @@ #include #include #include "adc.h" +#include "pins.h" /** * Returns to where sleep_mode() was called when ADC conversion is complete. diff --git a/lambda/adc.h b/lambda/adc.h index 99aa070..f0eb88b 100644 --- a/lambda/adc.h +++ b/lambda/adc.h @@ -17,10 +17,6 @@ #define ADC_OFFSET_MV 7 #define TEMPO_OP_OFFSET_MV 454 -#define ADC_TEMPI PC5 // PC5 on diagram -#define ADC_TEMPO PC0 // PC4 on diagram -#define ADC_LAMBDA PC2 // PC3 on diagram - /** * Sets up reference voltage and clock prescaler of the ADC and enables it. */ diff --git a/lambda/lcdroutines.c b/lambda/lcdroutines.c index ea6942e..f2def83 100644 --- a/lambda/lcdroutines.c +++ b/lambda/lcdroutines.c @@ -5,8 +5,9 @@ // Die Pinbelegung ist über defines in lcd-routines.h einstellbar #include -#include "lcdroutines.h" #include +#include "lcdroutines.h" +#include "pins.h" //////////////////////////////////////////////////////////////////////////////// diff --git a/lambda/lcdroutines.h b/lambda/lcdroutines.h index e362a56..4a37f93 100644 --- a/lambda/lcdroutines.h +++ b/lambda/lcdroutines.h @@ -13,19 +13,6 @@ #endif //////////////////////////////////////////////////////////////////////////////// -// Pinbelegung für das LCD, an verwendete Pins anpassen -// Alle LCD Pins dürfen an beliebige Pins am selben Port angeschlossen werden - -#define LCD_PORT PORTD -#define LCD_DDR DDRD -#define LCD_RS PD6 // PD7 on diagram -#define LCD_EN PD7 // PD6 on diagram -#define LCD_DB4 PD5 // PD5 on diagram -#define LCD_DB5 PD2 // PD4 on diagram -#define LCD_DB6 PD3 // PD3 on diagram -#define LCD_DB7 PD4 // PD2 on diagram - -//////////////////////////////////////////////////////////////////////////////// // LCD Ausführungszeiten (MS=Millisekunden, US=Mikrosekunden) #define LCD_BOOTUP_MS 15 diff --git a/lambda/pins.h b/lambda/pins.h new file mode 100644 index 0000000..a559fd0 --- /dev/null +++ b/lambda/pins.h @@ -0,0 +1,28 @@ +/* + * pins.h + * + * Created on: 06.05.2015 + * Author: dode@luniks.net + */ + +#ifndef PINS_H_ +#define PINS_H_ + +/** ADC pin for the type K thermocouple signal */ +#define ADC_TEMPI PC5 // PC5 on diagram +/** ADC pin for the PT1000 resistance thermometer signal */ +#define ADC_TEMPO PC0 // PC4 on diagram +/** ADC pin for the LSM 11 oxygen sensor signal */ +#define ADC_LAMBDA PC2 // PC3 on diagram + +/* Pins for the LCD */ +#define LCD_PORT PORTD +#define LCD_DDR DDRD +#define LCD_RS PD6 // PD7 on diagram +#define LCD_EN PD7 // PD6 on diagram +#define LCD_DB4 PD5 // PD5 on diagram +#define LCD_DB5 PD2 // PD4 on diagram +#define LCD_DB6 PD3 // PD3 on diagram +#define LCD_DB7 PD4 // PD2 on diagram + +#endif /* PINS_H_ */ diff --git a/lambda/sensors.c b/lambda/sensors.c index 4c84c70..63a7f5d 100644 --- a/lambda/sensors.c +++ b/lambda/sensors.c @@ -17,6 +17,7 @@ #include "adc.h" #include "sensors.h" #include "integers.h" +#include "pins.h" /** * Table used to look up the lambda value at 12 V heater voltage