Dear Simona, Using the ff upperhalf to add support for the DRV2605L driver is the correct approach. There is no need to implement a haptic upperhalf. we only need to implement the methods defined in the struct ff_lowerhalf_s within the driver. The aw86225.c supports RAM mode, RTP mode, and others, which can be used as a reference. For the flexible front-end interface supported by the DRV2605L mentioned above, the ff upperhalf will only pass the effect id to the specific driver, regardless of which mode of actuator is used. Those are all implementations at the lower layer of the driver, and the upperhalf layer does not need to be concerned with them. The driver needs to implement logic based on the specific business requirements, distinguishing between different ranges of effect ids to determine which control interface and method to use. A sample force feedback driver based on ff upperhalf is nuttx/drivers/input/aw86225.c. Additionally, an example of debugging during driver development using system calls can be found in apps/testing/fftest/fftest.c. I hope this information is helpful to you. If you have any questions, please feel free to reach out. Best regards
Simona Toaca <simona.alexandra2...@gmail.com> 于2024年12月2日周一 14:56写道: > Hello, > > I want to add support for the DRV2605L[1] haptic driver, but I am not sure > what interface to use in doing so. I saw that there was no haptic upperhalf > support in the motor/ folder, but I found a force-feedback upperhalf[2] in > input/ which, from what I understand, is meant for haptics. However, I > don't see how I can use it in my case. DRV2605L has a lot of features (RTP > support, Analog input, PWM input, Audio-To-Vibe interface, incorporated ROM > effects library, etc) and the ff driver seems to be lacking the flexibility > I need. > > My question is: Should I use the ff upperhalf to add support for DRV2605L > (and, if so, can you please give me some pointers on how to implement such > a feature-rich driver using the ff interface), or should I write a haptic > upperhalf that uses the classic file-operations: read, write, ioctl, etc. > (similar to a sensor upperhalf) ? > > [1]: > > https://www.ti.com/lit/ds/symlink/drv2605l.pdf?ts=1733068441406&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FDRV2605L > [2]: https://github.com/apache/nuttx/blob/master/drivers/input/ff_upper.c > > Thank you, > Simona >