This is not so much about a board configuration, it is about a driver 
configuration.

So the PCF driver is just a GPIO expander which in this case is driving a LCD.

My question really is about the integration of very specific configuration 
information into the OS.

From a high level view, the driver allows communication with the hardware and 
if there are variations then the driver should be configurable from the user 
application.  In this case there are four configurable items:

- I2C interface being used
- Address of the I2C peripheral
- Number of columns
- Number of rows

None of these are configurable from the user application and they are not 
configurable from kconfig, they are all hardwired.

Ideally, I’d have configured this from the user application.  As they are 
embedded within the board startup I’d have thought they would have been 
configurable through kconfig.

Regards,
Mark
_____________________________
Blog: blog.thepcsite.co.uk
Twitter: @nevynuk





> On 23 Jul 2023, at 20:00, Alan C. Assis <acas...@gmail.com> wrote:
> 
> Hi Mark,
> 
> In fact some examples are ("incorrectly") hard-code to some I2C Bus or
> uses #ifdef to compile only if that I2C Bus is enabled in the
> menuconfig.
> 
> There are pros and cons of using this approach:
> 
> PROS:
> 
> - 'Guarantee' that such config works (dev tested it);
> - Developer doesn't need to test all different setup combinations.
> 
> CONS:
> 
> - User will lost much time figuring out which configuration to use
> (case there is not Documentation in the README.txt explaining about
> how to use it)
> 
> - Some #ifdefs inside board are very dangerous to end user, because it
> is silent, users don't know that content of C file wasn't compiled.
> 
> A better approach could be creating some device configuration inside
> boards/xxx/xxx/xxx/Kconfig to let user to define what bus number to
> use.
> 
> These are things that we need to improve to make NuttX more user
> friendly. But, of course, it could bring more challenges as well, case
> a board doesn't have support to some I2C or SPI Bus and the user
> enabled it in the menuconfig.
> 
> BR,
> 
> Alan
> 
> On 7/23/23, Mark Stevens <mark.stev...@wildernesslabs.co> wrote:
>> Had some fun and games today working with the SLCD example on the Pico W.
>> 
>> It appears that the example has hard wired parameters for
>> 
>> I2C bus
>> Number of characters
>> Number of rows
>> 
>> Is it supposed to work like this or should these parameters be
>> configurable?
>> 
>> Regards,
>> Mark
>> ______________________________
>> mark.stev...@wildernesslabs.co
>> 
>> 
>> 
>> 
>> 

Reply via email to