1 |
2 |
jvillar |
//////////////////////////////////////////////////////////////////////
|
2 |
|
|
//// ////
|
3 |
|
|
//// lcd_defines.v ////
|
4 |
|
|
//// ////
|
5 |
|
|
//// This file is part of: ////
|
6 |
|
|
//// WISHBONE/MEM MAPPED CONTROLLER FOR LCD CHARACTER DISPLAYS ////
|
7 |
|
|
//// http://www.opencores.org/projects/wb_lcd/ ////
|
8 |
|
|
//// ////
|
9 |
|
|
//// Description ////
|
10 |
|
|
//// - Set of core customization defines. ////
|
11 |
|
|
//// ////
|
12 |
|
|
//// To Do: ////
|
13 |
|
|
//// - nothing really ////
|
14 |
|
|
//// ////
|
15 |
|
|
//// Author(s): ////
|
16 |
|
|
//// - José Ignacio Villar, jose@dte.us.es , jvillar@gmail.com ////
|
17 |
|
|
//// ////
|
18 |
|
|
//////////////////////////////////////////////////////////////////////
|
19 |
|
|
//// ////
|
20 |
|
|
//// Copyright (C) 2009 José Ignacio Villar - jvillar@gmail.com ////
|
21 |
|
|
//// ////
|
22 |
|
|
//// This source file may be used and distributed without ////
|
23 |
|
|
//// restriction provided that this copyright statement is not ////
|
24 |
|
|
//// removed from the file and that any derivative work contains ////
|
25 |
|
|
//// the original copyright notice and the associated disclaimer. ////
|
26 |
|
|
//// ////
|
27 |
|
|
//// This source file is free software; you can redistribute it ////
|
28 |
|
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
29 |
|
|
//// Public License as published by the Free Software Foundation; ////
|
30 |
|
|
//// either version 3 of the License, or (at your option) any ////
|
31 |
|
|
//// later version. ////
|
32 |
|
|
//// ////
|
33 |
|
|
//// This source is distributed in the hope that it will be ////
|
34 |
|
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
35 |
|
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
36 |
|
|
//// PURPOSE. See the GNU Lesser General Public License for more ////
|
37 |
|
|
//// details. ////
|
38 |
|
|
//// ////
|
39 |
|
|
//// You should have received a copy of the GNU Lesser General ////
|
40 |
|
|
//// Public License along with this source; if not, download it ////
|
41 |
|
|
//// from http://www.gnu.org/licenses/lgpl.txt ////
|
42 |
|
|
//// ////
|
43 |
|
|
//////////////////////////////////////////////////////////////////////
|
44 |
|
|
|
45 |
|
|
`timescale 1ns / 1ps
|
46 |
|
|
|
47 |
|
|
|
48 |
|
|
///
|
49 |
|
|
/// LCD Controller defines
|
50 |
|
|
///
|
51 |
|
|
`define ADDR_WIDTH 7 // Address bus width
|
52 |
|
|
`define ADDR_RNG `ADDR_WIDTH-1:0 // Address bus range
|
53 |
|
|
`define DAT_WIDTH 8 // data bus width
|
54 |
|
|
`define DAT_RNG `DAT_WIDTH-1:0 // Address bus range
|
55 |
|
|
`define MEM_LENGTH 67 // Number of LCD memory positions.
|
56 |
|
|
`define MEM_ADDR_WIDTH 7 // Memory address bus width
|
57 |
|
|
`define MEM_LOW1 `ADDR_WIDTH'h00 //0 // Memory address of the first character at the first line
|
58 |
|
|
`define MEM_HIGH1 `ADDR_WIDTH'h15 //21 // Memory address of the last character at the first line
|
59 |
|
|
`define MEM_LOW2 `ADDR_WIDTH'h40 //64 // Memory address of the first character at the second line
|
60 |
|
|
`define MEM_HIGH2 `ADDR_WIDTH'h55 //85 // Memory address of the last character at the second line
|
61 |
|
|
|
62 |
|
|
`define INIT_DELAY_COUNTER_WIDTH 20 // Delay cycle counter width for init & main FSM
|
63 |
|
|
`define TX_DELAY_COUNTER_WIDTH 11 // Delay cycle counter width for TX FSM
|
64 |
|
|
`define _1MS_DELAY_CYCLES 50 // Number of cycles for a 1ms delay
|
65 |
|
|
|
66 |
|
|
///
|
67 |
|
|
/// WB wrapper defines
|
68 |
|
|
///
|
69 |
|
|
|
70 |
|
|
// WB interface
|
71 |
|
|
`define WB_DAT_WIDTH 32 // WB data bus width
|
72 |
|
|
`define WB_DAT_RNG `WB_DAT_WIDTH-1:0 // WB data bus range
|
73 |
|
|
`define WB_ADDR_WIDTH 32 // WB address bus width
|
74 |
|
|
`define WB_ADDR_RNG `WB_ADDR_WIDTH-1:0 // WB address bus range
|
75 |
|
|
`define WB_BSEL_WIDTH 4 // WB byte sel bus width
|
76 |
|
|
`define WB_BSEL_RNG `WB_BSEL_WIDTH-1:0 // WB byte sel bus range
|
77 |
|
|
`define ADDRESS_BIT
|
78 |
|
|
|
79 |
|
|
|
80 |
|
|
// Command and status registers address mask
|
81 |
|
|
`define SPECIAL_REG_ADDR_MASK 32'h00000080
|
82 |
|
|
|
83 |
|
|
// LCD characters memory mapping
|
84 |
|
|
`define FIRST_LCD_ADDR 0 // Address at where first LCD character is mapped (0)
|
85 |
|
|
|
86 |
|
|
// Command register and command codes
|
87 |
|
|
`define COMMAND_REG_ADDR 32'h00000080 // Address at where command register is mapped (128)
|
88 |
|
|
`define COMMAND_NOP_CODE 32'h00000000 // Code for repaint command
|
89 |
|
|
`define COMMAND_REPAINT_CODE 32'h00000001 // Code for repaint command
|
90 |
|
|
|
91 |
|
|
// Status register and status codes
|
92 |
|
|
`define STATUS_REG_ADDR 32'h00000080 // Address at where status register is mapped (129)
|
93 |
|
|
`define STATUS_IDDLE_CODE 32'h00000000 // Code for iddle status
|
94 |
|
|
`define STATUS_BUSY_CODE 32'h00000001 // Code for busy status
|
95 |
|
|
|