Changeset 7 for ds1803

Show
Ignore:
Timestamp:
10/17/07 18:30:26 (15 months ago)
Author:
mlalondesvn
Message:

General:

MODIF - Moved all of the configurations out of the libraries and into the configs

Location:
ds1803
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • ds1803/ds1803.cpp

    r6 r7  
    44 
    55#include "../global.h" 
     6#include "../configs/ds1803/ds1803.h" 
    67#include "ds1803.h" 
    78 
     
    3132    Wire.endTransmission(); 
    3233} 
    33 /* 
     34 
     35#ifdef DS1803_USE_GET_VALUE_FUNC 
    3436uint8_t DS1803::getValue() 
    3537{ 
     
    4446    return 0; 
    4547} 
    46 */ 
     48#endif 
  • ds1803/ds1803.h

    r6 r7  
    11#ifndef DS1803_H 
    22#define DS1803_H 
     3    #include <inttypes.h> 
     4    #include "../configs/ds1803/ds1803.h" 
    35 
    4 #include <inttypes.h> 
     6#ifdef DS1803_A0 
     7    #define DS1803_A0           0 
     8#endif 
     9#ifdef DS1803_A1 
     10    #define DS1803_A1           0 
     11#endif 
     12#ifdef DS1803_A2 
     13    #define DS1803_A2           0 
     14#endif 
    515 
    6 /** 
    7  * Address byte selection 
    8  * Select 0 for low and 1 for high 
    9 **/ 
    10 #define DS1803_A0           0 
    11 #define DS1803_A1           0 
    12 #define DS1803_A2           0 
     16    #define DS1803_BASE_ADDR    B00101000 
     17    #define DS1803_WADDR        DS1803_BASE_ADDR | (DS1803_A0 * B00000001) | (DS1803_A1 * B00000010) | (DS1803_A2 * B00000100) 
     18    #define DS1803_RADDR        DS1803_WADDR | 0x01 
    1319 
    14 #define DS1803_BASE_ADDR    B00101000 
    15 #define DS1803_WADDR        DS1803_BASE_ADDR | (DS1803_A0 * B00000001) | (DS1803_A1 * B00000010) | (DS1803_A2 * B00000100) 
    16 #define DS1803_RADDR        DS1803_WADDR | 0x01 
     20    /** 
     21     * The number of available potentiometer wipers 
     22    **/ 
     23    #define DS1803_NBR_WIPERS   0x02 
    1724 
    18 /** 
    19  * The number of available potentiometer wipers 
    20 **/ 
    21 #define DS1803_NBR_WIPERS   0x02 
     25    /** 
     26     * Digital pot selection commands 
     27    **/ 
     28    #define DS1803_WIPERS   B10101111 
     29    #define DS1803_WIPER_0  B10101001 
     30    #define DS1803_WIPER_1  B10101010 
    2231 
    23 /** 
    24  * Digital pot selection commands 
    25 **/ 
    26 #define DS1803_WIPERS   B10101111 
    27 #define DS1803_WIPER_0  B10101001 
    28 #define DS1803_WIPER_1  B10101010 
     32    /** 
     33     * Macros 
     34    **/ 
     35    #define setWiper1(value) setWiper(value, DS1803_WIPER_0) 
     36    #define setWiper2(value) setWiper(value, DS1803_WIPER_1) 
     37    #define setWipers(value) setWiper(value, DS1803_WIPERS) 
    2938 
    30 /** 
    31  * Macros 
    32 **/ 
    33 #define setWiper1(value) setWiper(value, DS1803_WIPER_0) 
    34 #define setWiper2(value) setWiper(value, DS1803_WIPER_1) 
    35 #define setWipers(value) setWiper(value, DS1803_WIPERS) 
     39    /** 
     40     * DS1803 I2C Dual Digital Pot. 
     41    **/ 
     42    class DS1803 
     43    { 
     44        public: 
     45            DS1803(); 
     46            void setWiper(uint8_t, uint8_t); 
     47        #ifdef DS1803_USE_GET_VALUE_FUNC 
     48            uint8_t getValue(); 
     49        #endif 
     50    }; 
    3651 
    37 /** 
    38  * DS1803 I2C Dual Digital Pot. 
    39 **/ 
    40 class DS1803 
    41 { 
    42     public: 
    43         DS1803(); 
    44         void setWiper(uint8_t, uint8_t); 
    45         //uint8_t getValue(); 
    46 }; 
    47  
    48 /** 
    49  * Define the object's name 
    50 **/ 
    51 extern DS1803 DPOT; 
     52    /** 
     53     * Define the object's name 
     54    **/ 
     55    extern DS1803 DPOT; 
    5256 
    5357#endif