/trunk/libraries/ds1307/demo/ds1307__demo.c |
---|
30,9 → 30,9 |
#include "../ds1307.h" |
#include <twi/twi.h> |
#include <useful/datetime.h> |
#include <avr/io.h> |
#include <util/delay.h> |
#include <stdio.h> |
50,6 → 50,9 |
******************************************************************************/ |
int main(void) |
{ |
// Initialize TWI. |
twi__initialize(DS1307__CLOCK_RATE); |
// Initialize RTC. |
ds1307__initialize(); |
/trunk/libraries/ds1307/ds1307.h |
---|
38,6 → 38,16 |
#include <useful/datetime.h> |
/****************************************************************************** |
* Public macro definitions. |
******************************************************************************/ |
/**************************************************************************//** |
* \def DS1307__CLOCK_RATE |
* \brief DS1307 frequency in Hertz. |
******************************************************************************/ |
#define DS1307__CLOCK_RATE 100000 |
/****************************************************************************** |
* Public type definitions. |
******************************************************************************/ |
/trunk/libraries/ds1307/src/ds1307.c |
---|
52,8 → 52,6 |
#define DS1307__REGISTER_ADDRESS__YEAR 0x06 |
#define DS1307__REGISTER_ADDRESS__CONTROL 0x07 |
#define DS1307__CLOCK_RATE 100000 |
/****************************************************************************** |
* Private function prototypes. |
******************************************************************************/ |
84,8 → 82,9 |
( |
void |
){ |
// We don't initialize TWI here: we may have several devices on the bus. |
// Initialize TWI. |
twi__initialize(DS1307__CLOCK_RATE); |
//twi__initialize(DS1307__CLOCK_RATE); |
} |
/**************************************************************************//** |
/trunk/libraries/deuligne/demo/deuligne__demo.c |
---|
29,6 → 29,8 |
******************************************************************************/ |
#include <deuligne/deuligne.h> |
#include <mcp23008/mcp23008.h> |
#include <twi/twi.h> |
#include <util/delay.h> |
48,6 → 50,9 |
( |
void |
){ |
// Initialize TWI. |
twi__initialize(MCP23008__CLOCK_RATE); |
// Initialize Deuligne and configure display. |
deuligne__initialize(); |
deuligne__set_display(true, false, false); |
/trunk/libraries/mcp23008/mcp23008.h |
---|
41,6 → 41,13 |
* Public macro definitions. |
******************************************************************************/ |
/**************************************************************************//** |
* \def MCP23008__CLOCK_RATE |
* \brief MCP23008 frequency in Hertz. |
* On ATmega, can be 100 kHz or 400 Khz. |
******************************************************************************/ |
#define MCP23008__CLOCK_RATE 400000 |
/****************************************************************************** |
* MCP23008 GPIOs. |
******************************************************************************/ |
/trunk/libraries/mcp23008/src/mcp23008.c |
---|
112,13 → 112,6 |
******************************************************************************/ |
#define MCP23008__REG_OLAT 0x0A |
/**************************************************************************//** |
* \def MCP23008__CLOCK_RATE |
* \brief MCP23008 frequency in Hertz. |
* On ATmega, can be 100 kHz or 400 Khz. |
******************************************************************************/ |
#define MCP23008__CLOCK_RATE 400000 |
/****************************************************************************** |
* Private function prototypes. |
******************************************************************************/ |
175,8 → 168,9 |
( |
uint8_t hardware_address |
){ |
// We don't initialize TWI here: we may have several devices on the bus. |
// Initialize TWI. |
twi__initialize(MCP23008__CLOCK_RATE); |
//twi__initialize(MCP23008__CLOCK_RATE); |
// Compute MCP23008 TWI address. |
mcp23008__twi_address = (MCP23008__ADDRESS | hardware_address) << 1; |