mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-19 05:42:28 +00:00
close #105 add tud_vendor_write_available()
This commit is contained in:
parent
fa796de6cd
commit
b7dbc98ab1
5
src/class/vendor/vendor_device.c
vendored
5
src/class/vendor/vendor_device.c
vendored
@ -125,6 +125,11 @@ uint32_t tud_vendor_n_write (uint8_t itf, void const* buffer, uint32_t bufsize)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t tud_vendor_n_write_available (uint8_t itf)
|
||||||
|
{
|
||||||
|
return tu_fifo_remaining(&_vendord_itf[itf].tx_ff);
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// USBD Driver API
|
// USBD Driver API
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
9
src/class/vendor/vendor_device.h
vendored
9
src/class/vendor/vendor_device.h
vendored
@ -42,10 +42,13 @@
|
|||||||
// Application API (Multiple Interfaces)
|
// Application API (Multiple Interfaces)
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
bool tud_vendor_n_mounted (uint8_t itf);
|
bool tud_vendor_n_mounted (uint8_t itf);
|
||||||
|
|
||||||
uint32_t tud_vendor_n_available (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);
|
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, int pos, uint8_t* u8);
|
||||||
|
|
||||||
uint32_t tud_vendor_n_write (uint8_t itf, void const* buffer, uint32_t bufsize);
|
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);
|
||||||
|
|
||||||
static inline
|
static inline
|
||||||
uint32_t tud_vendor_n_write_str (uint8_t itf, char const* str);
|
uint32_t tud_vendor_n_write_str (uint8_t itf, char const* str);
|
||||||
@ -59,6 +62,7 @@ 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 (int pos, uint8_t* u8);
|
||||||
static inline uint32_t tud_vendor_write (void const* buffer, uint32_t bufsize);
|
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_str (char const* str);
|
||||||
|
static inline uint32_t tud_vendor_write_available (void);
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// Application Callback API (weak is optional)
|
// Application Callback API (weak is optional)
|
||||||
@ -106,6 +110,11 @@ static inline uint32_t tud_vendor_write_str (char const* str)
|
|||||||
return tud_vendor_n_write_str(0, str);
|
return tud_vendor_n_write_str(0, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline uint32_t tud_vendor_write_available (void)
|
||||||
|
{
|
||||||
|
return tud_vendor_n_write_available(0);
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// Internal Class Driver API
|
// Internal Class Driver API
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
Loading…
x
Reference in New Issue
Block a user