Re: UART based peripheral driver

2024-10-01 Thread Gregory Nutt
Well, to contradict myself, there is a driver that works in the way you were thinking: nuttx/drivers/wireless/bluetooth/bt_uart.c  This is a bluetooth driver built on an RS-232 bluetooth module and uses the lower half UART interface directly. But this driver was much despised because of this (

Re: UART based peripheral driver

2024-10-01 Thread Matteo Golin
Perfect, thank you so much for the pointers! When there is a draft ready hopefully we'll be able to get more valuable feedback on the implementation! Our goal is to implement things the NuttX way and be consistent, so we appreciate all the information so we can get it as close to right the first ti

Re: UART based peripheral driver

2024-10-01 Thread Matteo Golin
Thank you for the help everyone! I have some follow-up questions: > You should use the struct file instance to access the driver, not the raw > driver interface. Greg, can you clarify what you mean? My understanding is that it would be preferred that I use `file_open()` to get the struct file

Re: UART based peripheral driver

2024-10-01 Thread Gregory Nutt
The driver structure is contained in the struct file (filep->struct file->inode->u.file_operations.  The operation of many file systems, drivers, etc.  depend on the additional in these other structures. The driver interface is given by file_operations.  Notice that each method requires an ins

Re: UART based peripheral driver

2024-09-30 Thread Gregory Nutt
On 9/30/2024 12:25 PM, michal.lyszc...@bofc.pl wrote: On 2024-09-30 12:51:06, Matteo Golin wrote: Hello, 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 thoug

Re: UART based peripheral driver

2024-09-30 Thread michal . lyszczek
On 2024-09-30 12:51:06, Matteo Golin wrote: > Hello, > 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 req

Re: UART based peripheral driver

2024-09-30 Thread Gregory Nutt
On 9/30/2024 11:50 AM, Gregory Nutt wrote: On 9/30/2024 10:51 AM, Matteo Golin wrote: 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

Re: UART based peripheral driver

2024-09-30 Thread Gregory Nutt
On 9/30/2024 10:51 AM, Matteo Golin wrote: 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

UART based peripheral driver

2024-09-30 Thread Matteo Golin
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 w