UART send-recive
Posted: Fri Oct 16, 2015 7:01 am
hi to all i'm a student, i want use uart for university project, now i see some exemple in chibios but i don't understand well.
i have this question:
in project STM32F4XX-UART
for send and recive data from uart you use
uartStartReceive(&UARTD2, 16, buffer);
uartStartSend(&UARTD2, 16, message);
in project STM32L1XX-UART
you don't use this function but i read this:
/*
* This callback is invoked when a character is received but the application
* was not ready to receive it, the character is passed as parameter.
*/
static void rxchar(UARTDriver *uartp, uint16_t c) {
(void)uartp;
(void)c;
/* Flashing the LED each time a character is received.*/
palSetPad(GPIOB, GPIOB_LED4);
chSysLockFromISR();
chVTResetI(&vt2);
chVTDoSetI(&vt2, MS2ST(200), ledoff, NULL);
chSysUnlockFromISR();
}
i see that you use this function in STM32F4XX-UART
my question is this
if i want sand and receive data i will use funcition uartStartReceive/uartStartSend or i will modify the function
static void rxchar(UARTDriver *uartp, uint16_t c)
bye
f.
i have this question:
in project STM32F4XX-UART
for send and recive data from uart you use
uartStartReceive(&UARTD2, 16, buffer);
uartStartSend(&UARTD2, 16, message);
in project STM32L1XX-UART
you don't use this function but i read this:
/*
* This callback is invoked when a character is received but the application
* was not ready to receive it, the character is passed as parameter.
*/
static void rxchar(UARTDriver *uartp, uint16_t c) {
(void)uartp;
(void)c;
/* Flashing the LED each time a character is received.*/
palSetPad(GPIOB, GPIOB_LED4);
chSysLockFromISR();
chVTResetI(&vt2);
chVTDoSetI(&vt2, MS2ST(200), ledoff, NULL);
chSysUnlockFromISR();
}
i see that you use this function in STM32F4XX-UART
my question is this
if i want sand and receive data i will use funcition uartStartReceive/uartStartSend or i will modify the function
static void rxchar(UARTDriver *uartp, uint16_t c)
bye
f.