1 /* By Thomas.Lange@Corelatus.com 001025 */
2 /* Definitions for EEPROM/VOLT METER DS2438 */
3 /* Copyright (C) 2000-2005 Corelatus AB */
5 /* This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24 #define E_DEBUG(fmt,args...) if( Debug ) printk(KERN_DEBUG"EE: " fmt, ##args)
27 #define WRITE_PORT(Value) write_gpio_data(Value)
29 #define READ_PORT (gpio_read()&GPIO_EEDQ)
32 #define EE_CHIP_SIZE 64
34 /* Board with new current resistor */
37 /* new dsp and 64 MB SDRAM */
38 #define EE_DSP_64 0x10
41 /* Pull line down at least this long for reset pulse */
42 #define RESET_LOW_TIME 490
44 /* Read presence pulse after we release reset pulse */
45 #define PRESENCE_TIMEOUT 100
46 #define PRESENCE_LOW_TIME 200
48 #define WRITE_0_LOW 60
50 #define TOTAL_WRITE_LOW 60
53 #define READ_TIMEOUT 10
54 #define TOTAL_READ_LOW 70
56 /* Rom function commands */
58 #define MATCH_ROM 0x55
60 #define SEARCH_ROM 0xF0
63 /* Memory_command_function */
64 #define WRITE_SCRATCHPAD 0x4E
65 #define READ_SCRATCHPAD 0xBE
66 #define COPY_SCRATCHPAD 0x48
67 #define RECALL_MEMORY 0xB8
68 #define CONVERT_TEMP 0x44
69 #define CONVERT_VOLTAGE 0xB4
71 /* Chip is divided in 8 pages, 8 bytes each */
73 #define EE_PAGE_SIZE 8
75 /* All chip data we want are in page 0 */
78 #define EE_P0_STATUS 0
79 #define EE_P0_TEMP_LSB 1
80 #define EE_P0_TEMP_MSB 2
81 #define EE_P0_VOLT_LSB 3
82 #define EE_P0_VOLT_MSB 4
83 #define EE_P0_CURRENT_LSB 5
84 #define EE_P0_CURRENT_MSB 6
87 /* 40 byte user data is located at page 3-7 */
88 #define EE_USER_PAGE_0 3
91 /* Layout of gth user pages usage */
92 /* Bytes 0-16 ethernet addr in ascii ( len 17 ) */
94 #define EE_ETHERNET_OFFSET 0
96 #endif /* INCeedevh */