![]() |
PDL for FM4
Version1.2
Peripheral Driverl Library for FM4
|
Data Structures | |
| struct | stc_cdc_linecoding |
Typedefs | |
| typedef void(* | cdc_data_received_t )(uint8_t *pu8Data, uint32_t u32ReceviedSize) |
| typedef void(* | cdc_data_sent_t )(void) |
| typedef struct stc_cdc_linecoding | stc_cdc_linecoding_t |
| typedef void(* | usbdevicecdccom_linecodingchange_func_ptr_t )(stc_cdc_linecoding_t *pstcLineCoding) |
Provided functions of USB module:
Emulates UART routines for USB virtual com port
| #define CLEAR_COMM_FEATURE 0x04 |
Definition at line 134 of file UsbDeviceCdcCom.h.
| #define CLEAR_UNIT_PARAMETER 0x39 |
Definition at line 154 of file UsbDeviceCdcCom.h.
| #define DEC 0 |
Definition at line 167 of file UsbDeviceCdcCom.h.
Referenced by UsbDeviceCdcCom_SendBinAsci4(), and UsbDeviceCdcCom_SendBinAsci8().
| #define DIAL_DIGITS 0x36 |
Definition at line 151 of file UsbDeviceCdcCom.h.
| #define GET_ATM_DEVICE_STATISTICS 0x51 |
Definition at line 162 of file UsbDeviceCdcCom.h.
| #define GET_ATM_VC_STATISTICS 0x53 |
Definition at line 164 of file UsbDeviceCdcCom.h.
| #define GET_COMM_FEATURE 0x03 |
Definition at line 133 of file UsbDeviceCdcCom.h.
| #define GET_ENCAPSULATED_RESPONSE 0x01 |
Definition at line 131 of file UsbDeviceCdcCom.h.
| #define GET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER 0x42 |
Definition at line 158 of file UsbDeviceCdcCom.h.
| #define GET_ETHERNET_STATISTIC 0x44 |
Definition at line 160 of file UsbDeviceCdcCom.h.
| #define GET_LINE_CODING 0x21 |
Definition at line 142 of file UsbDeviceCdcCom.h.
Referenced by DecodeSetupRequest().
| #define GET_LINE_PARMS 0x35 |
Definition at line 150 of file UsbDeviceCdcCom.h.
| #define GET_OPERATION_PARMS 0x33 |
Definition at line 148 of file UsbDeviceCdcCom.h.
| #define GET_PROFILE 0x3A |
Definition at line 155 of file UsbDeviceCdcCom.h.
| #define GET_RINGER_PARMS 0x31 |
Definition at line 146 of file UsbDeviceCdcCom.h.
| #define GET_UNIT_PARAMETER 0x38 |
Definition at line 153 of file UsbDeviceCdcCom.h.
| #define HEX 1 |
Definition at line 168 of file UsbDeviceCdcCom.h.
Referenced by UsbDeviceCdcCom_SendBinAsci4(), and UsbDeviceCdcCom_SendBinAsci8().
| #define PULSE_SETUP 0x12 |
Definition at line 137 of file UsbDeviceCdcCom.h.
| #define RING_AUX_JACK 0x15 |
Definition at line 140 of file UsbDeviceCdcCom.h.
| #define SEND_BREAK 0x23 |
Definition at line 144 of file UsbDeviceCdcCom.h.
| #define SEND_ENCAPSULATED_COMMAND 0x00 |
Definition at line 130 of file UsbDeviceCdcCom.h.
| #define SEND_PULSE 0x13 |
Definition at line 138 of file UsbDeviceCdcCom.h.
| #define SET_ATM_DATA_FORMAT 0x50 |
Definition at line 161 of file UsbDeviceCdcCom.h.
| #define SET_ATM_DEFAULT_VC 0x52 |
Definition at line 163 of file UsbDeviceCdcCom.h.
| #define SET_AUX_LINE_STATE 0x10 |
Definition at line 135 of file UsbDeviceCdcCom.h.
| #define SET_COMM_FEATURE 0x02 |
Definition at line 132 of file UsbDeviceCdcCom.h.
| #define SET_CONTROL_LINE_STATE 0x22 |
Definition at line 143 of file UsbDeviceCdcCom.h.
Referenced by DecodeSetupRequest().
| #define SET_ETHERNET_MULTICAST_FILTERS 0x40 |
Definition at line 156 of file UsbDeviceCdcCom.h.
| #define SET_ETHERNET_PACKET_FILTER 0x43 |
Definition at line 159 of file UsbDeviceCdcCom.h.
| #define SET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER 0x41 |
Definition at line 157 of file UsbDeviceCdcCom.h.
| #define SET_HOOK_STATE 0x11 |
Definition at line 136 of file UsbDeviceCdcCom.h.
| #define SET_LINE_CODING 0x20 |
Definition at line 141 of file UsbDeviceCdcCom.h.
Referenced by DecodeSetupRequest().
| #define SET_LINE_PARMS 0x34 |
Definition at line 149 of file UsbDeviceCdcCom.h.
| #define SET_OPERATION_PARMS 0x32 |
Definition at line 147 of file UsbDeviceCdcCom.h.
| #define SET_PULSE_TIME 0x14 |
Definition at line 139 of file UsbDeviceCdcCom.h.
| #define SET_RINGER_PARMS 0x30 |
Definition at line 145 of file UsbDeviceCdcCom.h.
| #define SET_UNIT_PARAMETER 0x37 |
Definition at line 152 of file UsbDeviceCdcCom.h.
| #define USBCLASSCDC_CHARFORMAT_1_5STOPBIT 1 |
Definition at line 184 of file UsbDeviceCdcCom.h.
| #define USBCLASSCDC_CHARFORMAT_1STOPBIT 0 |
Definition at line 183 of file UsbDeviceCdcCom.h.
| #define USBCLASSCDC_CHARFORMAT_2STOPBIT 2 |
Definition at line 185 of file UsbDeviceCdcCom.h.
| #define USBCLASSCDC_PARITYTYPE_EVEN 2 |
Definition at line 189 of file UsbDeviceCdcCom.h.
| #define USBCLASSCDC_PARITYTYPE_MARK 3 |
Definition at line 190 of file UsbDeviceCdcCom.h.
| #define USBCLASSCDC_PARITYTYPE_NONE 0 |
Definition at line 187 of file UsbDeviceCdcCom.h.
| #define USBCLASSCDC_PARITYTYPE_ODD 1 |
Definition at line 188 of file UsbDeviceCdcCom.h.
| #define USBCLASSCDC_PARITYTYPE_SPACE 4 |
Definition at line 191 of file UsbDeviceCdcCom.h.
| #define USBDEVICECDCCOM_EPOUT_BUFFERSIZE 128 |
Definition at line 123 of file UsbDeviceCdcCom.h.
Referenced by UsbDeviceCdcCom_Init().
| #define USBDEVICECDCCOM_MAX_RECEIVE_BUFFER 512 |
Definition at line 124 of file UsbDeviceCdcCom.h.
Referenced by RxTxCallback().
| #define USBDEVICECDCCOM_USE_UARTCOMMANDS 0 |
Definition at line 126 of file UsbDeviceCdcCom.h.
| typedef void(* cdc_data_received_t)(uint8_t *pu8Data, uint32_t u32ReceviedSize) |
Definition at line 193 of file UsbDeviceCdcCom.h.
| typedef void(* cdc_data_sent_t)(void) |
Definition at line 194 of file UsbDeviceCdcCom.h.
| typedef struct stc_cdc_linecoding stc_cdc_linecoding_t |
| typedef void(* usbdevicecdccom_linecodingchange_func_ptr_t)(stc_cdc_linecoding_t *pstcLineCoding) |
Definition at line 204 of file UsbDeviceCdcCom.h.
| boolean_t UsbDeviceCdcCom_DataSent | ( | void | ) |
Check if data was sent
Definition at line 325 of file UsbDeviceCdcCom.c.
References DataSentFlags, FALSE, and TRUE.
| void UsbDeviceCdcCom_Init | ( | stc_usbn_t * | pstcUsb | ) |
Initialisation callback.
| pstcUsb | Pointer to USB instance |
Definition at line 213 of file UsbDeviceCdcCom.c.
References ConfCallback(), DecodeSetupRequest(), stc_usbdevice_class_config::pfnConfCallback, stc_usbdevice_class_config::pfnConnectionCallback, stc_usbdevice_class_config::pfnDisconnectionCallback, stc_usbdevice_endpoint_config::pfnRxTxCallback, stc_usbdevice_class_config::pfnSetupRequestCallback, stc_usbdevice_endpoint_config::pstcEndpointBuffer, pstcUsbHandle, pu8IngoingBuffer, RxTxCallback(), stcEndpointBufferIN, stcEndpointBufferOUT, stc_usbdevice_endpoint_config::u8EndpointAddress, stc_usbdevice_class_config::u8InterfaceClass, stc_usbdevice_class_config::u8InterfaceNumber, stc_usbdevice_class_config::u8InterfaceProtocoll, stc_usbdevice_class_config::u8InterfaceSubClass, USBDESCR_ENDPOINT, UsbDevice_ReceiveData(), UsbDevice_RegisterVendorClass(), UsbDevice_SetupEndpoint(), USBDEVICECDCCOM_EPOUT_BUFFERSIZE, and UsbIRQ.

| boolean_t UsbDeviceCdcCom_IsConnected | ( | void | ) |
getting vcomm connection status
Definition at line 479 of file UsbDeviceCdcCom.c.
References bReady, and bVcommActive.
| uint32_t UsbDeviceCdcCom_ReceiveBuffer | ( | uint8_t * | pu8Buffer | ) |
transfer receive buffer and clear it
| pu8Buffer | buffer to write in |
Definition at line 623 of file UsbDeviceCdcCom.c.
References bSeperatorFlag, FALSE, pu8VcommBuffer, and u32ReceivedData.
| uint8_t UsbDeviceCdcCom_ReceiveByte | ( | void | ) |
transfer one byte from the buffer
Definition at line 644 of file UsbDeviceCdcCom.c.
References pu8VcommBuffer, and u32ReceivedData.
Referenced by UsbDeviceCdcCom_ReceiveHex().

| uint32_t UsbDeviceCdcCom_ReceivedLength | ( | void | ) |
returns number of received bytes in buffer
Definition at line 603 of file UsbDeviceCdcCom.c.
References bSeperatorFlag, cSeperator, TRUE, and u32ReceivedData.
| uint32_t UsbDeviceCdcCom_ReceiveHex | ( | uint8_t | digits | ) |
receive hex value
| digits | number of digits |
Definition at line 844 of file UsbDeviceCdcCom.c.
References ASCIItobin(), FALSE, TRUE, UsbDeviceCdcCom_ReceiveByte(), UsbDeviceCdcCom_SendByte(), UsbDeviceCdcCom_SendString(), UsbDeviceCdcCom_SetEchomode(), and UsbDeviceCdcCom_SetSeparator().

| uint8_t UsbDeviceCdcCom_ReceiveLastByte | ( | void | ) |
transfer last received byte without touching the buffer
Definition at line 668 of file UsbDeviceCdcCom.c.
References pu8VcommBuffer, and u32ReceivedData.
| void UsbDeviceCdcCom_SendBin2DotDec99 | ( | uint8_t | a | ) |
bin to ascii function
| a | value |
Definition at line 818 of file UsbDeviceCdcCom.c.
References UsbDeviceCdcCom_SendByte().

| void UsbDeviceCdcCom_SendBinAsci4 | ( | uint16_t | a, |
| uint8_t | base, | ||
| char_t | fill | ||
| ) |
4-bit bin to ascii function
| a | value |
| base | type: HEX / DEC |
| fill | fill char |
Definition at line 750 of file UsbDeviceCdcCom.c.
References DEC, HEX, UsbDeviceCdcCom_SendByte(), and UsbDeviceCdcCom_SendString().
Referenced by UsbDeviceCdcCom_SendBinAsci8().


| void UsbDeviceCdcCom_SendBinAsci8 | ( | uint16_t | a, |
| uint8_t | base, | ||
| char_t | fill | ||
| ) |
8-bit bin to ascii function
| a | value |
| base | type: HEX / DEC |
| fill | fill char |
Definition at line 782 of file UsbDeviceCdcCom.c.
References DEC, HEX, UsbDeviceCdcCom_SendBinAsci4(), UsbDeviceCdcCom_SendByte(), and UsbDeviceCdcCom_SendString().

| uint8_t UsbDeviceCdcCom_SendBuffer | ( | uint8_t * | pu8Buffer, |
| uint32_t | u32Size | ||
| ) |
sending a buffer
| pu8Buffer | buffer to send |
| u32Size | buffersize |
Definition at line 538 of file UsbDeviceCdcCom.c.
References bVcommActive, SendData(), UsbDMA, and UsbIRQ.

| uint8_t UsbDeviceCdcCom_SendByte | ( | char_t | c | ) |
sending byte / char_t
| c | byte / char_t to send |
Definition at line 494 of file UsbDeviceCdcCom.c.
References bVcommActive, SendData(), and UsbPOLL.
Referenced by UsbDeviceCdcCom_ReceiveHex(), UsbDeviceCdcCom_SendBin2DotDec99(), UsbDeviceCdcCom_SendBinAsci4(), UsbDeviceCdcCom_SendBinAsci8(), and UsbDeviceCdcCom_SendHex().


| uint8_t UsbDeviceCdcCom_SendDec | ( | uint32_t | x | ) |
sends a decimal-digit
| x | value |
Definition at line 713 of file UsbDeviceCdcCom.c.
References pcASCII, and UsbDeviceCdcCom_SendString().

| uint8_t UsbDeviceCdcCom_SendHex | ( | uint32_t | n, |
| uint8_t | digits | ||
| ) |
sends a x-digit Hex-number (as ASCII charcaters)
| n | value |
| digits | number of hex-digits |
Definition at line 688 of file UsbDeviceCdcCom.c.
References pcASCII, UsbDeviceCdcCom_SendByte(), and UsbDeviceCdcCom_SendString().

| uint8_t UsbDeviceCdcCom_SendString | ( | char_t * | pcBuffer | ) |
sending a null terminated string
| pcBuffer | string to send |
Definition at line 514 of file UsbDeviceCdcCom.c.
References bVcommActive, SendData(), and UsbPOLL.
Referenced by UsbDeviceCdcCom_ReceiveHex(), UsbDeviceCdcCom_SendBinAsci4(), UsbDeviceCdcCom_SendBinAsci8(), UsbDeviceCdcCom_SendDec(), and UsbDeviceCdcCom_SendHex().


| void UsbDeviceCdcCom_SetCallbackLineCodingChange | ( | usbdevicecdccom_linecodingchange_func_ptr_t | pfnLineCodingChangeCallback | ) |
Set callback function for LineCoding changed event
| pfnLineCodingChangeCallback | Callback handler |
Definition at line 343 of file UsbDeviceCdcCom.c.
References pfnLineCodingChange.
| void UsbDeviceCdcCom_SetEchoAtSeperatorOnly | ( | boolean_t | bEchoAtSeperatorOnlyOnOff | ) |
echoes every received char after receiving defined seperator
| bEchoAtSeperatorOnlyOnOff | switch echo on/off |
Definition at line 590 of file UsbDeviceCdcCom.c.
References bEchoAtSeperatorOnly.
| void UsbDeviceCdcCom_SetEchomode | ( | boolean_t | bEchoOnOff | ) |
echoes every received char
| bEchoOnOff | switch echo on/off |
Definition at line 577 of file UsbDeviceCdcCom.c.
References bEchoMode.
Referenced by UsbDeviceCdcCom_ReceiveHex().

| void UsbDeviceCdcCom_SetReceivedCallback | ( | cdc_data_received_t | pstnCallback | ) |
Set received callback
| pstnCallback | callback handle |
Definition at line 276 of file UsbDeviceCdcCom.c.
References pstnReceivedData.
| void UsbDeviceCdcCom_SetSentCallback | ( | cdc_data_sent_t | pstnCallback | ) |
Set sent callback
| pstnCallback | callback handle |
Definition at line 288 of file UsbDeviceCdcCom.c.
References pstnSentData.
| void UsbDeviceCdcCom_SetSeparator | ( | const char_t | cNewSeperator | ) |
splits the buffer at a defined character
| cNewSeperator | split buffer every newSeparator if zerro, ignore splitting (default) |
Definition at line 563 of file UsbDeviceCdcCom.c.
References cSeperator.
Referenced by UsbDeviceCdcCom_ReceiveHex().
