EFR32BG22
Shenzhen RF-star Technology Co., Ltd.
Page 79 of 93
8 MCU Reference Code (Transparent Transmission)
The serial port between the module and the MCU uses hardware flow control IO ports (CTS and RTS) to send and
receive notifications and control.
These two IOs are always at a high level and will be triggered when pull low.
When the module can receive data, the module will pull the RTS signal low (CTS for the MCU) to notify the MCU that it
can send data.
When MCU can receive data, MCU should pull the RTS signal low (CTS for the module) to inform the module that it can
send data.
The demo code is as follows (for reference only):
void main(void)
{
//Wait for the BLE module to start successfully
while(!memcmp(rx_ble_mode_data(),"DEVICE_START\r\n",strlen("DEVICE_START\r\n")));
//Enable RTS, that is, MCU can receive date from BLE module
set_rts_enable();
While(1){
//Aquire whether the CTS status is at a low level
If(get_cts_state()==0){
// Send test data to BLE module
mcu_send_to_ble_string("Test data.\r\n");
}
// Processing the data obtained by MCU
mcu_data_process(mcu_uart_read_data());
}
}
Summary of Contents for EFR32BG22
Page 71: ...EFR32BG22 www szrfstar com V1 6 Jun 2022 Shenzhen RF star Technology Co Ltd Page 70 of 93...
Page 75: ...EFR32BG22 www szrfstar com V1 6 Jun 2022 Shenzhen RF star Technology Co Ltd Page 74 of 93...
Page 76: ...EFR32BG22 www szrfstar com V1 6 Jun 2022 Shenzhen RF star Technology Co Ltd Page 75 of 93...
Page 77: ...EFR32BG22 www szrfstar com V1 6 Jun 2022 Shenzhen RF star Technology Co Ltd Page 76 of 93...
Page 91: ...EFR32BG22 www szrfstar com V1 6 Jun 2022 Shenzhen RF star Technology Co Ltd Page 90 of 93 CE...