Libraries and Example of mbed parallel bus using I2C port expanders

Dependencies:   HDSP253X mbed PCF8574_Bus

Committer:
wim
Date:
Wed Aug 31 19:45:31 2011 +0000
Revision:
0:2467aed99127
First Version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wim 0:2467aed99127 1
wim 0:2467aed99127 2 /*
wim 0:2467aed99127 3 Copyright (c) 2010 Donatien Garnier (donatiengar [at] gmail [dot] com)
wim 0:2467aed99127 4
wim 0:2467aed99127 5 Permission is hereby granted, free of charge, to any person obtaining a copy
wim 0:2467aed99127 6 of this software and associated documentation files (the "Software"), to deal
wim 0:2467aed99127 7 in the Software without restriction, including without limitation the rights
wim 0:2467aed99127 8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
wim 0:2467aed99127 9 copies of the Software, and to permit persons to whom the Software is
wim 0:2467aed99127 10 furnished to do so, subject to the following conditions:
wim 0:2467aed99127 11
wim 0:2467aed99127 12 The above copyright notice and this permission notice shall be included in
wim 0:2467aed99127 13 all copies or substantial portions of the Software.
wim 0:2467aed99127 14
wim 0:2467aed99127 15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
wim 0:2467aed99127 16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
wim 0:2467aed99127 17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
wim 0:2467aed99127 18 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
wim 0:2467aed99127 19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
wim 0:2467aed99127 20 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
wim 0:2467aed99127 21 THE SOFTWARE.
wim 0:2467aed99127 22 */
wim 0:2467aed99127 23
wim 0:2467aed99127 24 #define __DEBUG
wim 0:2467aed99127 25 #include "Dbg.h"
wim 0:2467aed99127 26 #include "mbed.h"
wim 0:2467aed99127 27 #include <cstdarg>
wim 0:2467aed99127 28
wim 0:2467aed99127 29 void DebugStream::debug(const char* format, ...)
wim 0:2467aed99127 30 {
wim 0:2467aed99127 31 va_list argp;
wim 0:2467aed99127 32
wim 0:2467aed99127 33 va_start(argp, format);
wim 0:2467aed99127 34 vprintf(format, argp);
wim 0:2467aed99127 35 va_end(argp);
wim 0:2467aed99127 36 }
wim 0:2467aed99127 37
wim 0:2467aed99127 38 void DebugStream::release()
wim 0:2467aed99127 39 {
wim 0:2467aed99127 40
wim 0:2467aed99127 41 }
wim 0:2467aed99127 42
wim 0:2467aed99127 43 void DebugStream::breakPoint(const char* file, int line)
wim 0:2467aed99127 44 {
wim 0:2467aed99127 45 printf("\r\nBREAK in %s at line %d\r\n", file, line);
wim 0:2467aed99127 46 fflush(stdout);
wim 0:2467aed99127 47 getchar();
wim 0:2467aed99127 48 fflush(stdin);
wim 0:2467aed99127 49 }
wim 0:2467aed99127 50
wim 0:2467aed99127 51 /*
wim 0:2467aed99127 52 int snprintf(char *str, int size, const char *format, ...)
wim 0:2467aed99127 53 {
wim 0:2467aed99127 54 va_list argp;
wim 0:2467aed99127 55
wim 0:2467aed99127 56 va_start(argp, format);
wim 0:2467aed99127 57 vsprintf(str, format, argp);
wim 0:2467aed99127 58 va_end(argp);
wim 0:2467aed99127 59
wim 0:2467aed99127 60 return strlen(str);
wim 0:2467aed99127 61 }
wim 0:2467aed99127 62 */