Wiznet WIZ610io User Manual page 10

Hide thumbs Also See for WIZ610io:
Table of Contents

Advertisement

/* Pseudo Code for Write data of 8bit per packet */
#define
data_write_command
0x80
uint16 addr;
// Address : 16bits
int16 data_len;
// Data length :15bits
uint8 data_buf[];
// Array for data
{
SpiSendData();
//Send data from MCU to W6100
ISR_DISABLE();// Interrupt Service Routine disable
CSoff();// CS=0, SPI start
SpiSendData(((addr+idx) & 0xFF00) >> 8);
// Address byte 1
SpiSendData((addr+idx) & 0x00FF);
// Address byte 2
// Data write command + Data length upper 7bits
SpiSendData((data_write_command | ((data_len& 0x7F00) >> 8)));
// Data length bottom 8bits
SpiSendData((data_len& 0x00FF));
// Write data: On data_len> 1, Burst Write Processing Mode.
for(int idx = 0; idx<data_len; idx++)
SpiSendData(data_buf[idx]);
CSon();
// CS=1, SPI end
IINCHIP_ISR_ENABLE();
// Interrupt Service Routine disable
}
WIZ610io User Manual (WIZnet Co.,Ltd.)
10

Advertisement

Table of Contents
loading

Table of Contents