projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Exclude file with Qt-style documentation.
[bertos.git]
/
drv
/
lcd_gfx.c
diff --git
a/drv/lcd_gfx.c
b/drv/lcd_gfx.c
index f2530298e6266c1e8920caed409bdd31f092c1ef..3a5135c69a170a26ef0a111dea5e52095feda473 100755
(executable)
--- a/
drv/lcd_gfx.c
+++ b/
drv/lcd_gfx.c
@@
-16,6
+16,12
@@
/*#*
*#* $Log$
/*#*
*#* $Log$
+ *#* Revision 1.5 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
+ *#* Revision 1.4 2006/04/27 05:40:11 bernie
+ *#* Naming convention fixes; Partial merge from project_grl.
+ *#*
*#* Revision 1.3 2006/02/10 12:35:31 bernie
*#* Enforce CONFIG_* definitions.
*#*
*#* Revision 1.3 2006/02/10 12:35:31 bernie
*#* Enforce CONFIG_* definitions.
*#*
@@
-51,18
+57,18
@@
#if CONFIG_LCD_SOFTINT_REFRESH
#if CONFIG_LCD_SOFTINT_REFRESH
- /*
!
Interval between softint driven lcd refresh */
+ /*
*
Interval between softint driven lcd refresh */
# define LCD_REFRESH_INTERVAL 20 /* 20ms -> 50fps */
#endif /* CONFIG_LCD_SOFTINT_REFRESH */
# define LCD_REFRESH_INTERVAL 20 /* 20ms -> 50fps */
#endif /* CONFIG_LCD_SOFTINT_REFRESH */
-/*
!
Number of LCD pages */
+/*
*
Number of LCD pages */
#define LCD_PAGES 4
#define LCD_PAGES 4
-/*
!
Width of an LCD page */
+/*
*
Width of an LCD page */
#define LCD_PAGESIZE (LCD_WIDTH / 2)
#define LCD_PAGESIZE (LCD_WIDTH / 2)
-/*
!
+/*
*
* \name LCD I/O pins/ports
* @{
*/
* \name LCD I/O pins/ports
* @{
*/
@@
-80,7
+86,7
@@
#define LCD_PE_E2 PE6
/*@}*/
#define LCD_PE_E2 PE6
/*@}*/
-/*
!
+/*
*
* \name DB high nibble (DB[4-7])
* @{
*/
* \name DB high nibble (DB[4-7])
* @{
*/
@@
-91,7
+97,7
@@
#define LCD_DATA_HI_MASK 0xF0
/*@}*/
#define LCD_DATA_HI_MASK 0xF0
/*@}*/
-/*
!
+/*
*
* \name DB low nibble (DB[0-3])
* @{
*/
* \name DB low nibble (DB[0-3])
* @{
*/
@@
-102,7
+108,7
@@
#define LCD_DATA_LO_MASK 0xF0
/*@}*/
#define LCD_DATA_LO_MASK 0xF0
/*@}*/
-/*
!
+/*
*
* \name LCD bus control macros
* @{
*/
* \name LCD bus control macros
* @{
*/
@@
-118,7
+124,7
@@
#define LCD_CLR_E(x) (PORTE &= ~(x))
/*@}*/
#define LCD_CLR_E(x) (PORTE &= ~(x))
/*@}*/
-/*
!
+/*
*
* \name Chip select bits for LCD_SET_E()
* @{
*/
* \name Chip select bits for LCD_SET_E()
* @{
*/
@@
-126,41
+132,41
@@
#define LCDF_E2 (BV(LCD_PE_E2))
/*@}*/
#define LCDF_E2 (BV(LCD_PE_E2))
/*@}*/
-/*
!
Read from the LCD data bus (DB[0-7]) */
+/*
*
Read from the LCD data bus (DB[0-7]) */
#define LCD_READ ( \
((LCD_DATA_LO_PIN & LCD_DATA_LO_MASK) >> LCD_DATA_LO_SHIFT) | \
((LCD_DATA_HI_PIN & LCD_DATA_HI_MASK) >> LCD_DATA_HI_SHIFT) \
)
#define LCD_READ ( \
((LCD_DATA_LO_PIN & LCD_DATA_LO_MASK) >> LCD_DATA_LO_SHIFT) | \
((LCD_DATA_HI_PIN & LCD_DATA_HI_MASK) >> LCD_DATA_HI_SHIFT) \
)
-/*
!
Write to the LCD data bus (DB[0-7]) */
+/*
*
Write to the LCD data bus (DB[0-7]) */
#define LCD_WRITE(d) \
do { \
LCD_DATA_LO_PORT = (LCD_DATA_LO_PORT & ~LCD_DATA_LO_MASK) | (((d)<<LCD_DATA_LO_SHIFT) & LCD_DATA_LO_MASK); \
LCD_DATA_HI_PORT = (LCD_DATA_HI_PORT & ~LCD_DATA_HI_MASK) | (((d)<<LCD_DATA_HI_SHIFT) & LCD_DATA_HI_MASK); \
} while (0)
#define LCD_WRITE(d) \
do { \
LCD_DATA_LO_PORT = (LCD_DATA_LO_PORT & ~LCD_DATA_LO_MASK) | (((d)<<LCD_DATA_LO_SHIFT) & LCD_DATA_LO_MASK); \
LCD_DATA_HI_PORT = (LCD_DATA_HI_PORT & ~LCD_DATA_HI_MASK) | (((d)<<LCD_DATA_HI_SHIFT) & LCD_DATA_HI_MASK); \
} while (0)
-/*
!
Set data bus direction to output (write to display) */
+/*
*
Set data bus direction to output (write to display) */
#define LCD_DB_OUT \
do { \
LCD_DATA_LO_DDR |= LCD_DATA_LO_MASK; \
LCD_DATA_HI_DDR |= LCD_DATA_HI_MASK; \
} while (0)
#define LCD_DB_OUT \
do { \
LCD_DATA_LO_DDR |= LCD_DATA_LO_MASK; \
LCD_DATA_HI_DDR |= LCD_DATA_HI_MASK; \
} while (0)
-/*
!
Set data bus direction to input (read from display) */
+/*
*
Set data bus direction to input (read from display) */
#define LCD_DB_IN \
do { \
LCD_DATA_LO_DDR &= ~LCD_DATA_LO_MASK; \
LCD_DATA_HI_DDR &= ~LCD_DATA_HI_MASK; \
} while (0)
#define LCD_DB_IN \
do { \
LCD_DATA_LO_DDR &= ~LCD_DATA_LO_MASK; \
LCD_DATA_HI_DDR &= ~LCD_DATA_HI_MASK; \
} while (0)
-/*
!
Delay for tEW (160ns) */
+/*
*
Delay for tEW (160ns) */
#define LCD_DELAY_WRITE \
do { \
NOP; \
NOP; \
} while (0)
#define LCD_DELAY_WRITE \
do { \
NOP; \
NOP; \
} while (0)
-/*
!
Delay for tACC6 (180ns) */
+/*
*
Delay for tACC6 (180ns) */
#define LCD_DELAY_READ \
do { \
NOP; \
#define LCD_DELAY_READ \
do { \
NOP; \
@@
-169,7
+175,7
@@
} while (0)
} while (0)
-/*
!
+/*
*
* \name 32122A Commands
* @{
*/
* \name 32122A Commands
* @{
*/
@@
-189,11
+195,14
@@
#define LCD_CMD_RESET 0xE2
/*@}*/
#define LCD_CMD_RESET 0xE2
/*@}*/
+MOD_DEFINE(lcd)
+
+
/* Status flags */
#define LCDF_BUSY BV(7)
#if CONFIG_LCD_WAIT
/* Status flags */
#define LCDF_BUSY BV(7)
#if CONFIG_LCD_WAIT
-/*
!
+/*
*
* \code
* __ __
* RS __\____________/__
* \code
* __ __
* RS __\____________/__
@@
-230,7
+239,7
@@
#endif /* CONFIG_LCD_WAIT */
#endif /* CONFIG_LCD_WAIT */
-/*
!
+/*
*
* Raster buffer to draw into.
*
* Bits in the bitmap bytes have vertical orientation,
* Raster buffer to draw into.
*
* Bits in the bitmap bytes have vertical orientation,
@@
-240,13
+249,13
@@
DECLARE_WALL(wall_before_raster, WALL_SIZE)
static uint8_t lcd_raster[RASTER_SIZE(LCD_WIDTH, LCD_HEIGHT)];
DECLARE_WALL(wall_after_raster, WALL_SIZE)
static uint8_t lcd_raster[RASTER_SIZE(LCD_WIDTH, LCD_HEIGHT)];
DECLARE_WALL(wall_after_raster, WALL_SIZE)
-/*
!
Default LCD bitmap */
+/*
*
Default LCD bitmap */
struct Bitmap lcd_bitmap;
#if CONFIG_LCD_SOFTINT_REFRESH
struct Bitmap lcd_bitmap;
#if CONFIG_LCD_SOFTINT_REFRESH
-/*
!
Timer for regular LCD refresh */
+/*
*
Timer for regular LCD refresh */
static Timer *lcd_refresh_timer;
#endif /* CONFIG_LCD_SOFTINT_REFRESH */
static Timer *lcd_refresh_timer;
#endif /* CONFIG_LCD_SOFTINT_REFRESH */
@@
-305,7
+314,7
@@
static inline uint8_t lcd_read(uint8_t chip)
WAIT_LCD;
WAIT_LCD;
- /*
!
+ /*
*
* \code
* __________________
* A0 __/ \__
* \code
* __________________
* A0 __/ \__
@@
-337,7
+346,7
@@
static inline void lcd_write(uint8_t c, uint8_t chip)
{
WAIT_LCD;
{
WAIT_LCD;
- /*
!
+ /*
*
* \code
* __________________
* A0 ___/ \___
* \code
* __________________
* A0 ___/ \___
@@
-361,10
+370,10
@@
static inline void lcd_write(uint8_t c, uint8_t chip)
}
}
-/*
!
+/*
*
* Set LCD contrast PWM.
*/
* Set LCD contrast PWM.
*/
-void lcd_set
p
wm(int duty)
+void lcd_set
P
wm(int duty)
{
ASSERT(duty >= LCD_MIN_PWM);
ASSERT(duty <= LCD_MAX_PWM);
{
ASSERT(duty >= LCD_MIN_PWM);
ASSERT(duty <= LCD_MAX_PWM);
@@
-387,7
+396,7
@@
static void lcd_clear(void)
}
}
-static void lcd_write
r
aster(const uint8_t *raster)
+static void lcd_write
R
aster(const uint8_t *raster)
{
uint8_t page, rows;
const uint8_t *right_raster;
{
uint8_t page, rows;
const uint8_t *right_raster;
@@
-413,16
+422,19
@@
static void lcd_writeraster(const uint8_t *raster)
}
}
}
}
-
-void lcd_blit_bitmap(Bitmap *bm)
+/**
+ * Update the LCD display with data from the provided bitmap.
+ */
+void lcd_blitBitmap(Bitmap *bm)
{
{
- lcd_writeraster(bm->raster);
+ MOD_CHECK(lcd);
+ lcd_writeRaster(bm->raster);
}
#if CONFIG_LCD_SOFTINT_REFRESH
}
#if CONFIG_LCD_SOFTINT_REFRESH
-static void lcd_refresh
_s
oftint(void)
+static void lcd_refresh
S
oftint(void)
{
lcd_blit_bitmap(&lcd_bitmap);
timer_add(lcd_refresh_timer);
{
lcd_blit_bitmap(&lcd_bitmap);
timer_add(lcd_refresh_timer);
@@
-431,7
+443,7
@@
static void lcd_refresh_softint(void)
#endif /* CONFIG_LCD_SOFTINT_REFRESH */
#endif /* CONFIG_LCD_SOFTINT_REFRESH */
-/*
!
+/*
*
* Initialize LCD subsystem.
*
* \note The PWM used for LCD contrast is initialized in drv/pwm.c
* Initialize LCD subsystem.
*
* \note The PWM used for LCD contrast is initialized in drv/pwm.c
@@
-439,6
+451,8
@@
static void lcd_refresh_softint(void)
*/
void lcd_init(void)
{
*/
void lcd_init(void)
{
+ MOD_CHECK(timer);
+
// FIXME: interrupts are already disabled when we get here?!?
cpuflags_t flags;
IRQ_SAVE_DISABLE(flags);
// FIXME: interrupts are already disabled when we get here?!?
cpuflags_t flags;
IRQ_SAVE_DISABLE(flags);
@@
-496,4
+510,6
@@
void lcd_init(void)
timer_add(lcd_refresh_timer);
#endif /* CONFIG_LCD_SOFTINT_REFRESH */
timer_add(lcd_refresh_timer);
#endif /* CONFIG_LCD_SOFTINT_REFRESH */
+
+ MOD_INIT(lcd);
}
}