Update for new version of mbed.
Fork of USBDevice_STM32F103 by
Diff: USBSerial/USBCDC.h
- Revision:
- 71:52ef20e36cab
- Parent:
- 66:c86eab438152
diff -r c74dbe78ca5b -r 52ef20e36cab USBSerial/USBCDC.h --- a/USBSerial/USBCDC.h Sun Dec 03 21:14:26 2017 +0000 +++ b/USBSerial/USBCDC.h Mon Dec 04 23:05:41 2017 +0000 @@ -40,35 +40,35 @@ USBCDC(uint16_t vendor_id, uint16_t product_id, uint16_t product_release, bool connect_blocking); protected: - + /* * Get device descriptor. Warning: this method has to store the length of the report descriptor in reportLength. * * @returns pointer to the device descriptor */ virtual uint8_t * deviceDesc(); - + /* * Get string product descriptor * * @returns pointer to the string product descriptor */ virtual uint8_t * stringIproductDesc(); - + /* * Get string interface descriptor * * @returns pointer to the string interface descriptor */ virtual uint8_t * stringIinterfaceDesc(); - + /* * Get configuration descriptor * * @returns pointer to the configuration descriptor */ virtual uint8_t * configurationDesc(); - + /* * Send a buffer * @@ -78,7 +78,7 @@ * @returns true if successful */ bool send(uint8_t * buffer, uint32_t size); - + /* * Read a buffer from a certain endpoint. Warning: blocking * @@ -89,7 +89,7 @@ * @returns true if successful */ bool readEP(uint8_t * buffer, uint32_t * size); - + /* * Read a buffer from a certain endpoint. Warning: non blocking * @@ -100,13 +100,25 @@ * @returns true if successful */ bool readEP_NB(uint8_t * buffer, uint32_t * size); - + + /* + * Called by USBCallback_requestCompleted when CDC line coding is changed + * Warning: Called in ISR + * + * @param baud The baud rate + * @param bits The number of bits in a word (5-8) + * @param parity The parity + * @param stop The number of stop bits (1 or 2) + */ + virtual void lineCodingChanged(int baud, int bits, int parity, int stop) {}; + protected: virtual bool USBCallback_request(); + virtual void USBCallback_requestCompleted(uint8_t *buf, uint32_t length); virtual bool USBCallback_setConfiguration(uint8_t configuration); + virtual void USBCallback_busReset(void); volatile bool terminal_connected; }; #endif -