static GPIO_TypeDef * const UsartGPIOInitTable[] = {
GPIOA,
0
};
static uint8_t const UsartTxPINInitTable[] = {
2,
0
};
static uint8_t const UsartRxPINInitTable[] = {
3,
0
};
..........................
uint8_t i = 0;
//TX
while(UsartGPIOInitTable[i] != 0)
{
gpio_conf(UsartGPIOInitTable[i], UsartTxPINInitTable[i], MODE_AF, TYPE_PUSHPULL, SPEED_50MHz, PULLUP_UP, 7);
i++;
}
i = 0;
//RX
while(UsartGPIOInitTable[i] != 0)
{
gpio_conf(UsartGPIOInitTable[i], UsartRxPINInitTable[i], MODE_AF, TYPE_PUSHPULL, SPEED_50MHz, PULLUP_NONE, 7);
i++;
}
.......................... |