annotate target-utils/lunadrv/luna.h @ 1011:6d9b10633f10 default tip

etmsync Pirelli IMEI retrieval: fix poor use of printf() Bug reported by Vadim Yanitskiy <fixeria@osmocom.org>: the construct where a static-allocated string was passed to printf() without any format arguments causes newer compilers to report a security problem. Given that formatted output is not needed here, just fixed string output, change printf() to fputs(), and direct the error message to stderr while at it.
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 23 May 2024 17:29:57 +0000
parents db9a8e88e63f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
700
db9a8e88e63f target-utils lunadrv program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
db9a8e88e63f target-utils lunadrv program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * This header file provides definitions for the Luna LCD hardware interface.
db9a8e88e63f target-utils lunadrv program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 */
db9a8e88e63f target-utils lunadrv program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
db9a8e88e63f target-utils lunadrv program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 /* reset control */
db9a8e88e63f target-utils lunadrv program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 #define CNTL_RST_REG (*(volatile u16 *)0xFFFFFD04)
db9a8e88e63f target-utils lunadrv program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 #define EXT_RESET 0x0004
db9a8e88e63f target-utils lunadrv program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8
db9a8e88e63f target-utils lunadrv program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 /* the LCD is connected to Calypso nCS3, with A1 line as register select */
db9a8e88e63f target-utils lunadrv program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10
db9a8e88e63f target-utils lunadrv program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 #define LCD_IR (*(volatile u16 *)0x02000000)
db9a8e88e63f target-utils lunadrv program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 #define LCD_DR (*(volatile u16 *)0x02000002)
db9a8e88e63f target-utils lunadrv program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
db9a8e88e63f target-utils lunadrv program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 /* macro for writing first IR, then DR */
db9a8e88e63f target-utils lunadrv program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15
db9a8e88e63f target-utils lunadrv program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 #define LCD_REG_WR(reg, data) {LCD_IR = (reg); LCD_DR = (data);}
db9a8e88e63f target-utils lunadrv program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17
db9a8e88e63f target-utils lunadrv program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 /* some init operations call for controlled delays */
db9a8e88e63f target-utils lunadrv program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19
db9a8e88e63f target-utils lunadrv program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 #define DELAY_1MS 13000