mirror of
https://github.com/geekammo/MicroView-Arduino-Library.git
synced 2026-02-23 21:11:23 +01:00
Fast SPI pin changes
- added defines to map ports and bits for RESET, DC and SS. - added macros to quickly control RESET, DC and SS using the internal weak pullup for high.
This commit is contained in:
23
MicroView.h
23
MicroView.h
@@ -24,15 +24,36 @@
|
||||
|
||||
#define swap(a, b) { uint8_t t = a; a = b; b = t; }
|
||||
|
||||
#define OLEDPWR 4 // 3.3V regulator enable
|
||||
|
||||
#define DC 8
|
||||
#define DCPORT PORTB
|
||||
#define DCDDR DDRB
|
||||
#define DCBIT 0
|
||||
|
||||
#define RESET 7
|
||||
#define OLEDPWR 4
|
||||
#define RESETPORT PORTD
|
||||
#define RESETDDR DDRD
|
||||
#define RESETBIT 7
|
||||
|
||||
#define SSPORT PORTB
|
||||
#define SSDDR DDRB
|
||||
#define SSBIT 2
|
||||
|
||||
#define DCHIGH ((DCPORT |= _BV(DCBIT)), (DCDDR &= ~_BV(DCBIT)))
|
||||
#define DCLOW ((DCPORT &= ~_BV(DCBIT)), (DCDDR |= _BV(DCBIT)))
|
||||
|
||||
#define RESETHIGH ((RESETPORT |= _BV(RESETBIT)), (RESETDDR &= ~_BV(RESETBIT)))
|
||||
#define RESETLOW ((RESETPORT &= ~_BV(RESETBIT)), (RESETDDR |= _BV(RESETBIT)))
|
||||
|
||||
// SS, SCK, MOSI already defined by original pins_arduino.h
|
||||
//#define CS 10
|
||||
//#define SCK 13
|
||||
//#define MOSI 11
|
||||
|
||||
#define SSHIGH ((SSPORT |= _BV(SSBIT)), (SSDDR &= ~_BV(SSBIT)))
|
||||
#define SSLOW ((SSPORT &= ~_BV(SSBIT)), (SSDDR |= _BV(SSBIT)))
|
||||
|
||||
#define BLACK 0
|
||||
#define WHITE 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user