Let us start building our application.
The first thing that we need to do is to include all the many drivers if you go to the board support
package.
OK, so the recommended driver is GPI, so you just need to add a prefix x and then you have the driver
for our excited GPI person.
Great.
So hash include.
And then ICS, GPI, you got three.
Now remember, here we have a multiple instances of where GPI fitting right.
So we need to initialize product, right?
So this is the difference that you will be finding when you have multiple instances of the very.
Right.
So once you include all the mandatory file, now we go ahead to add that UPI IP again.
We need to call the config structure and the infrastructure right, so we'll just be finding whether
we have an initialize function, right?
So this required just a declaration of an instance structure.
And we are ready with an initialization rate, so they just go ahead and declare an instant structure.
OK, so instant structure for.
The LAPD will be naming it as and when required for the switch instance of any right.
So once you declared an instance structure, we add a function that could be used to perform an initialization.
All right.
So here we will be performing initialization of our code types, right?
So we have an ex GPI or initialize function that could also be used to perform an initialization.
So we just need to pass an instance structure and the device idea, right?
So we go ahead and it does the status of an initialization artillery just mean this as to sell for an
elderly.
OK.
And here for an elderly, the infrastructure is new as an elderly and to final delivery side, you just
need to go in an experimental hedge fund.
Now remember, we named our instance of an IPO saying You don't switch now if you just search for an
elderly, OK?
We're finding it becomes very easy now to recognize the instance.
There we have a leader for a specific guy.
Rachel, then we named it as an early thaw, allegedly deleted information will have an key, right?
So that helps us to easily recognize the data for the specific instance of an IP.
So remember this whenever you are working with the multiple instances, obviously you might be named
the macro adding to the functionality.
Right.
So this will perform an initialization for an alleged instance.
Similar thing that we need to do.
For the switch, all right, so we just copy this, we need to declare one more variable.
So let me just declare this to status is for the switch rate again, the same function only thing that
we need to changes in this structure, which is switch in this case and the device aid if you text parameter
Dark Age five.
OK, here we have a device, so we just need to add it over here, right?
So this dual performance initialization for both switch and an LCD instead, so far, you could say
GPI right now will verify whether both of them didn't exist two sets of state.
So status and OK and weight status, it's OK if that is equals to exist.
Success, so in that case, we could see.
Device locate device in it.
Successful.
OK.
And we could just mention.
Device in it fit, right?
So this complete the process of initialization will just be calling this function in our main application
rates, so they required in each platform and cleaner platform for and you are right, we'll just be
removing this.
OK, now first thing that we do is to set up the correct detection, OK, and then we are ready to work
around with the lead.
So we go ahead and look for set data direction.
OK, so this required the instance structure, China number and the direction that you want to set,
right?
So we go ahead, we add this function.
OK, let it just work for us.
We then switch incidence rates.
So instance structure name is switch.
OK, we have single channel for both types.
Now we want to set this as an input rate.
And if you.
Explore the functionality of the so we know that to set the pain as an input, we need to apply what
right?
So we have four switches which are available on board, so we'll just be adding fuel, one that is equivalent
to effin and hexadecimal.
Similarly, we'll just be calling centre utilization now for an empty.
The instant structure will be a lead China leg in this one, and we want to set to be said to be output
port, so we just need to add a seat.
So once you correctly set of that addiction rate, we will be reading the status of a switch.
We already know that there are discrete read returns you 32 will get will just declared one variable.
Let it just name the let's switch read OK and will be reading the value of a switch at an interval of
one second.
So while one.
So we'll switch read.
OK, this will be equal to if you go to.
Todd, GPIO drivers, we have a discreetly OK where we need to specify the correct instance structure,
so for instance, a tree switch and the channel is great and that is what we will be writing on to any
lead.
Okay, so to write the reader, we have a discreet right, OK?
So there's with three arguments.
First one is the infrastructure, the foreign, elderly and structure is named as an entity.
Channel we are utilizing is one, and the data that we want to write is switch read right.
We'll also be writing this.
We don't know.
Consults will be that we verify as we change the status of the switch, whether values are changing
or not.
Great.
So we'll just be mentioning the switch read.
And let me just bring the value in in decimal format, right?
And we have our value inside switch read right.
The last thing that we want to do is to add the necessary.
So it just wait for the delay of one second, OK, before we put it in the next round.
OK, so this completes our application code now will just be proceeding and build an entire application
project, right?
So once our bill is finished, select an application project, Nebo guys launch on heart rate.
First thing, as you switch your perspective from design to diva.
OK, we need to connect to a customer, so just click on this plus button, select the respect you can
put on which you have your bow and click OK, right?
So was the assistant.
You'll just be clicking on this resume button, right?
So you could see.
So here we are getting this status as a feel.
This is because we might have missed the 10 parenthesis, right?
So let me just say a parenthesis or here also and or here right now, what this will do is this will
first compute the ending of street to sell and suitcases, and then we'll be comparing it with that
status, except to say to let it just rebuild our project.
Right?
So once you rebuild your project with this modification, you'll be finding that warning that we are
getting in the previous case is gone.
OK, now we just disconnect our previous debug configuration, or we just select the DBA configuration,
right click and then we have a relaunch.
But right, so this will start the fresh instance of our DBA configuration.
OK, we already have connected our right to a minute to just be clearing up our console.
OK, so let me just clear a console.
OK.
And then we will be starting to execute.
Right.
So you could see device and it is now successful.
And the value that we read on the switch is zero because all the switches are in off.
Now I'll try to change the switch value from my MSB to LSV.
Great, so as soon as I turn on the MSP, switch will be getting the value of it.
The next one will be getting a value of 12, 14 and last one is 50.
So you would see how we utilize the multiple instances of GPI benefit.