ts-7000
[Top] [All Lists]

Re: [ts-7000] Re: SPI communication on a kernel module [TS-7500]

To: "" <>
Subject: Re: [ts-7000] Re: SPI communication on a kernel module [TS-7500]
From: Walter Marvin <>
Date: Thu, 11 Aug 2011 15:01:10 -0700 (PDT)


1) you might not want to put up with the latency required with polling the sbus or other devices
2) Accessing the sbus from the kernal is a bit different than in user space, again I can't elaborate


From: al <>
To:
Sent: Thursday, August 11, 2011 10:16 AM
Subject: [ts-7000] Re: SPI communication on a kernel module [TS-7500]

 
Interrupt handlers should be fast and not block other interrupts, so handling the VERY slow SPI device communications should be done not directly by the interrupt handler, but by a dedicated SPI task or thread. The interrupt handler need only send a signal to the dedicated SPI task to awaken it and have it perform SPI IO in either kernel or user space, depending on your needs. TS has made it easy to create a high-priority user space task to do the SPI IO. I don't know why you want a kernel space task, but if you look at the code in sbus.c you will see how the memory mapping is done to gain access to the SPI bus. Just don't mix multi-threaded sbus.c-based apps with your kernel space routine unless you add pthread_mutex support to the sbuslock/unlock routines - there can be no more than one user of the sbus at any given time. The sbus.c code provided is NOT safe for multi-threaded apps.

HTH

--- In , João Trindade <> wrote:
>
> Hi,
>
> I need to communicate via SPI whenever a hardware interruption occurs.
> I've done a module to handle the interruption and all is working there.
>
> The problem is how to do the SPI communication. The supplied sbus.c is
> user space and I need to do it through kernel space.
>
> Can anyone give me some hints on how to do SPI communication on a kernel module?
>
> Thanks
>
> --
> João Trindade      <>
> Telephone: +351 93 561 39 10
> http://cnm.tagus.inesc-id.pt/joao+trindade
>





__._,_.___


Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe

__,_._,___
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU