123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855 |
- /* ************************************************************************
- *
- * ATmega 328 specific global configuration, setup and settings
- *
- * (c) 2012-2020 by Markus Reschke
- * based on code from Markus Frejek and Karl-Heinz Kübbeler
- *
- * ************************************************************************ */
- /* source management */
- #define CONFIG_328_H
- /* ************************************************************************
- * LCD module
- * ************************************************************************ */
- /*
- * LCD module / controller
- *
- * Please uncomment the package matching your LCD module and adjust
- * settings. And comment out the default package if not used.
- *
- * To uncomment, remove the enclosing "#if 0" and "#endif" or put
- * a "//" in front of both. To comment out, remove the "//" in front
- * of the "#if 0" and "#endif".
- *
- * Individual settings can be enabled by removing the leading "//", or
- * disabled by placing a "//" in front of the setting.
- */
- /*
- * HD44780, 4 bit parallel interface
- * - if you change LCD_DB4/5/6/7 comment out LCD_DB_STD!
- */
- #if 0
- #define LCD_HD44780 /* display controller HD44780 */
- #define LCD_TEXT /* character display */
- #define LCD_PAR_4 /* 4 bit parallel interface */
- #define LCD_PORT PORTD /* port data register */
- #define LCD_DDR DDRD /* port data direction register */
- #define LCD_DB_STD /* use standard pins 0-3 for DB4-7 */
- #define LCD_DB4 PD0 /* port pin used for DB4 */
- #define LCD_DB5 PD1 /* port pin used for DB5 */
- #define LCD_DB6 PD2 /* port pin used for DB6 */
- #define LCD_DB7 PD3 /* port pin used for DB7 */
- #define LCD_RS PD4 /* port pin used for RS */
- #define LCD_EN1 PD5 /* port pin used for E */
- #define LCD_CHAR_X 16 /* characters per line */
- #define LCD_CHAR_Y 2 /* number of lines */
- /* HD44780 has an internal 5x7 font */
- #define FONT_HD44780_INT /* International font (English) */
- //#define FONT_HD44780_WIN1251 /* Cyrillic font (European) */
- #endif
- /*
- * HD44780, PCF8574 based backpack (bit-bang I2C)
- * - if you change LCD_DB4/5/6/7 comment out LCD_DB_STD!
- * - PCF8574T is 0x27, PCF8574AT is 0x3f
- */
- #if 0
- #define LCD_HD44780 /* display controller HD44780 */
- #define LCD_TEXT /* character display */
- #define LCD_PCF8574 /* PCF8574 backpack */
- #define LCD_I2C_ADDR 0x3f /* PCF8574's I2C address */
- #define LCD_DB_STD /* use standard pins 4-7 for DB4-7 */
- #define LCD_DB4 PCF8574_P4 /* port pin used for DB4 */
- #define LCD_DB5 PCF8574_P5 /* port pin used for DB5 */
- #define LCD_DB6 PCF8574_P6 /* port pin used for DB6 */
- #define LCD_DB7 PCF8574_P7 /* port pin used for DB7 */
- #define LCD_RS PCF8574_P0 /* port pin used for RS */
- #define LCD_RW PCF8574_P1 /* port pin used for RW */
- #define LCD_EN1 PCF8574_P2 /* port pin used for E */
- #define LCD_LED PCF8574_P3 /* port pin used for backlight */
- #define LCD_CHAR_X 16 /* characters per line */
- #define LCD_CHAR_Y 2 /* number of lines */
- /* HD44780 has an internal 5x7 font */
- #define FONT_HD44780_INT /* International font (English) */
- //#define FONT_HD44780_WIN1251 /* Cyrillic font (European) */
- #define I2C_BITBANG /* bit-bang I2C */
- #define I2C_STANDARD_MODE /* 100kHz bus speed */
- #define I2C_PORT PORTD /* I2C port data register */
- #define I2C_DDR DDRD /* I2C port data direction register */
- #define I2C_PIN PIND /* I2C port input pins register */
- #define I2C_SDA PD0 /* port pin used for SDA */
- #define I2C_SCL PD1 /* port pin used for SCL */
- #endif
- /*
- * ST7565R, SPI interface (bit-bang)
- * - settings for Electronic Assembly EA DOGM/DOGL128-6
- * - uses LCD_CS to support rotary encoder in parallel at PD2/3
- */
- #if 0
- #define LCD_ST7565R /* display controller ST7565R */
- #define LCD_GRAPHIC /* graphic display */
- #define LCD_SPI /* SPI interface */
- #define LCD_PORT PORTD /* port data register */
- #define LCD_DDR DDRD /* port data direction register */
- #define LCD_RESET PD0 /* port pin used for /RES (optional) */
- #define LCD_CS PD5 /* port pin used for /CS1 (optional) */
- #define LCD_A0 PD1 /* port pin used for A0 */
- #define LCD_SCL PD2 /* port pin used for SCL */
- #define LCD_SI PD3 /* port pin used for SI (LCD's data input) */
- #define LCD_DOTS_X 128 /* number of horizontal dots */
- #define LCD_DOTS_Y 64 /* number of vertical dots */
- //#define LCD_FLIP_X /* enable horizontal flip */
- #define LCD_OFFSET_X /* enable x offset of 4 dots */
- #define LCD_FLIP_Y /* enable vertical flip */
- #define LCD_START_Y 0 /* start line (0-63) */
- #define LCD_CONTRAST 22 /* default contrast (0-63) */
- /* font and symbols: vertically aligned & flipped, bank-wise grouping */
- //#define FONT_6X8_VF /* 6x8 font */
- #define FONT_8X8_VF /* 8x8 font */
- //#define FONT_8X16_VFP /* 8x16 font */
- //#define FONT_6X8_ISO8859_2_VF /* 6x8 Central European font */
- //#define FONT_8X8_ISO8859_2_VF /* 8x8 Central European font */
- //#define FONT_8X12T_ISO8859_2_VFP /* thin 8x12 Central European font */
- //#define FONT_8X16_ISO8859_2_VFP /* 8x16 Central European font */
- //#define FONT_8X8_WIN1251_VF /* 8x8 cyrillic font */
- //#define FONT_8X8T_WIN1251_VF /* thin 8x8 cyrillic font */
- //#define FONT_8X12T_WIN1251_VFP /* thin 8x12 cyrillic font */
- //#define FONT_8X16_WIN1251_VFP /* 8x16 cyrillic font */
- #define SYMBOLS_24X24_VFP /* 24x24 symbols */
- #define SPI_BITBANG /* bit-bang SPI */
- #define SPI_PORT LCD_PORT /* SPI port data register */
- #define SPI_DDR LCD_DDR /* SPI port data direction register */
- #define SPI_SCK LCD_SCL /* port pin used for SCK */
- #define SPI_MOSI LCD_SI /* port pin used for MOSI */
- #endif
- /*
- * ILI9342, SPI interface (bit-bang)
- */
- #if 0
- #define LCD_ILI9341 /* display controller ILI9341/ILI9342 */
- #define LCD_GRAPHIC /* graphic display */
- #define LCD_COLOR /* color display */
- #define LCD_SPI /* SPI interface */
- #define LCD_PORT PORTD /* port data register */
- #define LCD_DDR DDRD /* port data direction register */
- #define LCD_RES PD4 /* port pin used for /RES (optional) */
- #define LCD_CS PD5 /* port pin used for /CS (optional) */
- #define LCD_DC PD3 /* port pin used for D/C */
- #define LCD_SCK PD2 /* port pin used for SCK */
- #define LCD_SDI PD1 /* port pin used for SDI (LCD's data input) */
- //#define LCD_SDO PD0 /* port pin used for SDO (LCD's data output) */
- #define LCD_DOTS_X 320 /* number of horizontal dots */
- #define LCD_DOTS_Y 240 /* number of vertical dots */
- //#define LCD_FLIP_X /* enable horizontal flip */
- //#define LCD_FLIP_Y /* enable vertical flip */
- //#define LCD_ROTATE /* switch X and Y (rotate by 90°) */
- /* font and symbols: horizontally aligned & flipped */
- #define FONT_16X26_HF /* 16x26 font */
- //#define FONT_16X26_ISO8859_2_HF /* 16x26 Central European font */
- #define SYMBOLS_32X32_HF /* 32x32 symbols */
- #define SPI_BITBANG /* bit-bang SPI */
- #define SPI_PORT LCD_PORT /* SPI port data register */
- #define SPI_DDR LCD_DDR /* SPI port data direction register */
- #define SPI_SCK LCD_SCK /* port pin used for SCK */
- #define SPI_MOSI LCD_SDI /* port pin used for MOSI */
- #endif
- /*
- * ST7735, SPI interface (bit-bang, 4 wire)
- */
- #if 1
- #define LCD_ST7735 /* display controller ST7735 */
- #define LCD_GRAPHIC /* graphic display */
- #define LCD_COLOR /* color display */
- #define LCD_SPI /* SPI interface */
- #define LCD_PORT PORTD /* port data register */
- #define LCD_DDR DDRD /* port data direction register */
- #define LCD_RES PD0 /* port pin used for /RESX (optional) */
- #define LCD_CS PD5 /* port pin used for /CSX (optional) */
- #define LCD_DC PD1 /* port pin used for D/CX */
- #define LCD_SCL PD2 /* port pin used for SCL */
- #define LCD_SDA PD3 /* port pin used for SDA */
- #define LCD_DOTS_X 128 /* number of horizontal dots */
- #define LCD_DOTS_Y 160 /* number of vertical dots */
- #define LCD_FLIP_X /* enable horizontal flip */
- //#define LCD_FLIP_Y /* enable vertical flip */
- #define LCD_ROTATE /* switch X and Y (rotate by 90°) */
- //#define LCD_OFFSET_X 4 /* enable x offset of 2 or 4 dots */
- //#define LCD_OFFSET_Y 2 /* enable y offset of 1 or 2 dots */
- #define LCD_LATE_ON /* turn on LCD after clearing it */
- /* font and symbols: horizontally aligned & flipped */
- #define FONT_10X16_HF /* 10x16 font */
- //#define FONT_10X16_ISO8859_2_HF /* 10x16 Central European font */
- //#define FONT_8X16_WIN1251_HF /* 8x16 cyrillic font */
- #define SYMBOLS_24X24_HF /* 24x24 symbols */
- #define SPI_BITBANG /* bit-bang SPI */
- #define SPI_PORT LCD_PORT /* SPI port data register */
- #define SPI_DDR LCD_DDR /* SPI port data direction register */
- #define SPI_SCK LCD_SCL /* port pin used for SCK */
- #define SPI_MOSI LCD_SDA /* port pin used for MOSI */
- #endif
- /*
- * PCD8544, SPI interface (bit-bang)
- * - for a 180° rotated display (LCD_ROT180)
- * - comment out "_VF" font and "_VFP" symbols
- * - uncomment "_V_F" font and "_VP_F" symbols
- */
- #if 0
- #define LCD_PCD8544 /* display controller PCD8544 */
- #define LCD_GRAPHIC /* graphic display */
- #define LCD_SPI /* SPI interface */
- #define LCD_PORT PORTD /* port data register */
- #define LCD_DDR DDRD /* port data direction register */
- #define LCD_RES PD4 /* port pin used for /RES (optional) */
- #define LCD_SCE PD5 /* port pin used for /SCE (optional) */
- #define LCD_DC PD3 /* port pin used for D/C */
- #define LCD_SCLK PD2 /* port pin used for SCLK */
- #define LCD_SDIN PD1 /* port pin used for SDIN (LCD's data input) */
- #define LCD_DOTS_X 84 /* number of horizontal dots */
- #define LCD_DOTS_Y 48 /* number of vertical dots */
- #define LCD_CONTRAST 66 /* default contrast (1-127) */
- /* font and symbols: vertically aligned & flipped */
- #define FONT_6X8_VF /* 6x8 font */
- //#define FONT_6X8_ISO8859_2_VF /* 6x8 Central Euopean font */
- #define SYMBOLS_24X24_VFP /* 24x24 symbols, vertically aligned & flipped */
- //#define LCD_ROT180 /* rotate output by 180° (not supported yet) */
- /* font and symbols: vertically aligned, bank-wise grouping, hor. flipped */
- //#define FONT_6X8_V_F /* 6x8 font */
- //#define FONT_6X8_ISO8859_2_V_F /* 6x8 Central Euopean font */
- //#define SYMBOLS_24X24_VP_F /* 24x24 symbols */
- #define SPI_BITBANG /* bit-bang SPI */
- #define SPI_PORT LCD_PORT /* SPI port data register */
- #define SPI_DDR LCD_DDR /* SPI port data direction register */
- #define SPI_SCK LCD_SCLK /* port pin used for SCK */
- #define SPI_MOSI LCD_SDIN /* port pin used for MOSI */
- #endif
- /*
- * ST7920, SPI interface (bit-bang)
- * - for a 180° rotated display (LCD_ROT180)
- * - comment out "_H" font and symbols
- * - uncomment "_HF" font and symbols
- */
- #if 0
- #define LCD_ST7920 /* display controller ST7920 */
- #define LCD_GRAPHIC /* graphic display */
- #define LCD_SPI /* SPI interface */
- #define LCD_PORT PORTD /* port data register */
- #define LCD_DDR DDRD /* port data direction register */
- #define LCD_RESET PD4 /* port pin used for /RESET (optional) */
- #define LCD_CS PD5 /* port pin used for CS (optional) */
- #define LCD_SCLK PD2 /* port pin used for SCLK */
- #define LCD_SID PD1 /* port pin used for SID (LCD's data input) */
- #define LCD_DOTS_X 128 /* number of horizontal dots */
- #define LCD_DOTS_Y 64 /* number of vertical dots */
- /* font and symbols: horizonally aligned */
- #define FONT_8X8_H /* 8x8 font */
- //#define FONT_8X8_ISO8859_2_H /* 8x8 Central European font */
- #define SYMBOLS_24X24_H /* 24x24 symbols */
- //#define LCD_ROT180 /* rotate output by 180° */
- /* font and symbols: horizonally aligned & flipped */
- //#define FONT_8X8_HF /* 8x8 font */
- //#define FONT_8X8_ISO8859_2_HF /* 8x8 Central European font */
- //#define SYMBOLS_24X24_HF /* 24x24 symbols */
- #define SPI_BITBANG /* bit-bang SPI */
- #define SPI_PORT LCD_PORT /* SPI port data register */
- #define SPI_DDR LCD_DDR /* SPI port data direction register */
- #define SPI_SCK LCD_SCLK /* port pin used for SCK */
- #define SPI_MOSI LCD_SID /* port pin used for MOSI */
- #endif
- /*
- * ST7920, 4 bit parallel interface
- * - if you change LCD_DB4/5/6/7 comment out LCD_DB_STD!
- * - for a 180° rotated display (LCD_ROT180)
- * - comment out "_H" font and symbol
- * - uncomment "_HF" font and symbol
- */
- #if 0
- #define LCD_ST7920 /* display controller ST7920 */
- #define LCD_GRAPHIC /* graphic display */
- #define LCD_PAR_4 /* 4 bit parallel interface */
- #define LCD_PORT PORTD /* port data register */
- #define LCD_DDR DDRD /* port data direction register */
- #define LCD_DB_STD /* use standard pins 0-3 for DB4-7 */
- #define LCD_DB4 PD0 /* port pin used for DB4 */
- #define LCD_DB5 PD1 /* port pin used for DB5 */
- #define LCD_DB6 PD2 /* port pin used for DB6 */
- #define LCD_DB7 PD3 /* port pin used for DB7 */
- #define LCD_RS PD4 /* port pin used for RS */
- #define LCD_EN PD5 /* port pin used for E */
- #define LCD_DOTS_X 128 /* number of horizontal dots */
- #define LCD_DOTS_Y 64 /* number of vertical dots */
- /* font and symbols: horizonally aligned */
- #define FONT_8X8_H /* 8x8 font */
- #define SYMBOLS_24X24_H /* 24x24 symbols */
- //#define LCD_ROT180 /* rotate output by 180° */
- /* font and symbols: horizonally aligned & flipped */
- //#define FONT_8X8_HF /* 8x8 font */
- //#define SYMBOLS_24X24_HF /* 24x24 symbols */
- #endif
- /*
- * ILI9163, SPI interface (bit-bang, 4 wire)
- */
- #if 0
- #define LCD_ILI9163 /* display controller ILI9163 */
- #define LCD_GRAPHIC /* graphic display */
- #define LCD_COLOR /* color display */
- #define LCD_SPI /* SPI interface */
- #define LCD_PORT PORTD /* port data register */
- #define LCD_DDR DDRD /* port data direction register */
- #define LCD_RES PD4 /* port pin used for /RESX (optional) */
- #define LCD_CS PD5 /* port pin used for /CSX (optional) */
- #define LCD_DC PD3 /* port pin used for D/CX */
- #define LCD_SCL PD2 /* port pin used for SCL */
- #define LCD_SDA PD1 /* port pin used for SDA/SDIO */
- #define LCD_DOTS_X 128 /* number of horizontal dots */
- #define LCD_DOTS_Y 128 /* number of vertical dots */
- #define LCD_OFFSET_X 32 /* x offset of 32 dots (160-128) */
- //#define LCD_FLIP_X /* enable horizontal flip */
- #define LCD_FLIP_Y /* enable vertical flip */
- #define LCD_ROTATE /* switch X and Y (rotate by 90°) */
- //#define LCD_LATE_ON /* turn on LCD after clearing it */
- /* font and symbols: horizonally aligned & flipped */
- #define FONT_8X8_HF /* 8x8 font */
- //#define FONT_10X16_HF /* 10x16 font */
- //#define FONT_8X8_ISO8859_2_HF /* 8x8 Central European font */
- //#define FONT_8X16_WIN1251_HF /* 8x16 cyrillic font */
- #define SYMBOLS_30X32_HF /* 30x32 symbols */
- #define SPI_BITBANG /* bit-bang SPI */
- #define SPI_PORT LCD_PORT /* SPI port data register */
- #define SPI_DDR LCD_DDR /* SPI port data direction register */
- #define SPI_SCK LCD_SCL /* port pin used for SCK */
- #define SPI_MOSI LCD_SDA /* port pin used for MOSI */
- #endif
- /*
- * SSD1306, SPI interface (bit-bang, 4 wire)
- */
- #if 0
- #define LCD_SSD1306 /* display controller SSD1306 */
- #define LCD_GRAPHIC /* graphic display */
- #define LCD_SPI /* SPI interface */
- #define LCD_PORT PORTD /* port data register */
- #define LCD_DDR DDRD /* port data direction register */
- #define LCD_RESET PD4 /* port pin used for /RES (optional) */
- #define LCD_CS PD5 /* port pin used for /CS (optional) */
- #define LCD_DC PD3 /* port pin used for D/C */
- #define LCD_SCLK PD2 /* port pin used for SCLK */
- #define LCD_SDIN PD1 /* port pin used for SDIN (LCD's data input) */
- #define LCD_DOTS_X 128 /* number of horizontal dots */
- #define LCD_DOTS_Y 64 /* number of vertical dots */
- #define LCD_FLIP_X /* enable horizontal flip */
- #define LCD_FLIP_Y /* enable vertical flip */
- #define LCD_CONTRAST 127 /* default contrast (0-255) */
- /* font and symbols: vertically aligned & flipped, bank-wise grouping */
- //#define FONT_6X8_VF /* 6x8 font */
- #define FONT_8X8_VF /* 8x8 font */
- //#define FONT_8X16_VFP /* 8x16 font */
- //#define FONT_6X8_ISO8859_2_VF /* 6x8 Central European font */
- //#define FONT_8X8_ISO8859_2_VF /* 8x8 Central European font */
- //#define FONT_8X12T_ISO8859_2_VFP /* thin 8x12 Central European font */
- //#define FONT_8X16_ISO8859_2_VFP /* 8x16 Central European font */
- //#define FONT_8X8_WIN1251_VF /* 8x8 cyrillic font */
- //#define FONT_8X8T_WIN1251_VF /* thin 8x8 cyrillic font */
- //#define FONT_8X12T_WIN1251_VFP /* thin 8x12 cyrillic font */
- //#define FONT_8X16_WIN1251_VFP /* 8x16 cyrillic font */
- #define SYMBOLS_24X24_VFP /* 24x24 symbols */
- #define SPI_BITBANG /* bit-bang SPI */
- #define SPI_PORT LCD_PORT /* SPI port data register */
- #define SPI_DDR LCD_DDR /* SPI port data direction register */
- #define SPI_SCK LCD_SCLK /* port pin used for SCK */
- #define SPI_MOSI LCD_SDIN /* port pin used for MOSI */
- #endif
- /*
- * SSD1306, SPI interface (bit-bang, 3 wire)
- */
- #if 0
- #define LCD_SSD1306 /* display controller SSD1306 */
- #define LCD_GRAPHIC /* graphic display */
- #define LCD_SPI /* SPI interface */
- #define LCD_PORT PORTD /* port data register */
- #define LCD_DDR DDRD /* port data direction register */
- #define LCD_RESET PD4 /* port pin used for /RES (optional) */
- #define LCD_CS PD5 /* port pin used for /CS (optional) */
- #define LCD_SCLK PD2 /* port pin used for SCLK */
- #define LCD_SDIN PD1 /* port pin used for SDIN (LCD's data input) */
- #define LCD_DOTS_X 128 /* number of horizontal dots */
- #define LCD_DOTS_Y 64 /* number of vertical dots */
- #define LCD_FLIP_X /* enable horizontal flip */
- #define LCD_FLIP_Y /* enable vertical flip */
- #define LCD_CONTRAST 127 /* default contrast (0-255) */
- /* font and symbols: vertically aligned & flipped, bank-wise grouping */
- #define FONT_8X8_VF /* 8x8 font */
- #define SYMBOLS_24X24_VFP /* 24x24 symbols */
- #define SPI_BITBANG /* bit-bang SPI */
- #define SPI_9 /* support 9 bit frames */
- #define SPI_PORT LCD_PORT /* SPI port data register */
- #define SPI_DDR LCD_DDR /* SPI port data direction register */
- #define SPI_SCK LCD_SCLK /* port pin used for SCK */
- #define SPI_MOSI LCD_SDIN /* port pin used for MOSI */
- #endif
- /*
- * SSD1306, I2C interface (bit-bang)
- */
- #if 0
- #define LCD_SSD1306 /* display controller SSD1306 */
- #define LCD_GRAPHIC /* graphic display */
- #define LCD_I2C /* I2C interface */
- #define LCD_I2C_ADDR 0x3c /* SSD1306's I2C address */
- #define LCD_PORT PORTD /* port data register */
- #define LCD_DDR DDRD /* port data direction register */
- #define LCD_RESET PD4 /* port pin used for /RES (optional) */
- #define LCD_DOTS_X 128 /* number of horizontal dots */
- #define LCD_DOTS_Y 64 /* number of vertical dots */
- #define LCD_FLIP_X /* enable horizontal flip */
- #define LCD_FLIP_Y /* enable vertical flip */
- #define LCD_CONTRAST 127 /* default contrast (0-255) */
- /* font and symbols: vertically aligned & flipped, bank-wise grouping */
- #define FONT_8X8_VF /* 8x8 font */
- #define SYMBOLS_24X24_VFP /* 24x24 symbols */
- #define I2C_BITBANG /* bit-bang I2C */
- #define I2C_FAST_MODE /* 400kHz bus speed */
- #define I2C_PORT PORTD /* I2C port data register */
- #define I2C_DDR DDRD /* I2C port data direction register */
- #define I2C_PIN PIND /* I2C port input pins register */
- #define I2C_SDA PD0 /* port pin used for SDA */
- #define I2C_SCL PD1 /* port pin used for SCL */
- #endif
- /*
- * STE2007, SPI interface (bit-bang, 3 wire)
- */
- #if 0
- #define LCD_STE2007 /* display controller STE2007 */
- #define LCD_GRAPHIC /* graphic display */
- #define LCD_SPI /* SPI interface */
- #define LCD_PORT PORTD /* port data register */
- #define LCD_DDR DDRD /* port data direction register */
- #define LCD_RESET PD4 /* port pin used for /RES (optional) */
- #define LCD_CS PD5 /* port pin used for /CS (optional) */
- #define LCD_SCLK PD2 /* port pin used for SCLK */
- #define LCD_SDIN PD1 /* port pin used for SDIN (LCD's data input) */
- #define LCD_DOTS_X 96 /* number of horizontal dots */
- #define LCD_DOTS_Y 68 /* number of vertical dots */
- //#define LCD_FLIP_X /* enable horizontal flip */
- //#define LCD_FLIP_Y /* enable vertical flip */
- #define LCD_CONTRAST 16 /* default contrast (0-31) */
- /* font and symbols: vertically aligned & flipped */
- #define FONT_6X8_VF /* 6x8 font */
- //#define FONT_6X8_ISO8859_2_VF /* 6x8 Central European font */
- #define SYMBOLS_24X24_VFP /* 24x24 symbols */
- #define SPI_BITBANG /* bit-bang SPI */
- #define SPI_9 /* support 9 bit frames */
- #define SPI_PORT LCD_PORT /* SPI port data register */
- #define SPI_DDR LCD_DDR /* SPI port data direction register */
- #define SPI_SCK LCD_SCLK /* port pin used for SCK */
- #define SPI_MOSI LCD_SDIN /* port pin used for MOSI */
- #endif
- /*
- * PCF8814, SPI interface (bit-bang, 3 wire)
- */
- #if 0
- #define LCD_PCF8814 /* display controller PCF8814 */
- #define LCD_GRAPHIC /* graphic display */
- #define LCD_SPI /* SPI interface */
- #define LCD_PORT PORTD /* port data register */
- #define LCD_DDR DDRD /* port data direction register */
- #define LCD_RESET PD4 /* port pin used for /RES */
- #define LCD_CS PD5 /* port pin used for /CS (optional) */
- #define LCD_SCLK PD2 /* port pin used for SCLK */
- #define LCD_SDIN PD1 /* port pin used for SDIN (LCD's data input) */
- #define LCD_DOTS_X 96 /* number of horizontal dots */
- #define LCD_DOTS_Y 65 /* number of vertical dots */
- //#define LCD_FLIP_Y /* enable vertical flip */
- #define LCD_CONTRAST 5 /* default contrast (0-255) */
- /* font and symbols: vertically aligned & flipped, page-wise grouping */
- #define FONT_6X8_VF /* 6x8 font */
- //#define FONT_6X8_ISO8859_2_VF /* 6x8 Central European font */
- #define SYMBOLS_24X24_VFP /* 24x24 symbols */
- #define SPI_BITBANG /* bit-bang SPI */
- #define SPI_9 /* support 9 bit frames */
- #define SPI_PORT LCD_PORT /* SPI port data register */
- #define SPI_DDR LCD_DDR /* SPI port data direction register */
- #define SPI_SCK LCD_SCLK /* port pin used for SCK */
- #define SPI_MOSI LCD_SDIN /* port pin used for MOSI */
- #endif
- /*
- * ST7036, 4 bit parallel interface
- * - enable LCD_DB_STD when using port pins 0-3 for LCD_DB4/5/6/7
- * - untested!!!
- */
- #if 0
- #define LCD_ST7036 /* display controller ST7036 */
- #define LCD_TEXT /* character display */
- #define LCD_PAR_4 /* 4 bit parallel interface */
- #define LCD_PORT PORTD /* port data register */
- #define LCD_DDR DDRD /* port data direction register */
- //#define LCD_DB_STD /* use standard pins 0-3 for DB4-7 */
- #define LCD_DB4 PD0 /* port pin used for DB4 */
- #define LCD_DB5 PD1 /* port pin used for DB5 */
- #define LCD_DB6 PD2 /* port pin used for DB6 */
- #define LCD_DB7 PD3 /* port pin used for DB7 */
- #define LCD_RS PD4 /* port pin used for RS */
- #define LCD_EN PD5 /* port pin used for E */
- //#define LCD_RW ??? /* port pin used for R/W (optional) */
- //#define LCD_RESET ??? /* port pin used for XRESET (optional) */
- #define LCD_CHAR_X 16 /* characters per line */
- #define LCD_CHAR_Y 3 /* number of lines */
- #define LCD_EXTENDED_CMD /* extended instruction set (EXT pin high) */
- #define LCD_CONTRAST 32 /* default contrast (0-63) */
- /* ST7036 has internal 5x8 font */
- #define FONT_ST7036 /* 5x8 font */
- #endif
- /*
- * ST7036, SPI interface (bit-bang, 4 wire)
- * - untested!!!
- */
- #if 0
- #define LCD_ST7036 /* display controller ST7036 */
- #define LCD_TEXT /* character display */
- #define LCD_SPI /* SPI interface */
- #define LCD_PORT PORTD /* port data register */
- #define LCD_DDR DDRD /* port data direction register */
- #define LCD_RESET PD4 /* port pin used for XRESET (optional) */
- #define LCD_CS PD5 /* port pin used for CSB (optional) */
- #define LCD_RS PD3 /* port pin used for RS */
- #define LCD_SCL PD2 /* port pin used for SCL */
- #define LCD_SI PD1 /* port pin used for SI (LCD's data input) */
- #define LCD_CHAR_X 16 /* characters per line */
- #define LCD_CHAR_Y 3 /* number of lines */
- #define LCD_EXTENDED_CMD /* extended instruction set (EXT pin high) */
- #define LCD_CONTRAST 32 /* default contrast (0-63) */
- /* ST7036 has internal 5x8 font */
- #define FONT_ST7036 /* 5x8 font */
- #define SPI_BITBANG /* bit-bang SPI */
- #define SPI_PORT LCD_PORT /* SPI port data register */
- #define SPI_DDR LCD_DDR /* SPI port data direction register */
- #define SPI_SCK LCD_SCL /* port pin used for SCK */
- #define SPI_MOSI LCD_SI /* port pin used for MOSI */
- #endif
- /*
- * VT100 serial terminal, TTL serial
- */
- #if 0
- #define LCD_VT100 /* pseudo display VT100 */
- #define LCD_TEXT /* character display */
- #define LCD_COLOR /* color display */
- #define LCD_CHAR_X 40 /* characters per line */
- #define LCD_CHAR_Y 24 /* number of lines */
- #define SERIAL_BITBANG /* bit-bang serial */
- //#define SERIAL_HARDWARE /* hardware serial */
- #endif
- /*
- * check if a LCD module is specified
- */
- #if !defined(LCD_TEXT) && !defined(LCD_GRAPHIC)
- #error <<< No LCD module specified! >>>
- #endif
- /* ************************************************************************
- * port and pin assignments
- * ************************************************************************ */
- /*
- * Test probes:
- * - Must be an ADC port
- * - Lower 3 pins of the port must be used for probe pins.
- * - Please don't change the definitions of TP1, TP2 and TP3!
- * - Don't share this port with POWER_CTRL or TEST_BUTTON!
- */
- #define ADC_PORT PORTC /* ADC port data register */
- #define ADC_DDR DDRC /* ADC port data direction register */
- #define ADC_PIN PINC /* port input pins register */
- #define TP1 PC0 /* test pin 1 */
- #define TP2 PC1 /* test pin 2 */
- #define TP3 PC2 /* test pin 3 */
- #define TP_ZENER PC3 /* test pin with 10:1 voltage divider */
- #define TP_REF PC4 /* test pin with 2.5V reference and relay */
- #define TP_BAT PC5 /* test pin with 4:1 voltage divider */
- /*
- * Probe resistors
- * - For PWM/squarewave output via probe #2 R_RL_2 has to be PB2/OC1B.
- * - Don't share this port with POWER_CTRL or TEST_BUTTON!
- */
- #define R_PORT PORTB /* port data register */
- #define R_DDR DDRB /* port data direction register */
- #define R_RL_1 PB0 /* Rl (680R) for test pin #1 */
- #define R_RH_1 PB1 /* Rh (470k) for test pin #1 */
- #define R_RL_2 PB2 /* Rl (680R) for test pin #2 */
- #define R_RH_2 PB3 /* Rh (470k) for test pin #2 */
- #define R_RL_3 PB4 /* Rl (680R) for test pin #3 */
- #define R_RH_3 PB5 /* Rh (470k) for test pin #3 */
- /*
- * dedicated signal output via OC1B
- * - don't change this!
- */
- #define SIGNAL_PORT PORTB /* port data register */
- #define SIGNAL_DDR DDRB /* port data direction register */
- #define SIGNAL_OUT PB2 /* MCU's OC1B pin */
- /*
- * power control
- * - can't be same port as ADC_PORT or R_PORT
- */
- #define POWER_PORT PORTD /* port data register */
- #define POWER_DDR DDRD /* port data direction register */
- #define POWER_CTRL PD6 /* controls power (1: on / 0: off) */
- /*
- * test push button
- * - can't be same port as ADC_PORT or R_PORT
- */
- #define BUTTON_PORT PORTD /* port data register */
- #define BUTTON_DDR DDRD /* port data direction register */
- #define BUTTON_PIN PIND /* port input pins register */
- #define TEST_BUTTON PD7 /* test/start push button (low active) */
- /*
- * rotary encoder
- */
- #define ENCODER_PORT PORTD /* port data register */
- #define ENCODER_DDR DDRD /* port data direction register */
- #define ENCODER_PIN PIND /* port input pins register */
- #define ENCODER_A PD1 /* rotary encoder A signal */
- #define ENCODER_B PD3 /* rotary encoder B signal */
- /*
- * increase/decrease push buttons
- */
- #define KEY_PORT PORTD /* port data register */
- #define KEY_DDR DDRD /* port data direction register */
- #define KEY_PIN PIND /* port input pins register */
- #define KEY_INC PD2 /* increase push button (low active) */
- #define KEY_DEC PD3 /* decrease push button (low active) */
- /*
- * frequency counter
- * - input must be pin PD4/T0
- */
- #define COUNTER_PORT PORTD /* port data register */
- #define COUNTER_DDR DDRD /* port data direction register */
- #define COUNTER_IN PD4 /* signal input T0 */
- /*
- * IR detector/decoder
- * - fixed module connected to dedicated I/O pin
- */
- #define IR_PORT PORTC /* port data register */
- #define IR_DDR DDRC /* port data direction register */
- #define IR_PIN PINC /* port input pins register */
- #define IR_DATA PC6 /* data signal */
- /*
- * SPI
- * - hardware SPI uses PB5, PB3 and PB4
- * - could be already set in display section
- */
- /* for bit-bang SPI */
- #ifndef SPI_PORT
- #define SPI_PORT PORTB /* port data register */
- #define SPI_DDR DDRB /* port data direction register */
- #define SPI_PIN PINB /* port input pins register */
- #define SPI_SCK PB5 /* pin for SCK */
- #define SPI_MOSI PB3 /* pin for MOSI */
- #define SPI_MISO PB4 /* pin for MISO */
- #endif
- /*
- * I2C
- * - hardware I2C (TWI) uses PC4 & PC5
- * - could be already set in display section
- */
- /* for bit-bang I2C */
- #ifndef I2C_PORT
- #define I2C_PORT PORTC /* port data register */
- #define I2C_DDR DDRC /* port data direction register */
- #define I2C_PIN PINC /* port input pins register */
- #define I2C_SDA PC4 /* pin for SDA */
- #define I2C_SCL PC5 /* pin for SCL */
- #endif
- /*
- * TTL serial interface
- * - hardware USART0 uses PD0 & PD1
- */
- /* for hardware RS232 */
- #define SERIAL_USART 0 /* use USART0 */
- /* for bit-bang RS232 */
- #define SERIAL_PORT PORTD /* port data register */
- #define SERIAL_DDR DDRD /* port data direction register */
- #define SERIAL_PIN PIND /* port input pins register */
- #define SERIAL_TX PD1 /* pin for Tx (transmit) */
- #define SERIAL_RX PD0 /* pin for Rx (receive) */
- #define SERIAL_PCINT 16 /* PCINT# for Rx pin */
- /*
- * OneWire
- * - dedicated I/O pin
- */
- #define ONEWIRE_PORT PORTC /* port data register */
- #define ONEWIRE_DDR DDRC /* port data direction register */
- #define ONEWIRE_PIN PINC /* port input pins register */
- #define ONEWIRE_DQ PC6 /* DQ (data line) */
- /* ************************************************************************
- * internal stuff
- * ************************************************************************ */
- /* ADC reference selection: AVcc */
- #define ADC_REF_VCC (1 << REFS0)
- /* ADC reference selection: internal 1.1V bandgap */
- #define ADC_REF_BANDGAP ((1 << REFS1) | (1 << REFS0))
- /* ADC reference selection bit mask */
- #define ADC_REF_MASK ((1 << REFS1) | (1 << REFS0))
- /* ADC MUX channel for internal 1.1V bandgap reference */
- #define ADC_BANDGAP 0x0e /* 1110 */
- /* ************************************************************************
- * MCU specific setup to support different AVRs
- * ************************************************************************ */
- /*
- * ATmega 328/328P
- */
- #if defined(__AVR_ATmega328__)
- /* estimated internal resistance of port to GND (in 0.1 Ohms) */
- #define R_MCU_LOW 200
- /* estimated internal resistance of port to VCC (in 0.1 Ohms) */
- #define R_MCU_HIGH 220
- /* voltage offset of MCU's analog comparator (in mV): -50 up to 50 */
- #define COMPARATOR_OFFSET 0
- /* this MCU has 32kB Flash, 1kB EEPROM and 2kB RAM (enable extra features) */
- #define RES_FLASH 32
- #define RES_EEPROM 1
- #define RES_RAM 2
- /*
- * missing or unsupported MCU
- */
- #else
- #error <<< No or wrong MCU type selected! >>>
- #endif
- /* ************************************************************************
- * EOF
- * ************************************************************************ */
|