Implementation file for iSensor-SPI-Buffer USB command line register interface.
More...
#include "usb.h"
#include "reg.h"
#include "main.h"
#include "usbd_cdc_if.h"
#include "script.h"
#include "timer.h"
Implementation file for iSensor-SPI-Buffer USB command line register interface.
Copyright (c) Analog Devices Inc, 2020 All Rights Reserved.
- Date
- 6/26/2020
- Author
- A. Nolan (alex..nosp@m.nola.nosp@m.n@ana.nosp@m.log..nosp@m.com)
◆ USB_Reset()
Toggle USB PU to force a re-enumeration on the host side.
- Returns
- void
◆ USB_Rx_Handler()
Handler for received USB data.
- Returns
- void
This function should be called periodically from the main loop to check if new USB data has been received
◆ USB_Tx_Handler()
void USB_Tx_Handler |
( |
const uint8_t * |
buf, |
|
|
uint32_t |
count |
|
) |
| |
USB write handler.
- Parameters
-
buf | Buffer containing data to write |
count | Number of bytes to write |
- Returns
- void
This function is called by the script execution routines, when a script object is executed from a USB CLI context.
◆ USB_Wait_For_Tx_Done()
bool USB_Wait_For_Tx_Done |
( |
uint32_t |
TimeoutMs | ) |
|
Helper function to wait for the USB Tx to be free.
- Parameters
-
TimeoutMs | Operation timeout (in ms). Must keep under watchdog reset period |
- Returns
- true if Tx is free, false is timeout elapses
◆ USB_Watermark_Autoset()
void USB_Watermark_Autoset |
( |
| ) |
|
Helper function to set the watermark interrupt level for optimal USB streams.
- Returns
- void
This function can be called to configure the watermark interrupt level for ideal operation using a USB CLI stream. To get maximum throughput over the USB CLI stream, while maintaining minimal latency, the watermark interrupt level should be set such that each USB transmission occupies a single full buffer (512 bytes).
After calling this function, WATERMARK_INT_CONFIG will be set based on the current buffer length setting.
◆ CurrentCommand
uint8_t CurrentCommand[64] |
|
static |
◆ EchoBuf
Byte buffer for echoing to console
◆ hUsbDeviceFS
USBD_HandleTypeDef hUsbDeviceFS |
|
extern |
USB handle (from usb_device.c)
◆ NewLineStr
const uint8_t NewLineStr[] = "\r\n" |
|
static |
◆ scr
Script object (parsed from current command)
◆ USBRxCount
USB Rx count (from usbd_cdc_if.c)
◆ UserRxBufferFS
uint8_t UserRxBufferFS[APP_RX_DATA_SIZE] |
|
extern |
USB Rx buffer (from usbd_cdc_if.c)
◆ UserTxBufferFS
uint8_t UserTxBufferFS[APP_TX_DATA_SIZE] |
|
extern |
USB Tx buffer (from usbd_cdc_if.c)