Re: PCF8575 driver for NuttX

2023-10-04 Thread Gregory Nutt


On 10/4/2023 8:02 PM, Gustavo Soares wrote:

Hi Greg!

Yes, if I use #include  this problem is solved, but 
then the code loses the reference to that specific struct causing another error.

And how exactly "the file does not exist"? I can open it and it is at the nuttx 
repo, I shared it's link.
Because the compiler keeps a list of paths that it will include files 
from.  It will NOT include files from drivers/ioexpander because that is 
not in that include path list.  So "the file does not exists" in any 
directory in the list of include paths. You could hack up  the build 
system  (but no PRs for that please)or you could just copy the header 
file (a lot easier). But you cannot include it from drivers/ioexpander. 
Since this is necessarily throw-away code, the easier solution is 
recommended.

Re: PCF8575 driver for NuttX

2023-10-04 Thread Gregory Nutt



Actually, the problem is very simple.  This file does not exist.

#include 

You probably wanted

#include 


The more I look at what you are trying to do, the more confused I get.

There is a file at drivers/ioexpander/pcf8575.h, but you are not 
permitted to include that.  That contains internal driver definitions 
that are not available to applications.  For testing purposes (ONLY!!) 
you could copy those definitions into your app.  (Your app could never 
be included upstream anyway because it violates far too many basic POSIX 
interfacing principles.  But for testing, you can do anything you want.).


The directory nuttx/drivers would be nonsense in that case because there 
is no nuttx/ directory in the repository.  You made that up and there is 
no include path to access it.


The include file path corresponding to:

   #include 

is include/nuttx/drivers/ioexpander/pcf8575.h which does not exist.

This include file path

   #include 

corresponds to:

include/nuttx/drivers/ioexpander/pcf8575.h which exists and is legal to 
include.  But it is a different file.





Re: PCF8575 driver for NuttX

2023-10-04 Thread Gustavo Soares
Hi Greg!

Yes, if I use #include  this problem is solved, but 
then the code loses the reference to that specific struct causing another error.

And how exactly "the file does not exist"? I can open it and it is at the nuttx 
repo, I shared it's link.


From: Gregory Nutt 
Sent: Wednesday, October 4, 2023 10:52:32 PM
To: dev@nuttx.apache.org 
Subject: Re: PCF8575 driver for NuttX



>>> Why wouldn't the compiler access nuttx/drivers/ioexpander/pcf8575.h?
>>>
>> Access to internal driver files by applications is specifically
>> forbidden.  This is part of the enforcement of the modular design to
>> assure that people do not do that kind of thing:  Applications must
>> not have access to the internal implementation of drivers.
>>
>>
> Never mind,  I misread the ultra tiny fonts in the image.
> include/nuttx/ holds the public interface to the driver (vs. the
> internal private definitions for the driver in drivers/). Anything
> under include/ should be include-able by your application.


Actually, the problem is very simple.  This file does not exist.


#include 


You probably wanted


#include 




Re: PCF8575 driver for NuttX

2023-10-04 Thread Gregory Nutt




Why wouldn't the compiler access nuttx/drivers/ioexpander/pcf8575.h?

Access to internal driver files by applications is specifically 
forbidden.  This is part of the enforcement of the modular design to 
assure that people do not do that kind of thing:  Applications must 
not have access to the internal implementation of drivers.



Never mind,  I misread the ultra tiny fonts in the image. 
include/nuttx/ holds the public interface to the driver (vs. the 
internal private definitions for the driver in drivers/). Anything 
under include/ should be include-able by your application.



Actually, the problem is very simple.  This file does not exist.


#include 


You probably wanted


#include 



Re: PCF8575 driver for NuttX

2023-10-04 Thread Gregory Nutt




Why wouldn't the compiler access nuttx/drivers/ioexpander/pcf8575.h?

Access to internal driver files by applications is specifically 
forbidden.  This is part of the enforcement of the modular design to 
assure that people do not do that kind of thing: Applications must not 
have access to the internal implementation of drivers.



Never mind,  I misread the ultra tiny fonts in the image. include/nuttx/ 
holds the public interface to the driver (vs. the internal private 
definitions for the driver in drivers/).  Anything under include/ should 
be include-able by your application.

Re: PCF8575 driver for NuttX

2023-10-04 Thread Gregory Nutt


On 10/4/2023 7:02 PM, Gustavo Soares wrote:

Why wouldn't the compiler access nuttx/drivers/ioexpander/pcf8575.h?

Access to internal driver files by applications is specifically 
forbidden.  This is part of the enforcement of the modular design to 
assure that people do not do that kind of thing:  Applications must not 
have access to the internal implementation of drivers.