So let us start building up our application.
So first thing that we going to do is to include all the many dignified you.
So if you go to a board support package for an interim controller, the recommended rivalries are in
D.C. and for GPA, which is GPA, right?
So we'll go ahead.
We proceed to include both the magnitude driver for I in D.C. we just need to add and perfect size X
and then the tax rate for GPA.
We again proceed in a similar fashion to X GPA.
You got h.
And the last driver file that we required to get in hardware related information is experimental start
started raped.
So we first proceed with initialization of the GPI opposing right so white and GPA you and it again,
the process will remain exactly similar.
So we need to declare to structure, conflict structure and the infrastructure so we go to the GPA driver.
And here we have a config structure, so we'll be declaring it over here, right?
And this should be a pointer.
So I'll consecrate this is what we will be naming our config structure.
Then we required an instant structure.
So as we declare our conflict structure and internal structure, we go ahead and call look up Confederate,
so this will lead to conflict structure for us.
So truepill config will be equal to the look upon figure and here we need to pass the device idea.
So to get the device ID, you just need to go to an experimental dotage wrest control.
NF and Typekit UPI.
Right.
So here we have our device, right?
So this is what we're going to add as an argument to the look config.
The next step is to call CFG initially.
So here we have our see if you initialize and this returns the status of initialization, right?
So we go ahead.
We declared one variable which renamed as status, and this code initialize required three argument
first run in Steubenville, which is instant structure.
Then the config structure and the last thing that it requires is a be said for a state to be said.
This could be added from the parameter dirty trailer.
The config structure itself consists of the B surface rate, so we'll just be invoking looking this
address from it.
And they will verify whether initialization is successful or not great.
So since Dubai is a very simple, very fair, we do not need to perform a test for it, right?
So SSD sexists look, in that case, we could just mention that.
Cuba will reflect success rate again.
Do not forget to add a new line character and we can just mention.
GPA or their net, right?
This complete the process of initialization, all five GPO now here.
One thing we could do is since we are working on any job, we could set the direction for our pin in
the initialization function itself, so we do not wait for an interrupt occur.
And then we set up that addiction rate.
So we go ahead and look for the EPA, which could be used to say detection, right?
So this is an EPA that could be used to set the direction.
No first argument is an instance structure.
Then the China number.
Remember, we are utilizing only a single China and then the addiction rate.
So to say any of the pain as an input.
We need to apply one and to set any of the bills and output.
We need to apply zero rate to remember this effect.
Now we go ahead.
We call this API.
The first argument is an instant structure, which is studio, then the chain and number, which is
one.
OK, and then election.
Since we want to set the 16 points as an input, we'll just be adding f f right to four hexadecimal
digits basically is equivalent to 16.
What?
Right?
So this will set up the direction, so here we are performing initialization and we also set up the
direction.
Right now, we will be calling GPIO an 18 hour meeting application.
So this complete all the steps that we need to perform to correctly initialize GPI opposite.
Now we proceed to perform an initialization of an internal controller, right?
And in line with the initialization will also be performing the different configuration right.
We already discussed about discharge, so we'll take the help of this chart to build up our.
Great.
So first step is to perform an initialization of an intra controller.
So we go ahead and we explore and I see driver file, right?
Again, if you notice it consists of.
The config structure and incident structure, right, I if you didn't lose the base which are available,
so we do not have something else to look up config.
So we do not have something I see of Jeanne, as you look up configures there, legacy of initializes
is not there, so we'll proceed to use and initialise API.
Again, this just required an instant structure, so we just need to declare an instant structure for
an initial controller.
We do not need to declare the config structure right.
So exciting.
And we'll just be naming this as I in D.C., right?
We declared void, and then they did just name this as I NDC in it, right?
This could be used to initialize our entire controller, so we call.
They initialize.
OK, and this basically required an instant structure and the device they rate and designate and the
status.
So since this state is the rebel leaders local to Dubai owned it, we could use the same name for the
studio's variable in I in the seen it also, right?
So I in see initialize and this required first argument as an INTC instance structure.
And the next one is the device, right?
So to get the device, I we just need to go to X parameter dot each file.
Look for AI and DC and.
Here you have your device, 84 or 93.
That is one we night as an argument to an initialize function, then we need to for whether the initialization
is successful or not.
So we'll just be copying this same logic over here.
Only thing that we need to modify is it should be in and it's successful or I envision it free right
now for an intro controller.
We could also perform the services that will always be a good idea.
So we go to an AI in DC and then we have this set straight.
This just required as an instance structure as an argument.
So we go ahead.
Again, we will have the the value of the status so that it stored the status of a self.
Does that we are performing within a controller, right?
So this required just an instant structure.
That is what we going to add.
And again, we will be performing the check whether student is equal status to success.
And if that is the case, we will be mentioning that I in DC, no self test is successful.
This makes sense.
So this complete the process of initialization.
What we are doing is we are performing initialization and we are running the self test right now will
perform the different step that is used for our configuration of an internal controller, right?
So after 90 ce initialization, no, this consists of two steps.
Remember, first one is performing an initialization and second one is performing, so we could see
this consists of two step.
The first step is to initialize.
Right, and the second step will be to perform sell this.
OK, now we could proceed to our next tip that is enabling an exception handler, OK, so exception
in our case will be an interest rate.
So we go ahead and we look for the exception handler EPA right?
So all the exception related EPA is are available in jail.
Exception, daughter trait, so you need to include this hated flight, and then we'll look for the
apps that are available, right?
So here you have an interrupted.
So first step is to initialize our exception handler, and for that we have the API, right, so we
need to call and select ception in it.
And this will automatically perform an initialization, right?
So we'll go ahead and we perform initialization by calling this Zebpay.
This does not require any argument.
Right.
So we do not need to do anything, then we need to specify the exception type, right?
And that could be done with the help of registering the right.
So this required an IED.
ID is used to recognize the type of an exception, then an exception handler and finally ID, right?
So we copy this.
We go back to our mean code.
OK.
An IED for an interrupt.
Is this one right?
Exceptionally so with the exception.
IED i I.A. is defined for all the processor, but with the different value, and this is an exception
ID for an interest rate.
So we'll be calling it going back to an halol, and this will serve as a first argument for us.
The second argument is and handler for this case rate and remember that Enock is the master handler
will be i INDC that is in control, right?
So if you go to an AI in DC header file, you have an interrupt handler and that will be serving as
an introvert handler for an interest rate.
So we go ahead.
We add this interrupt handler over here, and the good idea will be to always perform a typecasting
related exception.
Expect the second argument to be in this format.
So we'll just be performing the typecasting rate.
So here we will be adding it over here, right?
So we are performing typecasting, and the interrupt handler for us is the master interrupt handler
that we have in.
And I think the last is the redirect required.
So this will be and I think, OK, which is an instance structure for it in Japan, right?
So once this is done, we just need to now enable so we initialize an exception.
We define that type of an exception.
The next step is to enable an exception rate and to do that.
We also have an API over here, right?
This, again, do not require any argument, so we'll just be calling it going ahead at it over here,
right?
So this complete the step one all fire solution.
OK, so I in DC, initialization is already completed and enable exception.
Handler is also great.
The next step is to specify the type of an entrance and the hang for it, right?
So we specified a master in Japan Labor, a handler over here.
But then that interrupt handler could have a multiple entrance.
Right now, we need to correctly specify that this is an interruption for that in.
This is and function which will act as an handler, right?
And to do that, we need to write the call great.
So we go ahead.
And then the first API that we have is connect, right?
So this will specify the.
Function handler for the specific source of an interest rate, so we just call this function.
OK, so first argument, if you can see is an A.C. pointer, right?
So that is an integer structure.
So we'll just call and see then the unique idea that you have for an interrupt.
So if you analyze the second argument is an IED, right?
So this is how we recognize the different sources of an interest rate so far each and job that you add
to an idea and you get an unique IED.
And that is how we recognize the source of an interstate.
So to get an IED again, this is hardware related information.
So we go to an experimental stage and you just need to look for a vector.
So we have added an enter for a GPIO, so you just need to find out the key word Cupido, unless correct?
Right.
So that they just go ahead and try to find out.
Vector.
OK.
And here you will see we have an intra flora GPO and this is a vector idea, right?
So this will serve as and unique ID for the GPI interest rate.
That is what we're going to add as the second argument.
The third argument I'd have is if you have this unique idea that is an integer from this source, OK,
what should be the handler?
So first, we'll just be copying this.
So this will act as a type for us.
OK.
So this will be.
And then the handler for us will be later just declared one function that will act as an handler for
us, right?
So GPIO.
And so this is a function that we want to call when we have an interest rate, so we'll just be calling
this handler.
We go back to a clinic function and we added, We're here, right?
The last argument is whether we want to store any detail or get any data when we have an interest in
this case, we could just add zero rate.
This doesn't affect us.
Zero.
Or you could just add the instant structure of a GPI, or that is the D Day if you want to get it right.
So this complete specifying the unique ID for an injury and the handler when that interpreter.
Right.
The next step is to close this just so we go ahead.
So to close the switch, we have this in Libya, right, so that is what we're going to call over here
and this required again, and it's just such a unique idea, right?
So we go ahead and we copy this to argument, and these are the same argument that this function also
requires.
Now what this will do is this will automatically close this switch.
Nowhere in D.C. could receive the interest from a benefit, provided that this, which is also closed
straight to enable input to.
I see.
So now we could look for this very, very specific function that could be used to close the switch on
the peripheral tribal area.
So if the area available, you need to add it.
If they are not available, you are ready to proceed, right?
So we'll go ahead and look for the GPIO tribal fight rate.
So here you could see we have two functions.
So one is global enabled and next one is an interest rate.
Whenever you see both, the EPA is have a label that is global enabled as well as it, but in that case,
OK, you need to add both Dizzy Bay to close our second switch, right?
So first, which could be closed by just calling I indiscernible.
Let me just call Global Enable first, and this required an instant structure, right?
So we go ahead.
And here we are, an instance of cheer for us, it is Dubai, the next one is to interrupt in a bit,
right?
This is also you need to act to enable the to here.
Both of this will be working together to close our switch to right.
This required first and instant structure and then.
Instance EPCR and then the mosque, right, so mosque will be the mosque for China.
And so if you go to the tribal fight.
OK, so usually the hardware related information, if you do not find any mosque over here.
So mosque are usually at the top of my trailer.
And here we do not have any mosque, right?
So you go to Dubai and the school réglage, right?
So here you'll be finding all the information which is not mentioned over here, right in the driver
file.
So if you go to the GPA, you underscore L Dot H so you could find the mosque related information.
Do getting to work here right?
So we want to have a chain, Elon Musk, because we are just utilizing the chain L1, right?
So we will be copying this and then we will be adding a door here.
Right.
So this complete the code.
Now what this does is this will automatically close this switch.
Right now, we are ready to send the intro from peripheral to AI in DC, right?
The last step, right?
The last step is to start an operation off and interrupt.
Now we are planning to sense an interest from the hardware itself.
Simple.
So the mode in which we will be operating is really more great.
So we go to an exciting DC and then you have this stock great and this is operating to more rate.
So either it could be the simulation mode, OK?
For that, you'll need to add in simulation mode, or it could be in real more rate that allow us to
work within hardware related interest rate higher when you are utilizing it to sense the enter from
an actual hardware, right?
So we go ahead, we call this OK.
This required first argument as an instance structure, so I in D.C. and then whether you are operating
in a simulation mode or whether you are operating in an hardware mode, right?
So we'll just be calling this because we want to operate in a real moderate.
So this completes all the configuration and initialization that you need to do with the interrupt controller,
right?
So just to distinguish between the different thing that we do.
So this will initialize and enable.
Exception handler, right, there's a representative step one, then specify unique IED or unique.
This could be just specifying trip type.
Interpolate OK.
And then you also need to specify the handler for it, right?
And this is done by the unique idea that you get for an interest in an experimental advantage rate,
then this representing closing switch one rate.
And then this represent losing switch to.
And the last step is start.
Operation in.
Really?
Right?
So these are the series of steps that you need to perform now, in some cases, it may be possible that
you do not have this switch available.
In that case, you could simply skip it, right?
The last spending step is to declare that UPI.
Right.
So what are we going to do is we will be forced disabling and intervention as we reach to handle.
OK, and then we process the interest.
And finally, we enable back an interest rate, so we go ahead first, acknowledge an interest.
So if you go to a 90TSI, so we have an API to acknowledge an interest rate, so we go ahead.
We call this EPA.
First argument is an interrupt handler, and the next one is an unique IED that we get, right, so
that is an unique IED that we have over here.
So we'll just be copying this, adding it over here.
Right.
So once we acknowledge and now we go to the next episode or take a look there, we have an API to disable
and integrate.
So that is what we're going to do here to disable and interrupt.
OK, this required again the Dubai idea and the channel must state, so we'll just be copying this.
We will be adding a door here.
Right?
But once you disable and interrupt, the next step is to serve, and that is what you want to do with
an interest rate.
In this case, we want to send the value that we read on to a console.
OK, so to do that, we just need to call the printer.
Hear what we were going to add is in trouble.
OK.
And we going to also mention Value Ray.
OK.
But Sidoti again, do not forget to add a new line director.
So, ladies, first to the value of the switch.
OK, in utero, you do.
So this will be switch red.
OK.
And to read the value that we have on a switch, we have a discreet reading period, so we'll just be
calling this, and the China number for us is what rate we will be adding this.
The instant structure for us is GPIO China.
The number will do like rate.
So we are reading the value of switch.
We already set up the direction when we initialize our GPI or badassery right here, you could clearly
remember.
And then we will be printing the value of it, right?
So this is the process that we need to do when we have an interest.
Now we'll see whether we have an EPA to clear the pending enterprise, so here we have an EPA.
This will clear up the spending, and so we'll just be calling it over here, OK?
And there's again required the same to argument that we have for an interpreter, so we collided over
here and then the last step is to enable and interrupt so that we could receive the new request.
Then user changed the switch, right?
So we'll just be calling this.
OK.
Again, this required this to argue.
OK, so once this is done, this complete the process, right, so we need to first acknowledge an injury,
disable and injured so that we do not get the new request until we solve the current danger request.
Then we read the value from a switch, OK?
We are sending that value on to a console.
We are clearing any pending request and then we are enabling back our interest rate.
So this is what we're going to do in an independent.
But this is done.
We just need to call an interrupt handler in our main application, right?
So we already called GPI on it.
Now we are calling an in.
And with an intro, we just need to perform a reading.
OK, so that user will add an intro and then that will be serving us right?
So we do not need to do anything.
We'll just be waiting here.
So while one and then as soon as user genes dusted off a search, we will be getting an interrupt and
that will be sold by our interpreter, right?
So this completes an entire knew what we were going to add when you are working with an interest rate.
So let us proceed to build up our entire application project.
To one to build a successful.
We will select an application project debug at launch on hardware.
OK, so this will switch our perspective from design to debug and automatically program our FPGA.
We go to a dystopia where we will be selecting the Column six and the border, which is nine six zero
six, right?
The only thing that we're going to need is to click on a resume button, right?
So once you do that, you'll be finding that GPIO initialization is successful in D.C. and it is also
successful.
LightSail test is also successful.
You know, what we're going to do is will be changing the state of the switch, right, too.
And as soon as you could see as I change the value of a switch.
So let me just go ahead, right?
So now what we're going to do is we will be changing the state of an Elizabeth switch, right?
So if I make a little switch one, you could see that the value really lives like if I change the next
LSP switch.
So we'll be finding the value three if I change next one, the value seven, if I change next one,
the value is fifteen thirty one, sixty three and so on and so forth.
Right.
So you could clearly see be able to sense and enter and send the value on to a console.