So let's try to understand how we add the switch or alcohol or how we utilize the switch within a mile.
And then since the data that we have on a switch and then sending that data down to an elderly rate.
So this is what we will be covering in this.
We do.
OK.
So utilizing the diesel script that we have generated, we are able to create a fundamental hardware
design.
OK.
And here you could see by default, all the GPI options are enabled, right?
So when we consider GPI or am I?
So all of them are nebula.
As soon as we select GPI, where my right to all of them are selected, except those which are being
utilized by the very far right.
So we do not need to worry much about this only thing that we need to make sure when we utilize the
push button is now we already know that pin number 50 and 51 have a button been present at that.
Am I open?
OK, so our agenda will be just to disable disable the pull up if we have on this stupid rate.
So here what we did is we will be predominately working on am I 50, where we have button for?
We'll just be disabling the put right.
So this is one thing that will be doing the one modification as compared to our previous case.
But if you keep this enable, we able to just sense always a high on the push button.
OK.
So do you see the changing seat?
We need to disable the pull up and then only we could sense are different values on the switch.
So remember this thing?
You could also give a try on keeping this build up enabled until you will be always receiving one on
a push button, right?
So once you disable now, if you press the button, you will be getting one else will be getting zero.
Right.
So let me just to it this modification and then create and they still happen.
So applauded each individual and they still happen, and it changed a bit.
So we already I have already generated a bitstream.
I just need to launch an SDK, right?
So I already exploded and hardware failing to investigate.
Only thing that we'll be discussing is what will be the differences in the code that we have right now.
The device initialization will remain as it is.
OK, as we have written in the previous case, when we are working with an elite wait, we just need
to specify the device in the lock up config function, then utilize the C of G initialize, right?
So they do think that we'll be doing and then this will allow us to initialize our GPI right now here
too.
Since the state of a switch, it basically returns you with 32, and that could be verified later.
So if you just go ahead and explore the functions that we have in X UPI who aspires to read the data
from a switch?
OK.
When we consider the pin.
So here we have a series of functions which are available in therapy, right?
One of them is Ex Tupaea.
Oh yes, read and write.
So this will basically write a new 32.
So to handle this situation, we declare a temporary variable.
All seem the that issue 30 to me, so we could actually check the indirection also.
So if you want to sense the pain direction because we already know that for setting up an input, we
need to add a zero to said direction, brain function and for setting up an output.
We need to send one that is this we already discussed day two.
We could actually check the direction if we want, but we will not be doing that over here, right?
Two, but indeed will be storing the value that has been written by the read function.
Right now, we need to set the direction.
So a pin number seven where we have our elderly.
Being number seven there, we have an alibi, so we need to set this number as one, right?
So this will consider this thing to be an output.
And similarly, we need to enable an output.
So for that, we also need to apply when right does that.
We think that we need to do to consider pin number.
Am I 007?
As an output book where we have a reality for setting up an input, we just need to apply zero in the
same direction bin function, right?
So for us, the button that will be utilizing is button number four, which is connected to Amil 50.
We'll just be specifying the pin number to be 50.
And here we need to specify zero right to this.
We already discussed if you just explore this function you could clearly know doesn't settle for an
input direction and then run for an open direction.
To this, the last argument is our direction.
OK, now we will be starting a GPIO email and let it stand here.
We could read the data, right?
So we do not want to read the direction.
The other direction is set correctly or not.
We will utilize the function that we have.
Get direction.
OK, so this will this will be giving us an.
So if you just analyze get direction.
OK, so let me just try to explore what it truth to zero for an input direction and one for an open
direction, so if you specifically need to know the direction set for a specific thing?
OK.
You could just utilize this API, right?
But here we will not be doing this.
So but indeed?
OK, which is the variable that we declare, which is to the value that we have on button.
OK?
The function that we have to read, the value on happiness is.
We need to specify the instance, which is.
And then the pin number.
So once we read a reader.
Now what we want to do is we'll be writing the same day down to any leads.
So as we press, the push button will be to anyone else.
Will just be keeping energy off, right?
So to do that, we have the right brain function.
Here, we need to again specify an instance, which is the pin number seven where we have our reality
and the button.
So the data that will be reading OK from the push button will be sending the same data to an elite,
right?
We are also branding the value that helps us to debug an entire thing.
So as we dynamically change the speed of the switch, we'll be seeing or observing the changes of pattern
data.
And then we could analyze whether we see the respective changes on a console also, right?
We are reading the value of pushbutton and an interval of two second rate and that.
So let me just go ahead and try to program, and if you rate so we already exported our hardware file,
we just need to go ahead and try to program and FPGA straight.
So this is the first thing that we do.
Then we will be connecting and it's sticky terminal.
We'll get to come board for right.
They just go away.
And now we will be performing execution of this application on to and hardware to run its launch on
hardware run as launch on Hottovy.
Right.
So now if you analyze.
We successfully initialize our device and then we are starting and model, so like, no, I haven't
pressed the button, so we could clearly see that we are getting a value of zero now as soon as I press
the switch.
OK.
So you could now see that we are reading the value of one right down, in fact, as I change the stick.
OK.
You could see that we are reading and see you right now.
We could dynamically change the speed of a pushbutton, so we able to read the reader from the periphery,
OK through an email.
And then we are also sending the data to anelli, right?
So this is how you could interface or you could utilize the push button and the switches within a Miyu
interface.