Hello, InSpace uses a radio module for our telemetry systems called the RN2483, which is a LoRa radio chip that has a UART interface.
I would like to have a device driver on NuttX for this module, so I am having some of the students try experimenting with creating one to get an idea of how to write a driver on NuttX. Unlike sensor drivers where the device's `register` function takes an instance of the communication interface device (i.e. `i2c_master_s` device for I2C sensors, see for example the `sht4x_register()` function), it does not appear like there is a way to get the underlying device struct for a UART interface. It seems that the UART interfaces are registered as part of the `serialinit` step by calls to `uart_register` and can only be interacted with from external code by first calling `open()` on their pathname. The best idea I can come up with is to have the RN2483 driver perform such an `open()` call, so that the registration function for the device takes the UART output's pathname as an input parameter in place of the device struct (`uart_dev_t`). But this requires that there be a pathname for the UART interface as well as the RN2483. I would like to avoid this so that the RN2483 device takes control of that UART bus and arbitrates all communications with the peripheral. I did find a function called `stm32_get_uart()` which returns the UART device; this is more what I am looking for. It doesn't seem like most other platforms implement a similar function though, and I'm not sure if it is good design to require that an architecture first implement something similar before being able to use this driver. I don't want to introduce this pattern to NuttX without first checking for other suggestions. Am I missing an easier way to do this? Thank you, Matteo
signature.asc
Description: PGP signature