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

git-svn-id: svn+ssh://oldsvn/home/mlalondesvn/svn/cral@7 3ee9b42a-b53c-0410-a25e-f0b6218d5d5b
master
mlalondesvn 17 years ago
parent 835bc100b5
commit 1d1f320cd8

@ -0,0 +1,37 @@
#ifndef DS1337_CONFIG
#define DS1337_CONFIG
/**
* Define the DS1337 I2C addresses
**/
#define DS1337_WADDR B01101000 /* 0x68 */
// Ucomment this to enable setting the clock from a
// unix time stamp with gmt and dst correction
#define DS1337_USE_SET_UTS
// Uncomment this enable setting the clock using BCD
//#define DS1337_USE_BCD_CLOCKSET
// Uncomment this if you need to read back unix time stamp (without DTS correction)
//#define DS1337_USE_GET_UTS
// Uncomment this to support alarms
#define DS1337_USE_ALARMS
#ifdef DS1337_USE_ALARMS
// Uncomment this to allow use external alarm interrupts
#define DS1337_USE_ALARM_INTERRUPTS
// Uncomment this to allow alarm functions callback
#define DS1337_USE_ALARMS_CALLBACK
#endif
// Uncomment this to use integrity check functions
//#define DS1337_USE_OSC_INTEGRITY
// Uncomment this to support square wave output
// If this is enabled, alarm 2 will output it's interrupt on INTA
#define DS1337_USE_SQW_OUTPUT
#endif

@ -0,0 +1,18 @@
#ifndef DS1624_CONFIG
#define DS1624_CONFIG
/**
* Address byte selection
* Select 0 for low and 1 for high
**/
#define DS1624_A0 0
#define DS1624_A1 0
#define DS1624_A2 0
/**
* Comment this out if you don't want the
* init function to account for the ~1S startup
* delay for the first temperature sample!
**/
#define DS1624_HANDLE_BOOT_DELAY
#endif

@ -0,0 +1,15 @@
#ifndef DS1803_CONFIG
#define DS1803_CONFIG
/**
* Address byte selection
* Select 0 for low and 1 for high
**/
#define DS1803_A0 0
#define DS1803_A1 0
#define DS1803_A2 0
// Uncomment this to use the the read back function
//#define DS1803_USE_GET_VALUE_FUNC
#endif

@ -0,0 +1,53 @@
#ifndef TWILCD_CONFIG
#define TWILCD_CONFIG
/**
* Address byte selection
* Select 0 for low and 1 for high
**/
#define PCF8574_A0 0
#define PCF8574_A1 0
#define PCF8574_A2 0
// Uncomment this to use minimal mode (less functions, not as big)
// #define TWI_LCD_SMALL
#if defined(__AVR_ATmega168__) && !defined(TWI_LCD_SMALL)
// Uncomment this to enable use of a timeout after which the LCD turns off
#define TWI_LCD_USE_TIMEOUT
#ifdef TWI_LCD_USE_TIMEOUT
#define TWI_LCD_TIMEOUT 5000 /* In milliseconds (30 sec) */
#endif
// Uncomment this to enable control of the backlight on pin 3
#define TWI_LCD_CTRL
#ifdef TWI_LCD_CTRL
// Uncomment this to use PWM for backlight control.
//#define TWI_LCD_BL_PWM
#ifdef TWI_LCD_BL_PWM
// Set this to the default brightness for PWM controlled backlight
#define TWI_LCD_BL_LEVEL 255
#endif
#ifndef TWI_LCD_BL_PWM
// Uncomment this use the DS1803 digi-pot for display/backlight brightness
#define TWI_LCD_DPOT_CTRL
#ifdef TWI_LCD_DPOT_CTRL
// Set this to the default value of the backlight (0 to 254)
#define TWI_LCD_BL_LEVEL 254
// Set this to the default value of the display brightness (0 to 254)
#define TWI_LCD_DB_LEVEL 225
#endif
#endif
// End LCD Control
#endif
// End Small version
#endif
#endif

@ -2,8 +2,6 @@ extern "C" {
#include <Wire/Wire.h> #include <Wire/Wire.h>
} }
#include "../global.h"
#include "../configs/RTC/rtcConfig.h"
#include "ds1337.h" #include "ds1337.h"
// Internal macro for storing month days! // Internal macro for storing month days!

@ -9,39 +9,9 @@
// include types & constants of Wiring core API // include types & constants of Wiring core API
#include "../global.h" #include "../global.h"
// include types & constants of Wire ic2 lib #include "../global.h"
#include <Wire/Wire.h>
// Include global RTC configs
#include "../configs/RTC/rtcConfig.h" #include "../configs/RTC/rtcConfig.h"
#include "../configs/ds1337/ds1337.h"
// Ucomment this to enable setting the clock from a
// unix time stamp with gmt and dst correction
#define DS1337_USE_SET_UTS
// Uncomment this enable setting the clock using BCD
//#define DS1337_USE_BCD_CLOCKSET
// Uncomment this if you need to read back unix time stamp (without DTS correction)
//#define DS1337_USE_GET_UTS
// Uncomment this to support alarms
#define DS1337_USE_ALARMS
#ifdef DS1337_USE_ALARMS
// Uncomment this to allow use external alarm interrupts
#define DS1337_USE_ALARM_INTERRUPTS
// Uncomment this to allow alarm functions callback
#define DS1337_USE_ALARMS_CALLBACK
#endif
// Uncomment this to use integrity check functions
//#define DS1337_USE_OSC_INTEGRITY
// Uncomment this to support square wave output
// If this is enabled, alarm 2 will output it's interrupt on INTA
#define DS1337_USE_SQW_OUTPUT
/** /**
* Define the position of the RTC buffer values * Define the position of the RTC buffer values
@ -68,7 +38,9 @@
/** /**
* Define the DS1337 I2C addresses * Define the DS1337 I2C addresses
**/ **/
#ifndef DS1337_WADDR
#define DS1337_WADDR 0x68 #define DS1337_WADDR 0x68
#endif
#define DS1337_RADDR DS1337_WADDR | 0x01 #define DS1337_RADDR DS1337_WADDR | 0x01
/** /**

@ -2,7 +2,6 @@ extern "C" {
#include <Wire/Wire.h> #include <Wire/Wire.h>
} }
#include "../global.h"
#include "ds1624.h" #include "ds1624.h"
DS1624::DS1624() DS1624::DS1624()

@ -1,27 +1,8 @@
#ifndef DS1624_H #ifndef DS1624_H
#define DS1624_H #define DS1624_H
// include types & constants of Wiring core API #include "../global.h"
#include <WConstants.h> #include "../configs/ds1624/ds1624.h"
#include <inttypes.h>
// include types & constants of Wire ic2 lib
#include <Wire/Wire.h>
/**
* Comment this out if you don't want the
* init function to account for the ~1S startup
* delay for the first temperature sample!
**/
#define DS1624_HANDLE_BOOT_DELAY
/**
* Address byte selection
* Select 0 for low and 1 for high
**/
#define DS1624_A0 0
#define DS1624_A1 0
#define DS1624_A2 0
#define DS1624_BASE_ADDR B01001000 #define DS1624_BASE_ADDR B01001000
#define DS1624_ADDR DS1624_BASE_ADDR | (DS1624_A0 * B00000001) | (DS1624_A1 * B00000010) | (DS1624_A2 * B00000100) #define DS1624_ADDR DS1624_BASE_ADDR | (DS1624_A0 * B00000001) | (DS1624_A1 * B00000010) | (DS1624_A2 * B00000100)

@ -3,6 +3,7 @@ extern "C" {
} }
#include "../global.h" #include "../global.h"
#include "../configs/ds1803/ds1803.h"
#include "ds1803.h" #include "ds1803.h"
DS1803::DS1803() DS1803::DS1803()
@ -30,7 +31,8 @@ void DS1803::setWiper(uint8_t value, uint8_t wiperAddr)
Wire.endTransmission(); Wire.endTransmission();
} }
/*
#ifdef DS1803_USE_GET_VALUE_FUNC
uint8_t DS1803::getValue() uint8_t DS1803::getValue()
{ {
if (!Wire.checkAddress(DS1803_WADDR)) return; if (!Wire.checkAddress(DS1803_WADDR)) return;
@ -43,4 +45,4 @@ uint8_t DS1803::getValue()
return 0; return 0;
} }
*/ #endif

@ -1,53 +1,57 @@
#ifndef DS1803_H #ifndef DS1803_H
#define DS1803_H #define DS1803_H
#include <inttypes.h>
#include "../configs/ds1803/ds1803.h"
#include <inttypes.h> #ifdef DS1803_A0
#define DS1803_A0 0
/** #endif
* Address byte selection #ifdef DS1803_A1
* Select 0 for low and 1 for high #define DS1803_A1 0
**/ #endif
#define DS1803_A0 0 #ifdef DS1803_A2
#define DS1803_A1 0 #define DS1803_A2 0
#define DS1803_A2 0 #endif
#define DS1803_BASE_ADDR B00101000 #define DS1803_BASE_ADDR B00101000
#define DS1803_WADDR DS1803_BASE_ADDR | (DS1803_A0 * B00000001) | (DS1803_A1 * B00000010) | (DS1803_A2 * B00000100) #define DS1803_WADDR DS1803_BASE_ADDR | (DS1803_A0 * B00000001) | (DS1803_A1 * B00000010) | (DS1803_A2 * B00000100)
#define DS1803_RADDR DS1803_WADDR | 0x01 #define DS1803_RADDR DS1803_WADDR | 0x01
/** /**
* The number of available potentiometer wipers * The number of available potentiometer wipers
**/ **/
#define DS1803_NBR_WIPERS 0x02 #define DS1803_NBR_WIPERS 0x02
/** /**
* Digital pot selection commands * Digital pot selection commands
**/ **/
#define DS1803_WIPERS B10101111 #define DS1803_WIPERS B10101111
#define DS1803_WIPER_0 B10101001 #define DS1803_WIPER_0 B10101001
#define DS1803_WIPER_1 B10101010 #define DS1803_WIPER_1 B10101010
/** /**
* Macros * Macros
**/ **/
#define setWiper1(value) setWiper(value, DS1803_WIPER_0) #define setWiper1(value) setWiper(value, DS1803_WIPER_0)
#define setWiper2(value) setWiper(value, DS1803_WIPER_1) #define setWiper2(value) setWiper(value, DS1803_WIPER_1)
#define setWipers(value) setWiper(value, DS1803_WIPERS) #define setWipers(value) setWiper(value, DS1803_WIPERS)
/** /**
* DS1803 I2C Dual Digital Pot. * DS1803 I2C Dual Digital Pot.
**/ **/
class DS1803 class DS1803
{ {
public: public:
DS1803(); DS1803();
void setWiper(uint8_t, uint8_t); void setWiper(uint8_t, uint8_t);
//uint8_t getValue(); #ifdef DS1803_USE_GET_VALUE_FUNC
}; uint8_t getValue();
#endif
/** };
* Define the object's name
**/ /**
extern DS1803 DPOT; * Define the object's name
**/
extern DS1803 DPOT;
#endif #endif

@ -2,8 +2,6 @@ extern "C" {
#include <Wire/Wire.h> #include <Wire/Wire.h>
} }
#include "../global.h"
#include "../configs/LCD/lcd.h"
#include "twiLCD.h" #include "twiLCD.h"
#ifdef TWI_LCD_DPOT_CTRL #ifdef TWI_LCD_DPOT_CTRL

@ -3,16 +3,18 @@
#include "../global.h" #include "../global.h"
#include "../configs/LCD/lcd.h" #include "../configs/LCD/lcd.h"
#include "twiLCDConfig.h" #include "../configs/twiLCD/twiLCD.h"
/** #ifndef PCF8574_A0
* Address byte selection
* Select 0 for low and 1 for high
**/
#define PCF8574_A0 0 #define PCF8574_A0 0
#endif
#ifndef PCF8574_A1
#define PCF8574_A1 0 #define PCF8574_A1 0
#endif
#ifndef PCF8574_A2
#define PCF8574_A2 0 #define PCF8574_A2 0
#endif
#define PCF8574_BASE_ADDR B00100000 #define PCF8574_BASE_ADDR B00100000
#define PCF8574_WADDR PCF8574_BASE_ADDR | (PCF8574_A0 * B00000001) | (PCF8574_A1 * B00000010) | (PCF8574_A2 * B00000100) #define PCF8574_WADDR PCF8574_BASE_ADDR | (PCF8574_A0 * B00000001) | (PCF8574_A1 * B00000010) | (PCF8574_A2 * B00000100)
#define PCF8574_RADDR PCF8574_WADDR | 0x01 #define PCF8574_RADDR PCF8574_WADDR | 0x01

@ -1,45 +0,0 @@
#ifndef TWI_LCD_CONF_H
#define TWI_LCD_CONF_H
// Uncomment this to use minimal mode (less functions, not as big)
// #define TWI_LCD_SMALL
#if defined(__AVR_ATmega168__) && !defined(TWI_LCD_SMALL)
// Uncomment this to enable use of a timeout after which the LCD turns off
#define TWI_LCD_USE_TIMEOUT
#ifdef TWI_LCD_USE_TIMEOUT
#define TWI_LCD_TIMEOUT 5000 /* In milliseconds (30 sec) */
#endif
// Uncomment this to enable control of the backlight on pin 3
#define TWI_LCD_CTRL
#ifdef TWI_LCD_CTRL
// Uncomment this to use PWM for backlight control.
//#define TWI_LCD_BL_PWM
#ifdef TWI_LCD_BL_PWM
// Set this to the default brightness for PWM controlled backlight
#define TWI_LCD_BL_LEVEL 255
#endif
#ifndef TWI_LCD_BL_PWM
// Uncomment this use the DS1803 digi-pot for display/backlight brightness
#define TWI_LCD_DPOT_CTRL
#ifdef TWI_LCD_DPOT_CTRL
// Set this to the default value of the backlight (0 to 254)
#define TWI_LCD_BL_LEVEL 254
// Set this to the default value of the display brightness (0 to 254)
#define TWI_LCD_DB_LEVEL 225
#endif
#endif
// End LCD Control
#endif
// End Small version
#endif
#endif
Loading…
Cancel
Save