rename bit_* helper to tu_bit_*, BIT_* to TU_BIT_* for consistency
This commit is contained in:
@@ -64,20 +64,20 @@ enum {
|
||||
};
|
||||
|
||||
enum {
|
||||
INT_SOF_MASK = BIT_(30),
|
||||
INT_DEVICE_STATUS_MASK = BIT_(31)
|
||||
INT_SOF_MASK = TU_BIT(30),
|
||||
INT_DEVICE_STATUS_MASK = TU_BIT(31)
|
||||
};
|
||||
|
||||
enum {
|
||||
CMDSTAT_DEVICE_ADDR_MASK = BIT_(7 )-1,
|
||||
CMDSTAT_DEVICE_ENABLE_MASK = BIT_(7 ),
|
||||
CMDSTAT_SETUP_RECEIVED_MASK = BIT_(8 ),
|
||||
CMDSTAT_DEVICE_CONNECT_MASK = BIT_(16), ///< reflect the softconnect only, does not reflect the actual attached state
|
||||
CMDSTAT_DEVICE_SUSPEND_MASK = BIT_(17),
|
||||
CMDSTAT_CONNECT_CHANGE_MASK = BIT_(24),
|
||||
CMDSTAT_SUSPEND_CHANGE_MASK = BIT_(25),
|
||||
CMDSTAT_RESET_CHANGE_MASK = BIT_(26),
|
||||
CMDSTAT_VBUS_DEBOUNCED_MASK = BIT_(28),
|
||||
CMDSTAT_DEVICE_ADDR_MASK = TU_BIT(7 )-1,
|
||||
CMDSTAT_DEVICE_ENABLE_MASK = TU_BIT(7 ),
|
||||
CMDSTAT_SETUP_RECEIVED_MASK = TU_BIT(8 ),
|
||||
CMDSTAT_DEVICE_CONNECT_MASK = TU_BIT(16), ///< reflect the softconnect only, does not reflect the actual attached state
|
||||
CMDSTAT_DEVICE_SUSPEND_MASK = TU_BIT(17),
|
||||
CMDSTAT_CONNECT_CHANGE_MASK = TU_BIT(24),
|
||||
CMDSTAT_SUSPEND_CHANGE_MASK = TU_BIT(25),
|
||||
CMDSTAT_RESET_CHANGE_MASK = TU_BIT(26),
|
||||
CMDSTAT_VBUS_DEBOUNCED_MASK = TU_BIT(28),
|
||||
};
|
||||
|
||||
typedef struct ATTR_PACKED
|
||||
@@ -237,7 +237,7 @@ bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc)
|
||||
_dcd.ep[ep_id][0].is_iso = (p_endpoint_desc->bmAttributes.xfer == TUSB_XFER_ISOCHRONOUS);
|
||||
|
||||
// Enable EP interrupt
|
||||
LPC_USB->INTEN |= BIT_(ep_id);
|
||||
LPC_USB->INTEN |= TU_BIT(ep_id);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -296,14 +296,14 @@ static void bus_reset(void)
|
||||
|
||||
LPC_USB->INTSTAT = LPC_USB->INTSTAT; // clear all pending interrupt
|
||||
LPC_USB->DEVCMDSTAT |= CMDSTAT_SETUP_RECEIVED_MASK; // clear setup received interrupt
|
||||
LPC_USB->INTEN = INT_DEVICE_STATUS_MASK | BIT_(0) | BIT_(1); // enable device status & control endpoints
|
||||
LPC_USB->INTEN = INT_DEVICE_STATUS_MASK | TU_BIT(0) | TU_BIT(1); // enable device status & control endpoints
|
||||
}
|
||||
|
||||
static void process_xfer_isr(uint32_t int_status)
|
||||
{
|
||||
for(uint8_t ep_id = 0; ep_id < EP_COUNT; ep_id++ )
|
||||
{
|
||||
if ( BIT_TEST_(int_status, ep_id) )
|
||||
if ( TU_BIT_TEST(int_status, ep_id) )
|
||||
{
|
||||
ep_cmd_sts_t * ep_cs = &_dcd.ep[ep_id][0];
|
||||
xfer_dma_t* xfer_dma = &_dcd.dma[ep_id];
|
||||
@@ -378,7 +378,7 @@ void USB_IRQHandler(void)
|
||||
}
|
||||
|
||||
// Setup Receive
|
||||
if ( BIT_TEST_(int_status, 0) && (dev_cmd_stat & CMDSTAT_SETUP_RECEIVED_MASK) )
|
||||
if ( TU_BIT_TEST(int_status, 0) && (dev_cmd_stat & CMDSTAT_SETUP_RECEIVED_MASK) )
|
||||
{
|
||||
// Follow UM flowchart to clear Active & Stall on both Control IN/OUT endpoints
|
||||
_dcd.ep[0][0].active = _dcd.ep[1][0].active = 0;
|
||||
@@ -392,7 +392,7 @@ void USB_IRQHandler(void)
|
||||
_dcd.ep[0][1].buffer_offset = get_buf_offset(_dcd.setup_packet);
|
||||
|
||||
// clear bit0
|
||||
int_status = BIT_CLR_(int_status, 0);
|
||||
int_status = TU_BIT_CLEAR(int_status, 0);
|
||||
}
|
||||
|
||||
// Endpoint transfer complete interrupt
|
||||
|
||||
@@ -148,7 +148,7 @@ static inline uint8_t ep_addr2idx(uint8_t ep_addr)
|
||||
static void set_ep_size(uint8_t ep_id, uint16_t max_packet_size)
|
||||
{
|
||||
// follows example in 11.10.4.2
|
||||
LPC_USB->ReEp |= BIT_(ep_id);
|
||||
LPC_USB->ReEp |= TU_BIT(ep_id);
|
||||
LPC_USB->EpInd = ep_id; // select index before setting packet size
|
||||
LPC_USB->MaxPSize = max_packet_size;
|
||||
|
||||
@@ -419,15 +419,15 @@ bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t* buffer, uint16_t t
|
||||
if ( ep_id % 2 )
|
||||
{
|
||||
// Clear EP interrupt before Enable DMA
|
||||
LPC_USB->EpIntEn &= ~BIT_(ep_id);
|
||||
LPC_USB->EpDMAEn = BIT_(ep_id);
|
||||
LPC_USB->EpIntEn &= ~TU_BIT(ep_id);
|
||||
LPC_USB->EpDMAEn = TU_BIT(ep_id);
|
||||
|
||||
// endpoint IN need to actively raise DMA request
|
||||
LPC_USB->DMARSet = BIT_(ep_id);
|
||||
LPC_USB->DMARSet = TU_BIT(ep_id);
|
||||
}else
|
||||
{
|
||||
// Enable DMA
|
||||
LPC_USB->EpDMAEn = BIT_(ep_id);
|
||||
LPC_USB->EpDMAEn = TU_BIT(ep_id);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -442,11 +442,11 @@ bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t* buffer, uint16_t t
|
||||
static void control_xfer_isr(uint8_t rhport, uint32_t ep_int_status)
|
||||
{
|
||||
// Control out complete
|
||||
if ( ep_int_status & BIT_(0) )
|
||||
if ( ep_int_status & TU_BIT(0) )
|
||||
{
|
||||
bool is_setup = sie_read(SIE_CMDCODE_ENDPOINT_SELECT+0) & SIE_SELECT_ENDPOINT_SETUP_RECEIVED_MASK;
|
||||
|
||||
LPC_USB->EpIntClr = BIT_(0);
|
||||
LPC_USB->EpIntClr = TU_BIT(0);
|
||||
|
||||
if (is_setup)
|
||||
{
|
||||
@@ -472,9 +472,9 @@ static void control_xfer_isr(uint8_t rhport, uint32_t ep_int_status)
|
||||
}
|
||||
|
||||
// Control In complete
|
||||
if ( ep_int_status & BIT_(1) )
|
||||
if ( ep_int_status & TU_BIT(1) )
|
||||
{
|
||||
LPC_USB->EpIntClr = BIT_(1);
|
||||
LPC_USB->EpIntClr = TU_BIT(1);
|
||||
dcd_event_xfer_complete(rhport, TUSB_DIR_IN_MASK, _dcd.control.in_bytes, XFER_RESULT_SUCCESS, true);
|
||||
}
|
||||
}
|
||||
@@ -546,12 +546,12 @@ void hal_dcd_isr(uint8_t rhport)
|
||||
{
|
||||
for ( uint8_t ep_id = 3; ep_id < DCD_ENDPOINT_MAX; ep_id += 2 )
|
||||
{
|
||||
if ( BIT_TEST_(ep_int_status, ep_id) )
|
||||
if ( TU_BIT_TEST(ep_int_status, ep_id) )
|
||||
{
|
||||
LPC_USB->EpIntClr = BIT_(ep_id);
|
||||
LPC_USB->EpIntClr = TU_BIT(ep_id);
|
||||
|
||||
// Clear Ep interrupt for next DMA
|
||||
LPC_USB->EpIntEn &= ~BIT_(ep_id);
|
||||
LPC_USB->EpIntEn &= ~TU_BIT(ep_id);
|
||||
|
||||
dd_complete_isr(rhport, ep_id);
|
||||
}
|
||||
@@ -569,12 +569,12 @@ void hal_dcd_isr(uint8_t rhport)
|
||||
|
||||
for ( uint8_t ep_id = 2; ep_id < DCD_ENDPOINT_MAX; ep_id++ )
|
||||
{
|
||||
if ( BIT_TEST_(eot, ep_id) )
|
||||
if ( TU_BIT_TEST(eot, ep_id) )
|
||||
{
|
||||
if ( ep_id & 0x01 )
|
||||
{
|
||||
// IN enable EpInt for end of usb transfer
|
||||
LPC_USB->EpIntEn |= BIT_(ep_id);
|
||||
LPC_USB->EpIntEn |= TU_BIT(ep_id);
|
||||
}else
|
||||
{
|
||||
// OUT
|
||||
|
||||
@@ -51,45 +51,45 @@
|
||||
|
||||
//------------- USB Interrupt USBIntSt -------------//
|
||||
//enum {
|
||||
// DCD_USB_REQ_LOW_PRIO_MASK = BIT_(0),
|
||||
// DCD_USB_REQ_HIGH_PRIO_MASK = BIT_(1),
|
||||
// DCD_USB_REQ_DMA_MASK = BIT_(2),
|
||||
// DCD_USB_REQ_NEED_CLOCK_MASK = BIT_(8),
|
||||
// DCD_USB_REQ_ENABLE_MASK = BIT_(31)
|
||||
// DCD_USB_REQ_LOW_PRIO_MASK = TU_BIT(0),
|
||||
// DCD_USB_REQ_HIGH_PRIO_MASK = TU_BIT(1),
|
||||
// DCD_USB_REQ_DMA_MASK = TU_BIT(2),
|
||||
// DCD_USB_REQ_NEED_CLOCK_MASK = TU_BIT(8),
|
||||
// DCD_USB_REQ_ENABLE_MASK = TU_BIT(31)
|
||||
//};
|
||||
|
||||
//------------- Device Interrupt USBDevInt -------------//
|
||||
enum {
|
||||
DEV_INT_FRAME_MASK = BIT_(0),
|
||||
DEV_INT_ENDPOINT_FAST_MASK = BIT_(1),
|
||||
DEV_INT_ENDPOINT_SLOW_MASK = BIT_(2),
|
||||
DEV_INT_DEVICE_STATUS_MASK = BIT_(3),
|
||||
DEV_INT_COMMAND_CODE_EMPTY_MASK = BIT_(4),
|
||||
DEV_INT_COMMAND_DATA_FULL_MASK = BIT_(5),
|
||||
DEV_INT_RX_ENDPOINT_PACKET_MASK = BIT_(6),
|
||||
DEV_INT_TX_ENDPOINT_PACKET_MASK = BIT_(7),
|
||||
DEV_INT_ENDPOINT_REALIZED_MASK = BIT_(8),
|
||||
DEV_INT_ERROR_MASK = BIT_(9)
|
||||
DEV_INT_FRAME_MASK = TU_BIT(0),
|
||||
DEV_INT_ENDPOINT_FAST_MASK = TU_BIT(1),
|
||||
DEV_INT_ENDPOINT_SLOW_MASK = TU_BIT(2),
|
||||
DEV_INT_DEVICE_STATUS_MASK = TU_BIT(3),
|
||||
DEV_INT_COMMAND_CODE_EMPTY_MASK = TU_BIT(4),
|
||||
DEV_INT_COMMAND_DATA_FULL_MASK = TU_BIT(5),
|
||||
DEV_INT_RX_ENDPOINT_PACKET_MASK = TU_BIT(6),
|
||||
DEV_INT_TX_ENDPOINT_PACKET_MASK = TU_BIT(7),
|
||||
DEV_INT_ENDPOINT_REALIZED_MASK = TU_BIT(8),
|
||||
DEV_INT_ERROR_MASK = TU_BIT(9)
|
||||
};
|
||||
|
||||
//------------- DMA Interrupt USBDMAInt-------------//
|
||||
enum {
|
||||
DMA_INT_END_OF_XFER_MASK = BIT_(0),
|
||||
DMA_INT_NEW_DD_REQUEST_MASK = BIT_(1),
|
||||
DMA_INT_ERROR_MASK = BIT_(2)
|
||||
DMA_INT_END_OF_XFER_MASK = TU_BIT(0),
|
||||
DMA_INT_NEW_DD_REQUEST_MASK = TU_BIT(1),
|
||||
DMA_INT_ERROR_MASK = TU_BIT(2)
|
||||
};
|
||||
|
||||
//------------- USBCtrl -------------//
|
||||
enum {
|
||||
USBCTRL_READ_ENABLE_MASK = BIT_(0),
|
||||
USBCTRL_WRITE_ENABLE_MASK = BIT_(1),
|
||||
USBCTRL_READ_ENABLE_MASK = TU_BIT(0),
|
||||
USBCTRL_WRITE_ENABLE_MASK = TU_BIT(1),
|
||||
};
|
||||
|
||||
//------------- USBRxPLen -------------//
|
||||
enum {
|
||||
USBRXPLEN_PACKET_LENGTH_MASK = (BIT_(10)-1),
|
||||
USBRXPLEN_DATA_VALID_MASK = BIT_(10),
|
||||
USBRXPLEN_PACKET_READY_MASK = BIT_(11),
|
||||
USBRXPLEN_PACKET_LENGTH_MASK = (TU_BIT(10)-1),
|
||||
USBRXPLEN_DATA_VALID_MASK = TU_BIT(10),
|
||||
USBRXPLEN_PACKET_READY_MASK = TU_BIT(11),
|
||||
};
|
||||
|
||||
//------------- SIE Command Code -------------//
|
||||
@@ -121,30 +121,30 @@ enum {
|
||||
|
||||
//------------- SIE Device Status (get/set from SIE_CMDCODE_DEVICE_STATUS) -------------//
|
||||
enum {
|
||||
SIE_DEV_STATUS_CONNECT_STATUS_MASK = BIT_(0),
|
||||
SIE_DEV_STATUS_CONNECT_CHANGE_MASK = BIT_(1),
|
||||
SIE_DEV_STATUS_SUSPEND_MASK = BIT_(2),
|
||||
SIE_DEV_STATUS_SUSPEND_CHANGE_MASK = BIT_(3),
|
||||
SIE_DEV_STATUS_RESET_MASK = BIT_(4)
|
||||
SIE_DEV_STATUS_CONNECT_STATUS_MASK = TU_BIT(0),
|
||||
SIE_DEV_STATUS_CONNECT_CHANGE_MASK = TU_BIT(1),
|
||||
SIE_DEV_STATUS_SUSPEND_MASK = TU_BIT(2),
|
||||
SIE_DEV_STATUS_SUSPEND_CHANGE_MASK = TU_BIT(3),
|
||||
SIE_DEV_STATUS_RESET_MASK = TU_BIT(4)
|
||||
};
|
||||
|
||||
//------------- SIE Select Endpoint Command -------------//
|
||||
enum {
|
||||
SIE_SELECT_ENDPOINT_FULL_EMPTY_MASK = BIT_(0), // 0: empty, 1 full. IN endpoint checks empty, OUT endpoint check full
|
||||
SIE_SELECT_ENDPOINT_STALL_MASK = BIT_(1),
|
||||
SIE_SELECT_ENDPOINT_SETUP_RECEIVED_MASK = BIT_(2), // clear by SIE_CMDCODE_ENDPOINT_SELECT_CLEAR_INTERRUPT
|
||||
SIE_SELECT_ENDPOINT_PACKET_OVERWRITTEN_MASK = BIT_(3), // previous packet is overwritten by a SETUP packet
|
||||
SIE_SELECT_ENDPOINT_NAK_MASK = BIT_(4), // last packet response is NAK (auto clear by an ACK)
|
||||
SIE_SELECT_ENDPOINT_BUFFER1_FULL_MASK = BIT_(5),
|
||||
SIE_SELECT_ENDPOINT_BUFFER2_FULL_MASK = BIT_(6)
|
||||
SIE_SELECT_ENDPOINT_FULL_EMPTY_MASK = TU_BIT(0), // 0: empty, 1 full. IN endpoint checks empty, OUT endpoint check full
|
||||
SIE_SELECT_ENDPOINT_STALL_MASK = TU_BIT(1),
|
||||
SIE_SELECT_ENDPOINT_SETUP_RECEIVED_MASK = TU_BIT(2), // clear by SIE_CMDCODE_ENDPOINT_SELECT_CLEAR_INTERRUPT
|
||||
SIE_SELECT_ENDPOINT_PACKET_OVERWRITTEN_MASK = TU_BIT(3), // previous packet is overwritten by a SETUP packet
|
||||
SIE_SELECT_ENDPOINT_NAK_MASK = TU_BIT(4), // last packet response is NAK (auto clear by an ACK)
|
||||
SIE_SELECT_ENDPOINT_BUFFER1_FULL_MASK = TU_BIT(5),
|
||||
SIE_SELECT_ENDPOINT_BUFFER2_FULL_MASK = TU_BIT(6)
|
||||
};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SIE_SET_ENDPOINT_STALLED_MASK = BIT_(0),
|
||||
SIE_SET_ENDPOINT_DISABLED_MASK = BIT_(5),
|
||||
SIE_SET_ENDPOINT_RATE_FEEDBACK_MASK = BIT_(6),
|
||||
SIE_SET_ENDPOINT_CONDITION_STALLED_MASK = BIT_(7),
|
||||
SIE_SET_ENDPOINT_STALLED_MASK = TU_BIT(0),
|
||||
SIE_SET_ENDPOINT_DISABLED_MASK = TU_BIT(5),
|
||||
SIE_SET_ENDPOINT_RATE_FEEDBACK_MASK = TU_BIT(6),
|
||||
SIE_SET_ENDPOINT_CONDITION_STALLED_MASK = TU_BIT(7),
|
||||
}sie_endpoint_set_status_mask_t;
|
||||
|
||||
//------------- DMA Descriptor Status -------------//
|
||||
|
||||
@@ -94,7 +94,7 @@ static dcd_data_t* const dcd_data_ptr[2] =
|
||||
//--------------------------------------------------------------------+
|
||||
void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
|
||||
{
|
||||
LPC_USB[rhport]->DEVICEADDR = (dev_addr << 25) | BIT_(24);
|
||||
LPC_USB[rhport]->DEVICEADDR = (dev_addr << 25) | TU_BIT(24);
|
||||
}
|
||||
|
||||
void dcd_set_config(uint8_t rhport, uint8_t config_num)
|
||||
@@ -158,7 +158,7 @@ bool dcd_init(uint8_t rhport)
|
||||
lpc_usb->USBINTR_D = INT_MASK_USB | INT_MASK_ERROR | INT_MASK_PORT_CHANGE | INT_MASK_RESET | INT_MASK_SUSPEND | INT_MASK_SOF;
|
||||
|
||||
lpc_usb->USBCMD_D &= ~0x00FF0000; // Interrupt Threshold Interval = 0
|
||||
lpc_usb->USBCMD_D |= BIT_(0); // connect
|
||||
lpc_usb->USBCMD_D |= TU_BIT(0); // connect
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -284,7 +284,7 @@ bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t t
|
||||
{
|
||||
// follows UM 24.10.8.1.1 Setup packet handling using setup lockout mechanism
|
||||
// wait until ENDPTSETUPSTAT before priming data/status in response TODO add time out
|
||||
while(LPC_USB[rhport]->ENDPTSETUPSTAT & BIT_(0)) {}
|
||||
while(LPC_USB[rhport]->ENDPTSETUPSTAT & TU_BIT(0)) {}
|
||||
}
|
||||
|
||||
dcd_qhd_t * p_qhd = &dcd_data_ptr[rhport]->qhd[ep_idx];
|
||||
@@ -296,7 +296,7 @@ bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t t
|
||||
p_qhd->qtd_overlay.next = (uint32_t) p_qtd; // link qtd to qhd
|
||||
|
||||
// start transfer
|
||||
LPC_USB[rhport]->ENDPTPRIME = BIT_( ep_idx2bit(ep_idx) ) ;
|
||||
LPC_USB[rhport]->ENDPTPRIME = TU_BIT( ep_idx2bit(ep_idx) ) ;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -363,7 +363,7 @@ void hal_dcd_isr(uint8_t rhport)
|
||||
{
|
||||
for(uint8_t ep_idx = 0; ep_idx < QHD_MAX; ep_idx++)
|
||||
{
|
||||
if ( BIT_TEST_(edpt_complete, ep_idx2bit(ep_idx)) )
|
||||
if ( TU_BIT_TEST(edpt_complete, ep_idx2bit(ep_idx)) )
|
||||
{
|
||||
// 23.10.12.3 Failed QTD also get ENDPTCOMPLETE set
|
||||
dcd_qtd_t * p_qtd = &dcd_data_ptr[rhport]->qtd[ep_idx];
|
||||
|
||||
@@ -55,37 +55,37 @@
|
||||
|
||||
/*---------- ENDPTCTRL ----------*/
|
||||
enum {
|
||||
ENDPTCTRL_MASK_STALL = BIT_(0),
|
||||
ENDPTCTRL_MASK_TOGGLE_INHIBIT = BIT_(5), ///< used for test only
|
||||
ENDPTCTRL_MASK_TOGGLE_RESET = BIT_(6),
|
||||
ENDPTCTRL_MASK_ENABLE = BIT_(7)
|
||||
ENDPTCTRL_MASK_STALL = TU_BIT(0),
|
||||
ENDPTCTRL_MASK_TOGGLE_INHIBIT = TU_BIT(5), ///< used for test only
|
||||
ENDPTCTRL_MASK_TOGGLE_RESET = TU_BIT(6),
|
||||
ENDPTCTRL_MASK_ENABLE = TU_BIT(7)
|
||||
};
|
||||
|
||||
/*---------- USBCMD ----------*/
|
||||
enum {
|
||||
USBCMD_MASK_RUN_STOP = BIT_(0),
|
||||
USBCMD_MASK_RESET = BIT_(1),
|
||||
USBCMD_MASK_SETUP_TRIPWIRE = BIT_(13),
|
||||
USBCMD_MASK_ADD_QTD_TRIPWIRE = BIT_(14) ///< This bit is used as a semaphore to ensure the to proper addition of a new dTD to an active (primed) endpoint’s linked list. This bit is set and cleared by software during the process of adding a new dTD
|
||||
USBCMD_MASK_RUN_STOP = TU_BIT(0),
|
||||
USBCMD_MASK_RESET = TU_BIT(1),
|
||||
USBCMD_MASK_SETUP_TRIPWIRE = TU_BIT(13),
|
||||
USBCMD_MASK_ADD_QTD_TRIPWIRE = TU_BIT(14) ///< This bit is used as a semaphore to ensure the to proper addition of a new dTD to an active (primed) endpoint’s linked list. This bit is set and cleared by software during the process of adding a new dTD
|
||||
};
|
||||
// Interrupt Threshold bit 23:16
|
||||
|
||||
/*---------- USBSTS, USBINTR ----------*/
|
||||
enum {
|
||||
INT_MASK_USB = BIT_(0),
|
||||
INT_MASK_ERROR = BIT_(1),
|
||||
INT_MASK_PORT_CHANGE = BIT_(2),
|
||||
INT_MASK_RESET = BIT_(6),
|
||||
INT_MASK_SOF = BIT_(7),
|
||||
INT_MASK_SUSPEND = BIT_(8),
|
||||
INT_MASK_NAK = BIT_(16)
|
||||
INT_MASK_USB = TU_BIT(0),
|
||||
INT_MASK_ERROR = TU_BIT(1),
|
||||
INT_MASK_PORT_CHANGE = TU_BIT(2),
|
||||
INT_MASK_RESET = TU_BIT(6),
|
||||
INT_MASK_SOF = TU_BIT(7),
|
||||
INT_MASK_SUSPEND = TU_BIT(8),
|
||||
INT_MASK_NAK = TU_BIT(16)
|
||||
};
|
||||
|
||||
//------------- PORTSC -------------//
|
||||
enum {
|
||||
PORTSC_CURRENT_CONNECT_STATUS_MASK = BIT_(0),
|
||||
PORTSC_FORCE_PORT_RESUME_MASK = BIT_(6),
|
||||
PORTSC_SUSPEND_MASK = BIT_(7)
|
||||
PORTSC_CURRENT_CONNECT_STATUS_MASK = TU_BIT(0),
|
||||
PORTSC_FORCE_PORT_RESUME_MASK = TU_BIT(6),
|
||||
PORTSC_SUSPEND_MASK = TU_BIT(7)
|
||||
};
|
||||
|
||||
typedef struct
|
||||
|
||||
Reference in New Issue
Block a user