chibios+enc28j60+lwip_binding

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
Legath
Posts: 21
Joined: Thu Oct 17, 2013 3:24 pm

chibios+enc28j60+lwip_binding

Post 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?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: chibios+enc28j60+lwip_binding

Post by Giovanni »

Yes, it is a possible solution, probably could also do that from some SPI callback.

Giovanni
Legath
Posts: 21
Joined: Thu Oct 17, 2013 3:24 pm

Re: chibios+enc28j60+lwip_binding

Post 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);
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: chibios+enc28j60+lwip_binding

Post by Giovanni »

The above code is not related to interrupts handlers, I don't understand what you want to do.

Giovanni
Legath
Posts: 21
Joined: Thu Oct 17, 2013 3:24 pm

Re: chibios+enc28j60+lwip_binding

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: chibios+enc28j60+lwip_binding

Post by Giovanni »

Hi,

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

Giovanni
Post Reply