W5500
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
Ethernet
wizchip_conf.c
Go to the documentation of this file.
1
//*****************************************************************************
2
//
39
//
40
//*****************************************************************************
41
#include "
wizchip_conf.h
"
47
void
wizchip_cris_enter
(
void
) {};
53
void
wizchip_cris_exit
(
void
) {};
59
void
wizchip_cs_select
(
void
) {};
65
void
wizchip_cs_deselect
(
void
) {};
71
uint8_t
wizchip_bus_readbyte
(uint32_t AddrSel) {
return
* ((
volatile
uint8_t *) AddrSel); };
78
void
wizchip_bus_writebyte
(uint32_t AddrSel, uint8_t wb) { *((
volatile
uint8_t*)AddrSel) = wb; };
84
uint8_t
wizchip_spi_readbyte
(
void
) {
return
0;};
90
void
wizchip_spi_writebyte
(uint8_t wb) {};
91
92
93
_WIZCHIP
WIZCHIP
=
94
{
95
.
id
=
_WIZCHIP_ID_
,
96
.if_mode =
_WIZCHIP_IO_MODE_
,
97
.CRIS._enter =
wizchip_cris_enter
,
98
.CRIS._exit =
wizchip_cris_exit
,
99
.CS._select =
wizchip_cs_select
,
100
.CS._deselect =
wizchip_cs_deselect
,
101
.IF.BUS._read_byte =
wizchip_bus_readbyte
,
102
.IF.BUS._write_byte =
wizchip_bus_writebyte
103
// .IF.SPI._read_byte = wizchip_spi_readbyte,
104
// .IF.SPI._write_byte = wizchip_spi_writebyte
105
};
106
107
108
void
reg_wizchip_cris_cbfunc
(
void
(*cris_en)(
void
),
void
(*cris_ex)(
void
))
109
{
110
if
(!cris_en || !cris_ex)
111
{
112
WIZCHIP.
CRIS
.
_enter
=
wizchip_cris_enter
;
113
WIZCHIP.
CRIS
.
_exit
=
wizchip_cris_exit
;
114
}
115
else
116
{
117
WIZCHIP.
CRIS
.
_enter
= cris_en;
118
WIZCHIP.
CRIS
.
_exit
= cris_ex;
119
}
120
}
121
122
void
reg_wizchip_cs_cbfunc
(
void
(*cs_sel)(
void
),
void
(*cs_desel)(
void
))
123
{
124
if
(!cs_sel || !cs_desel)
125
{
126
WIZCHIP.
CS
.
_select
=
wizchip_cs_select
;
127
WIZCHIP.
CS
.
_deselect
=
wizchip_cs_deselect
;
128
}
129
else
130
{
131
WIZCHIP.
CS
.
_select
= cs_sel;
132
WIZCHIP.
CS
.
_deselect
= cs_desel;
133
}
134
}
135
136
void
reg_wizchip_bus_cbfunc
(uint8_t(*bus_rb)(uint32_t addr),
void
(*bus_wb)(uint32_t addr, uint8_t wb))
137
{
138
while
(!(WIZCHIP.
if_mode
&
_WIZCHIP_IO_MODE_BUS_
));
139
140
if
(!bus_rb || !bus_wb)
141
{
142
WIZCHIP.
IF
.
BUS
._read_byte =
wizchip_bus_readbyte
;
143
WIZCHIP.
IF
.
BUS
._write_byte =
wizchip_bus_writebyte
;
144
}
145
else
146
{
147
WIZCHIP.
IF
.
BUS
._read_byte = bus_rb;
148
WIZCHIP.
IF
.
BUS
._write_byte = bus_wb;
149
}
150
}
151
152
void
reg_wizchip_spi_cbfunc
(uint8_t (*spi_rb)(
void
),
void
(*spi_wb)(uint8_t wb))
153
{
154
while
(!(WIZCHIP.
if_mode
&
_WIZCHIP_IO_MODE_SPI_
));
155
156
if
(!spi_rb || !spi_wb)
157
{
158
WIZCHIP.
IF
.
SPI
._read_byte =
wizchip_spi_readbyte
;
159
WIZCHIP.
IF
.
SPI
._write_byte =
wizchip_spi_writebyte
;
160
}
161
else
162
{
163
WIZCHIP.
IF
.
SPI
._read_byte = spi_rb;
164
WIZCHIP.
IF
.
SPI
._write_byte = spi_wb;
165
}
166
}
Generated on Wed Aug 7 2013 16:43:41 for W5500 by
1.8.4