Here we are in a situation where we need to utilize the same hardware design that we have created in,
then we right, so we already know that by default, the washed up timer and the 32 bit esut timer that
is private with zinc processing system is enabled.
Who can we all really work around with, then washed up tomorrow?
So this is an application project that we have for our postdoc Daimler.
And since our platform remains seen for a few times or so.
So what we want to do is we will be utilizing the same workspace of a white society and create a new
application project.
Again, the platform project will remain seem for an issue time only.
The difference will be though we use an issue time Rachel against select our platform project, right
click new and then application project great.
So click next.
Let me just select the same platform project, because hardware design will remain same for both a few
times, as well as our watchdog timer.
Right click next and then let it just name this as timer underscore S.W., right?
So see that you give a name to an application project, which is different than your previous application
project that you have utilized for an watchdog time, right?
So click next.
And again, we will be using an Halliwell template because that gives them access to a function which
could be used to interact with our.
So here we Jews and hello world again and click finish.
So now we have our existing watchdog timer application project and the newly added application project.
So we go to the source, step off our timer, we go run Hello World and we start creating an application
for RSU timer again.
We know that an timer operate at half of the clock while fuzzing that is at 330 megahertz rate.
So we need to build up an application on that, right?
So first, we need to include the mandate to do Driver X.
So we go to a WD where we have our board support package and for a timer if you just exclude the driver,
which is mentioned.
So here we have an ICU timer in the school zero and the recommended driver is a siu timer, right?
So we go ahead and include the driver file straight so.
Trash include.
We need to add an excessive prefix.
OK, then see you timer or treachery.
So this is the driver that you required for the chamber.
One more driver, we need to add that is.
X parameters, daughter trait, so there's a again consist of all the hardware information, so let
us explore the container of the tribal rivalry.
So if you go to a timer driver.
So Taimur supports a normal mode and in order to reload more great, so we will hear not much description
is given, but normal mode.
We will be exploring both of this morning a deeper right so we go ahead and first light to just overview
the functions that are provided with us in this chamber.
So we have a config structure and just saturate.
A lot of the structures are present in our driver, right?
And if you can see the first function we just provided is a cue timer is expired.
So this could be used to verify whether our timer is expired or not.
So this could be considered as a pooling mode where we are utilizing the CPU resources to check whether
timer is expired or not.
Then we have a function to restart a timer, right?
We have a function to load a timer.
So this will be the value or the delay that will be achieved with the help of the time right?
Then we also have a function to get the current value of our time right.
So we initialize a counter to some value and then it will start going down.
So at any instance, if you want to find out the value of the timer, OK, then you could use this function.
Then we have a function to enable an auto reload mode, disable an auto reload.
Now you could see we have a to moderate the normal mode and an auto reload.
More so first, we work with the normal mode, and whenever we work with the normal mode, we need to
disable an auto reload more great.
So to disable that, we have this function again whenever you are working with an auto reload mode.
This is the function that could be used to set up that rate.
Then we have a function to enable an interest rate, disable and interrupt this.
We will be discussing when we proceed to an interrupt section.
So the function that we have over here is a look up config that generator config structure.
And then we also have the CFG initially.
We also have a function to perform the self test of a timer to start and stop a timer.
We can also control the clock that is going to this block rate so pre-schooler can be used to control
the clock that is going to our teletovic time, right?
So now we know that the series of functions that are available in a driver with this right now, we
go ahead and proceed to first initialize up, right, so that it just copy the config structure.
Go back to our Halloway.
Let's see, I did the config structure, right?
So this should be a pointer.
So asterisk and anti-armor one write.
The next one we required is an instance structure, right?
So usually once you have a config structure.
So the first world that you have in a config structure represent your instance structure, right?
So that is what we going right over here.
And let me just name this last year, right?
Then we declared one function, which could be used to perform an initialization of our issue time,
right?
So we go ahead and rename this has timer really great.
So we already know that we have a lookup config where we need to provide the device 80.
And that returns the config structure.
So this is how we do need to config structure to TMR config.
OK.
This will be close to look up config and then we just need to pass the device A.D. So where you get
the device ID is from an X parameter file, right?
So here we just search for a see you OK and then here you have an issue timer a little information,
right?
So we'll just be copying the device.
I do.
From here, we go back to our hello world or C, and then we will be adding the door here.
Right.
So once we get the config structure, then the initialization can be done by calling c f g initialized.
This is again written the status of an initialization which required the s32 as the data format, right?
And then there are three arguments that we need to go right.
First, one is an instance structure, then a config structure and finally a separate state.
So let it just go ahead and declare when s32 variable Larry just named this status right?
I'll see if initialize first, we need to provide an instance structure.
So this is Marinakis.
Then one fixed structure.
So which is to configure last one is the basic history.
So from the beginning, we've been utilizing the base address from the timer config structure itself,
right?
So let it just use another way.
Don't that is, go to an experimental order.
And here also you always get a base address or wherever you'll be finding an instance of a benefit.
You always get the access to a base address.
So just give a try to this.
So we copy this Bayes address book.
So instead of accessing the base address from the config structure, now we are utilizing the base address,
which is provided in an experimental dot h.
Right.
So once we perform it in.
Initialization steps.
OK.
It is mandatory that you verify that the status is existing, a success rate, so status is.
So if she does it exist, you said this will just be utilizing to bring death, right?
And then here we will be adding that timer you.
Yes, success for right?
As we just mentioned.
They'll bring death again.
And then here we could mention the timer in it.
Failure rate, this makes it.
So this is exactly what we've been doing from the beginning, right?
And we already did this because whenever you have a complex or an intermediate peripheral, see that
you also perform the self-test that help us to verify whether hardware is properly configured or not
great again.
There's also readiness that you do, indicating whether the centrist is successful or not great.
So we beat this to this value.
OK, and this test will be quest to save this year.
We just need to add an instance to which GMA, in this case, right again, will be calling this logic.
The only thing that we are going to change over here is here.
We mentioned self.
Test successful, right?
And here we will be mentioning sell this.
Fit, right, so this completes the school year, what we are doing is we are first performing an initialization
of RSU timer and then we are verifying whether the initialization is successful or not.
Finally, we are performing the third test again.
We are checking whether self discharge is successful or not, right?
So next steps, we will be calling this in and mean go right to a timer in it.
Intermingle and this will perform an initialization for.