checked in missing file
git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@240 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
@@ -81,6 +81,25 @@ struct Pcba* PCBA_getInstance(void)
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
ErrorStatus PCBA_setIO(T_PL_GPIO* A0, T_PL_GPIO* A1)
|
||||
{
|
||||
ErrorStatus returnValue = SUCCESS;
|
||||
|
||||
if ((A0 != NULL) && (A1 != NULL))
|
||||
{
|
||||
thisPCBA.A0 = *A0;
|
||||
thisPCBA.A1 = *A1;
|
||||
}
|
||||
else
|
||||
{
|
||||
returnValue = ERROR;
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
|
||||
static ErrorStatus PCBA_construct(struct Pcba* self)
|
||||
{
|
||||
ErrorStatus returnValue = SUCCESS;
|
||||
|
||||
@@ -430,20 +430,21 @@ static ErrorStatus initIO (void)
|
||||
|
||||
/*PCBA IO initialisation -------------------------------------------------*/
|
||||
// A0
|
||||
gpio.GPIO_Typedef = GPIOC;
|
||||
gpio.GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IPD;
|
||||
gpio.GPIO_InitStruct.GPIO_Pin = GPIO_Pin_0;
|
||||
gpio.GPIO_InitStruct.GPIO_Speed = GPIO_Speed_10MHz;
|
||||
GPIO_Init(gpio.GPIO_Typedef, &gpio.GPIO_InitStruct);
|
||||
PCBA_getInstance()->A0 = gpio;
|
||||
T_PL_GPIO A0;
|
||||
A0.GPIO_Typedef = GPIOC;
|
||||
A0.GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IPD;
|
||||
A0.GPIO_InitStruct.GPIO_Pin = GPIO_Pin_0;
|
||||
A0.GPIO_InitStruct.GPIO_Speed = GPIO_Speed_10MHz;
|
||||
GPIO_Init(A0.GPIO_Typedef, &A0.GPIO_InitStruct);
|
||||
// A1
|
||||
gpio.GPIO_Typedef = GPIOC;
|
||||
gpio.GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IPD;
|
||||
gpio.GPIO_InitStruct.GPIO_Pin = GPIO_Pin_1;
|
||||
gpio.GPIO_InitStruct.GPIO_Speed = GPIO_Speed_10MHz;
|
||||
GPIO_Init(gpio.GPIO_Typedef, &gpio.GPIO_InitStruct);
|
||||
PCBA_getInstance()->A1 = gpio;
|
||||
T_PL_GPIO A1;
|
||||
A1.GPIO_Typedef = GPIOC;
|
||||
A1.GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IPD;
|
||||
A1.GPIO_InitStruct.GPIO_Pin = GPIO_Pin_1;
|
||||
A1.GPIO_InitStruct.GPIO_Speed = GPIO_Speed_10MHz;
|
||||
GPIO_Init(A1.GPIO_Typedef, &A1.GPIO_InitStruct);
|
||||
|
||||
PCBA_setIO(&A0, &A1);
|
||||
|
||||
|
||||
/*LED IO initialisation --------------------------------------------------*/
|
||||
@@ -504,17 +505,20 @@ static ErrorStatus initIO (void)
|
||||
|
||||
/* USART3 initialisation -------------------------------------------------*/
|
||||
// Init TX line
|
||||
uart3->USART_TX.GPIO_Typedef = GPIOB;
|
||||
uart3->USART_TX.GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF_PP;
|
||||
uart3->USART_TX.GPIO_InitStruct.GPIO_Pin = GPIO_Pin_10;
|
||||
uart3->USART_TX.GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_Init(uart3->USART_TX.GPIO_Typedef, &uart3->USART_TX.GPIO_InitStruct);
|
||||
gpio.GPIO_Typedef = GPIOB;
|
||||
gpio.GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF_PP;
|
||||
gpio.GPIO_InitStruct.GPIO_Pin = GPIO_Pin_10;
|
||||
gpio.GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
uart1->USART_TX = gpio;
|
||||
GPIO_Init(gpio.GPIO_Typedef, &gpio.GPIO_InitStruct);
|
||||
|
||||
|
||||
// Init RX line
|
||||
uart3->USART_RX.GPIO_Typedef = GPIOB;
|
||||
uart3->USART_RX.GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN_FLOATING;
|
||||
uart3->USART_RX.GPIO_InitStruct.GPIO_Pin = GPIO_Pin_11;
|
||||
uart3->USART_RX.GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
gpio.GPIO_Typedef = GPIOB;
|
||||
gpio.GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN_FLOATING;
|
||||
gpio.GPIO_InitStruct.GPIO_Pin = GPIO_Pin_11;
|
||||
uart1->USART_RX = gpio;
|
||||
GPIO_Init(gpio.GPIO_Typedef, &gpio.GPIO_InitStruct);
|
||||
GPIO_Init(uart3->USART_RX.GPIO_Typedef, &uart3->USART_RX.GPIO_InitStruct);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user