It is the oldest driver and also the one that received least changes over the years.
I just introduced the new concept of "line", A line is a combo of port and pin, this simplifies the API a lot, for example instead of writing:
palSetPad(GPIOA, GPIOA_LED_GREEN);
Now it is possible to write:
palSetLine(LINE_LED_GREEN);
The advantages are:
- Easier to use API.
- Identifiers not bound to specific ports, this makes code a lot more portable.
The new functions are: palWriteLine(), palReadLine(), palSetLine(), palClearLine(), palToggleLine(), palSetLineMode(). Those are all macros so there is no code size increase, the old API is still available.
I modified the GPIOv1 and GPIOv2 drivers. Platforms with not updated drivers will give an error when trying one of the new macros but will work unmodified otherwise.
The boards generator now generates macros for both "Pad" and "Line" functions, it now generates both GPIOA_LED_GREEN and LINE_LED_GREEN.
I only updated the F7 boards/demos, others will be done gradually.
Giovanni
[INFO] Enhancements to the PAL driver
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: [INFO] Enhancements to the PAL driver
Change to the boards generator, now it is possible to make aliases of pins (giving them multiple names) by simply separating identifiers with a space in the .chcfg.
It will be included in next ChibiStudio and also be available as installable plugin on the update site.
Giovanni
It will be included in next ChibiStudio and also be available as installable plugin on the update site.
Giovanni
-
- Posts: 3
- Joined: Wed Aug 29, 2012 7:21 pm
Re: [INFO] Enhancements to the PAL driver
Hi
In the function palWriteLine, pin needs to be line.
Anderson
In the function palWriteLine, pin needs to be line.
Anderson
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Return to “Development and Feedback”
Who is online
Users browsing this forum: No registered users and 46 guests