* example generalization
This commit is contained in:
parent
57adae9420
commit
3e01c9b7dc
|
@ -15,6 +15,11 @@ package Board is
|
|||
UART_TX_Bit : constant Port_Bit_Number := 9;
|
||||
UART_RX_Bit : constant Port_Bit_Number := 10;
|
||||
|
||||
UART_Port_RCC_EN : Boolean renames RCC.AHB1ENR(Index.GPIOA);
|
||||
UART_Port_RCC_RST : Boolean renames RCC.AHB1RSTR(Index.GPIOA);
|
||||
|
||||
UART_AF : Alternate_Function renames Alternate_Functions.USART1;
|
||||
|
||||
UART_Module : USART_Registers renames USART1;
|
||||
|
||||
UART_RCC_EN : Boolean renames RCC.APB2ENR(Index.USART1);
|
||||
|
|
|
@ -32,20 +32,20 @@ procedure UART_429Disco is
|
|||
Now: Time := Clock;
|
||||
|
||||
begin
|
||||
RCC.AHB1ENR(Index.GPIOA) := True;
|
||||
UART_Port_RCC_EN := True;
|
||||
|
||||
UART_RCC_EN := True;
|
||||
|
||||
UART_RCC_RST := True;
|
||||
UART_RCC_RST := False;
|
||||
|
||||
UART_Port.AFR(UART_TX_Bit) := Alternate_Functions.USART1;
|
||||
UART_Port.AFR(UART_TX_Bit) := UART_AF;
|
||||
UART_Port.MODER(UART_TX_Bit) := Alternate_Mode;
|
||||
UART_Port.OSPEEDR(UART_TX_Bit) := Low_Speed;
|
||||
UART_Port.OTYPER(UART_TX_Bit) := Push_Pull_Type;
|
||||
UART_Port.PUPDR(UART_TX_Bit) := Pull_Down;
|
||||
|
||||
UART_Port.AFR(UART_RX_Bit) := Alternate_Functions.USART1;
|
||||
UART_Port.AFR(UART_RX_Bit) := UART_AF;
|
||||
UART_Port.MODER(UART_RX_Bit) := Alternate_Mode;
|
||||
UART_Port.OSPEEDR(UART_RX_Bit) := Low_Speed;
|
||||
UART_Port.OTYPER(UART_RX_Bit) := Push_Pull_Type;
|
||||
|
|
Loading…
Reference in New Issue