Loading...
Searching...
No Matches

Interface and definitions for USB CDC ACM type interfaces in USBUS. More...

Detailed Description

Interface and definitions for USB CDC ACM type interfaces in USBUS.

The functionality provided here only implements the USB specific handling. A different module is required to provide functional handling of the data e.g. UART or STDIO integration.

Author
Dylan Laduranty dylan.nosp@m..lad.nosp@m.urant.nosp@m.y@me.nosp@m.sotic.nosp@m..com
Koen Zandberg koen@.nosp@m.berg.nosp@m.zand..nosp@m.net

Definition in file acm.h.

#include <stdint.h>
#include "usb/cdc.h"
#include "usb/usbus.h"
#include "tsrb.h"
+ Include dependency graph for acm.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  usbus_cdcacm_device
 USBUS CDC ACM context struct. More...
 

Macros

#define CONFIG_USBUS_CDC_ACM_STDIO_BUF_SIZE   (128)
 Buffer size for STDIN and STDOUT data to and from USB when using the USBUS_CDC_ACM_STDIO module.
 
#define CONFIG_USBUS_CDC_ACM_BULK_EP_SIZE   (64)
 USB CDC ACM bulk endpoint size.
 
#define USBUS_CDC_ACM_INT_EP_SIZE   (8)
 USBUS CDC ACM interrupt endpoint size.
 
#define USBUS_CDC_ACM_EP_IN_REQUIRED_NUMOF   2
 Number of IN EPs required for the CDC ACM interface.
 
#define USBUS_CDC_ACM_EP_OUT_REQUIRED_NUMOF   1
 Number of Out EPs required for the CDC ACM interface.
 

Typedefs

typedef struct usbus_cdcacm_device usbus_cdcacm_device_t
 USBUS CDC ACM context struct forward declaration.
 
typedef void(* usbus_cdcacm_cb_t) (usbus_cdcacm_device_t *cdcacm, uint8_t *data, size_t len)
 CDC ACM data callback.
 
typedef int(* usbus_cdcacm_coding_cb_t) (usbus_cdcacm_device_t *cdcacm, uint32_t baud, uint8_t bits, uint8_t parity, uint8_t stop)
 CDC ACM line coding callback.
 

Enumerations

enum  usbus_cdcacm_line_state_t { USBUS_CDC_ACM_LINE_STATE_DISCONNECTED , USBUS_CDC_ACM_LINE_STATE_DTE }
 CDC ACM line state as reported by the host computer. More...
 

Functions

void usbus_cdc_acm_init (usbus_t *usbus, usbus_cdcacm_device_t *cdcacm, usbus_cdcacm_cb_t cb, usbus_cdcacm_coding_cb_t coding_cb, uint8_t *buf, size_t len)
 Initialize an USBUS CDC ACM interface.
 
size_t usbus_cdc_acm_submit (usbus_cdcacm_device_t *cdcacm, const uint8_t *buf, size_t len)
 Submit bytes to the CDC ACM handler.
 
void usbus_cdc_acm_flush (usbus_cdcacm_device_t *cdcacm)
 Flush the buffer to the USB host.
 
void usbus_cdc_acm_set_coding_cb (usbus_cdcacm_device_t *cdcacm, usbus_cdcacm_coding_cb_t coding_cb)
 Set the callback for control settings.