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 |
static uint8_t | udi_phdc_preample_feature |
struct { | |
bool b_preample_run | |
bool b_run | |
void(* callback )(uint16_t) | |
void * cntx | |
udi_phdc_metadata_t * metadata | |
uint16_t metadata_pos | |
usb_phdc_metadata_msg_t preample_header | |
uint8_t preample_opaque_data [UDI_PHDC_EP_SIZE_BULK_IN-sizeof(usb_phdc_metadata_msg_t)] | |
} | 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 | |
usb_phdc_metadata_msg_t preample_header | |
uint8_t preample_opaque_data [UDI_PHDC_EP_SIZE_BULK_OUT-sizeof(usb_phdc_metadata_msg_t)] | |
} | udi_phdc_out_trans |
Internal routines | |
static bool | udi_phdc_send_preamplemsg (void) |
This function sends a preample message. More... | |
static void | udi_phdc_preamplemsg_ack (udd_ep_status_t status, iram_size_t nb_send, udd_ep_id_t ep) |
Callback called when preample message is sent. More... | |
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_preamplemsg (void) |
This function requests a preample message. More... | |
static void | udi_phdc_received_preample (udd_ep_status_t status, iram_size_t nb_received, udd_ep_id_t ep) |
Callback called when metadata is received. 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, udi_phdc_preample_feature, 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 preample message is sent.
status | Transfer state (UDD_EP_TRANSFER_ABORT/_OK) |
nb_send | Number of data sent |
References cpu_to_le16, UDD_EP_TRANSFER_ABORT, UDI_PHDC_EP_SIZE_BULK_IN, udi_phdc_holding_data, udi_phdc_in_trans, udi_phdc_send_metadata(), and USB_EP_ADDR_MASK.
Referenced by udi_phdc_send_preamplemsg().
|
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 |
Callback called when metadata is received.
status | Transfer state (UDD_EP_TRANSFER_ABORT/_OK) |
nb_received | Number of data received |
References usb_phdc_metadata_msg_t::bmLatencyReliability, METADATA_MESSAGE_SIG, preample_header, udd_ep_set_halt(), UDD_EP_TRANSFER_ABORT, UDI_PHDC_EP_BULK_OUT, UDI_PHDC_EP_SIZE_BULK_OUT, udi_phdc_out_trans, UDI_PHDC_QOS_OUT, udi_phdc_wait_metadata(), and USB_PHDC_QOS_ENCODING_VERSION_1.
Referenced by udi_phdc_wait_preamplemsg().
|
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_preamplemsg_ack(), and udi_phdc_senddata().
|
static |
This function sends a preample message.
true | when success |
References usb_phdc_metadata_msg_t::bOpaqueDataSize, cpu_to_le16, preample_header, udd_ep_run(), UDI_PHDC_EP_BULK_IN, UDI_PHDC_EP_SIZE_BULK_IN, udi_phdc_holding_data, udi_phdc_in_trans, udi_phdc_preamplemsg_ack(), and USB_EP_ADDR_MASK.
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_preample_feature, UDI_PHDC_QOS_IN, udi_phdc_send_metadata(), udi_phdc_send_preamplemsg(), 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_received_preample(), and udi_phdc_waitdata().
|
static |
This function requests a preample message.
true | when success |
References udd_ep_run(), UDI_PHDC_EP_BULK_OUT, UDI_PHDC_EP_SIZE_BULK_OUT, udi_phdc_out_trans, and udi_phdc_received_preample().
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_preample_feature, UDI_PHDC_QOS_OUT, udi_phdc_wait_metadata(), and udi_phdc_wait_preamplemsg().
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 |
usb_phdc_metadata_msg_t { ... } preample_header |
usb_phdc_metadata_msg_t { ... } preample_header |
uint8_t { ... } preample_opaque_data[UDI_PHDC_EP_SIZE_BULK_IN-sizeof(usb_phdc_metadata_msg_t)] |
uint8_t { ... } preample_opaque_data[UDI_PHDC_EP_SIZE_BULK_OUT-sizeof(usb_phdc_metadata_msg_t)] |
|
static |
struct { ... } udi_phdc_in_trans |
struct { ... } udi_phdc_out_trans |
|
static |
Referenced by udi_phdc_abort_all_transfers_ongoing(), udi_phdc_enable(), udi_phdc_senddata(), and udi_phdc_waitdata().