New to CDE - How to add properties like Port and Pins like PE GPIO or BitsIO?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

New to CDE - How to add properties like Port and Pins like PE GPIO or BitsIO?

523 Views
jiteshpatel
Contributor I

Hello all,

I am trying to make my own components with following features for reading the GPIO port/pins on HCS08 series controller:

1) Allows user to select the Port

2) Allows user to select the pins to read - generate functions for reading pin value or whole port with the mask generated automatically

3) Allows user to select the pull resistor - generate functions to enable/disable pull resistor/allows to read the current pull direction (up/down)/function to read the whole port pull mask at once/function to set the pull up or down

4) Allows user to select the interrupt (KBI) - Enable/Disable interrupt and Edge sense

Currently I have tried using the BitsIO and BitIO component but it does not provide all features that I want. I am looking into the inheritance of these component and expand it but till now no success.

If any one can suggest how to add a property like Port which will be selected from the available ports on chosen controller would be a great help.

Also how can we edit the existing components to learn how it is designed without inheritance wizard - like opening the existing PE components.

Thanks in advance

0 Kudos
1 Reply

238 Views
michalzan
NXP Employee
NXP Employee

Hi Jitesh!

CDE is mainly aimed at creating software components, which doesn't access the hardware directly, but they should use (inherit) Freescale components. However there is a way. You should inherit Init_GPIO and from the inheritance property you can read values of the component's symbols. This way is not encouraged because it is against the philosophy of Processor Expert components and inheritance, but it should work for you.

To read the symbols you should use this macro language construction in your .drv/.chg script

     %get(@Init_GPIO_HCS08@PeriphDevice,SymbolValue[PeriphDeviceBitsMask])

Here Init_GPIO_HCS08 is the symbol of the inheritance property in your component, PeriphDevice is the symbol of the property in the Init_GPIO component and PeriphDeviceBitsMask is the symbol which value you want to know.

To see all symbols that some property generates you have to check both check boxes in Debug Level in Processor Expert preferences:

perfs.PNG.png

After you have done this, you can see some of the symbols of the property in it's tooltip (to see this you have to create new PEx project and insert the Init_GPIO component into it and generate the project):

tooltip.png

If you don't find the symbol you need to work with in the tooltip, you can see all generated symbols and their values in file {component name}_DEBUG.txt after you generate the project:

tree.PNG.png

All these symbols are however MCU specific and should be used with caution as they can vary between different MCUs.

If you need additional support, feel free to contact us again :smileyhappy: