Skip to content

Commit

Permalink
Cleanup of Raspberry Pi GPIO definitions.
Browse files Browse the repository at this point in the history
  • Loading branch information
fbrausse committed Jan 19, 2013
1 parent 6c9c11a commit 8e1e9dc
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions ssd-gpio-rpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@

#include "gpio.h"

/*
// #define MB() __asm__ __volatile__("dmb st")
// #define MB() __sync_synchronize()
#ifndef MB
#define MB()
#endif
*/

#if 1
/* free: 4, 14, 15, 17, 18, 28-31 */

/* 7, 8, 9, 10, 11, 23, 24, 25 */
Expand All @@ -29,36 +19,8 @@
/* D/#C: 27 */
#define LCD_DC_MASK (1 << 27)

#else

/* free: 2,3,7,14,15 */

/* 22, 23, 24, 27, 28, 29, 30, 31 */
#define GPIO_WR8(i) \
(((uint32_t)(i) & 0x07) << 22 | ((uint32_t)(i) & 0xf8) << (27 - 3))
#define GPIO_MASK GPIO_WR8(0xff)

#define LCD_RD_MASK (1 << 4) /* #RD : 4 */
#define LCD_WR_MASK (1 << 17) /* #WR : 17 */
#define LCD_DC_MASK (1 << 18) /* D/#C: 18 */

#endif

#define LCD_D8(v) GPIO_WR8(v)



#define CPU_MHZ 700
#define CPU_CYCLES(ns) ((CPU_MHZ * (ns) + 999) / 1000)

#define T_ACC 32
#define T_DSW 4
#define T_PWLW 12
#define T_PWLR 36

#define MAX(a,b) ((a) > (b) ? (a) : (b))


void lcd_wr8_slow(unsigned char c);
void lcd_cmd_slow(unsigned char c);

Expand All @@ -68,7 +30,6 @@ static inline void lcd_wr8_fast(unsigned char c)

GPIO_CLR = (~d & GPIO_MASK) | LCD_WR_MASK;
GPIO_SET = d & GPIO_MASK;
// nop(MAX(CPU_CYCLES(T_PWLW) - 2, CPU_CYCLES(T_DSW) - 1));
GPIO_SET = LCD_WR_MASK;
}

Expand Down

0 comments on commit 8e1e9dc

Please sign in to comment.