46 uint8_t
ACM::Init(uint8_t parent, uint8_t port,
bool lowspeed) {
50 uint8_t buf[constBufSize];
130 goto FailSetDevTblEntry;
134 for(uint8_t i = 0; i < num_of_conf; i++) {
148 goto FailGetConfDescr;
153 goto FailGetConfDescr;
171 goto FailSetConfDescr;
195 #ifdef DEBUG_USB_HOST 201 #ifdef DEBUG_USB_HOST 207 #ifdef DEBUG_USB_HOST 213 #ifdef DEBUG_USB_HOST 219 #ifdef DEBUG_USB_HOST 223 #ifdef DEBUG_USB_HOST 282 if(rv && rv !=
hrNAK) {
290 if(rv && rv !=
hrNAK) {
297 uint8_t rv = (
pUsb->
ctrlReq(
bAddress, 0,
bmREQ_CDCOUT,
CDC_SET_COMM_FEATURE, (fid & 0xff), (fid >> 8),
bControlIface, nbytes, nbytes, dataptr, NULL));
298 if(rv && rv !=
hrNAK) {
305 uint8_t rv = (
pUsb->
ctrlReq(
bAddress, 0,
bmREQ_CDCIN,
CDC_GET_COMM_FEATURE, (fid & 0xff), (fid >> 8),
bControlIface, nbytes, nbytes, dataptr, NULL));
306 if(rv && rv !=
hrNAK) {
313 uint8_t rv = (
pUsb->
ctrlReq(
bAddress, 0,
bmREQ_CDCOUT,
CDC_CLEAR_COMM_FEATURE, (fid & 0xff), (fid >> 8),
bControlIface, 0, 0, NULL, NULL));
314 if(rv && rv !=
hrNAK) {
321 uint8_t rv = (
pUsb->
ctrlReq(
bAddress, 0,
bmREQ_CDCOUT,
CDC_SET_LINE_CODING, 0x00, 0x00,
bControlIface,
sizeof (
LINE_CODING),
sizeof (
LINE_CODING), (uint8_t*)dataptr, NULL));
322 if(rv && rv !=
hrNAK) {
329 uint8_t rv = (
pUsb->
ctrlReq(
bAddress, 0,
bmREQ_CDCIN,
CDC_GET_LINE_CODING, 0x00, 0x00,
bControlIface,
sizeof (
LINE_CODING),
sizeof (
LINE_CODING), (uint8_t*)dataptr, NULL));
330 if(rv && rv !=
hrNAK) {
337 uint8_t rv = (
pUsb->
ctrlReq(
bAddress, 0,
bmREQ_CDCOUT,
CDC_SET_CONTROL_LINE_STATE, state, 0,
bControlIface, 0, 0, NULL, NULL));
338 if(rv && rv !=
hrNAK) {
345 uint8_t rv = (
pUsb->
ctrlReq(
bAddress, 0,
bmREQ_CDCOUT,
CDC_SEND_BREAK, (duration & 0xff), (duration >> 8),
bControlIface, 0, 0, NULL, NULL));
346 if(rv && rv !=
hrNAK) {
355 D_PrintHex<uint8_t > (ep_ptr->
bLength, 0x80);
365 D_PrintHex<uint8_t > (ep_ptr->
bInterval, 0x80);
#define USB_CLASS_COM_AND_CDC_CTRL
#define USB_CLASS_CDC_DATA
uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
virtual tty_features enhanced_features(void)
ACM(USB *pusb, CDCAsyncOper *pasync)
#define CDC_PROTOCOL_ITU_T_V_250
#define CP_MASK_COMPARE_PROTOCOL
#define USB_ERROR_EPINFO_IS_NULL
virtual uint8_t OnInit(ACM *pacm)
static const uint8_t epInterruptInIndex
static const uint8_t epDataOutIndex
#define CDC_CLEAR_COMM_FEATURE
#define CDC_SET_COMM_FEATURE
#define CDC_SET_LINE_CODING
virtual void autoflowRTS(bool s)
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
EpInfo epInfo[ACM_MAX_ENDPOINTS]
#define USB_TRANSFER_TYPE_INTERRUPT
#define NotifyFailGetDevDescr(...)
uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo *eprecord_ptr)
#define CP_MASK_COMPARE_CLASS
#define CDC_GET_COMM_FEATURE
virtual void FreeAddress(uint8_t addr)=0
uint8_t ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi, uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t *dataptr, USBReadParser *p)
virtual UsbDevice * GetUsbDevicePtr(uint8_t addr)=0
void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
#define ACM_MAX_ENDPOINTS
#define NotifyFailGetConfDescr(...)
virtual void wide(bool s)
uint8_t GetLineCoding(LINE_CODING *dataptr)
#define USB_NAK_MAX_POWER
virtual void autoflowXON(bool s)
uint8_t SndData(uint16_t nbytes, uint8_t *dataptr)
#define CDC_GET_LINE_CODING
uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *data)
#define bmUSB_TRANSFER_TYPE
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
#define CP_MASK_COMPARE_SUBCLASS
virtual uint8_t AllocAddress(uint8_t parent, bool is_hub=false, uint8_t port=0)=0
static const uint8_t epDataInIndex
virtual void autoflowDSR(bool s)
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
uint8_t SetLineCoding(const LINE_CODING *dataptr)
void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
uint8_t SendBreak(uint16_t duration)
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
uint8_t GetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr)
uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data, uint8_t bInterval=0)
uint8_t bNumConfigurations
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
#define CDC_SET_CONTROL_LINE_STATE
AddressPool & GetAddressPool()
#define USB_TRANSFER_TYPE_BULK
volatile bool bPollEnable
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
#define NotifyFailSetConfDescr(...)
tty_features _enhanced_status
uint8_t SetControlLineState(uint8_t state)
uint8_t SetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr)
uint8_t ClearCommFeature(uint16_t fid)
virtual void half_duplex(bool s)
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
#define NotifyFailSetDevTblEntry(...)
uint8_t RcvData(uint16_t *nbytesptr, uint8_t *dataptr)