This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to use CAN in poll mode?


On 2/5/07, Gary Thomas <gary@mlbassoc.com> wrote:
wang cui wrote:
> I did researched the mechanism of network drivers and CAN stack.:)
>
> The ethernet driver get polled through the "void (*poll)(struct
> eth_drv_sc *sc);" call back registered in its "eth_hwr_funs". Then
> Redboot can poll ethernet driver through a hw-independent style.
>
> But there is no such poll callback registed in "can_lowlevel_funs".
> Which means when read a CAN device, it assumes the messages have been
> put into the buffer(during interrupt or outside poll). Anyway, there is
> a "bool (*getevent)(can_channel *priv, cyg_can_event *pevent, void
> *pdata);"
>
> So I have to do a CYG_IO_SET_CONFIG_CAN_INPUT_DRAIN(added by myself)
> before every read.

I didn't write that stack nor interface, but it seems to me that you
need to add something equivalent to the ethernet poll() function.

You might try contacting the CAN stack author for ideas.

>
>>
>> You should look at the CAN stack and see how to make it "think" you've
>> had an interrupt by calling some poll() entry point.  That's how the
>> network drivers work - the same drivers work in either RedBoot or full
>> eCos with virtually no change.

--
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



Hello! Are we discussing the same CAN protocol, as in Controller Area Network, that Bosch invented mostly for its fuel injection hardware, but then adopted by the car companies for managing the whole vehicle, and then adopted by individuals who build automation systems? if the answer to all of that is yes, then it does not use Ethernet, that's a different protocol altogether.

As I recall it uses a collection of specialty hardware items, and then
the RS422/RS423/RS485 wiring standards. Specialty hardware drivers
have been made for that. Intel makes a dandy device for that as well
which handles the basic protocol methods. You still need a good
processor for it, and of course an operating system, or atleast what
eCos does.

--
Gregg C Levine gregg.drwho8@gmail.com
"This signature was once found posting rude
messages in English in the Moscow subway."

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]