You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Tim Hardisty <ti...@jti.uk.com.INVALID> on 2022/10/24 18:29:08 UTC

RE: ADC device close and IRQ

Now I am very much more familiar with the SAMA5Dx ADC and Touch Screen Controller (TSC) driver code, the more I think it is making life really difficult having the TSD code separate to the ADC code - they are just too closely related especially given all the combinations of ADC channels and/or TSC control requirements, and common interrupts etc.

I am minded to subsume the relevant sam_tsc code into the sam_adc code and rationalise it that way.

Does that seem a reasonable approach or is there a very good reason to keep them separate?

>-----Original Message-----
>From: Nathan Hartman <ha...@gmail.com>
>Sent: 16 September 2022 12:31
>To: dev@nuttx.apache.org
>Subject: Re: ADC device close and IRQ
>
>On Fri, Sep 16, 2022 at 7:20 AM TimH <ti...@jti.uk.com.invalid> wrote:
>
>> Actually a little more complicated as the detach and disable in adc
>> close then kills the touch screen driver as well (it uses the ADC).
>> l'll figure out a way, I'm sure!
>
>
>
>I haven't looked at the code, but it sounds like any driver being closed 
>shuts
>down the ADC for all drivers.
>
>Instead, the driver should keep a reference count. The underlying hardware
>should be initialized when the first instance of the driver is opened and 
>un-
>initialized only when the last instance of the driver is closed.
>
>Cheers
>Nathan