Using the PAL functions

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
Post Reply
e_l_tang
Posts: 33
Joined: Sun Jul 03, 2016 7:58 pm
Been thanked: 2 times

Using the PAL functions

Post by e_l_tang »

Hi everyone,

What are the types and the sizes of the parameters accepted by the PAL functions? My code needs to repeatedly perform the same actions on different pads, and I am looking for a way to avoid needing to hard-code every action. My goal would be to store that information in arrays of structures. If it's helpful, here is the source file I am working on.

Thanks,
Eric
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Using the PAL functions

Post by Giovanni »

Hi,

The PAL driver allows to operate groups of pads (on the same port), look for "bus" functions. Groups are declared as structures.

Giovanni
e_l_tang
Posts: 33
Joined: Sun Jul 03, 2016 7:58 pm
Been thanked: 2 times

Re: Using the PAL functions

Post by e_l_tang »

Hi Giovanni,

The pads won't always be part of the same port and they won't always be manipulated simultaneously. I'm looking for a way to perform random access on them.

Thanks,
Eric
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Using the PAL functions

Post by Giovanni »

Then I have not understood your idea, you can use pal functions in order to manipulate them individually or in groups. You can use the "line" functions if you need for pads to have a type.

Giovanni
e_l_tang
Posts: 33
Joined: Sun Jul 03, 2016 7:58 pm
Been thanked: 2 times

Re: Using the PAL functions

Post by e_l_tang »

Hi Giovanni,

No, I think you have understood. Those functions are probably what I am looking for. I will try them and report back.

Thanks,
Eric
Post Reply