modify to nucleo stm32F411
Dependencies: RingBuffer
Dependents: MX_control Program_BEAR_Protocol SwitchMode BEAR_Motion ... more
Fork of iSerial by
Diff: iSerial.h
- Revision:
- 3:d5353b68105f
- Parent:
- 2:3fc74f4d685a
- Child:
- 4:b38ef9675d39
diff -r 3fc74f4d685a -r d5353b68105f iSerial.h --- a/iSerial.h Fri Aug 31 17:32:00 2012 +0000 +++ b/iSerial.h Sat Sep 01 12:28:28 2012 +0000 @@ -1,80 +1,80 @@ -// -// iSerial.h ... Serial Driver with Interrupt Rec/Send -// -// Copyright 2012 Yoji KURODA -// -// 2009.11.13 ... Originally written by Y.Kuroda for Renesas H83664 -// 2012.08.31 ... Code convert for mbed in C++ -// -#ifndef _ISERIAL_H -#define _ISERIAL_H - -#include <string.h> -#include "RingBuffer.h" - - -class ISerial : public Serial { - protected: - - RingBuffer txbuf; - RingBuffer rxbuf; - - void tx_handler(void); - void rx_handler(void); - - - public: - - enum TERMINL_CODES { CR=0x0D, LF=0x0A }; - - /* - * void init_sci(void) - * - *ããã¼ãåæåé¢æ°ï¼ï¼ï¼ï¼ãã¹ã¦ã®I/Oã®è¨å®ãè¡ã£ã¦ããï¼ - * - *ããå¼æ°ï¼ãªã - *ããæ»ãå¤ï¼ãªã - * - */ - ISerial(PinName _tx, PinName _rx, const char *_name=NULL, int _txbufsize=100, int _rxbufsize=100); - - /* - * ã·ãªã¢ã«å ¥åã«æåããããã©ãããã§ã㯠- * è¿å¤ï¼ ï¼ããï¼æåããªã - * ï¼ä»¥å¤ï¼æåãæ¥ã¦ãã - */ - int readable(void); - - /* - * ã·ãªã¢ã«ããä¸æåå ¥å - */ - int getc(void); - - /* - *ãã·ãªã¢ã«ã¸ä¸æååºå - */ - void putc(short ch); - - - /* - *ãã·ãªã¢ã«ã¸æååãåºå - *ãã注ï¼ä¸åã®æ大æåæ°ã¯LINESIZE - *ãã注ï¼æååã®çµããã«ã¯ãã«æåãå¿ è¦ï¼ - * - *ããå¼æ°ï¼æååã¸ã®ãã¤ã³ã¿ - *ããè¿å¤ï¼åºåããæåæ° - */ - short int putstr(const char* s); - - /*ãvoid outs(char* s) - *ãã·ãªã¢ã«ã¸æååãä¸è¡åºå - *ãã注ï¼æå¾ã«æ¹è¡ã³ã¼ããéãä»ã¯outstrã¨åã - * - *ããå¼æ°ï¼æååã¸ã®ãã¤ã³ã¿ - *ããè¿å¤ï¼åºåããæåæ° - */ - short int puts(const char* s); -}; - - -#endif /* _SCI_H */ +// +// iSerial.h ... Serial Driver with Interrupt Rec/Send +// +// Copyright 2012 Yoji KURODA +// +// 2009.11.13 ... Originally written by Y.Kuroda for Renesas H83664 +// 2012.08.31 ... Code convert for mbed in C++ +// +#ifndef _ISERIAL_H +#define _ISERIAL_H + +#include <string.h> +#include "RingBuffer.h" + + +class iSerial : public Serial { + protected: + + RingBuffer txbuf; + RingBuffer rxbuf; + + void tx_handler(void); + void rx_handler(void); + + + public: + + enum TERMINL_CODES { CR=0x0D, LF=0x0A }; + + /* + * void init_sci(void) + * + *@|[gú»ÖDDDD·×ÄÌI/OÌÝèðsÁÄ¢éD + * + *@@øFȵ + *@@ßèlFȵ + * + */ + iSerial(PinName _tx, PinName _rx, const char *_name=NULL, int _txbufsize=100, int _rxbufsize=100); + + /* + * VAüÍɶª é©Ç¤©`FbN + * ÔlF O@@F¶ªÈ¢ + * OÈOF¶ªÄ¢é + */ + int readable(void); + + /* + * VA©çê¶üÍ + */ + int getc(void); + + /* + *@VAÖê¶oÍ + */ + void putc(short ch); + + + /* + *@VAÖ¶ñðoÍ + *@@FêñÌÅå¶ÍLINESIZE + *@@F¶ñÌIíèÉÍk¶ªKvD + * + *@@øF¶ñÖÌ|C^ + *@@ÔlFo͵½¶ + */ + short int putstr(const char* s); + + /*@void outs(char* s) + *@VAÖ¶ñðêsoÍ + *@@FÅãÉüsR[hðé¼ÍoutstrƯ¶ + * + *@@øF¶ñÖÌ|C^ + *@@ÔlFo͵½¶ + */ + short int puts(const char* s); +}; + + +#endif /* _SCI_H */