37 uint8_t
AMBX::Init(uint8_t parent, uint8_t port,
bool lowspeed) {
96 goto FailUnknownDevice;
113 #ifdef DEBUG_USB_HOST
115 D_PrintHex<uint8_t > (rcode, 0x80);
121 D_PrintHex<uint8_t > (
bAddress, 0x80);
136 goto FailSetDevTblEntry;
153 goto FailSetDevTblEntry;
160 goto FailSetConfDescr;
172 #ifdef DEBUG_USB_HOST
178 #ifdef DEBUG_USB_HOST
184 #ifdef DEBUG_USB_HOST
190 #ifdef DEBUG_USB_HOST
196 #ifdef DEBUG_USB_HOST
197 Notify(
PSTR(
"\r\nAMBX Init Failed, error code: "), 0x80);
216 void AMBX::Light_Command(uint8_t *data, uint16_t nbytes) {
217 #ifdef DEBUG_USB_HOST
225 writeBuf[1] = ambx_light;
234 setLight(ambx_light, (uint8_t)(color >> 16), (uint8_t)(color >> 8), (uint8_t)(color));
245 void AMBX::onInit() {
246 #ifdef DEBUG_USB_HOST
#define AMBX_MAX_ENDPOINTS
#define AMBX_EP_MAXPKTSIZE
#define AMBX_ENDPOINT_OUT
#define AMBX_LIGHT_COMMAND_BUFFER_SIZE
#define AMBX_CONTROL_PIPE
#define AMBX_SET_COLOR_COMMAND
#define AMBX_PREFIX_COMMAND
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
#define USB_ERROR_EPINFO_IS_NULL
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
#define USB_NAK_MAX_POWER
EpInfo epInfo[AMBX_MAX_ENDPOINTS]
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
void setAllLights(AmbxColorsEnum color)
void setLight(uint8_t ambx_light, uint8_t r, uint8_t g, uint8_t b)
virtual void FreeAddress(uint8_t addr)=0
virtual uint8_t AllocAddress(uint8_t parent, bool is_hub=false, uint8_t port=0)=0
virtual UsbDevice * GetUsbDevicePtr(uint8_t addr)=0
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
AddressPool & GetAddressPool()
uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo *eprecord_ptr)
uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *data)
#define NotifyFailSetConfDescr(...)
#define NotifyFailUnknownDevice(...)
#define NotifyFailSetDevTblEntry(...)
#define NotifyFailGetDevDescr(...)
#define USB_TRANSFER_TYPE_INTERRUPT