zdebanos opened a new pull request, #17182: URL: https://github.com/apache/nuttx/pull/17182
## Summary This pull request adds several new features: - an `ioctl` base for 1wire drivers - a simplified way of interfacing with 1wire devices (of the same family on the same bus) using two `ioctl` calls - a generic 1Wire driver for DS2XXX eeproms. Before these commits, the expected way of using your 1wire driver was to implement a callback that recorded all the scanned devices on the bus. However, that, in my opinion, led to nonstandartized and awkward consequences, such as implementing the callback in your userspace application. One of the commit fixes this: now the way of reading all scanned devices on the bus is done by a `ONEWIREIOC_GETFAMILYROMS` `ioctl` call. And with that `ONEWIREIOC_SETROM` tells the driver which rom should be interfaced. The methods for scanning and setting the interfaced device are implemented and should be generic for any driver. It is expected the device driver implements the switch table to call these methods. The correct way of scanning the bus for new devices would involve a background kernel thread continuously scanning the bus for new devices and registering new files the userspace can access. But that's probably too much of an overkill for NuttX. Therefore my approach sets a good middleground between usable and resource-friendly. @cederom a little bit too late, but I did not forget :-) ## Testing Tested on a STM32F302 board. Reads and writes (even those unaligned ones with the scratchpads) were succesful. However, the testing was only done on the DS2431 eeprom. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
