![]() |
BiVo EFM32GG12
0.1
An open source foundation foundation for remote monitoring of bird vocalizations.
|
Serial USB Driver. More...
#include "serial_usb_drv.h"
Functions | |
void | serialUsbDriver_init (void) |
Initializes the USART and GPIO peripherals for using the SEGGER JLINK chip as a a virtual communication (VCOM) port over the DBG USB port and initializes pointers to input and output buffers. More... | |
enum USB_Ecode | transmit_HalfWord (int16_t *buffer, uint32_t size) |
enum USB_Ecode | transmit_Byte (int8_t *buffer, uint32_t size) |
enum USB_Ecode | receive_Byte (int8_t *buffer, uint32_t size) |
Serial USB Driver.
This driver manages the specific functionalities needed to run a serial link to the desktop application over a USB cable using the debug chip's virtual communication port. The Thunderboard has two micro-USB ports, the VCOM connects to the port on the debug side of the board.
This code is adapted in part from the leuart_echo peripheral example from by Silicon Labs and the LDMA example code by Silicon Labs. github.com/SiliconLabs/peripheral_examples/tree/master/series1/leuart/leuart_echo. https://docs.silabs.com/mcu/5.8/efm32gg12/group-LDMA#ga0b27c0375b6e3f6a862f9317a7d04fba.
Figure out how to include parameters for the RX and TX callback functions.
Assess if possible to send and receive concurrently.
enum USB_Ecode receive_Byte | ( | int8_t * | buffer, |
uint32_t | size | ||
) |
Receive a byte at a time over the serial connection. This is useful to receive strings.
buffer | Buffer of bytes (or byte sized) to store the received message into. |
size | The number of bytes to receive. |
void serialUsbDriver_init | ( | void | ) |
Initializes the USART and GPIO peripherals for using the SEGGER JLINK chip as a a virtual communication (VCOM) port over the DBG USB port and initializes pointers to input and output buffers.
This initialization must be run before any other functions can be called that control the serial communication.
enum USB_Ecode transmit_Byte | ( | int8_t * | buffer, |
uint32_t | size | ||
) |
Transmit a byte at a time over the serial connection. This is useful to send strings.
buffer | Buffer of bytes (or byte sized) to transmit over the serial connection. |
size | The number of bytes to transmit. |
enum USB_Ecode transmit_HalfWord | ( | int16_t * | buffer, |
uint32_t | size | ||
) |
Transmit half a word at a time over the serial connection. This is useful to send audio samples, as samples are half words.
buffer | Buffer of half words to transmit over the serial connection. |
size | The number of half words to transmit. |