317 views
in Embedded Wizard Studio by
Can someone please explain how the in-line code works if I want to turn on and off the LED using GPIOs of RPi 4. I am not getting any suitable hints
Raspberry pi
Thanks

1 Answer

0 votes
by
 
Best answer

Hi,

executing native coding in Chora is well explained here: https://doc.embedded-wizard.de/integrating-with-the-device?v=11.00#1

You need to do 3 things:

1. Prepare C API: lets assume you have a c file that contains the implemented c-functions pi_enable_led() and pi_enable_led()

2. Include header: in the Embedded Wizard you have to include the header file of your led-functions, like this:

3. Call the API via GUI: In the Embedded Wizard you just need to create a method and you can call the PI functions directly via native code:

{
  native
  {
    //this is native c code
    pi_enable_led();
  }
}

Bind this function to a button click and that's it.

Chris

by
where do I define the function pi_enable_led()?
and this inline code brick can be used alone or with DeviceClass?

Sorry If I am asking too basic questions. I am a beginner
by
It is recommended to split Model (interaction with middleware or hardware) and View (GUI), so I would always implement the Device Interface: https://doc.embedded-wizard.de/device-class-and-device-driver?v=11.00

If you add the device interface (in the Embedded Wizard), it includes an inline-code automatically. Inside the DeviceClass you add a GUI method like EnableLED() and within this method you add the above native code (from my last post).

Your pi_enable_led() function should be implemented in an own c file. If you have no c files yet (e.g. a middleware ...), you could directly implement your stuff within the Device Driver: https://doc.embedded-wizard.de/device-class-and-device-driver?v=11.00#31

I think the default DeviceDriver (which is inside the PlatformPackage: RasPi-4B/Application/Source/) should also already include some reference code for LEDs and GPIOs.
by
Can you please provide me with a simple example for toggling GPIO? I am facing difficulties implementing it

Thanks in Advance
by

Please see the section Accessing Hardware GPIOs 

Best regards,

Manfred.

by
But i am not able to see the settings of embedded wizard in that example
by
Also, ewconfig file for master demo is not available and I am using HDMI display instead of DSI
by
Please follow the rpi4b documentation, this should also cover HDMI support:

https://doc.embedded-wizard.de/getting-started-raspi-4b
by
MasterDemo is only for DSI interface

Embedded Wizard Website | Privacy Policy | Imprint

...