1 |
4 |
DFC |
/******************************************************************************
|
2 |
|
|
**
|
3 |
|
|
** (C) Copyright 2013 DFC Design, s.r.o., Brno, Czech Republic
|
4 |
|
|
** Author: Marek Kvas (m.kvas@dspfpga.com)
|
5 |
|
|
**
|
6 |
|
|
****************************************************************************
|
7 |
|
|
**
|
8 |
|
|
** This file is part of Xenia Ethernet Example project.
|
9 |
|
|
**
|
10 |
|
|
** Xenia Ethernet Example project is free software: you can
|
11 |
|
|
** redistribute it and/or modify it under the terms of
|
12 |
|
|
** the GNU Lesser General Public License as published by the Free
|
13 |
|
|
** Software Foundation, either version 3 of the License, or
|
14 |
|
|
** (at your option) any later version.
|
15 |
|
|
**
|
16 |
|
|
** Xenia Ethernet Example project is distributed in the hope that
|
17 |
|
|
** it will be useful, but WITHOUT ANY WARRANTY; without even
|
18 |
|
|
** the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
19 |
|
|
** PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
20 |
|
|
** for more details.
|
21 |
|
|
**
|
22 |
|
|
** You should have received a copy of the GNU Lesser General Public
|
23 |
|
|
** License along with Xenia Ethernet Example project. If not,
|
24 |
|
|
** see <http://www.gnu.org/licenses/>.
|
25 |
|
|
*******************************************************************************
|
26 |
|
|
**
|
27 |
|
|
** This is driver for MAC EEPROM chip 24AA025E48.
|
28 |
|
|
**
|
29 |
|
|
*******************************************************************************
|
30 |
|
|
*/
|
31 |
|
|
|
32 |
|
|
#ifndef __IIC_ID_EEPROM_H__
|
33 |
|
|
#define __IIC_ID_EEPROM_H__
|
34 |
|
|
|
35 |
|
|
#include "iic_wrap.h"
|
36 |
|
|
|
37 |
|
|
struct iic_id_eeprom_dev {
|
38 |
|
|
struct iic_wrap_dev *iic_wrap;
|
39 |
|
|
u8 iic_addr;
|
40 |
|
|
int iic_op_timeout;
|
41 |
|
|
};
|
42 |
|
|
|
43 |
|
|
#define ID_ADDR 0xFA
|
44 |
|
|
#define ID_EEPROM_MAX_SIZE 128
|
45 |
|
|
|
46 |
|
|
int iic_id_eeprom_init(struct iic_id_eeprom_dev *dev, struct iic_wrap_dev *iic_wrap, u8 iic_addr, int iic_op_timeout);
|
47 |
|
|
int iic_id_eeprom_getId(struct iic_id_eeprom_dev *dev, u8* id);
|
48 |
|
|
int iic_id_eeprom_read(struct iic_id_eeprom_dev *dev, u8 addr, u8* data, u8 len);
|
49 |
|
|
int iic_id_eeprom_write(struct iic_id_eeprom_dev *dev, u8 addr, u8* data, u8 len);
|
50 |
|
|
|
51 |
|
|
#endif /* __IIC_ID_EEPROM_H__ */
|
52 |
|
|
|