-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactual_req1.txt
More file actions
61 lines (50 loc) · 2.03 KB
/
Copy pathactual_req1.txt
File metadata and controls
61 lines (50 loc) · 2.03 KB
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
//********************************************************************
//* EEE2046F C template *
//*==================================================================*
//* DESCRIPTION: *
//* display stdNum and four leds *
//********************************************************************
// INCLUDE FILES
//====================================================================
#include "stm32f0xx.h"
#include <lcd_stm32f0.c>
//====================================================================
// GLOBAL CONSTANTS
//====================================================================
#define pattern 0b11000011
//====================================================================
// GLOBAL VARIABLES
//====================================================================
//====================================================================
// FUNCTION DECLARATIONS
//====================================================================
void display_studentNum();
void init_GPIO();
//====================================================================
// MAIN FUNCTION
//====================================================================
int main (void)
{
display_studentNum();
init_GPIO();
while (1){
}
}
//====================================================================
// FUNCTION DEFINITIONS
//====================================================================
void display_studentNum(){
init_LCD();
lcd_command(CLEAR);
lcd_putstring("PSWKAM001");
}
void init_GPIO(void){
// enabling the clock something
RCC->AHBENR |= RCC_AHBENR_GPIOBEN;
// configure PB0-PB7 to output
GPIOB->MODER |= 0b0101010101010101;
GPIOB-> ODR = pattern;
}
//********************************************************************
// END OF PROGRAM
//********************************************************************