Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of SD600A by
Diff: SD600A.cpp
- Revision:
- 18:a61600110235
- Parent:
- 17:a625ffe26993
- Child:
- 20:843cfd0d6adb
--- a/SD600A.cpp Thu Oct 11 04:30:47 2012 +0000 +++ b/SD600A.cpp Thu Oct 11 04:40:47 2012 +0000 @@ -16,7 +16,17 @@ * there is no need to lock the buffer. */ -void SD600A::idle_function(void) { +void SD600A::spi_isr(void) { + clk = 1; + dat = pixels[byte_index] & (0x80 >> bit_index); + clk = 0; + bit_index++; + if (bit_index == 8) { + byte_index++; + bit_index = 0; + } + if (byte_index == data_length) + byte_index = 0; clk = 1; dat = pixels[byte_index] & (0x80 >> bit_index); clk = 0; @@ -45,7 +55,7 @@ bit_index = 0; } else error("SD600A could not allocate memory!\r\n"); NVIC_SetPriority(TIMER3_IRQn, 0); - idletoggle.attach_us(this, &SD600A::idle_function, IDLE_INTERVAL); + idletoggle.attach_us(this, &SD600A::spi_isr, INTERRUPT_INTERVAL); } void SD600A::begin(void) {