adafruit / Adafruit_SHARP_Memory_Display

This is an Arduino library for the Adafruit Monochrome SHARP Memory Displays
http://www.adafruit.com/products/1393
Other
60 stars 54 forks source link

added compatibility with non-avr boards via SPI library #6

Closed dhiltonp closed 4 years ago

dhiltonp commented 8 years ago

I've tested this with the Zero as my non-AVR, and the Leonardo as my AVR board.

I'm unfamiliar with the entire Arduino family; I'd be willing to convert everything to the SPI library. Are there good reasons to not use SPI.h for all platforms?

dhiltonp commented 8 years ago

Any comments?

RadJaz commented 8 years ago

I have tested this on a Feather M0+ and can confirm it works. I'm using the board's hardware SPI pins. On the board, the pins are labeled "SCK" and "MOSI" and are pins 24 and 23 respectively. Try using those pins and any i/o pin should work for the slave select pin.

dlabun commented 8 years ago

2 changes you may want to consider... 1. Set the SPI bus speed as required by Sharp (1 or 2MHz depending on the LCD) 2. Use beginTransaction() and endTransaction() so you don't block other libraries from working. I ran into those issues in testing the library and had to make those changes.

madias123 commented 8 years ago

Thank you for your work. So I got it working on a STM32F1 (stm32duino.com) within minutes. I just changed some #ifdefs in the lib (on STM32 I needed SPI.setClockDivider(SPI_CLOCK_DIV16)) I also eliminated the AVR code #ifdefs, so even on AVR's this display runs in SPI mode. http://www.stm32duino.com/viewtopic.php?f=13&p=16557#p16557

riklaunim commented 6 years ago

So what about this pull request and making this library compatible with other SPI devices? Right now the display works on for example ESP32 or M0 but I can't use it with other SPI devices using hardware SPI on the same SPI pins. For example Adafruit_SSD1325 does supports hardware SPI.

ladyada commented 4 years ago

refactored and fixed - we now use busio