Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SDFileSystem mbed
Log.h
00001 //**** Log.h **** 00002 //ログをリングバッファを用いて、 00003 //シリアル送信、SDカード出力を行う 00004 //*************** 00005 00006 #ifndef LOG_H_ 00007 #define LOG_H_ 00008 00009 #include "mbed.h" 00010 #include "SDFileSystem.h" 00011 #include "RingBuffer.h" 00012 00013 class Log{ 00014 public: 00015 Log(PinName rx, PinName tx, PinName mosi, PinName miso, PinName sck, PinName cs, const char* name); 00016 int initialize_sdlog(const char* str); 00017 void close(); 00018 int find_last(); 00019 void puts(const char *str); 00020 void putc(char ch); 00021 void write_data(uint8_t* buf, int16_t size); 00022 bool is_empty(); 00023 int16_t recieve_buffer_size(); 00024 int16_t getc(); 00025 int16_t read_data(uint8_t* buf, int16_t size); 00026 char int_tx(); 00027 void int_serial_tx(); 00028 00029 protected: 00030 SDFileSystem _sd; 00031 FILE *fp; 00032 Serial _device; 00033 RingBuffer buf_send; 00034 RingBuffer buf_recieve; 00035 }; 00036 00037 #endif /* LOG_H_ */
Generated on Tue Jul 12 2022 18:37:36 by
1.7.2