Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
79d17e3e
Commit
79d17e3e
authored
10 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
drivers, wiznet5k: Change SPI interface to read/write multiple bytes.
parent
812cf62f
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
drivers/wiznet5k/ethernet/wizchip_conf.c
+7
-7
7 additions, 7 deletions
drivers/wiznet5k/ethernet/wizchip_conf.c
drivers/wiznet5k/ethernet/wizchip_conf.h
+5
-5
5 additions, 5 deletions
drivers/wiznet5k/ethernet/wizchip_conf.h
with
12 additions
and
12 deletions
drivers/wiznet5k/ethernet/wizchip_conf.c
+
7
−
7
View file @
79d17e3e
...
@@ -96,13 +96,13 @@ void wizchip_bus_writebyte(uint32_t AddrSel, uint8_t wb) { *((volatile uint8_t
...
@@ -96,13 +96,13 @@ void wizchip_bus_writebyte(uint32_t AddrSel, uint8_t wb) { *((volatile uint8_t
* @note This function help not to access wrong address. If you do not describe this function or register any functions,
* @note This function help not to access wrong address. If you do not describe this function or register any functions,
* null function is called.
* null function is called.
*/
*/
uint8_t
wizchip_spi_readbyte
(
void
)
{
return
0
;};
void
wizchip_spi_readbyte
s
(
uint8_t
*
buf
,
uint32_t
len
)
{}
/**
/**
* @brief Default function to write in SPI interface.
* @brief Default function to write in SPI interface.
* @note This function help not to access wrong address. If you do not describe this function or register any functions,
* @note This function help not to access wrong address. If you do not describe this function or register any functions,
* null function is called.
* null function is called.
*/
*/
void
wizchip_spi_writebyte
(
uint8_t
wb
)
{}
;
void
wizchip_spi_writebyte
s
(
const
uint8_t
*
buf
,
uint32_t
len
)
{}
/**
/**
* @\ref _WIZCHIP instance
* @\ref _WIZCHIP instance
...
@@ -168,19 +168,19 @@ void reg_wizchip_bus_cbfunc(uint8_t(*bus_rb)(uint32_t addr), void (*bus_wb)(uint
...
@@ -168,19 +168,19 @@ void reg_wizchip_bus_cbfunc(uint8_t(*bus_rb)(uint32_t addr), void (*bus_wb)(uint
}
}
}
}
void
reg_wizchip_spi_cbfunc
(
uint8_t
(
*
spi_rb
)(
void
),
void
(
*
spi_wb
)(
uint8_t
wb
))
void
reg_wizchip_spi_cbfunc
(
(
void
(
*
spi_rb
)(
uint8_t
*
,
uint32_t
),
void
(
*
spi_wb
)(
const
uint8_t
*
,
uint32_t
))
{
{
while
(
!
(
WIZCHIP
.
if_mode
&
_WIZCHIP_IO_MODE_SPI_
));
while
(
!
(
WIZCHIP
.
if_mode
&
_WIZCHIP_IO_MODE_SPI_
));
if
(
!
spi_rb
||
!
spi_wb
)
if
(
!
spi_rb
||
!
spi_wb
)
{
{
WIZCHIP
.
IF
.
SPI
.
_read_byte
=
wizchip_spi_readbyte
;
WIZCHIP
.
IF
.
SPI
.
_read_byte
s
=
wizchip_spi_readbyte
s
;
WIZCHIP
.
IF
.
SPI
.
_write_byte
=
wizchip_spi_writebyte
;
WIZCHIP
.
IF
.
SPI
.
_write_byte
s
=
wizchip_spi_writebyte
s
;
}
}
else
else
{
{
WIZCHIP
.
IF
.
SPI
.
_read_byte
=
spi_rb
;
WIZCHIP
.
IF
.
SPI
.
_read_byte
s
=
spi_rb
;
WIZCHIP
.
IF
.
SPI
.
_write_byte
=
spi_wb
;
WIZCHIP
.
IF
.
SPI
.
_write_byte
s
=
spi_wb
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
drivers/wiznet5k/ethernet/wizchip_conf.h
+
5
−
5
View file @
79d17e3e
...
@@ -92,7 +92,7 @@
...
@@ -92,7 +92,7 @@
*/
*/
// #define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_BUS_INDIR_
// #define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_BUS_INDIR_
#define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_SPI_
#define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_SPI_
#include
"
W
5200/w5200.h"
#include
"
w
5200/w5200.h"
#elif (_WIZCHIP_ == 5500)
#elif (_WIZCHIP_ == 5500)
#define _WIZCHIP_ID_ "W5500\0"
#define _WIZCHIP_ID_ "W5500\0"
...
@@ -111,7 +111,7 @@
...
@@ -111,7 +111,7 @@
*/
*/
//#define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_SPI_FDM_
//#define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_SPI_FDM_
#define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_SPI_VDM_
#define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_SPI_VDM_
#include
"
W
5500/w5500.h"
#include
"
w
5500/w5500.h"
#else
#else
#error "Unknown defined _WIZCHIP_. You should define one of 5100, 5200, and 5500 !!!"
#error "Unknown defined _WIZCHIP_. You should define one of 5100, 5200, and 5500 !!!"
#endif
#endif
...
@@ -186,8 +186,8 @@ typedef struct __WIZCHIP
...
@@ -186,8 +186,8 @@ typedef struct __WIZCHIP
*/
*/
struct
struct
{
{
uint8_t
(
*
_read_byte
)
(
void
);
void
(
*
_read_byte
s
)
(
uint8_t
*
buf
,
uint32_t
len
);
void
(
*
_write_byte
)
(
uint8_t
wb
);
void
(
*
_write_byte
s
)
(
const
uint8_t
*
buf
,
uint32_t
len
);
}
SPI
;
}
SPI
;
// To be added
// To be added
//
//
...
@@ -393,7 +393,7 @@ void reg_wizchip_bus_cbfunc(uint8_t (*bus_rb)(uint32_t addr), void (*bus_wb)(uin
...
@@ -393,7 +393,7 @@ void reg_wizchip_bus_cbfunc(uint8_t (*bus_rb)(uint32_t addr), void (*bus_wb)(uin
*or register your functions.
*or register your functions.
*@note If you do not describe or register, null function is called.
*@note If you do not describe or register, null function is called.
*/
*/
void
reg_wizchip_spi_cbfunc
(
uint8_t
(
*
spi_rb
)(
void
),
void
(
*
spi_wb
)(
uint8_t
wb
));
void
reg_wizchip_spi_cbfunc
(
void
(
*
spi_rb
)(
uint8_t
*
,
uint32_t
),
void
(
*
spi_wb
)(
const
uint8_t
*
,
uint32_t
));
/**
/**
* @ingroup extra_functions
* @ingroup extra_functions
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment