Esempio n. 1
0
bool uhi_vendor_bulk_out_run(uint8_t * buf, iram_size_t buf_size,
		uhd_callback_trans_t callback)
{
	if (!uhi_vendor_bulk_is_available()) {
		return false;
	}
	return uhd_ep_run(uhi_vendor_dev.dev->address,
			uhi_vendor_dev.ep_bulk_out, false, buf, buf_size,
			UHI_VENDOR_TIMEOUT, callback);
}
Esempio n. 2
0
static bool ar9170_usb_send_data(uint8_t* data, uint16_t data_len) {
	
	#if USB_WRAPPER_DEBUG_DEEP
	printf("Send data down [%u].\n",data_len);
	#endif

	/* Wait for the bulk endpoint to become available. */
	if (!uhi_vendor_bulk_is_available()) {
		printf("ERROR: BULK endpoint not available.\n");
		while(!uhi_vendor_bulk_is_available());
	}
	
	
	/* Copy the packet data to the 
	 * interrupt endpoint output buffer.
	 */
	memcpy(bulk_out_buffer, data, data_len);
	
	/* Start transferring OUT on the interrupt endpoint. 
	 * Return the status of the transfer upon completion. 
	 */
	return (bool) uhi_vendor_bulk_out_run(bulk_out_buffer, 
		(iram_size_t) data_len, ar9170_bulk_out_transfer_done);
}
Esempio n. 3
0
void ar9170_listen_on_bulk_in()
{	
	/* Signal an error if the bulk endpoint is not available. */	
	if (!uhi_vendor_bulk_is_available()) {
		printf("ERROR: Bulk transfer endpoint is not available.\n");
		return;
	}
	
	#if USB_WRAPPER_DEBUG_DEEP
	printf("DEBUG: Register listening on the bulk endpoint...\n");
	#endif
	
	if (!uhi_vendor_bulk_in_run((COMPILER_WORD_ALIGNED uint8_t*)bulk_in_buffer, 
		(iram_size_t)(BULK_ENDPOINT_MAX_SIZE), ar9170_bulk_in_transfer_done)) {
		/* Signal an error. */	
		printf("ERROR: BULK IN Listening registration completed with errors!\n");		
	}	
}