keil_examples/EMAC/EMAC.c
// copies bytes from MCU-memory to frame port
// NOTES: * an odd number of byte may only be transfered
//          if the frame is written to the end!
//        * MCU-memory MUST start at word-boundary
copies bytes from MCU-memory to frame port
NOTES: * an odd number of byte may only be transfered
if the frame is written to the end.
MCU-memory MUST start at word-boundary
copies bytes from MCU - memory to frame port NOTES : * an odd number of byte may only be transfered if the frame is written to the end . MCU - memory MUST start at word - boundary
void CopyToFrame_EMAC(void *Source, unsigned int Size)
{
  unsigned short * piSource;
  unsigned int idx;
  piSource = Source;
  Size = (Size + 1) & 0xFFFE;    
  while (Size > 0) {
    WriteFrame_EMAC(*piSource++);
    Size -= 2;
  }
  idx = LPC_EMAC->TxProduceIndex;
  if (++idx == NUM_TX_FRAG)
  { 
    idx = 0;
  }
  LPC_EMAC->TxProduceIndex = idx;
}
void CopyToFrame_EMAC ( void * Source , unsigned int Size ) { unsigned short * piSource ; unsigned int idx ; piSource = Source ; Size = ( Size + 1 ) & 0xFFFE ; while ( Size > 0 ) { WriteFrame_EMAC ( * piSource ++ ) ; Size -= 2 ; } idx = LPC_EMAC -> TxProduceIndex ; if ( ++ idx == NUM_TX_FRAG ) { idx = 0 ; } LPC_EMAC -> TxProduceIndex = idx ; }
copies bytes from MCU-memory to frame port
NOTES: * an odd number of byte may only be transfered
if the frame is written to the end!
copies bytes from MCU - memory to frame port NOTES : * an odd number of byte may only be transfered if the frame is written to the end!
// round Size up to next even number