01.06.2013 Views

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Implementation of this function is necessary if you decide to use your own buffers for receiving incoming data.<br />

The TCP/IP stack will call this function to inform you that the receive buffer (input parameter dataPtr) is no<br />

longer used by TCP/IP.<br />

This callback should return 0 if ok, else -1 on failure.<br />

Generic example:<br />

int huge myDevFreeRecv(DevUserIfaceHandle ifaceHandle, unsigned char far *dataPtr )<br />

{<br />

// Somehow free your allocated buffer at dataPtr<br />

my_free(dataPtr);<br />

}<br />

Related Topics<br />

Top of list<br />

Index page<br />

return 0;<br />

DevUserIfaceHandle type definition<br />

Device Get PhysicalAddress function<br />

This function applies only to Ethernet controllers.<br />

The 6 byte array referenced by the PhysicalAddress input parameter should be filled with the MAC address of<br />

your connected Ethernet controller.<br />

Generic example:<br />

int huge myDevGetPhysAddr(DevUserIfaceHandle ifaceHandle,<br />

unsigned char far * physicalAddress)<br />

{<br />

// Hardware specific: copy MAC address into physicalAddress<br />

_fmemcpy(physicalAddress, myEthernet_MAC, 6) ;<br />

return 0;<br />

}<br />

Related Topics<br />

Top of list<br />

Index page<br />

DevUserIfaceHandle type definition<br />

Implementation of an interrupt service routine (ISR) and receiver task<br />

The implementation of a device specific ISR is optional. If your hardware device is able to generate interrupts on<br />

device events (e.g. incoming data available), you can implement an ISR like the example below. The CPU time<br />

spent within an ISR must be keep to a minimum, as the length of this interrupts masked period impacts the<br />

interrupt latency of the other critical system ISR's. Consequently, your ISR should only notify events (incoming<br />

data, error,..) at the device and not directly handle device events itself (e.g. retrieve incoming data) immediately<br />

Page 347 / 400

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!