-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.c
44 lines (32 loc) · 922 Bytes
/
main.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
/******************************************************************************
*
* Module: Port driver header file
*
* File Name: main.h
*
* Description: This file contains the a blinking led application to test the PORT and DIO drivers
*
* Author: Abdelrahman Bakr
*
*******************************************************************************/
#include "Port.h"
#include "Dio.h"
void delay(void){
for(uint32 i =0 ; i< 5000 ; i++){
for(uint32 j = 0 ; j < 100 ; j++){
}
}
}
int main(void){
Port_Init(&Port_Configuration);
Dio_Init(&Dio_Configuration);
Port_SetPinDirection(PA5,PORT_PIN_OUT);
while(1){
if(Dio_ReadChannel(DioConf_BUTTON_CHANNEL_ID_INDEX) == STD_LOW){
Dio_WriteChannel(DioConf_LED_CHANNEL_ID_INDEX,STD_HIGH);
delay();
Dio_WriteChannel(DioConf_LED_CHANNEL_ID_INDEX,STD_LOW);
delay() ;
}
}
}