H300: RTC support

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8284 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2005-12-22 23:48:32 +00:00
parent 0dac8b77b8
commit e57471a1be
5 changed files with 41 additions and 3 deletions

View File

@ -93,10 +93,15 @@
7*ICONS_SPACING
#define STATUSBAR_LOCKR_WIDTH 5
#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
#define STATUSBAR_DISK_WIDTH 12
#define STATUSBAR_DISK_X_POS(statusbar_width) statusbar_width - \
STATUSBAR_DISK_WIDTH
#define STATUSBAR_TIME_X_END(statusbar_width) statusbar_width-1
#else
#define STATUSBAR_DISK_WIDTH 0
#endif
#define STATUSBAR_TIME_X_END(statusbar_width) statusbar_width - 1 - \
STATUSBAR_DISK_WIDTH
struct gui_syncstatusbar statusbars;

View File

@ -53,7 +53,7 @@
#define SETTINGS_CANCEL2 BUTTON_MODE
#define SETTINGS_PREV BUTTON_LEFT
#define SETTINGS_NEXT BUTTON_RIGHT
#define SETTINGS_ACCEPT BUTTON_MODE
#define SETTINGS_ACCEPT BUTTON_ON
#elif CONFIG_KEYPAD == RECORDER_PAD
#define SETTINGS_INC BUTTON_UP

View File

@ -105,7 +105,7 @@ drivers/pcf50606.c
#if defined(APPLE_IPODCOLOR) || defined(APPLE_IPODNANO) || defined(APPLE_IPODVIDEO)
drivers/pcf50605.c
#endif
#if CONFIG_RTC == RTC_M41ST84W
#if (CONFIG_RTC == RTC_M41ST84W) || (CONFIG_RTC == RTC_PCF50606)
drivers/rtc.c
#endif
drivers/serial.c

View File

@ -21,12 +21,41 @@
#include "i2c.h"
#include "rtc.h"
#include "kernel.h"
#include "system.h"
#include "pcf50606.h"
#include <stdbool.h>
#define RTC_ADR 0xd0
#define RTC_DEV_WRITE (RTC_ADR | 0x00)
#define RTC_DEV_READ (RTC_ADR | 0x01)
#if CONFIG_RTC == RTC_PCF50606
void rtc_init(void)
{
}
int rtc_read_datetime(unsigned char* buf) {
int rc;
int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL);
rc = pcf50606_read_multiple(0x0a, buf, 7);
set_irq_level(oldlevel);
return rc;
}
int rtc_write_datetime(unsigned char* buf) {
int rc;
int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL);
rc = pcf50606_write_multiple(0x0a, buf, 7);
set_irq_level(oldlevel);
return rc;
}
#else
void rtc_init(void)
{
unsigned char data;
@ -278,5 +307,6 @@ int rtc_write_datetime(unsigned char* buf) {
return rc;
}
#endif /* CONFIG_RTC == RTC_PCF50606 */
#endif /* CONFIG_RTC */

View File

@ -30,6 +30,9 @@
/* Define this if you do software codec */
#define CONFIG_CODEC SWCODEC
/* define this if you have a real-time clock */
#define CONFIG_RTC RTC_PCF50606
/* Define this if you have an remote lcd */
#define HAVE_REMOTE_LCD