USBD_PHDC_IsConn

Description

Get PHDC connection state.

Files

usbd_phdc.h / usbd_phdc.c

Prototype

CPU_BOOLEAN  USBD_PHDC_IsConn (CPU_INT08U  class_nbr);


Arguments

class_nbr

PHDC instance number.

Returned Value

DEF_YES, if PHDC is connected.

DEF_NO, otherwise.

Callers

Application.

Notes / Warnings

USBD_PHDC_IsConn() is typically used to verify that the device is in ‘configured’ state and that the PHDC instance is ready for communication. The following code illustrates a typical example:


CPU_BOOLEAN  conn;
 
conn = USBD_PHDC_IsConn(class_nbr);
while (conn != DEF_YES) {
    OSTimeDlyHMSM(0, 0, 0, 250);
 
    conn = USBD_PHDC_IsConn(class_nbr);
}


Once the connected status is DEF_YES, the communication can start.