hello,rod,
at first, thanks a lot for your valuable suggetions. Actually the usr can call
some APIs to get the can message.
1.I have read the readburst.c, in this file many options are given, for
instance, readburst -d/dev/can0...So if I wanna write some application code to
read the can message, need I write these options.
2.My comprehension to your meaning is: I don't need to care that how the can
data are tranferrd between TSCAN1 and TS7300. Because after running this
"insmod" command when man loads the TSCAN1 drive like:
insmod -f lincan.o hw=tscan1 io=0x150 irq=-1 baudrate=1000
the SJA1000 chip has automatically recieved the can message, because of the
DMA, so PC104 peripherals will appear in TS-7300 physical address started at
0x11E0_0150. what should I do is:write some application code which calls read()
and write() API to exchange data with struct canmsg_t. Then I will save this
C.code and cross compile it with arm-linux-gcc tool. At last transfer this
compiled file to TS-7300 root directory and run it.
What's your opinion? Thank you in advance~
regards
ZHANG Jing
--- In Rod Nussbaumer <> wrote:
>
> ZAHNG Jing:
>
> The code you show does exactly what you state as your objective. If
> there is something more that you want to do, then I don't understand;
> perhaps restate your requirements in some different terminology.
>
> The read() call gets one message, with the data field populated with the
> data read from the CAN bus. You can copy that data to
> application-specific variables, and use the data in whatever way is
> appropriate to your application. Sending data on the CAN bus is
> essentially the opposite. Populate the data (and other) fields of the
> canmsg_t structure, and pass the structure to the write() function.
>
> This is pretty much the standard way of using character device drivers
> in Linux. Devices are abstracted as files, and we open(), read(),
> write() and close() them. The data we read and write is the data from
> the device or that we send to the device. The driver makes it easy to
> access the device by treating it like a file. This is all done in
> userspace code. The driver runs in kernel space, and the read() and
> write() functions perform the work of transferring the data between the
> application and the kernel driver. Nothing in this paragraph describes
> anything that is TS-73xx, ARM, or CANbus specific.
>
> --- rod.
>
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|