 1f2f92d97a
			
		
	
	1f2f92d97a
	
	
	
		
			
			While there is a define for the port, the clock enable is hardcoded for GPIOA, so setting a different port than GPIOA doesn't work. This fixes it by adding a define for enabling the port clock. It also adds a define for the pin mode, because not all boards have the LED connected in a way that open drain works with it.
		
			
				
	
	
		
			29 lines
		
	
	
		
			613 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			613 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /* metadata:
 | |
|    name: CH32V203G-R0-1v0
 | |
|    url: https://github.com/openwch/ch32v20x/tree/main/SCHPCB/CH32V203C-R0
 | |
| */
 | |
| 
 | |
| #ifndef BOARD_H_
 | |
| #define BOARD_H_
 | |
| 
 | |
| #ifdef __cplusplus
 | |
| extern "C" {
 | |
| #endif
 | |
| 
 | |
| #define LED_PORT       GPIOA
 | |
| #define LED_PIN        GPIO_Pin_0
 | |
| #define LED_STATE_ON   0
 | |
| #define LED_CLOCK_EN() RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE)
 | |
| #define LED_MODE       GPIO_Mode_Out_OD
 | |
| 
 | |
| #define UART_DEV        USART2
 | |
| #define UART_CLOCK_EN() RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART2, ENABLE)
 | |
| #define UART_TX_PIN     GPIO_Pin_2
 | |
| #define UART_RX_PIN     GPIO_Pin_3
 | |
| 
 | |
| #ifdef __cplusplus
 | |
| }
 | |
| #endif
 | |
| 
 | |
| #endif
 |