1
00:00:00,150 --> 00:00:01,770
Let us start building our application.

2
00:00:01,980 --> 00:00:07,200
The first thing that we need to do is to include all the many drivers if you go to the board support

3
00:00:07,200 --> 00:00:07,660
package.

4
00:00:07,740 --> 00:00:14,100
OK, so the recommended driver is GPI, so you just need to add a prefix x and then you have the driver

5
00:00:14,100 --> 00:00:16,080
for our excited GPI person.

6
00:00:16,140 --> 00:00:16,380
Great.

7
00:00:16,380 --> 00:00:17,460
So hash include.

8
00:00:18,120 --> 00:00:21,630
And then ICS, GPI, you got three.

9
00:00:22,380 --> 00:00:27,030
Now remember, here we have a multiple instances of where GPI fitting right.

10
00:00:27,030 --> 00:00:29,240
So we need to initialize product, right?

11
00:00:29,260 --> 00:00:35,110
So this is the difference that you will be finding when you have multiple instances of the very.

12
00:00:35,560 --> 00:00:35,780
Right.

13
00:00:35,790 --> 00:00:41,310
So once you include all the mandatory file, now we go ahead to add that UPI IP again.

14
00:00:42,340 --> 00:00:48,160
We need to call the config structure and the infrastructure right, so we'll just be finding whether

15
00:00:48,160 --> 00:00:49,700
we have an initialize function, right?

16
00:00:49,720 --> 00:00:53,410
So this required just a declaration of an instance structure.

17
00:00:53,710 --> 00:00:58,390
And we are ready with an initialization rate, so they just go ahead and declare an instant structure.

18
00:00:59,350 --> 00:01:02,110
OK, so instant structure for.

19
00:01:03,050 --> 00:01:08,510
The LAPD will be naming it as and when required for the switch instance of any right.

20
00:01:08,510 --> 00:01:15,440
So once you declared an instance structure, we add a function that could be used to perform an initialization.

21
00:01:15,530 --> 00:01:15,770
All right.

22
00:01:15,770 --> 00:01:19,460
So here we will be performing initialization of our code types, right?

23
00:01:20,090 --> 00:01:25,700
So we have an ex GPI or initialize function that could also be used to perform an initialization.

24
00:01:25,700 --> 00:01:28,900
So we just need to pass an instance structure and the device idea, right?

25
00:01:29,480 --> 00:01:35,780
So we go ahead and it does the status of an initialization artillery just mean this as to sell for an

26
00:01:35,780 --> 00:01:36,170
elderly.

27
00:01:37,310 --> 00:01:37,700
OK.

28
00:01:38,210 --> 00:01:44,000
And here for an elderly, the infrastructure is new as an elderly and to final delivery side, you just

29
00:01:44,000 --> 00:01:46,040
need to go in an experimental hedge fund.

30
00:01:46,310 --> 00:01:51,320
Now remember, we named our instance of an IPO saying You don't switch now if you just search for an

31
00:01:51,320 --> 00:01:52,230
elderly, OK?

32
00:01:52,310 --> 00:01:57,950
We're finding it becomes very easy now to recognize the instance.

33
00:01:59,150 --> 00:02:01,310
There we have a leader for a specific guy.

34
00:02:01,500 --> 00:02:06,820
Rachel, then we named it as an early thaw, allegedly deleted information will have an key, right?

35
00:02:06,890 --> 00:02:11,290
So that helps us to easily recognize the data for the specific instance of an IP.

36
00:02:11,300 --> 00:02:16,010
So remember this whenever you are working with the multiple instances, obviously you might be named

37
00:02:16,010 --> 00:02:17,600
the macro adding to the functionality.

38
00:02:17,760 --> 00:02:17,880
Right.

39
00:02:17,900 --> 00:02:20,750
So this will perform an initialization for an alleged instance.

40
00:02:21,170 --> 00:02:22,850
Similar thing that we need to do.

41
00:02:23,830 --> 00:02:29,450
For the switch, all right, so we just copy this, we need to declare one more variable.

42
00:02:29,470 --> 00:02:37,750
So let me just declare this to status is for the switch rate again, the same function only thing that

43
00:02:37,750 --> 00:02:44,650
we need to changes in this structure, which is switch in this case and the device aid if you text parameter

44
00:02:44,650 --> 00:02:45,370
Dark Age five.

45
00:02:45,430 --> 00:02:49,560
OK, here we have a device, so we just need to add it over here, right?

46
00:02:49,570 --> 00:02:55,450
So this dual performance initialization for both switch and an LCD instead, so far, you could say

47
00:02:55,450 --> 00:02:59,470
GPI right now will verify whether both of them didn't exist two sets of state.

48
00:03:00,460 --> 00:03:09,220
So status and OK and weight status, it's OK if that is equals to exist.

49
00:03:10,450 --> 00:03:12,790
Success, so in that case, we could see.

50
00:03:14,140 --> 00:03:18,190
Device locate device in it.

51
00:03:19,190 --> 00:03:20,000
Successful.

52
00:03:22,140 --> 00:03:22,540
OK.

53
00:03:22,560 --> 00:03:24,330
And we could just mention.

54
00:03:26,080 --> 00:03:27,820
Device in it fit, right?

55
00:03:29,840 --> 00:03:35,300
So this complete the process of initialization will just be calling this function in our main application

56
00:03:35,300 --> 00:03:40,100
rates, so they required in each platform and cleaner platform for and you are right, we'll just be

57
00:03:40,100 --> 00:03:40,820
removing this.

58
00:03:41,300 --> 00:03:46,250
OK, now first thing that we do is to set up the correct detection, OK, and then we are ready to work

59
00:03:46,250 --> 00:03:46,970
around with the lead.

60
00:03:47,060 --> 00:03:50,430
So we go ahead and look for set data direction.

61
00:03:50,460 --> 00:03:56,240
OK, so this required the instance structure, China number and the direction that you want to set,

62
00:03:56,240 --> 00:03:56,480
right?

63
00:03:56,480 --> 00:03:59,380
So we go ahead, we add this function.

64
00:03:59,660 --> 00:04:01,090
OK, let it just work for us.

65
00:04:01,100 --> 00:04:03,170
We then switch incidence rates.

66
00:04:03,170 --> 00:04:05,090
So instance structure name is switch.

67
00:04:05,090 --> 00:04:07,790
OK, we have single channel for both types.

68
00:04:08,090 --> 00:04:10,570
Now we want to set this as an input rate.

69
00:04:10,600 --> 00:04:11,510
And if you.

70
00:04:12,450 --> 00:04:18,960
Explore the functionality of the so we know that to set the pain as an input, we need to apply what

71
00:04:18,960 --> 00:04:19,220
right?

72
00:04:19,230 --> 00:04:24,570
So we have four switches which are available on board, so we'll just be adding fuel, one that is equivalent

73
00:04:24,570 --> 00:04:26,940
to effin and hexadecimal.

74
00:04:27,210 --> 00:04:31,160
Similarly, we'll just be calling centre utilization now for an empty.

75
00:04:31,500 --> 00:04:37,840
The instant structure will be a lead China leg in this one, and we want to set to be said to be output

76
00:04:37,840 --> 00:04:39,300
port, so we just need to add a seat.

77
00:04:39,360 --> 00:04:44,200
So once you correctly set of that addiction rate, we will be reading the status of a switch.

78
00:04:44,460 --> 00:04:50,850
We already know that there are discrete read returns you 32 will get will just declared one variable.

79
00:04:50,850 --> 00:04:57,090
Let it just name the let's switch read OK and will be reading the value of a switch at an interval of

80
00:04:57,090 --> 00:04:57,630
one second.

81
00:04:57,900 --> 00:04:58,590
So while one.

82
00:04:59,750 --> 00:05:00,770
So we'll switch read.

83
00:05:01,810 --> 00:05:04,570
OK, this will be equal to if you go to.

84
00:05:05,910 --> 00:05:12,260
Todd, GPIO drivers, we have a discreetly OK where we need to specify the correct instance structure,

85
00:05:12,270 --> 00:05:19,350
so for instance, a tree switch and the channel is great and that is what we will be writing on to any

86
00:05:19,350 --> 00:05:19,560
lead.

87
00:05:19,720 --> 00:05:22,570
Okay, so to write the reader, we have a discreet right, OK?

88
00:05:23,600 --> 00:05:25,370
So there's with three arguments.

89
00:05:25,400 --> 00:05:30,530
First one is the infrastructure, the foreign, elderly and structure is named as an entity.

90
00:05:30,860 --> 00:05:37,190
Channel we are utilizing is one, and the data that we want to write is switch read right.

91
00:05:37,460 --> 00:05:38,840
We'll also be writing this.

92
00:05:38,840 --> 00:05:39,350
We don't know.

93
00:05:39,350 --> 00:05:44,150
Consults will be that we verify as we change the status of the switch, whether values are changing

94
00:05:44,150 --> 00:05:44,540
or not.

95
00:05:44,540 --> 00:05:44,750
Great.

96
00:05:44,780 --> 00:05:48,710
So we'll just be mentioning the switch read.

97
00:05:50,350 --> 00:05:53,620
And let me just bring the value in in decimal format, right?

98
00:05:53,950 --> 00:05:58,420
And we have our value inside switch read right.

99
00:05:58,750 --> 00:06:01,690
The last thing that we want to do is to add the necessary.

100
00:06:02,100 --> 00:06:07,300
So it just wait for the delay of one second, OK, before we put it in the next round.

101
00:06:07,780 --> 00:06:14,350
OK, so this completes our application code now will just be proceeding and build an entire application

102
00:06:14,350 --> 00:06:15,040
project, right?

103
00:06:16,700 --> 00:06:22,290
So once our bill is finished, select an application project, Nebo guys launch on heart rate.

104
00:06:23,470 --> 00:06:27,200
First thing, as you switch your perspective from design to diva.

105
00:06:27,230 --> 00:06:32,740
OK, we need to connect to a customer, so just click on this plus button, select the respect you can

106
00:06:32,740 --> 00:06:36,250
put on which you have your bow and click OK, right?

107
00:06:36,260 --> 00:06:37,210
So was the assistant.

108
00:06:37,540 --> 00:06:40,550
You'll just be clicking on this resume button, right?

109
00:06:40,570 --> 00:06:41,500
So you could see.

110
00:06:43,400 --> 00:06:47,690
So here we are getting this status as a feel.

111
00:06:47,960 --> 00:06:51,290
This is because we might have missed the 10 parenthesis, right?

112
00:06:51,290 --> 00:06:58,130
So let me just say a parenthesis or here also and or here right now, what this will do is this will

113
00:06:58,130 --> 00:07:03,920
first compute the ending of street to sell and suitcases, and then we'll be comparing it with that

114
00:07:04,130 --> 00:07:08,330
status, except to say to let it just rebuild our project.

115
00:07:09,020 --> 00:07:09,340
Right?

116
00:07:09,500 --> 00:07:14,300
So once you rebuild your project with this modification, you'll be finding that warning that we are

117
00:07:14,300 --> 00:07:15,940
getting in the previous case is gone.

118
00:07:16,260 --> 00:07:23,450
OK, now we just disconnect our previous debug configuration, or we just select the DBA configuration,

119
00:07:23,450 --> 00:07:25,340
right click and then we have a relaunch.

120
00:07:25,340 --> 00:07:29,880
But right, so this will start the fresh instance of our DBA configuration.

121
00:07:29,920 --> 00:07:34,880
OK, we already have connected our right to a minute to just be clearing up our console.

122
00:07:35,130 --> 00:07:37,280
OK, so let me just clear a console.

123
00:07:37,610 --> 00:07:38,000
OK.

124
00:07:38,450 --> 00:07:42,170
And then we will be starting to execute.

125
00:07:42,590 --> 00:07:42,830
Right.

126
00:07:42,860 --> 00:07:46,380
So you could see device and it is now successful.

127
00:07:46,380 --> 00:07:49,970
And the value that we read on the switch is zero because all the switches are in off.

128
00:07:50,220 --> 00:07:54,650
Now I'll try to change the switch value from my MSB to LSV.

129
00:07:55,610 --> 00:07:59,480
Great, so as soon as I turn on the MSP, switch will be getting the value of it.

130
00:08:00,510 --> 00:08:05,700
The next one will be getting a value of 12, 14 and last one is 50.

131
00:08:05,940 --> 00:08:11,830
So you would see how we utilize the multiple instances of GPI benefit.
