PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

60 行
2.8KB

  1. /*
  2. ks0108_Sanguino.h - Arduino library support for ks0108 and compatable graphic LCDs
  3. Copyright (c)2008 Michael Margolis All right reserved
  4. This is the configuration file for mapping Sanguino (ATmega644) pins to the ks0108 Graphics LCD library
  5. */
  6. #ifndef KS0108_CONFIG_H
  7. #define KS0108_CONFIG_H
  8. #define SANGUINO644
  9. /*******************************************************************************************/
  10. /* Sanguino/ ATmega644 defines */
  11. /*******************************************************************************************/
  12. // Command pins assignments:
  13. #define CSEL1 24 // CS1 Bit // swap pin assignments with CSEL2 if left/right image is reversed
  14. #define CSEL2 25 // CS2 Bit
  15. #define R_W 26 // R/W Bit
  16. #define D_I 27 // D/I Bit
  17. #define EN 28 // EN Bit
  18. //all command pins are on the same port for slight speed & code size improvement
  19. #define LCD_CMD_PORT PORTC // Command Output Register for pins 16-23
  20. // data pin assignments- on ATmega644 all data pins are assigned to the same port
  21. #define dataPins0to7 // bits 0-7 assigned to sanguino pins 0-7
  22. //#define dataPins8to15 // bits 0-7 assigned to sanguino pins 8-15 // note this conflicts with serial UART
  23. //#define dataPins16to23 // bits 0-7 assigned to sanguino pins 16-23
  24. //#define dataPins24to31 // bits 0-7 assigned to sanguino pins 24-31
  25. /*******************************************************/
  26. /* end of Sanguino configuration */
  27. /*******************************************************/
  28. // these macros map pins to ports using the defines above
  29. // the following should not be changed unless you really know what your doing
  30. #ifdef dataPins0to7
  31. #define LCD_DATA_LOW_NBL B // port B=pins 0-7 on ATmega466
  32. #define LCD_DATA_HIGH_NBL B // on ATmega644, high and low nibbles are on the same port
  33. #endif
  34. #ifdef dataPins8to15
  35. #define LCD_DATA_LOW_NBL D // port D=pins 8-15 (note serial UART uses 8 and 9)
  36. #define LCD_DATA_HIGH_NBL D
  37. #endif
  38. #ifdef dataPins16to23
  39. #define LCD_DATA_LOW_NBL C // port C=pins 16-23
  40. #define LCD_DATA_HIGH_NBL C
  41. #endif
  42. #ifdef dataPins24to31
  43. #define LCD_DATA_LOW_NBL A // port A=pins 24-31 (note these are the analog ports)
  44. #define LCD_DATA_HIGH_NBL A
  45. #endif
  46. // ATmega644 macros to fast write data to pins, this version only works for pins 0-23
  47. #define fastWriteHigh(_pin_) ( _pin_ < 8 ? PORTB |= 1 << (_pin_ & 0x07) : ( _pin_ < 16 ? PORTD |= 1 << ((_pin_ -8) & 0x07) : PORTC |= 1 << ((_pin_ -16) & 0x07) ) )
  48. #define fastWriteLow(_pin_) ( _pin_ < 8 ? PORTB &= ~(1 << (_pin_ & 0x07)) : ( _pin_ < 16 ? PORTD &= ~(1 << ((_pin_ -8) & 0x07) ) : PORTC &= ~(1 << ((_pin_ -16) & 0x07) ) ) )
  49. #endif