-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSSD_PROGRAM.c
102 lines (95 loc) · 2.63 KB
/
SSD_PROGRAM.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
/***************************************************************/
/***************************************************************/
/************ Author: A. S. Eldesouky ************/
/************ Layer: HAL ************/
/************ SWC: SSD ************/
/************ Date: 2-9-2020 ************/
/************ Version: 1.00 ************/
/***************************************************************/
/***************************************************************/
#include "STD_TYPE.h"
#include "DIO_INTERFACE.h"
#include "PORT_INTERFACE.h"
#include "SSD_INTERFACE.h"
#include "SSD_PRIVET.h"
uint8 SSD_uint8DISPLAYNUMBER (SSD_CONFIG * ssd , uint8 Copy_uint8Number)
{
uint8 Local_uint8ErrorState = OK ;
static uint8 Local_uint8NumbersArr[10] = SSD_NUMBER_ARR ;
if (Copy_uint8Number < 10)
{
if (ssd->SSD_uint8TYPE == COMMON_CATHODE_TYPE)
{
DIO_uint8PortValue(ssd->SSD_uint8PORT, Local_uint8NumbersArr[Copy_uint8Number]) ;
}
else if (ssd->SSD_uint8TYPE == COMMON_ANODE_TYPE)
{
DIO_uint8PortValue(ssd->SSD_uint8PORT , ~Local_uint8NumbersArr[Copy_uint8Number]) ;
}
else
{
Local_uint8ErrorState = NOK ;
}
}
else
{
Local_uint8ErrorState = NOK ;
}
return Local_uint8ErrorState ;
}
uint8 SSD_uint8DISPLAYChar (SSD_CONFIG * ssd , uint8 Copy_uint8Char)
{
uint8 Local_uint8ErrorState = OK ;
if (ssd->SSD_uint8TYPE == COMMON_CATHODE_TYPE)
{
DIO_uint8PortValue(ssd->SSD_uint8PORT , Copy_uint8Char) ;
}
else if (ssd->SSD_uint8TYPE == COMMON_ANODE_TYPE)
{
DIO_uint8PortValue(ssd->SSD_uint8PORT , ~Copy_uint8Char) ;
}
else
{
Local_uint8ErrorState = NOK ;
}
return Local_uint8ErrorState ;
}
uint8 SSD_uint8CONTROL (SSD_CONFIG * ssd , uint8 Copy_uint8State)
{
uint8 Local_uint8ErrorState = OK ;
if (Copy_uint8State == SSD_OFF)
{
if (ssd->SSD_uint8TYPE == COMMON_ANODE_TYPE)
{
DIO_uint8SetPinValue(ssd->SSD_uint8EN_PORT , ssd->SSD_uint8EN_PIN , SSD_OFF) ;
}
else if (ssd->SSD_uint8TYPE == COMMON_CATHODE_TYPE)
{
DIO_uint8SetPinValue(ssd->SSD_uint8EN_PORT , ssd->SSD_uint8EN_PIN , !SSD_OFF) ;
}
else
{
Local_uint8ErrorState = NOK ;
}
}
else if (Copy_uint8State == SSD_ON)
{
if (ssd->SSD_uint8TYPE == COMMON_ANODE_TYPE)
{
DIO_uint8SetPinValue(ssd->SSD_uint8EN_PORT , ssd->SSD_uint8EN_PIN , SSD_ON) ;
}
else if (ssd->SSD_uint8TYPE == COMMON_CATHODE_TYPE)
{
DIO_uint8SetPinValue(ssd->SSD_uint8EN_PORT , ssd->SSD_uint8EN_PIN , !SSD_ON) ;
}
else
{
Local_uint8ErrorState = NOK ;
}
}
else
{
Local_uint8ErrorState = NOK ;
}
return Local_uint8ErrorState ;
}