Enable single PAL pads?
Posted: Wed Sep 21, 2011 5:41 pm
Hi,
I have a question about the PAL driver. For me it seems impossible to enable or disable the PAL functionality for single pads? So, if I enable the PAL module by setting HAL_USE_PAL to TRUE, it automatically enables the GPIO functionality on all pads/pins in the _pal_lld_init.
We are working on the AT91SAM7. The corresponding PAL_LLD driver automatically writes 0xFFFFFFFF to the PIO Enable Registers, so all 64 pins are switched to I/O mode, although we just need 4 of them.
Is there a way to avoid this? I think it would be nice to have an additional field in the config structure (where the pullup settings, etc. are defined) that indicates for each pad if it is used for PAL or if it is not.
Besides, it would be great if the setup for a pin could be changed during runtime, e.g. by additional macros in the PAL module. Otherwise I had to change the definition of the pal_default_config in hal_lld.c.
Thanks!
Regards,
Florian
I have a question about the PAL driver. For me it seems impossible to enable or disable the PAL functionality for single pads? So, if I enable the PAL module by setting HAL_USE_PAL to TRUE, it automatically enables the GPIO functionality on all pads/pins in the _pal_lld_init.
We are working on the AT91SAM7. The corresponding PAL_LLD driver automatically writes 0xFFFFFFFF to the PIO Enable Registers, so all 64 pins are switched to I/O mode, although we just need 4 of them.
Is there a way to avoid this? I think it would be nice to have an additional field in the config structure (where the pullup settings, etc. are defined) that indicates for each pad if it is used for PAL or if it is not.
Besides, it would be great if the setup for a pin could be changed during runtime, e.g. by additional macros in the PAL module. Otherwise I had to change the definition of the pal_default_config in hal_lld.c.
Thanks!
Regards,
Florian