mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-04 01:21:17 +00:00
change to dcd_get_frame_number
This commit is contained in:
parent
426064201a
commit
6f17b4e019
@ -100,8 +100,8 @@ void dcd_int_disable(uint8_t rhport);
|
|||||||
void dcd_set_address(uint8_t rhport, uint8_t dev_addr);
|
void dcd_set_address(uint8_t rhport, uint8_t dev_addr);
|
||||||
void dcd_set_config (uint8_t rhport, uint8_t config_num);
|
void dcd_set_config (uint8_t rhport, uint8_t config_num);
|
||||||
|
|
||||||
// Get current micro-frame number
|
// Get current frame number
|
||||||
uint32_t dcd_get_microframe(uint8_t rhport);
|
uint32_t dcd_get_frame_number(uint8_t rhport);
|
||||||
|
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
/* Event Function
|
/* Event Function
|
||||||
|
@ -124,10 +124,10 @@ void dcd_set_config (uint8_t rhport, uint8_t config_num)
|
|||||||
// Nothing to do
|
// Nothing to do
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t dcd_get_microframe(uint8_t rhport)
|
uint32_t dcd_get_frame_number(uint8_t rhport)
|
||||||
{
|
{
|
||||||
(void) rhport;
|
(void) rhport;
|
||||||
return USB->DEVICE.FNUM.reg & (TU_BIT(14) - 1);
|
return USB->DEVICE.FNUM.bit.FNUM;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
|
@ -129,10 +129,10 @@ void dcd_set_config (uint8_t rhport, uint8_t config_num)
|
|||||||
// Nothing to do
|
// Nothing to do
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t dcd_get_microframe(uint8_t rhport)
|
uint32_t dcd_get_frame_number(uint8_t rhport)
|
||||||
{
|
{
|
||||||
(void) rhport;
|
(void) rhport;
|
||||||
return USB->DEVICE.FNUM.reg & (TU_BIT(14) - 1);
|
return USB->DEVICE.FNUM.bit.FNUM;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
|
@ -221,10 +221,10 @@ void dcd_set_config (uint8_t rhport, uint8_t config_num)
|
|||||||
// Nothing to do
|
// Nothing to do
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t dcd_get_microframe(uint8_t rhport)
|
uint32_t dcd_get_frame_number(uint8_t rhport)
|
||||||
{
|
{
|
||||||
(void) rhport;
|
(void) rhport;
|
||||||
return NRF_USBD->FRAMECNTR << 3;
|
return NRF_USBD->FRAMECNTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
@ -165,11 +165,11 @@ void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
|
|||||||
LPC_USB->DEVCMDSTAT |= dev_addr;
|
LPC_USB->DEVCMDSTAT |= dev_addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t dcd_get_microframe(uint8_t rhport)
|
uint32_t dcd_get_frame_number(uint8_t rhport)
|
||||||
{
|
{
|
||||||
(void) rhport;
|
(void) rhport;
|
||||||
|
|
||||||
return (LPC_USB->INFO & (TU_BIT(11) - 1)) << 3;
|
return LPC_USB->INFO & (TU_BIT(11) - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool dcd_init(uint8_t rhport)
|
bool dcd_init(uint8_t rhport)
|
||||||
|
@ -227,10 +227,10 @@ void dcd_set_config(uint8_t rhport, uint8_t config_num)
|
|||||||
sie_write(SIE_CMDCODE_CONFIGURE_DEVICE, 1, 1);
|
sie_write(SIE_CMDCODE_CONFIGURE_DEVICE, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t dcd_get_microframe(uint8_t rhport)
|
uint32_t dcd_get_frame_number(uint8_t rhport)
|
||||||
{
|
{
|
||||||
(void) rhport;
|
(void) rhport;
|
||||||
return ((uint32_t) sie_read(SIE_CMDCODE_READ_FRAME_NUMBER)) << 3;
|
return (uint32_t) sie_read(SIE_CMDCODE_READ_FRAME_NUMBER);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
@ -174,9 +174,9 @@ void dcd_set_config(uint8_t rhport, uint8_t config_num)
|
|||||||
// nothing to do
|
// nothing to do
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t dcd_get_microframe(uint8_t rhport)
|
uint32_t dcd_get_frame_number(uint8_t rhport)
|
||||||
{
|
{
|
||||||
return LPC_USB[rhport]->FRINDEX_D;
|
return LPC_USB[rhport]->FRINDEX_D >> 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
Loading…
x
Reference in New Issue
Block a user