static void lcd_dataWrite(const uint8_t *buf, size_t count)
{
while (count--)
- {
LCD_WRITE(*buf++);
- /* Dummy read to drain the FIFO */
- (void)LCD_READ;
- }
}
/* Turn on the OLED display */
void rit128x96_lcd_blitBitmap(const Bitmap *bm)
{
uint8_t lcd_row[bm->width / 2];
- uint8_t buffer[8];
+ uint8_t buffer[3];
uint8_t mask;
int i, l;
/* Send data to the display */
#define LCD_WRITE(x) ((void)x)/* Implement me! */
-
-/* Read data from the display */
-#define LCD_READ (0 /* Implement me! */ )
/*@}*/
INLINE void lcd_bus_init(void)
lm3s_gpioPinWrite(GPIO_PORTH_BASE, GPIO_OLEDDC_PIN, GPIO_OLEDDC_PIN)
/* Send data to the display */
-#define LCD_WRITE(x) lm3s_ssiWriteFrame(SSI0_BASE, x)
-
-/* Read data from the display */
-#define LCD_READ \
- ({ \
- uint32_t frame; \
- lm3s_ssiReadFrame(SSI0_BASE, &frame); \
- frame; \
- })
+#define LCD_WRITE(x) \
+ { \
+ uint32_t _x; \
+ lm3s_ssiWriteFrame(SSI0_BASE, x); \
+ /* Dummy read to drain the FIFO */ \
+ while (!lm3s_ssiReadFrameNonBlocking(SSI0_BASE, &_x)); \
+ cpu_relax(); \
+ }
/*@}*/
INLINE void lcd_bus_init(void)
{
- cpu_flags_t flags;
uint32_t dummy;
- IRQ_SAVE_DISABLE(flags);
-
/* Enable the peripheral clock */
SYSCTL_RCGC1_R |= SYSCTL_RCGC1_SSI0;
SYSCTL_RCGC2_R |= SYSCTL_RCGC2_GPIOA;
/* Drain the SSI RX FIFO */
while (lm3s_ssiReadFrameNonBlocking(SSI0_BASE, &dummy));
-
- IRQ_RESTORE(flags);
}
#endif /* HW_RIT128x96_H */