On 7/11/2023 2:00 PM, Alan C. Assis wrote:
Hi Ed,
Are you the Ed Sutter from uMon bootloader author?
On 7/11/23, Ed Sutter<edsutte...@gmail.com> wrote:
Hi,
Are there any examples of application code accessing a SPI device on Nuttx?
Thanks,
Normally NuttX applications don't access the SPI Bus directly, an SPI
device needs to be exported through the driver implementing its
function, so an SPI temperature sensor will create a /dev/temp0, an
SPI light sensor will create a /dev/light0, etc.
Exception to this is when you want to test the SPI Bus directly using
the SPI Tool (similar to I2C Tool idea), in this case you have to
enable CONFIG_SPI_DRIVER and
CONFIG_SYSTEM_SPITOOL (look at apps/system/spi).
BR,
Alan
Alan,
Ok, so I can use apps/system/spi for basic SPI interface testing. Now I'm
trying to digest
your first paragraph... I assume the same applies to I2C, is that true? The
actual interface
is transparent to the application because there's a functional layer between
them, correct?
Assuming that is the case, is there an example snippet of code (I2C or SPI,
doesn't matter) that
exports the function to the application?
Thanks,
Ed