40 #ifndef __USBMANAGER_H__ 41 #define __USBMANAGER_H__ 55 #include "cdcdf_acm.h" 56 #include "cdcdf_acm_desc.h" 57 #include "hal_usb_device.h" 58 #include "hri_mclk_e53.h" 59 #include "hri_gclk_e53.h" 61 #include "hri_port_e53.h" 68 #ifndef USB_SERIAL_BUFFER_SIZE 69 #define USB_SERIAL_BUFFER_SIZE 64 74 #define USB_STATUS_REG_LIST(Func) \ 75 Func(UnhandledSetupReq) \ 76 Func(UnhandledDescReq) \ 77 Func(UnhandledStringReq) \ 78 Func(UnhandledFeatureReq) \ 79 Func(FailedStandardSetup) \ 80 Func(FailedClassSetup) \ 81 Func(FailedDescriptor) \ 82 Func(FailedTransferIn) \ 83 Func(FailedTransferOut) \ 87 Func(RamAccessError) \ 88 Func(FrameNumberCrcError) \ 89 Func(ReadBufferOverflow) \ 96 #define STRUCTIFY(item) \ 103 #define ENUMIFY(item) \ 110 #define MASKIFY(item) \ 111 const uint32_t item##Mask = 1UL << item ; 113 #define MIN(a, b) (((a) < (b)) ? (a) : (b)) 116 #ifndef HIDE_FROM_DOXYGEN 120 union UsbStatusRegister {
129 USB_STATUS_REG_LIST(STRUCTIFY)
134 #ifndef HIDE_FROM_DOXYGEN 142 USB_STATUS_REG_LIST(ENUMIFY)
143 USB_STATUS_REG_FIELD_LAST_ITEM
144 } UsbStatusRegFields;
146 #define UNUSED(expr) (void)(expr) 155 USB_STATUS_REG_LIST(MASKIFY)
181 #ifndef HIDE_FROM_DOXYGEN 185 static UsbManager &Instance();
194 bool Speed(uint32_t bitsPerSecond);
215 void WaitForWriteFinish();
220 int32_t AvailableForRead();
225 int32_t AvailableForWrite();
240 bool SendChar(uint8_t charToSend);
247 const volatile usb_cdc_control_signal_t &LineState() {
267 static bool CBLineStateChanged(usb_cdc_control_signal_t state);
268 static bool TxComplete(
const uint8_t ep,
269 const enum usb_xfer_code rc,
270 const uint32_t count);
271 static bool RxComplete(
const uint8_t ep,
272 const enum usb_xfer_code rc,
273 const uint32_t count);
275 void cdc_device_acm_init(
void);
285 volatile uint32_t m_inHead, m_inTail;
286 volatile uint32_t m_outHead, m_outTail;
288 volatile bool m_sendActive;
289 volatile bool m_readActive;
290 usb_cdc_control_signal_t m_lineState;
291 uint8_t *m_readBufPtr;
292 uint32_t m_readBufAvail;
305 void RxCopyToRingBuf();
314 #endif //__USBMANAGER_H__ Namespace to encompass the ClearCore board API.
Definition: AdcManager.h:36
USB manager Class.
Definition: UsbManager.h:178
#define USB_SERIAL_BUFFER_SIZE
Definition: UsbManager.h:69
ClearCore Board Supervisory System Manager.
Definition: SysManager.h:58