HARMcksL: ARM HAL toolbox (yet STM32 oriented) 1.6
SMFSW collection of HAL hacks for STM32
Loading...
Searching...
No Matches
USB_CDC_IF_ex.h File Reference

Extensions for USB VCP. More...

#include "sarmfsw.h"
Include dependency graph for USB_CDC_IF_ex.h:
This graph shows which files directly or indirectly include this file:

Functions

FctERR CDC_Control_Set_Line_State_Callback (const bool open)
 Callback for CDC port connection/disconnection.
 
FctERR CDC_Control_Set_Line_State (const uint8_t *const pbuf)
 CDC Set Line State message handler.
 
void CDC_Control_Set_Line_Coding (const uint8_t *const pbuf)
 CDC Set Line Coding message handler.
 
void CDC_Control_Get_Line_Coding (uint8_t *const pbuf)
 CDC Get Line Coding message handler.
 
bool get_CDC_Line_State (void)
 CDC Get current port state.
 

Detailed Description

Extensions for USB VCP.

Author
SMFSW
static int8_t CDC_Control_FS(uint8_t cmd, uint8_t* pbuf, uint16_t length)
{
switch(cmd)
{
...
case CDC_SET_LINE_CODING:
break;
case CDC_GET_LINE_CODING:
break;
case CDC_SET_CONTROL_LINE_STATE:
break;
...
}
}
void CDC_Control_Get_Line_Coding(uint8_t *const pbuf)
CDC Get Line Coding message handler.
Definition USB_CDC_IF_ex.c:91
FctERR CDC_Control_Set_Line_State(const uint8_t *const pbuf)
CDC Set Line State message handler.
Definition USB_CDC_IF_ex.c:82
void CDC_Control_Set_Line_Coding(const uint8_t *const pbuf)
CDC Set Line Coding message handler.
Definition USB_CDC_IF_ex.c:87
Note
Define USE_USB_CDC_IF_EX symbol at project level to use CDC_IF_ex functionalities

Function Documentation

◆ CDC_Control_Get_Line_Coding()

void CDC_Control_Get_Line_Coding ( uint8_t *const pbuf)

CDC Get Line Coding message handler.

Note
Call CDC_Control_Get_Line_Coding in usbd_cdc_if.c CDC_Control_FS function, CDC_GET_LINE_CODING case
Parameters
[in,out]pbuf- Pointer to message data

◆ CDC_Control_Set_Line_Coding()

void CDC_Control_Set_Line_Coding ( const uint8_t *const pbuf)

CDC Set Line Coding message handler.

Note
Call CDC_Control_Set_Line_Coding in usbd_cdc_if.c CDC_Control_FS function, CDC_SET_LINE_CODING case
Parameters
[in]pbuf- Pointer to message data

◆ CDC_Control_Set_Line_State()

FctERR CDC_Control_Set_Line_State ( const uint8_t *const pbuf)

CDC Set Line State message handler.

Note
Call CDC_Control_Set_Line_State in usbd_cdc_if.c CDC_Control_FS function, CDC_SET_CONTROL_LINE_STATE case
Several disconnection messages can appear on bus, use example code in callback to get only state change
Parameters
[in]pbuf- Pointer to message data
Returns
FctERR - Error code
Here is the call graph for this function:

◆ CDC_Control_Set_Line_State_Callback()

FctERR CDC_Control_Set_Line_State_Callback ( const bool open)

Callback for CDC port connection/disconnection.

Weak Functions
CDC_Control_Set_Line_State_Callback may be user implemented to suit custom needs
Note
Several disconnection messages can appear on bus, use example code to get only state change
get_CDC_Line_State can be used instead (if not willing to use callback) to check port current status
Parameters
[in]open- port state
Returns
FctERR - Error code
static bool connected = false;
if (open != connected) // To avoid multiple control line state disconnections
{
connected = open;
// Custom code here
}
Here is the caller graph for this function:

◆ get_CDC_Line_State()

bool get_CDC_Line_State ( void )

CDC Get current port state.

Returns
Port state