Class internal implementation.
Functions | |
bool | udi_phdc_senddata (udi_phdc_metadata_t *metadata, void(*callback)(uint16_t)) |
Send metadata to USB host. More... | |
void | udi_phdc_senddata_abort (void) |
Abort of send metadata to USB host. More... | |
bool | udi_phdc_waitdata (udi_phdc_metadata_t *metadata, void(*callback)(bool, uint16_t)) |
Wait metadata from USB host. More... | |
Internal variables to manage PHDC | |
static COMPILER_WORD_ALIGNED le16_t | udi_phdc_holding_data |
struct { | |
bool b_preample_run | |
bool b_run | |
void(* callback )(uint16_t) | |
void * cntx | |
udi_phdc_metadata_t * metadata | |
uint16_t metadata_pos | |
} | udi_phdc_in_trans |
struct { | |
bool b_preample_run | |
bool b_run | |
void(* callback )(bool, uint16_t) | |
void * cntx | |
udi_phdc_metadata_t * metadata | |
uint16_t metadata_pos | |
} | udi_phdc_out_trans |
Internal routines | |
static bool | udi_phdc_send_metadata (void) |
This function sends a metadata. More... | |
static void | udi_phdc_metadata_ack (udd_ep_status_t status, iram_size_t nb_send, udd_ep_id_t ep) |
Callback called when metadata is sent. More... | |
static bool | udi_phdc_wait_metadata (uint8_t bNumTransfers) |
This function request metadata. More... | |
static void | udi_phdc_received_metadata (udd_ep_status_t status, iram_size_t nb_received, udd_ep_id_t ep) |
Callback called when metadata is received. More... | |
static void | udi_phdc_abort_all_transfers_ongoing (void) |
Aborts all PHDC transfers on-going or pending. More... | |
|
static |
Aborts all PHDC transfers on-going or pending.
References udd_ep_abort(), UDI_PHDC_EP_BULK_IN, UDI_PHDC_EP_BULK_OUT, UDI_PHDC_EP_INTERRUPT_IN, udi_phdc_holding_data, udi_phdc_in_trans, udi_phdc_out_trans, and USB_PHDC_QOS_LOW_GOOD.
Referenced by udi_phdc_disable(), and udi_phdc_setup().
|
static |
Callback called when metadata is sent.
status | Transfer state (UDD_EP_TRANSFER_ABORT/_OK) |
nb_send | Number of data sent |
References cpu_to_le16, UDI_PHDC_EP_BULK_IN, UDI_PHDC_EP_INTERRUPT_IN, udi_phdc_holding_data, udi_phdc_in_trans, USB_EP_ADDR_MASK, and USB_PHDC_QOS_LOW_GOOD.
Referenced by udi_phdc_send_metadata().
|
static |
Callback called when metadata is received.
status | Transfer state (UDD_EP_TRANSFER_ABORT/_OK) |
nb_received | Number of data received |
References UDD_EP_TRANSFER_OK, and udi_phdc_out_trans.
Referenced by udi_phdc_wait_metadata().
|
static |
This function sends a metadata.
true | when success |
References cpu_to_le16, udi_phdc_metadata_t::metadata_size, udd_ep_run(), UDI_PHDC_EP_BULK_IN, UDI_PHDC_EP_INTERRUPT_IN, udi_phdc_holding_data, udi_phdc_in_trans, udi_phdc_metadata_ack(), USB_EP_ADDR_MASK, and USB_PHDC_QOS_LOW_GOOD.
Referenced by udi_phdc_senddata().
bool udi_phdc_senddata | ( | udi_phdc_metadata_t * | metadata, |
void(*)(uint16_t) | callback | ||
) |
Send metadata to USB host.
metadata | Information about metadata to send |
callback | Function to call at the end of transfer. |
1
if function was successfully done, otherwise 0
. References callback, cpu_irq_restore(), cpu_irq_save(), metadata, udi_phdc_metadata_t::qos, udi_phdc_in_trans, UDI_PHDC_QOS_IN, udi_phdc_send_metadata(), and USB_PHDC_QOS_LOW_GOOD.
Referenced by ieee11073_decode_metadata(), ieee11073_send_association(), and ieee11073_send_mesure().
void udi_phdc_senddata_abort | ( | void | ) |
Abort of send metadata to USB host.
References udd_ep_abort(), UDI_PHDC_EP_BULK_IN, UDI_PHDC_EP_INTERRUPT_IN, udi_phdc_in_trans, and USB_PHDC_QOS_LOW_GOOD.
|
static |
This function request metadata.
true | when success |
References Assert, udd_ep_run(), UDI_PHDC_EP_BULK_OUT, UDI_PHDC_EP_SIZE_BULK_OUT, udi_phdc_out_trans, and udi_phdc_received_metadata().
Referenced by udi_phdc_waitdata().
bool udi_phdc_waitdata | ( | udi_phdc_metadata_t * | metadata, |
void(*)(bool, uint16_t) | callback | ||
) |
Wait metadata from USB host.
metadata | Information about expected metadata |
callback | Function to call at the end of transfer. |
1
if function was successfully done, otherwise 0
. References callback, cpu_irq_restore(), cpu_irq_save(), metadata, UDI_PHDC_EP_SIZE_BULK_OUT, udi_phdc_out_trans, UDI_PHDC_QOS_OUT, and udi_phdc_wait_metadata().
Referenced by ieee11073_enable_reception().
bool { ... } b_preample_run |
bool { ... } b_preample_run |
bool { ... } b_run |
bool { ... } b_run |
void(* { ... } callback)(uint16_t) |
void(* { ... } callback)(bool, uint16_t) |
void* { ... } cntx |
void* { ... } cntx |
udi_phdc_metadata_t* { ... } metadata |
udi_phdc_metadata_t* { ... } metadata |
uint16_t { ... } metadata_pos |
uint16_t { ... } metadata_pos |
|
static |
struct { ... } udi_phdc_in_trans |
struct { ... } udi_phdc_out_trans |