/** Comienza el envío de un nuevo frame */
void netdev_send_start()
{
+ // Wait until pending transmit operation completes.
+ while (read_reg(CR) & TXP) continue;
+ write_reg(ISR, PTX); // Limpio bit de interrupción
+
// Set remote DMA start address registers to indicate where to load packet.
write_reg(RSAR0, 0u);
write_reg(RSAR1, TX_PAGE_START);
// Issue command for RTL8019AS to transmit packet from it's local buffer.
write_reg(CR, START | TXP);
-
- // Wait until pending transmit operation completes.
- while(read_reg(CR) & TXP) continue;
}
void netdev_write_start(byte len)
{
// Set remote DMA byte count registers to indicate length of packet load.
- write_reg(RBCR0, len); // Tamaño máximo en principio
+ write_reg(RBCR0, len);
+ write_reg(RBCR1, 0u);
+
+ // Initiate DMA transfer of uip_buf & uip_appdata buffers to RTL8019AS.
+ write_reg(CR, WRITE);
+}
+
+void netdev_write_start_at(byte offset, byte len)
+{
+ // Set remote DMA start address registers to packet data.
+ write_reg(RSAR0, offset);
+ write_reg(RSAR1, TX_PAGE_START);
+
+ // Set remote DMA byte count registers to indicate length of packet load.
+ write_reg(RBCR0, len);
write_reg(RBCR1, 0u);
// Initiate DMA transfer of uip_buf & uip_appdata buffers to RTL8019AS.
printb(read_reg(ISR), 0x01);
printb(read_reg(BNRY), 0x02);
printb(current, 0x04);
- ledsb(0x00, 0x00);
+ printb(0x00, 0x00);
reset();
}
return 0;