kengineer Posted July 11, 2016 Report Share Posted July 11, 2016 Just wondering about the proper usage of the toggle driver. The readme file in the driver says that after enabling the driver you just need to create a toggle board file, however, it seems that the "ginput_lld_toggle_Pal" contains functions specific to Chibios (palSetGroupMode & palReadBus). Should I copy this file out into my application and replace those functions with my GPIO functions or should I implement palReadBus and palSetGroupMode on my platform? Link to comment Share on other sites More sharing options...
kengineer Posted July 11, 2016 Author Report Share Posted July 11, 2016 Also, it doesn't look like these inputs are debounced, correct? Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted July 13, 2016 Report Share Posted July 13, 2016 Yes it's correct that the toggle driver called "Pal" is for the ChibiOS/HAL. Just as with the GDISP module for displays, you will have to write a driver that works with the HAL that you want to use. The driver then uses a board file to interface the actual hardware - exactly the same as with the GDISP module. You basically have to implementing everything in /src/drivers/ginput/toggle/Pal but using the other HAL that you'd like to use. The driver interface can be found in /src/ginput/toggle/ginput_driver_toggle.h. Implementing the palXxx() functions on your platform is definitely not the right way to go. Sorry for the confusion on this. The toggle drivers are not often used and we simply didn't clean up properly after we removed the ChibiOS-only constrain. On 7/11/2016 at 23:00, kengineer said: Also, it doesn't look like these inputs are debounced, correct? That's correct. That is up to the driver / board file. Link to comment Share on other sites More sharing options...
kengineer Posted July 13, 2016 Author Report Share Posted July 13, 2016 No problem I got it working like you suggested. Thanks for the info! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now