Processor Expert - How to use driver in my application?

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

Processor Expert - How to use driver in my application?

631 Views
lmg
Contributor III

CW10.4

MQX 4.0.1

TWRK60D100

 

I see that PE allows me to drag and drop code for particular methods into my application.

 

But the code that's generated is just a template. Where do I find the specific values to fill in?

 

Example:

 

I want to turn on a GPIO output pin.

 

In the Component Inspector, I've named the field "LED2".

 

When I drag "SetFieldValue" into my source file, I get:

 

       GPIO1_SetFieldValue();

 

The pop-up box for SetFieldValue says the syntax is:

 

        void GPIO1_SetFieldValue(LDD_TDeviceData *DeviceDataPtr, LDD_GPIO_TBitField Field, GPIO1_TFieldValue Value);

 

I'm clueless on the four arguments I'm supposed to fill in. I assume they're automagically generated somewhere???

 

 

Also, I assume this I/O point is initialized somewhere. Do I have to add that code, or is it automagically included in the build?

 

Thanks!

 

~LMG

Labels (1)
0 Kudos
3 Replies

347 Views
trytohelp
NXP Employee
NXP Employee

Hi,

There are some examples for each bean.

To access them you must select the bean and with the popup menu click on Help on Component.

A help tab will appear under Eclipse (at right).

the help will provide documentation and examples for the bean.

Hope this will help you.

Pascal

0 Kudos

347 Views
BlackNight
NXP Employee
NXP Employee

Hello,

Looks like you are using BitsIO_LDD?

It would be easier to use the BitIO component which is a wrapper around the BitIO_LDD.

Or to to use BitIO_LDD.

If you want to use the BitIO_LDD:

you need to create a device handle first with the Init() function: something like

handle = GPIO1_Init(NULL);

this returns the handle to be used as first argument for SetFieldValue().

The other parameter are defined from the bit field names: best if you generate code and then looup-up the names.

I hope this helps.

Otherwise:

Tutorial: Bits and Pins with Kinetis and the FRDM-KL25Z Board | MCU on Eclipse

0 Kudos

347 Views
lmg
Contributor III

Thanks Erich. I'll check out the link when I get back from lunch.

And I appreciate your blog!

~LMG

0 Kudos