Merge pull request #804 from hathach/audio_make_dma_ready
Implement functions to allow for DMA usage in audio driver.
This commit is contained in:
@@ -55,9 +55,9 @@
|
||||
//--------------------------------------------------------------------+
|
||||
// INCLUDE
|
||||
//--------------------------------------------------------------------+
|
||||
#include "audio_device.h"
|
||||
#include "class/audio/audio.h"
|
||||
#include "device/usbd_pvt.h"
|
||||
#include "audio_device.h"
|
||||
//#include "common/tusb_fifo.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// MACRO CONSTANT TYPEDEF
|
||||
@@ -447,27 +447,39 @@ bool tud_audio_n_clear_ep_out_ff(uint8_t func_id)
|
||||
return tu_fifo_clear(&_audiod_fct[func_id].ep_out_ff);
|
||||
}
|
||||
|
||||
tu_fifo_t* tud_audio_n_get_ep_out_ff(uint8_t func_id)
|
||||
{
|
||||
if(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL) return &_audiod_fct[func_id].ep_out_ff;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if CFG_TUD_AUDIO_ENABLE_DECODING && CFG_TUD_AUDIO_ENABLE_EP_OUT
|
||||
// Delete all content in the support RX FIFOs
|
||||
bool tud_audio_n_clear_rx_support_ff(uint8_t func_id, uint8_t ff_idx)
|
||||
{
|
||||
TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL, ff_idx < _audiod_fct[func_id].n_rx_supp_ff);
|
||||
TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL && ff_idx < _audiod_fct[func_id].n_rx_supp_ff);
|
||||
return tu_fifo_clear(&_audiod_fct[func_id].rx_supp_ff[ff_idx]);
|
||||
}
|
||||
|
||||
uint16_t tud_audio_n_available_support_ff(uint8_t func_id, uint8_t ff_idx)
|
||||
{
|
||||
TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL, ff_idx < _audiod_fct[func_id].n_rx_supp_ff);
|
||||
TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL && ff_idx < _audiod_fct[func_id].n_rx_supp_ff);
|
||||
return tu_fifo_count(&_audiod_fct[func_id].rx_supp_ff[ff_idx]);
|
||||
}
|
||||
|
||||
uint16_t tud_audio_n_read_support_ff(uint8_t func_id, uint8_t ff_idx, void* buffer, uint16_t bufsize)
|
||||
{
|
||||
TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL, ff_idx < _audiod_fct[func_id].n_rx_supp_ff);
|
||||
TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL && ff_idx < _audiod_fct[func_id].n_rx_supp_ff);
|
||||
return tu_fifo_read_n(&_audiod_fct[func_id].rx_supp_ff[ff_idx], buffer, bufsize);
|
||||
}
|
||||
|
||||
tu_fifo_t* tud_audio_n_get_rx_support_ff(uint8_t func_id, uint8_t ff_idx)
|
||||
{
|
||||
if(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL && ff_idx < _audiod_fct[func_id].n_rx_supp_ff) return &_audiod_fct[func_id].rx_supp_ff[ff_idx];
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
// This function is called once an audio packet is received by the USB and is responsible for putting data from USB memory into EP_OUT_FIFO (or support FIFOs + decoding of received stream into audio channels).
|
||||
@@ -635,31 +647,30 @@ static bool audiod_decode_type_I_pcm(uint8_t rhport, audiod_function_t* audio, u
|
||||
uint8_t cnt_ff;
|
||||
|
||||
// Decode
|
||||
void * dst;
|
||||
uint8_t * src;
|
||||
uint8_t * dst_end;
|
||||
uint16_t len;
|
||||
|
||||
tu_fifo_buffer_info_t info;
|
||||
|
||||
for (cnt_ff = 0; cnt_ff < n_ff_used; cnt_ff++)
|
||||
{
|
||||
src = &audio->lin_buf_out[cnt_ff*audio->n_channels_per_ff_rx * audio->n_bytes_per_sampe_rx];
|
||||
tu_fifo_get_write_info(&audio->rx_supp_ff[cnt_ff], &info);
|
||||
|
||||
len = tu_fifo_get_linear_write_info(&audio->rx_supp_ff[cnt_ff], 0, &dst, nBytesPerFFToRead);
|
||||
tu_fifo_advance_write_pointer(&audio->rx_supp_ff[cnt_ff], len);
|
||||
|
||||
dst_end = dst + len;
|
||||
|
||||
src = audiod_interleaved_copy_bytes_fast_decode(nBytesToCopy, dst, dst_end, src, n_ff_used);
|
||||
|
||||
// Handle wrapped part of FIFO
|
||||
if (len < nBytesPerFFToRead)
|
||||
if (info.len_lin != 0)
|
||||
{
|
||||
len = tu_fifo_get_linear_write_info(&audio->rx_supp_ff[cnt_ff], 0, &dst, nBytesPerFFToRead - len);
|
||||
tu_fifo_advance_write_pointer(&audio->rx_supp_ff[cnt_ff], len);
|
||||
info.len_lin = tu_min16(nBytesPerFFToRead, info.len_lin);
|
||||
src = &audio->lin_buf_out[cnt_ff*audio->n_channels_per_ff_rx * audio->n_bytes_per_sampe_rx];
|
||||
dst_end = info.ptr_lin + info.len_lin;
|
||||
src = audiod_interleaved_copy_bytes_fast_decode(nBytesToCopy, info.ptr_lin, dst_end, src, n_ff_used);
|
||||
|
||||
dst_end = dst + len;
|
||||
|
||||
audiod_interleaved_copy_bytes_fast_decode(nBytesToCopy, dst, dst_end, src, n_ff_used);
|
||||
// Handle wrapped part of FIFO
|
||||
info.len_wrap = tu_min16(nBytesPerFFToRead - info.len_lin, info.len_wrap);
|
||||
if (info.len_wrap != 0)
|
||||
{
|
||||
dst_end = info.ptr_wrap + info.len_wrap;
|
||||
audiod_interleaved_copy_bytes_fast_decode(nBytesToCopy, info.ptr_wrap, dst_end, src, n_ff_used);
|
||||
}
|
||||
tu_fifo_advance_write_pointer(&audio->rx_supp_ff[cnt_ff], info.len_lin + info.len_wrap);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -699,9 +710,16 @@ bool tud_audio_n_clear_ep_in_ff(uint8_t func_id) // Del
|
||||
return tu_fifo_clear(&_audiod_fct[func_id].ep_in_ff);
|
||||
}
|
||||
|
||||
tu_fifo_t* tud_audio_n_get_ep_in_ff(uint8_t func_id)
|
||||
{
|
||||
if(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL) return &_audiod_fct[func_id].ep_in_ff;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if CFG_TUD_AUDIO_ENABLE_ENCODING && CFG_TUD_AUDIO_ENABLE_EP_IN
|
||||
|
||||
uint16_t tud_audio_n_flush_tx_support_ff(uint8_t func_id) // Force all content in the support TX FIFOs to be written into linear buffer and schedule a transmit
|
||||
{
|
||||
TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL);
|
||||
@@ -719,15 +737,22 @@ uint16_t tud_audio_n_flush_tx_support_ff(uint8_t func_id) // For
|
||||
|
||||
bool tud_audio_n_clear_tx_support_ff(uint8_t func_id, uint8_t ff_idx)
|
||||
{
|
||||
TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL, ff_idx < _audiod_fct[func_id].n_tx_supp_ff);
|
||||
TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL && ff_idx < _audiod_fct[func_id].n_tx_supp_ff);
|
||||
return tu_fifo_clear(&_audiod_fct[func_id].tx_supp_ff[ff_idx]);
|
||||
}
|
||||
|
||||
uint16_t tud_audio_n_write_support_ff(uint8_t func_id, uint8_t ff_idx, const void * data, uint16_t len)
|
||||
{
|
||||
TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL, ff_idx < _audiod_fct[func_id].n_tx_supp_ff);
|
||||
TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL && ff_idx < _audiod_fct[func_id].n_tx_supp_ff);
|
||||
return tu_fifo_write_n(&_audiod_fct[func_id].tx_supp_ff[ff_idx], data, len);
|
||||
}
|
||||
|
||||
tu_fifo_t* tud_audio_n_get_tx_support_ff(uint8_t func_id, uint8_t ff_idx)
|
||||
{
|
||||
if(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL && ff_idx < _audiod_fct[func_id].n_tx_supp_ff) return &_audiod_fct[func_id].tx_supp_ff[ff_idx];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -751,6 +776,7 @@ uint16_t tud_audio_int_ctr_n_write(uint8_t func_id, uint8_t const* buffer, uint1
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -952,31 +978,34 @@ static uint16_t audiod_encode_type_I_pcm(uint8_t rhport, audiod_function_t* audi
|
||||
nBytesPerFFToSend = (nBytesPerFFToSend / nBytesToCopy) * nBytesToCopy;
|
||||
|
||||
// Encode
|
||||
void * src;
|
||||
uint8_t * dst;
|
||||
uint8_t * src_end;
|
||||
uint16_t len;
|
||||
|
||||
tu_fifo_buffer_info_t info;
|
||||
|
||||
for (cnt_ff = 0; cnt_ff < n_ff_used; cnt_ff++)
|
||||
{
|
||||
dst = &audio->lin_buf_in[cnt_ff*audio->n_channels_per_ff_tx*audio->n_bytes_per_sampe_tx];
|
||||
|
||||
len = tu_fifo_get_linear_read_info(&audio->tx_supp_ff[cnt_ff], 0, &src, nBytesPerFFToSend);
|
||||
tu_fifo_advance_read_pointer(&audio->tx_supp_ff[cnt_ff], len);
|
||||
tu_fifo_get_read_info(&audio->tx_supp_ff[cnt_ff], &info);
|
||||
|
||||
src_end = src + len;
|
||||
|
||||
dst = audiod_interleaved_copy_bytes_fast_encode(nBytesToCopy, src, src_end, dst, n_ff_used);
|
||||
|
||||
// Handle wrapped part of FIFO
|
||||
if (len < nBytesPerFFToSend)
|
||||
if (info.len_lin != 0)
|
||||
{
|
||||
len = tu_fifo_get_linear_read_info(&audio->tx_supp_ff[cnt_ff], 0, &src, nBytesPerFFToSend - len);
|
||||
tu_fifo_advance_read_pointer(&audio->tx_supp_ff[cnt_ff], len);
|
||||
info.len_lin = tu_min16(nBytesPerFFToSend, info.len_lin); // Limit up to desired length
|
||||
src_end = info.ptr_lin + info.len_lin;
|
||||
dst = audiod_interleaved_copy_bytes_fast_encode(nBytesToCopy, info.ptr_lin, src_end, dst, n_ff_used);
|
||||
|
||||
src_end = src + len;
|
||||
// Limit up to desired length
|
||||
info.len_wrap = tu_min16(nBytesPerFFToSend - info.len_lin, info.len_wrap);
|
||||
|
||||
audiod_interleaved_copy_bytes_fast_encode(nBytesToCopy, src, src_end, dst, n_ff_used);
|
||||
// Handle wrapped part of FIFO
|
||||
if (info.len_wrap != 0)
|
||||
{
|
||||
src_end = info.ptr_wrap + info.len_wrap;
|
||||
audiod_interleaved_copy_bytes_fast_encode(nBytesToCopy, info.ptr_wrap, src_end, dst, n_ff_used);
|
||||
}
|
||||
|
||||
tu_fifo_advance_read_pointer(&audio->tx_supp_ff[cnt_ff], info.len_lin + info.len_wrap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -364,23 +364,27 @@ bool tud_audio_n_mounted (uint8_t func_id);
|
||||
uint16_t tud_audio_n_available (uint8_t func_id);
|
||||
uint16_t tud_audio_n_read (uint8_t func_id, void* buffer, uint16_t bufsize);
|
||||
bool tud_audio_n_clear_ep_out_ff (uint8_t func_id); // Delete all content in the EP OUT FIFO
|
||||
tu_fifo_t* tud_audio_n_get_ep_out_ff (uint8_t func_id);
|
||||
#endif
|
||||
|
||||
#if CFG_TUD_AUDIO_ENABLE_EP_OUT && CFG_TUD_AUDIO_ENABLE_DECODING
|
||||
bool tud_audio_n_clear_rx_support_ff (uint8_t func_id, uint8_t ff_idx); // Delete all content in the support RX FIFOs
|
||||
uint16_t tud_audio_n_available_support_ff (uint8_t func_id, uint8_t ff_idx);
|
||||
uint16_t tud_audio_n_read_support_ff (uint8_t func_id, uint8_t ff_idx, void* buffer, uint16_t bufsize);
|
||||
tu_fifo_t* tud_audio_n_get_rx_support_ff (uint8_t func_id, uint8_t ff_idx);
|
||||
#endif
|
||||
|
||||
#if CFG_TUD_AUDIO_ENABLE_EP_IN && !CFG_TUD_AUDIO_ENABLE_ENCODING
|
||||
uint16_t tud_audio_n_write (uint8_t func_id, const void * data, uint16_t len);
|
||||
bool tud_audio_n_clear_ep_in_ff (uint8_t func_id); // Delete all content in the EP IN FIFO
|
||||
tu_fifo_t* tud_audio_n_get_ep_in_ff (uint8_t func_id);
|
||||
#endif
|
||||
|
||||
#if CFG_TUD_AUDIO_ENABLE_EP_IN && CFG_TUD_AUDIO_ENABLE_ENCODING
|
||||
uint16_t tud_audio_n_flush_tx_support_ff (uint8_t func_id); // Force all content in the support TX FIFOs to be written into EP SW FIFO
|
||||
bool tud_audio_n_clear_tx_support_ff (uint8_t func_id, uint8_t ff_idx);
|
||||
uint16_t tud_audio_n_write_support_ff (uint8_t func_id, uint8_t ff_idx, const void * data, uint16_t len);
|
||||
tu_fifo_t* tud_audio_n_get_tx_support_ff (uint8_t func_id, uint8_t ff_idx);
|
||||
#endif
|
||||
|
||||
#if CFG_TUD_AUDIO_INT_CTR_EPSIZE_IN
|
||||
@@ -399,12 +403,14 @@ static inline bool tud_audio_mounted (void);
|
||||
static inline uint16_t tud_audio_available (void);
|
||||
static inline bool tud_audio_clear_ep_out_ff (void); // Delete all content in the EP OUT FIFO
|
||||
static inline uint16_t tud_audio_read (void* buffer, uint16_t bufsize);
|
||||
static inline tu_fifo_t* tud_audio_get_ep_out_ff (void);
|
||||
#endif
|
||||
|
||||
#if CFG_TUD_AUDIO_ENABLE_EP_OUT && CFG_TUD_AUDIO_ENABLE_DECODING
|
||||
static inline bool tud_audio_clear_rx_support_ff (uint8_t ff_idx);
|
||||
static inline uint16_t tud_audio_available_support_ff (uint8_t ff_idx);
|
||||
static inline uint16_t tud_audio_read_support_ff (uint8_t ff_idx, void* buffer, uint16_t bufsize);
|
||||
static inline tu_fifo_t* tud_audio_get_rx_support_ff (uint8_t ff_idx);
|
||||
#endif
|
||||
|
||||
// TX API
|
||||
@@ -412,12 +418,14 @@ static inline uint16_t tud_audio_read_support_ff (uint8_t ff_idx, voi
|
||||
#if CFG_TUD_AUDIO_ENABLE_EP_IN && !CFG_TUD_AUDIO_ENABLE_ENCODING
|
||||
static inline uint16_t tud_audio_write (const void * data, uint16_t len);
|
||||
static inline bool tud_audio_clear_ep_in_ff (void);
|
||||
static inline tu_fifo_t* tud_audio_get_ep_in_ff (void);
|
||||
#endif
|
||||
|
||||
#if CFG_TUD_AUDIO_ENABLE_EP_IN && CFG_TUD_AUDIO_ENABLE_ENCODING
|
||||
static inline uint16_t tud_audio_flush_tx_support_ff (void);
|
||||
static inline uint16_t tud_audio_clear_tx_support_ff (uint8_t ff_idx);
|
||||
static inline uint16_t tud_audio_write_support_ff (uint8_t ff_idx, const void * data, uint16_t len);
|
||||
static inline tu_fifo_t* tud_audio_get_tx_support_ff (uint8_t ff_idx);
|
||||
#endif
|
||||
|
||||
// INT CTR API
|
||||
@@ -514,6 +522,11 @@ static inline bool tud_audio_clear_ep_out_ff(void)
|
||||
return tud_audio_n_clear_ep_out_ff(0);
|
||||
}
|
||||
|
||||
static inline tu_fifo_t* tud_audio_get_ep_out_ff(void)
|
||||
{
|
||||
return tud_audio_n_get_ep_out_ff(0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if CFG_TUD_AUDIO_ENABLE_EP_OUT && CFG_TUD_AUDIO_ENABLE_DECODING
|
||||
@@ -533,6 +546,11 @@ static inline uint16_t tud_audio_read_support_ff(uint8_t ff_idx, void* buffer, u
|
||||
return tud_audio_n_read_support_ff(0, ff_idx, buffer, bufsize);
|
||||
}
|
||||
|
||||
static inline tu_fifo_t* tud_audio_get_rx_support_ff(uint8_t ff_idx)
|
||||
{
|
||||
return tud_audio_n_get_rx_support_ff(0, ff_idx);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// TX API
|
||||
@@ -549,6 +567,11 @@ static inline bool tud_audio_clear_ep_in_ff(void)
|
||||
return tud_audio_n_clear_ep_in_ff(0);
|
||||
}
|
||||
|
||||
static inline tu_fifo_t* tud_audio_get_ep_in_ff(void)
|
||||
{
|
||||
return tud_audio_n_get_ep_in_ff(0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if CFG_TUD_AUDIO_ENABLE_EP_IN && CFG_TUD_AUDIO_ENABLE_ENCODING
|
||||
@@ -568,6 +591,11 @@ static inline uint16_t tud_audio_write_support_ff(uint8_t ff_idx, const void * d
|
||||
return tud_audio_n_write_support_ff(0, ff_idx, data, len);
|
||||
}
|
||||
|
||||
static inline tu_fifo_t* tud_audio_get_tx_support_ff(uint8_t ff_idx)
|
||||
{
|
||||
return tud_audio_n_get_tx_support_ff(0, ff_idx);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if CFG_TUD_AUDIO_INT_CTR_EPSIZE_IN
|
||||
|
||||
@@ -146,9 +146,9 @@ uint32_t tud_cdc_n_read(uint8_t itf, void* buffer, uint32_t bufsize)
|
||||
return num_read;
|
||||
}
|
||||
|
||||
bool tud_cdc_n_peek(uint8_t itf, int pos, uint8_t* chr)
|
||||
bool tud_cdc_n_peek(uint8_t itf, uint8_t* chr)
|
||||
{
|
||||
return tu_fifo_peek_at(&_cdcd_itf[itf].rx_ff, pos, chr);
|
||||
return tu_fifo_peek(&_cdcd_itf[itf].rx_ff, chr);
|
||||
}
|
||||
|
||||
void tud_cdc_n_read_flush (uint8_t itf)
|
||||
|
||||
@@ -83,7 +83,7 @@ int32_t tud_cdc_n_read_char (uint8_t itf);
|
||||
void tud_cdc_n_read_flush (uint8_t itf);
|
||||
|
||||
// Get a byte from FIFO at the specified position without removing it
|
||||
bool tud_cdc_n_peek (uint8_t itf, int pos, uint8_t* u8);
|
||||
bool tud_cdc_n_peek (uint8_t itf, uint8_t* u8);
|
||||
|
||||
// Write bytes to TX FIFO, data may remain in the FIFO for a while
|
||||
uint32_t tud_cdc_n_write (uint8_t itf, void const* buffer, uint32_t bufsize);
|
||||
@@ -117,7 +117,7 @@ static inline uint32_t tud_cdc_available (void);
|
||||
static inline int32_t tud_cdc_read_char (void);
|
||||
static inline uint32_t tud_cdc_read (void* buffer, uint32_t bufsize);
|
||||
static inline void tud_cdc_read_flush (void);
|
||||
static inline bool tud_cdc_peek (int pos, uint8_t* u8);
|
||||
static inline bool tud_cdc_peek (uint8_t* u8);
|
||||
|
||||
static inline uint32_t tud_cdc_write_char (char ch);
|
||||
static inline uint32_t tud_cdc_write (void const* buffer, uint32_t bufsize);
|
||||
@@ -207,9 +207,9 @@ static inline void tud_cdc_read_flush (void)
|
||||
tud_cdc_n_read_flush(0);
|
||||
}
|
||||
|
||||
static inline bool tud_cdc_peek (int pos, uint8_t* u8)
|
||||
static inline bool tud_cdc_peek (uint8_t* u8)
|
||||
{
|
||||
return tud_cdc_n_peek(0, pos, u8);
|
||||
return tud_cdc_n_peek(0, u8);
|
||||
}
|
||||
|
||||
static inline uint32_t tud_cdc_write_char (char ch)
|
||||
|
||||
4
src/class/vendor/vendor_device.c
vendored
4
src/class/vendor/vendor_device.c
vendored
@@ -72,9 +72,9 @@ uint32_t tud_vendor_n_available (uint8_t itf)
|
||||
return tu_fifo_count(&_vendord_itf[itf].rx_ff);
|
||||
}
|
||||
|
||||
bool tud_vendor_n_peek(uint8_t itf, int pos, uint8_t* u8)
|
||||
bool tud_vendor_n_peek(uint8_t itf, uint8_t* u8)
|
||||
{
|
||||
return tu_fifo_peek_at(&_vendord_itf[itf].rx_ff, pos, u8);
|
||||
return tu_fifo_peek(&_vendord_itf[itf].rx_ff, u8);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
8
src/class/vendor/vendor_device.h
vendored
8
src/class/vendor/vendor_device.h
vendored
@@ -45,7 +45,7 @@ bool tud_vendor_n_mounted (uint8_t itf);
|
||||
|
||||
uint32_t tud_vendor_n_available (uint8_t itf);
|
||||
uint32_t tud_vendor_n_read (uint8_t itf, void* buffer, uint32_t bufsize);
|
||||
bool tud_vendor_n_peek (uint8_t itf, int pos, uint8_t* u8);
|
||||
bool tud_vendor_n_peek (uint8_t itf, uint8_t* u8);
|
||||
|
||||
uint32_t tud_vendor_n_write (uint8_t itf, void const* buffer, uint32_t bufsize);
|
||||
uint32_t tud_vendor_n_write_available (uint8_t itf);
|
||||
@@ -59,7 +59,7 @@ uint32_t tud_vendor_n_write_str (uint8_t itf, char const* str);
|
||||
static inline bool tud_vendor_mounted (void);
|
||||
static inline uint32_t tud_vendor_available (void);
|
||||
static inline uint32_t tud_vendor_read (void* buffer, uint32_t bufsize);
|
||||
static inline bool tud_vendor_peek (int pos, uint8_t* u8);
|
||||
static inline bool tud_vendor_peek (uint8_t* u8);
|
||||
static inline uint32_t tud_vendor_write (void const* buffer, uint32_t bufsize);
|
||||
static inline uint32_t tud_vendor_write_str (char const* str);
|
||||
static inline uint32_t tud_vendor_write_available (void);
|
||||
@@ -95,9 +95,9 @@ static inline uint32_t tud_vendor_read (void* buffer, uint32_t bufsize)
|
||||
return tud_vendor_n_read(0, buffer, bufsize);
|
||||
}
|
||||
|
||||
static inline bool tud_vendor_peek (int pos, uint8_t* u8)
|
||||
static inline bool tud_vendor_peek (uint8_t* u8)
|
||||
{
|
||||
return tud_vendor_n_peek(0, pos, u8);
|
||||
return tud_vendor_n_peek(0, u8);
|
||||
}
|
||||
|
||||
static inline uint32_t tud_vendor_write (void const* buffer, uint32_t bufsize)
|
||||
|
||||
Reference in New Issue
Block a user