So let us start with adding a driver necessary for all the ideas that we have added, Rachel.
If you go to a board support package, the recommended driver for our GPIO instance of an eyepiece is
Dubai, right?
So we just go ahead and there the queue, right?
You just need to add a prefix that's X and then GPI, right?
This is the driver file, which will be providing us the list of an EPA that allows us to interact with
that GPI right along with this, we know that we need to have an access to environmental information
which is present in that experimental, not accurate along with this to work with the engine controller.
So if you just explore the again.
OK, so we have an SUV, OK?
That is our electric controller.
OK.
And that will be sensing and into from the sources.
So we need to include this driver, right?
So we go ahead.
And then we had hash include, right?
X, see you see, Dr..
One more thing that we need to do is to enable an exception handler, OK?
And for that, we have an EPA president until unless for exception daughter.
So this will be the list of the drivers that you require.
OK.
As you work with that interest, be only difference as you use a different peripheral.
Is the GPI driver, right?
So that will be different for the rest of the drivers you would be requiring right now.
If you analyze whatever you have summarized, the first step is to perform an initialization right to
the initialization of both the the paper, as well as an x ray or an intra controller.
So we will be proceeding.
And first, let's just explore the GPI, right?
So this consists of all the function that could be used to work around with that UPI.
So we have a two structure, right?
So GPI config, OK, which is a config structure that we will be adding and this will again be appointed.
So let me just leave this stupid you can pick OK?
And the next structure that we require is an instance.
So we just copy and then we add it all here, right?
So these are the two structure which are required for initialization, you go.
That us declared one function, which we need it.
This consists of all the functions that could be used to initialized UPI.
Right?
So if you go ahead, the first function that we call is look up configuration, where we will be by
a single device, Heidi.
And this can lead to conflict structure for us.
So we go head to head and will not see, right?
So you can say, OK, so our code structure will be was to look up conflict where we are a device.
So if you go to an X parameter dot fight and search for you.
Right.
So here you get the device that you need to add to a look up, right?
So this will generate the config structure for us.
And once we have a config structure, the initialization process is very simple.
You just need to see if the initialize and designate criteria to first document is an instance structure,
then you need to provide a config structure and finally be set.
So these addresses were not a member of a config structure, so we could just access the basically stronger
from the config structure itself.
Right.
So this new function will perform an initialization offered UPI.
The next step is to check whether initialization is successful or not.
Save status is equal to existing success rate in that case.
The Proceed.
OK, I mentioned GPIO in its success.
This makes it and else we could just add.
Keep you in it.
We right?
So whenever you are working with an interest to try to perform a configuration in any function set,
right, so we know that you are working with the GPI and we want to utilize the switch, right?
So the switch behave as an input put for so the configuration of output as an input should be done in
init function itself, right?
So that allow us to keep the algorithm often.
Interrupt and then initialization separate, right, so all the initialization step, including configuration
of different operations, setting up the direction, performing an initialization should be done in
a single function.
OK, whenever you are working with the complex applications or finding out specific.
Bug becomes very easy.
So this is what we got to do here.
Now here we know that we want to utilize the bin as an input, so we go ahead and we set up the direction.
All right, so we have a function to do that.
OK, so safety direction can be used to set up the direction for.
The specified rate, so we need to pass a it per child in the direction, right?
And we knew that.
For setting up the billions and output we need to actually look for setting pennies and input, we need
to add what rates already just go ahead.
Call this function right here, we need to add GPI, which is that instant structure we are utilizing
a single it.
And we want to utilize force, which is right.
So we just need to add.
Airport.
Right?
So if that basically is equally valid, you for one right and lets you set a better one.
This will configure that plane as it input, right?
So here we set up the direction of our.
Peanuts, which is an input direction.
Now here, one thing that is pending is you just need to add in, right, because this function return
an intel.
OK, so that be storing A.D.A. very well, that will be verified.
So remember this thing.
If you are working with a paper line, you are building a complex application.
See that you incorporate all the configuration settings in that single function.
Right.
So this completes and initialization off UPI.