-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapplication.c
45 lines (40 loc) · 1.73 KB
/
application.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* File : application.c
* Author : Mohamed Ahmed Abdel Wahab
* LinkedIn : https://www.linkedin.com/in/mohamed-abdel-wahab-162413253/
* Github : https://github.com/moabdelwahab6611
* Created on May 21, 2023, 5:38 PM
*/
/**************************Includes-Section*****************************/
#include "application.h"
/***********************************************************************/
/***********************************************************************/
led_t led1 = {.port_name = PORTC_INDEX, .pin = GPIO_PIN0, .led_status = GPIO_LOW};
led_t led2 = {.port_name = PORTC_INDEX, .pin = GPIO_PIN1, .led_status = GPIO_LOW};
led_t led3 = {.port_name = PORTC_INDEX, .pin = GPIO_PIN2, .led_status = GPIO_LOW};
led_t led4 = {.port_name = PORTC_INDEX, .pin = GPIO_PIN3, .led_status = GPIO_LOW};
/***********************************************************************/
/***********************Main Function-Section***************************/
int main()
{
application_intialize();
while(1)
{
led_turn_on(&led1); led_turn_on(&led2); led_turn_on(&led3); led_turn_on(&led4);
__delay_ms(250);
led_turn_off(&led1); led_turn_off(&led2); led_turn_off(&led3); led_turn_off(&led4);
__delay_ms(250);
}
return (EXIT_SUCCESS);
}
/***********************************************************************/
/*************************Functions-Section*****************************/
void application_intialize(void)
{
Std_ReturnType ret = E_NOT_OK;
ret = led_initialize(&led1);
ret = led_initialize(&led2);
ret = led_initialize(&led3);
ret = led_initialize(&led4);
}
/***********************************************************************/