device API rename
This commit is contained in:
@@ -64,19 +64,19 @@ FIFO_DEF(fifo_serial, SERIAL_BUFFER_SIZE, uint8_t, true);
|
||||
//--------------------------------------------------------------------+
|
||||
// tinyusb callbacks
|
||||
//--------------------------------------------------------------------+
|
||||
void tusbd_cdc_mounted_cb(uint8_t coreid)
|
||||
void tud_cdc_mounted_cb(uint8_t coreid)
|
||||
{
|
||||
osal_semaphore_reset(sem_hdl);
|
||||
|
||||
tusbd_cdc_receive(coreid, serial_rx_buffer, SERIAL_BUFFER_SIZE, true);
|
||||
tud_cdc_receive(coreid, serial_rx_buffer, SERIAL_BUFFER_SIZE, true);
|
||||
}
|
||||
|
||||
void tusbd_cdc_unmounted_cb(uint8_t coreid)
|
||||
void tud_cdc_unmounted_cb(uint8_t coreid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void tusbd_cdc_xfer_cb(uint8_t coreid, tusb_event_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes)
|
||||
void tud_cdc_xfer_cb(uint8_t coreid, tusb_event_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes)
|
||||
{
|
||||
switch ( pipe_id )
|
||||
{
|
||||
@@ -92,7 +92,7 @@ void tusbd_cdc_xfer_cb(uint8_t coreid, tusb_event_t event, cdc_pipeid_t pipe_id,
|
||||
break;
|
||||
|
||||
case TUSB_EVENT_XFER_ERROR:
|
||||
tusbd_cdc_receive(0, serial_rx_buffer, SERIAL_BUFFER_SIZE, true); // ignore, queue transfer again
|
||||
tud_cdc_receive(0, serial_rx_buffer, SERIAL_BUFFER_SIZE, true); // ignore, queue transfer again
|
||||
break;
|
||||
|
||||
case TUSB_EVENT_XFER_STALLED:
|
||||
@@ -139,10 +139,10 @@ tusb_error_t cdcd_serial_subtask(void)
|
||||
osal_semaphore_wait(sem_hdl, OSAL_TIMEOUT_WAIT_FOREVER, &error);
|
||||
(void) error; // suppress compiler's warnings
|
||||
|
||||
if ( tusbd_is_configured(0) )
|
||||
if ( tud_configured(0) )
|
||||
{
|
||||
// echo back data in the fifo
|
||||
if ( !tusbd_cdc_is_busy(0, CDC_PIPE_DATA_IN) )
|
||||
if ( !tud_cdc_busy(0, CDC_PIPE_DATA_IN) )
|
||||
{
|
||||
uint16_t count=0;
|
||||
while( fifo_read(&fifo_serial, &serial_tx_buffer[count]) )
|
||||
@@ -152,12 +152,12 @@ tusb_error_t cdcd_serial_subtask(void)
|
||||
|
||||
if (count)
|
||||
{
|
||||
tusbd_cdc_send(0, serial_tx_buffer, count, false);
|
||||
tud_cdc_send(0, serial_tx_buffer, count, false);
|
||||
}
|
||||
}
|
||||
|
||||
// getting more data from host
|
||||
tusbd_cdc_receive(0, serial_rx_buffer, SERIAL_BUFFER_SIZE, true);
|
||||
tud_cdc_receive(0, serial_rx_buffer, SERIAL_BUFFER_SIZE, true);
|
||||
}
|
||||
|
||||
OSAL_SUBTASK_END
|
||||
|
||||
@@ -56,17 +56,17 @@ TUSB_CFG_ATTR_USBRAM hid_keyboard_report_t keyboard_report;
|
||||
//--------------------------------------------------------------------+
|
||||
// tinyusb callbacks
|
||||
//--------------------------------------------------------------------+
|
||||
void tusbd_hid_keyboard_mounted_cb(uint8_t coreid)
|
||||
void tud_hid_keyboard_mounted_cb(uint8_t coreid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void tusbd_hid_keyboard_unmounted_cb(uint8_t coreid)
|
||||
void tud_hid_keyboard_unmounted_cb(uint8_t coreid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void tusbd_hid_keyboard_cb(uint8_t coreid, tusb_event_t event, uint32_t xferred_bytes)
|
||||
void tud_hid_keyboard_cb(uint8_t coreid, tusb_event_t event, uint32_t xferred_bytes)
|
||||
{
|
||||
switch(event)
|
||||
{
|
||||
@@ -77,7 +77,7 @@ void tusbd_hid_keyboard_cb(uint8_t coreid, tusb_event_t event, uint32_t xferred_
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t tusbd_hid_keyboard_get_report_cb(uint8_t coreid, hid_request_report_type_t report_type, void** pp_report, uint16_t requested_length)
|
||||
uint16_t tud_hid_keyboard_get_report_cb(uint8_t coreid, hid_request_report_type_t report_type, void** pp_report, uint16_t requested_length)
|
||||
{
|
||||
// get other than input report is not supported by this keyboard demo
|
||||
if ( report_type != HID_REQUEST_REPORT_INPUT ) return 0;
|
||||
@@ -86,7 +86,7 @@ uint16_t tusbd_hid_keyboard_get_report_cb(uint8_t coreid, hid_request_report_typ
|
||||
return requested_length;
|
||||
}
|
||||
|
||||
void tusbd_hid_keyboard_set_report_cb(uint8_t coreid, hid_request_report_type_t report_type, uint8_t p_report_data[], uint16_t length)
|
||||
void tud_hid_keyboard_set_report_cb(uint8_t coreid, hid_request_report_type_t report_type, uint8_t p_report_data[], uint16_t length)
|
||||
{
|
||||
// set other than output report is not supported by this keyboard demo
|
||||
if ( report_type != HID_REQUEST_REPORT_OUTPUT ) return;
|
||||
@@ -126,7 +126,7 @@ tusb_error_t keyboard_device_subtask(void)
|
||||
|
||||
osal_task_delay(50);
|
||||
|
||||
if ( tusbd_is_configured(0) && !tusbd_hid_keyboard_is_busy(0) )
|
||||
if ( tud_configured(0) && !tud_hid_keyboard_busy(0) )
|
||||
{
|
||||
static uint32_t button_mask = 0;
|
||||
uint32_t new_button_mask = board_buttons();
|
||||
@@ -141,7 +141,7 @@ tusb_error_t keyboard_device_subtask(void)
|
||||
keyboard_report.keycode[i] = BIT_TEST_(button_mask, i) ? (0x04+i) : 0;
|
||||
}
|
||||
|
||||
tusbd_hid_keyboard_send(0, &keyboard_report );
|
||||
tud_hid_keyboard_send(0, &keyboard_report );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -89,17 +89,17 @@ static scsi_mode_parameters_t const msc_dev_mode_para =
|
||||
//--------------------------------------------------------------------+
|
||||
// tinyusb callbacks
|
||||
//--------------------------------------------------------------------+
|
||||
void tusbd_msc_mounted_cb(uint8_t coreid)
|
||||
void tud_msc_mounted_cb(uint8_t coreid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void tusbd_msc_unmounted_cb(uint8_t coreid)
|
||||
void tud_msc_unmounted_cb(uint8_t coreid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
msc_csw_status_t tusbd_msc_scsi_cb (uint8_t coreid, uint8_t lun, uint8_t scsi_cmd[16], void const ** pp_buffer, uint16_t* p_length)
|
||||
msc_csw_status_t tud_msc_scsi_cb (uint8_t coreid, uint8_t lun, uint8_t scsi_cmd[16], void const ** pp_buffer, uint16_t* p_length)
|
||||
{
|
||||
// read10 & write10 has their own callback and MUST not be handled here
|
||||
switch (scsi_cmd[0])
|
||||
|
||||
@@ -91,13 +91,13 @@ uint8_t msc_device_ramdisk[DISK_BLOCK_NUM][DISK_BLOCK_SIZE] =
|
||||
//--------------------------------------------------------------------+
|
||||
// IMPLEMENTATION
|
||||
//--------------------------------------------------------------------+
|
||||
uint16_t tusbd_msc_read10_cb (uint8_t coreid, uint8_t lun, void** pp_buffer, uint32_t lba, uint16_t block_count)
|
||||
uint16_t tud_msc_read10_cb (uint8_t coreid, uint8_t lun, void** pp_buffer, uint32_t lba, uint16_t block_count)
|
||||
{
|
||||
(*pp_buffer) = msc_device_ramdisk[lba];
|
||||
|
||||
return min16_of(block_count, DISK_BLOCK_NUM);
|
||||
}
|
||||
uint16_t tusbd_msc_write10_cb(uint8_t coreid, uint8_t lun, void** pp_buffer, uint32_t lba, uint16_t block_count)
|
||||
uint16_t tud_msc_write10_cb(uint8_t coreid, uint8_t lun, void** pp_buffer, uint32_t lba, uint16_t block_count)
|
||||
{
|
||||
(*pp_buffer) = msc_device_ramdisk[lba];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user