Skip to content

Commit 5184606

Browse files
author
TinyCircuits
committed
Changed to Arduino 1.5 library format
1 parent 5a3035a commit 5184606

File tree

8 files changed

+33
-2
lines changed

8 files changed

+33
-2
lines changed
File renamed without changes.
File renamed without changes.

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# TinyCircuits TinyScreen/TinyScreen+ Arduino Library
2+
3+
This library allows for easy use of the TinyScreen display and input buttons. Text, shapes, pixel manipulation, flipping, mirroring, and more allow you to display data, pictures, video, games or whatever you can fit in 96 by 64 pixels.
4+
5+
## Basic Example
6+
7+
An example demonstrating and explaining most of the library functions is included. A list of further notes:
8+
9+
* Include the TinyScreen, SPI, and Wire libraries (Wire can be omitted from TinyScreen+ code if necessary)
10+
* Declare TinyScreen as display, and use the correct board type(TinyScreenDefault, TinyScreenAlternate, TinyScreenPlus): TinyScreen display = TinyScreen(TinyScreenPlus);
11+
* TinyScreen library defaults to BGR colors, and this is what the TS_8b and TS_16b color definitions use. This can be changed with setColorMode(TSColorModeRGB);
12+
* Testing for a button press can now be done in a readable way, and works the same when the display is flipped: if (display.getButtons(TSButtonUpperLeft)) { };
13+
* TinyScreen+ supports DMA data transfers- check the end of TinySCreen.cpp

TinyScreen.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
TinyScreen.cpp - Last modified 2 February 2016
2+
TinyScreen.cpp - Last modified 11 February 2016
33
44
This library is free software; you can redistribute it and/or
55
modify it under the terms of the GNU Lesser General Public
@@ -641,6 +641,9 @@ void DMAC_Handler() {
641641
uint8_t TinyScreen::getReadyStatusDMA(){
642642
#if defined(ARDUINO_ARCH_SAMD)
643643
return dmaReady;
644+
#else
645+
//it's tough to raise an error about not having DMA in the IDE- try to fall back to regular software transfer
646+
return 1;//always return ready
644647
#endif
645648
}
646649

@@ -682,6 +685,9 @@ void TinyScreen::writeBufferDMA(uint8_t *txdata,int n) {
682685

683686
//DMAC->CHID.reg = DMAC_CHID_ID(chnltx); //disable DMA to allow lib SPI- necessary? needs to be done after completion
684687
//DMAC->CHCTRLA.reg &= ~DMAC_CHCTRLA_ENABLE;
688+
#else
689+
//it's tough to raise an error about not having DMA in the IDE- try to fall back to regular software transfer
690+
writeBuffer(txdata,n);//just write the data without DMA
685691
#endif
686692
}
687693

@@ -695,5 +701,8 @@ void TinyScreen::initDMA(void){
695701
DMAC->BASEADDR.reg = (uint32_t)descriptor_section;
696702
DMAC->WRBADDR.reg = (uint32_t)wrb;
697703
DMAC->CTRL.reg = DMAC_CTRL_DMAENABLE | DMAC_CTRL_LVLEN(0xf);
704+
#else
705+
//it's tough to raise an error about not having DMA in the IDE- try to fall back to regular software transfer
706+
//ignore init
698707
#endif
699708
}

TinyScreen.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
TinyScreen.h - Last modified 29 January 2016
2+
TinyScreen.h - Last modified 11 February 2016
33
44
This library is free software; you can redistribute it and/or
55
modify it under the terms of the GNU Lesser General Public
File renamed without changes.
File renamed without changes.

library.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name=TinyScreen
2+
version=1.1.0
3+
author=TinyCircuits <[email protected]>
4+
maintainer=TinyCircuits <[email protected]>
5+
sentence=Arduino compatible software support for TinyScreen and TinyScreen+.
6+
paragraph=Allows easy use of text and graphics on a tiny display as well as reading built-in button inputs.
7+
category=Display
8+
url=https://github.com/TinyCircuits/TinyCircuits-TinyScreen_Lib
9+
architectures=*

0 commit comments

Comments
 (0)