-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecu_layer_init.c
102 lines (94 loc) · 3.67 KB
/
ecu_layer_init.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
* File: ecu_layer_init.h
* Author: Mohamed Ahmed Abdel Wahab
* LinkedIn : https://www.linkedin.com/in/mohamed-abdel-wahab-162413253/
* Github : https://github.com/moabdelwahab6611
* Created on May 31, 2023, 7:16 PM
*/
/**************************Includes-Section*****************************/
#include "ecu_layer_init.h"
/***********************************************************************/
/**********************Macro Declarations-Section***********************/
/***********************************************************************/
/******************Macro Function Declarations-Section******************/
/***********************************************************************/
/********************Data Types Declarations-Section********************/
chr_4bit_lcd_t lcd_1 =
{
.lcd_rs.port = PORTC_INDEX,
.lcd_rs.pin = GPIO_PIN0,
.lcd_rs.direction = GPIO_DIRECTION_OUTPUT,
.lcd_rs.logic = GPIO_LOW,
.lcd_en.port = PORTC_INDEX,
.lcd_en.pin = GPIO_PIN1,
.lcd_en.direction = GPIO_DIRECTION_OUTPUT,
.lcd_en.logic = GPIO_LOW,
.lcd_data[0].port = PORTC_INDEX,
.lcd_data[0].pin = GPIO_PIN2,
.lcd_data[0].direction = GPIO_DIRECTION_OUTPUT,
.lcd_data[0].logic = GPIO_LOW,
.lcd_data[1].port = PORTC_INDEX,
.lcd_data[1].pin = GPIO_PIN3,
.lcd_data[1].direction = GPIO_DIRECTION_OUTPUT,
.lcd_data[1].logic = GPIO_LOW,
.lcd_data[2].port = PORTC_INDEX,
.lcd_data[2].pin = GPIO_PIN4,
.lcd_data[2].direction = GPIO_DIRECTION_OUTPUT,
.lcd_data[2].logic = GPIO_LOW,
.lcd_data[3].port = PORTC_INDEX,
.lcd_data[3].pin = GPIO_PIN5,
.lcd_data[3].direction = GPIO_DIRECTION_OUTPUT,
.lcd_data[3].logic = GPIO_LOW
};
chr_8bit_lcd_t lcd_2 =
{
.lcd_rs.port = PORTC_INDEX,
.lcd_rs.pin = GPIO_PIN6,
.lcd_rs.direction = GPIO_DIRECTION_OUTPUT,
.lcd_rs.logic = GPIO_LOW,
.lcd_en.port = PORTC_INDEX,
.lcd_en.pin = GPIO_PIN7,
.lcd_en.direction = GPIO_DIRECTION_OUTPUT,
.lcd_en.logic = GPIO_LOW,
.lcd_data[0].port = PORTD_INDEX,
.lcd_data[0].pin = GPIO_PIN0,
.lcd_data[0].direction = GPIO_DIRECTION_OUTPUT,
.lcd_data[0].logic = GPIO_LOW,
.lcd_data[1].port = PORTD_INDEX,
.lcd_data[1].pin = GPIO_PIN1,
.lcd_data[1].direction = GPIO_DIRECTION_OUTPUT,
.lcd_data[1].logic = GPIO_LOW,
.lcd_data[2].port = PORTD_INDEX,
.lcd_data[2].pin = GPIO_PIN2,
.lcd_data[2].direction = GPIO_DIRECTION_OUTPUT,
.lcd_data[2].logic = GPIO_LOW,
.lcd_data[3].port = PORTD_INDEX,
.lcd_data[3].pin = GPIO_PIN3,
.lcd_data[3].direction = GPIO_DIRECTION_OUTPUT,
.lcd_data[3].logic = GPIO_LOW,
.lcd_data[4].port = PORTD_INDEX,
.lcd_data[4].pin = GPIO_PIN4,
.lcd_data[4].direction = GPIO_DIRECTION_OUTPUT,
.lcd_data[4].logic = GPIO_LOW,
.lcd_data[5].port = PORTD_INDEX,
.lcd_data[5].pin = GPIO_PIN5,
.lcd_data[5].direction = GPIO_DIRECTION_OUTPUT,
.lcd_data[5].logic = GPIO_LOW,
.lcd_data[6].port = PORTD_INDEX,
.lcd_data[6].pin = GPIO_PIN6,
.lcd_data[6].direction = GPIO_DIRECTION_OUTPUT,
.lcd_data[6].logic = GPIO_LOW,
.lcd_data[7].port = PORTD_INDEX,
.lcd_data[7].pin = GPIO_PIN7,
.lcd_data[7].direction = GPIO_DIRECTION_OUTPUT,
.lcd_data[7].logic = GPIO_LOW
};
/***********************************************************************/
/*****************Software Interfaces Functions-Section*****************/
void ecu_layer_intialize(void)
{
Std_ReturnType ret = E_NOT_OK;
ret = lcd_4bit_intialize(&lcd_1);
ret = lcd_8bit_intialize(&lcd_2);
}
/***********************************************************************/