usb_request_status_t usb_vendor_request_set_txvga_gain(
	usb_endpoint_t* const endpoint,	const usb_transfer_stage_t stage)
{
	if( stage == USB_TRANSFER_STAGE_SETUP ) {
			const uint8_t value = max2837_set_txvga_gain(&max2837, endpoint->setup.index);
			endpoint->buffer[0] = value;
			if(value) hackrf_ui_setBBTXVGAGain(endpoint->setup.index);
			usb_transfer_schedule_block(endpoint->in, &endpoint->buffer, 1,
						    NULL, NULL);
			usb_transfer_schedule_ack(endpoint->out);
			return USB_REQUEST_STATUS_OK;
	}
	return USB_REQUEST_STATUS_OK;
}
Exemple #2
0
static void rad1o_ui_set_bb_tx_vga_gain(const uint32_t gain_db) {
	hackrf_ui_setBBTXVGAGain(gain_db);
}