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.
SPIDebug.h
00001 /////////////////////////////////////////////////////////////////////////////// 00002 // SPIDebug.h 00003 // 00004 // COPYRIGHT (c) 2012 by David Van Wagner 00005 // 00006 // dave@vanwagner.org 00007 // http://techwithdave.blogspot.com 00008 // 00009 // License: Creative Commons Attribution-ShareAlike 3.0 Unported License 00010 // http://creativecommons.org/licenses/by-sa/3.0/ 00011 /////////////////////////////////////////////////////////////////////////////// 00012 00013 #include <mbed.h> 00014 00015 class SPIDebug 00016 { 00017 private: 00018 SPI* spi; 00019 00020 public: 00021 SPIDebug(PinName mosi, PinName miso, PinName sclk, const char *name = NULL); 00022 virtual ~SPIDebug(); 00023 void format(int bits, int mode = 0); 00024 void frequency(int hz = 10000000); 00025 virtual int write(int value); 00026 static bool debug; // allow to be changed to control whether there are debug messages 00027 }; 00028 00029 class CSDebug 00030 { 00031 private: 00032 DigitalOut* cs; 00033 00034 public: 00035 CSDebug(PinName pin); 00036 ~CSDebug(); 00037 void write(bool state); 00038 };
Generated on Sat Jul 16 2022 02:59:49 by
1.7.2