Page 1 of 1

chibios+enc28j60+lwip_binding

Posted: Wed Dec 11, 2013 2:58 pm
by Legath
Hi,

i want to use stm32f3 discovery with enc28j60 via spi2.
As pattern i take lwip_bindings from stm32f4 demo. As i see i need to change all mac functions to wrappers over spi. but i do not know how to change events
such as

Code: Select all

 chEvtRegisterMask(macGetReceiveEventSource(&ETHD1), &el1, FRAME_RECEIVED_ID);


may be can i change it to external irq handler which rise by enc28 irq pin?

Re: chibios+enc28j60+lwip_binding

Posted: Wed Dec 11, 2013 3:24 pm
by Giovanni
Yes, it is a possible solution, probably could also do that from some SPI callback.

Giovanni

Re: chibios+enc28j60+lwip_binding

Posted: Thu Dec 19, 2013 1:57 pm
by Legath
On more question:
i have not found events from external irq.
How can i change next code for working with irq handler?

Code: Select all

chEvtRegisterMask(macGetReceiveEventSource(&ETHD1), &el1, FRAME_RECEIVED_ID);

Re: chibios+enc28j60+lwip_binding

Posted: Thu Dec 19, 2013 1:59 pm
by Giovanni
The above code is not related to interrupts handlers, I don't understand what you want to do.

Giovanni

Re: chibios+enc28j60+lwip_binding

Posted: Thu Dec 19, 2013 2:02 pm
by Legath
I mean i want to send event from irq handler (or irq can generate handler by himself).
So i want to minimize handler code and use this only as flag.

Re: chibios+enc28j60+lwip_binding

Posted: Thu Dec 19, 2013 2:56 pm
by Giovanni
Hi,

In order to send events you have to perform a chEvtBroadcastFlagsI(), see the various drivers implementing events.

Giovanni