New drivers
[hackover2013-badge-firmware.git] / core / usbcdc / cdc_buf.h
1 /*----------------------------------------------------------------------------
2 * Name: cdc_buf.h
3 * Purpose: usb cdc buffer handling
4 * Version: V1.00
5 *---------------------------------------------------------------------------*/
6
7 #ifndef __CDC_BUF_H__
8 #define __CDC_BUF_H__
9
10 #include "projectconfig.h"
11
12 // Buffer used for circular fifo
13 typedef struct _cdc_buffer_t
14 {
15 volatile uint8_t len;
16 volatile uint8_t wr_ptr;
17 volatile uint8_t rd_ptr;
18 uint8_t buf[CFG_USBCDC_BUFFERSIZE];
19 } cdc_buffer_t;
20
21 cdc_buffer_t * cdcGetBuffer();
22 void cdcBufferInit();
23 uint8_t cdcBufferRead();
24 uint32_t cdcBufferReadLen(uint8_t* buf, uint32_t len);
25 void cdcBufferWrite(uint8_t data);
26 void cdcBufferClearFIFO();
27 uint8_t cdcBufferDataPending();
28
29 #endif
This page took 0.044581 seconds and 5 git commands to generate.