-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathperipheral_config.h
More file actions
35 lines (28 loc) · 816 Bytes
/
peripheral_config.h
File metadata and controls
35 lines (28 loc) · 816 Bytes
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
#ifndef __PERIPHERAL_CONFIG_H
#define __PERIPHERAL_CONFIG_H
#include "stm32f0xx.h"
#include "stm32f0xx_rcc.h"
#include "stm32f0xx_gpio.h"
#include "stm32f0xx_usart.h"
#include "stm32f0xx_misc.h"
/* LED */
#define LED_PIN GPIO_Pin_6
#define LED_GPIO_PORT GPIOB
#define LED_GPIO_CLK RCC_AHBPeriph_GPIOB
/* LED */
#define PWRKEY_PIN GPIO_Pin_9
#define PWRKEY_GPIO_PORT GPIOA
#define PWRKEY_GPIO_CLK RCC_AHBPeriph_GPIOA
/* UART */
#define U1TX_GPIO_PORT GPIOA
#define U1TX_PIN GPIO_Pin_2
#define U1TX_SOURCE GPIO_PinSource2
#define U1RX_GPIO_PORT GPIOA
#define U1RX_PIN GPIO_Pin_3
#define U1RX_SOURCE GPIO_PinSource3
#define U1_GPIO_CLK RCC_AHBPeriph_GPIOA
void Clock_Config(void);
void GPIO_Config(void);
void UART_Config(void);
void USART_Puts(char* str);
#endif /* End of __PERIPHERAL_CONFIG_H */