yefj
Advanced Member level 5
Hello, for my EFM32LG controller i have a line shown bellow.From the reference table shown in the end we see the sub properties of STATUS
also i know that <<6 mean multiply by 2^6
What is the logic of this line?
Thanks.
also i know that <<6 mean multiply by 2^6
What is the logic of this line?
Thanks.
Code:
USART1->STATUS & (1 << 6)
Code:
if(USART1->STATUS & (1 << 7)) { // if RX buffer contains valid data
rx_char = USART1->RXDATA; // store the data
}
if(rx_char) { // if we have a valid character
if(USART1->STATUS & (1 << 6)) { // check if TX buffer is empty
USART1->TXDATA = rx_char; // echo received char
rx_char = 0; // reset temp variable
}
}