USB Device Personal Healthcare Device Class (PHDC) interface.
Copyright (c) 2009-2018 Microchip Technology Inc. and its subsidiaries.
#include "conf_usb.h"
#include "usb_protocol.h"
#include "usb_protocol_phdc.h"
#include "udd.h"
#include "udc.h"
#include "udi_phdc.h"
#include <string.h>
Functions | |
void | udi_phdc_disable (void) |
bool | udi_phdc_enable (void) |
uint8_t | udi_phdc_getsetting (void) |
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_setup (void) |
bool | udi_phdc_waitdata (udi_phdc_metadata_t *metadata, void(*callback)(bool, uint16_t)) |
Wait metadata from USB host. More... | |
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... | |
Variables | |
UDC_DESC_STORAGE udi_api_t | udi_api_phdc |
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 |
bool b_preample_run |
bool b_run |
Referenced by usart_getdata_xmd().
void(* callback)(bool, uint16_t) |
Referenced by AckStatusCallback(), addToAckWaitList(), dma_register_callback(), extint_register_callback(), HandleExpiredResponseCallbacks(), http_client_register_callback(), http_socket_get(), http_socket_post(), i2c_master_register_callback(), i2c_slave_register_callback(), mqtt_register_callback(), nbr_table_allocate(), nbr_table_register(), rtc_calendar_register_callback(), shadow_delta_callback(), sw_timer_register_callback(), sw_timer_service(), udd_ep_run(), udd_ep_wait_stall_clear(), udi_msc_trans_block(), udi_phdc_senddata(), udi_phdc_waitdata(), uhc_enable_timeout_callback(), uhd_ep_run(), uhd_send_reset(), uhi_msc_reset_endpoint(), uhi_msc_scsi(), uhi_msc_scsi_inquiry(), uhi_msc_scsi_mode_sense6(), uhi_msc_scsi_read_10(), uhi_msc_scsi_read_capacity(), uhi_msc_scsi_request_sense(), uhi_msc_scsi_test_unit_ready(), uhi_msc_scsi_write_10(), and wdt_register_callback().
void* cntx |
udi_phdc_metadata_t* metadata |
Referenced by packet_sent(), send_packet(), udi_phdc_senddata(), and udi_phdc_waitdata().
uint16_t metadata_pos |
usb_phdc_metadata_msg_t preample_header |
Referenced by udi_phdc_received_preample(), and udi_phdc_send_preamplemsg().
uint8_t preample_opaque_data[UDI_PHDC_EP_SIZE_BULK_OUT-sizeof(usb_phdc_metadata_msg_t)] |