Dear NuttX enjoyers, I am currently developing a driver for the Analog Devices/Maxim Integrated 1wire eeproms and I've got several questions I'd like to discuss. I already have a working prototype which emulates the eeprom as a struct filep (like in i2c/i2c_xx24xx.c) with working reads and writes, the writes being substantially more difficult to implement (due to the scratchpad).
Since the EEPROMs are by nature used for identification, the typical appliaction where this driver should run is a some kind of device that reads all the EEPROMs on the 1wire bus and identifies all the components connected together (and this is actually my application). This means I need to tell the driver which romcode should the driver match. The current workaround is by an ioctl call, with which I tell the driver the current romcode to match. Before the ioctl is called, I scan the bus by a custom boardctl call that supplies all the found romcodes. What is your opinion? However, I've thought of different approaches: 1) is there some kind of automatic registration of newly connected devices in NuttX? For example in Linux, all the newly connected devices can be listed in /sys. But I admit this would be much harder to implement and possibly add a lot of overhead to memory constrained devices 2) Concerning 1wire/ds28e17.c, the current implementation revolves around one onewire_master_s struct with only one slave - meaning only one slave on the bus is possible. If I wanted more devices on the bus, I'd need to dynamically allocate new drivers. Has anyone tried to solve this issue by having, for example, preallocated driver holders that would only turn on/turn off when more devices are present on the bus? I'm looking for a more general approach. Best regards, Stepan Pressl