We successfully complete the generation of a team, and what we want to do is we will be exporting the
hardware into an SDK, so we'll just go to file export export.
They will also be including of the extreme right.
Once we do this, we will go ahead and will launch an SDK right away.
I will start building our see application.
OK, so we already have our hardware packed on Spec. Over here, which includes all the 1980 files,
such as initializing the processing system a bit fine.
OK, now we'll go ahead and will utilize the hellotel template that we have at this rate.
So we'll just need this as GPL e-mail.
OK, and then we'll be selecting in Hallowell dump, right?
Now here, once we create a fight, a weakened law which try where we need to utilize foreign GPI,
so we'll just go for a GPIO.
Here you can see the driver.
The recommended driver for us is GPI is right.
So we'll just proceed, go to Helloworld or see OK, which is, I mean, fight.
And then here we start adding RC application rate.
First thing is, we will be including some of the mandatory drivers.
So we have X will be estratégia, which will help us to work around with the periphery.
OK, the next one that we're required is experimental stage, so that will provide us all the data related
to the hardware right now.
If you just explore GPI, OK?
So what we did in a previous case, we again need to do to initialize the peripheral.
OK, we require to structure.
One is the config structure.
OK, that will be declaring as a pointer.
So they just need this as GPIO config, OK?
And we required the structure, which will hold an instance.
The director will just be calling this structure.
We're here and we will be naming it as GPI, right?
So this will be a simple structure.
It won't be a point, right?
Then we declared one function that will be.
Initializing are petrified, right, so let me just go ahead and try to add the initialization.
So first we'll look for the device aile, and for that we do have information to the function that we'll
be utilizing is GPIO look configure and this returns the config structure.
OK, so we just need to buy this argument and the device idea, right?
So for the config structure is GPIO config, OK, and this will be attaching to the lookup config function.
And here we need to pass the device A.D. So to get the device to you just need to go to experimentar
to attach file look for.
OK, and then you get this macro, OK, which you just need to apply here, right?
This is the first step.
The next step will be to use the initialize to initialize the Palestinian, right.
So if we go to stupid old dart, yes.
So here you have CFD initialization, which again requires three arguments so instance structure, config
structure and interest rate.
So again, address could be found out from experimentar.
Don't actually.
First argument is the ancient structure, which is GPIO, then conflict structure, so you can think,
OK in the last one is a base.
So if you go to experimental door that you could find out, double etc. so you just need to pass it.
And that's basically written whether initialization is successful or not.
Right.
So to check whether initialization is successful or not, they'll just declare in status and then whatever
this function rate, and we'll just be storing in this variable save.
Does 60 success?
OK, we could see that we successfully initialize the device rate so the cell brain death, and then
we could just mention device in it.
Successful rate.
Else is this we could just be mentioning that we failed to initialize our basic rate will again be adding
till primitive device initialization free rate.
So this is what we are going to do in any next function.
Now, after the initial are you what?
Right?
So we will just be calling this innate function.
So this will automatically initialize our base very late.
And then we start with a message that we are starting our test rate so that they just go ahead and mention
we are starting the or e-mail list right now.
Here we relied on logic.
So the first thing that we do is to set the direction for report.
So if you go ahead to and we will be predominantly working on a into do not work with this bank API
to instead work on a ping API, Rachel, we have the same direction, OK, which required an instance
structure, pin number and the direction.
OK, well, just go ahead.
And this way required to specify for each pin, right?
So for us, an incident structure is GPIO.
OK, the next day is the pin number, so first pin will be fifty four and we already know that we connected
switches at the ellipse before because the GPI will create so Fifty-Four will be a switch.
So here we need to set the direction to be input, right?
And we already know if you just explore this function.
So for setting any of the pain as an input, we just need to apply.
Zero rate will apply zero here.
So when we consider planning, but what we do not need to utilize the output enablement rate, so this
will be doing for all the input that we have.
So here we said pin number 54, 55 56 57, which represent the database, which is at an input trade.
The next one will be doing the same thing for our reality now when we considered an elderly.
So we need to do two things that is first, we need to set the direction as an output and then we also
need to enable an output rate.
So the pin, the EMI number there, we will be having our it.
Fifty eight, fifty nine, then sixty and sixty one night to set this as an output.
We need to apply one one one nine.
What right?
And then we need to do one more thing that is we need to enable and operate.
So we have a function to do that.
So set output enable PIN and we just need to apply one over here.
Right again, we need to pass an instance structure and a pin number.
So let me just square.
First is an instance name, OK, which is GPIO.
PIN number is fifty eight, OK?
And then we just need to apply one right this way required to do for all the bins where we have our
l'église right.
So we have our digits at 58, 59, 60 and 61, right?
So we said the direction for all the points where we have our elderly as well as we also enable an output
rate.
And here we set all the bins where we have a sutures as an input rate, so we could just add a message
over here setting fifty eight, fifty nine, sixty and sixty one as output.
Right.
So this complete all the initialization of a particular line setting up our direction now we could write
the mean code, which will be running throughout the span of an application.
So to read the reader, what are we going to do is we'll be reading the data from a switch, OK, and
then that data will be applying to the daily rate.
So if you just analyze the driver for hobbyists who do read up in, you had this function and that basically
read and you started right.
So we will be utilizing the same leadership here we required for variable rate so each switch data will
be inside available to you to redo.
OK, we'll just be naming this as zero six one.
Switch two and Switch three.
OK, so these are all variable, which will be holding the data that will be reading utilizing the read
brain function that we have.
So we'll just be initiating them to zero.
OK, so let me just go ahead and try to utilize the redefine function, right, so we just need to pass
an.
Instance structure and a pin number.
So infrastructure is GPO and the pin number for our switches.
Fifty four.
So we apply the same logic for pin number fifty five, fifty six and fifty seven, right?
So far, all the switches will be reading the value and will be storing them in their respective variable.
So for our first function, we will be storing it in zero.
OK, then we have a Switch one, Switch two and then we have a Switch three, right?
Next, we will be writing this data onto respect to early data to do that, we have a function right
thing where we need to specify and instance structure benign data, right?
So let me just go ahead.
So instance structure is GPIO in number we have is fifty eight, OK, which is the first thing where
we have our ability.
Then the data so far, First Lady will just be sending such so right.
Will just be gulping this and pasting it full time rate the next day leads at fifty nine, where we
will be sending the data from search one.
OK, so this complete accord, what are we going to do is we'll also be printing the value that we are
receiving, so that will help us to debugger value, right?
So they'll.
Brain death, OK?
Value read from the switch we'll get to city to.
Switch one switch to the last one is Switch three, right, and the variable which are holding this
value are switches to switch one, switch to Switch three.
Right.
So this allows us to see whether the code is working at the expected rate so we could manipulate the
result.
We could verify the result that we are getting on the diesel console with the Switch Street rate and
will be setting each new value in an interval of two seconds.
So this is an entire logic that we going above perform right to what we are doing.
We are reading the value from a switch.
Then we are applying the same value to the respective values, and we are also printing the values that
we are getting on a switch, right?
So this helps to verify the data with the switch state.
And then we are sensing the value of a switch after an interval of music.
So once you complete the score now, we could just proceed to downloading the program onto an FPGA who
will just hit program FPGA.
OK, this will automatically invoke the big fight that we exported from and we will do.
So once programming is done, we could go ahead where we have our head of the world or see OK and then
right click run as launch.
So before this, what we could do is we could just is to get them in to the respective comfort that
you have right and then proceed to launch on how to write.
Now, if you see all those details, OK, so here we forget to add a new line character.
Yes, we'll will just add a new line character and then will again relaunch our debug session.
So now you could see by default on the Switch are in zero.
So I'll now try to turn on Switch clearly.
So the first and be just turned on, no right that you could see the next one, then next one, right
and then final.
Now you could see all the switch are turned off and respectively, all the ladies are also on.
So now we'll see.
Turn them off, right?
So we will first turn off Switch three, then we will turn or switch to and then switch one and finally
switch seats.
Right?
So the cold is working as expected.
Now you're good now you know how you utilize the e-mail, OK, to sense the signal from the GPIO.
And along with that, we also understand how we applied the signal to the GPI process.