From: batt Date: Mon, 31 Aug 2009 18:11:02 +0000 (+0000) Subject: Make hw files more generic. X-Git-Tag: 2.2.0~134 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=e61510a7ef8893c7502701f01b8f09fd859bca57;p=bertos.git Make hw files more generic. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2834 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/hw/hw_sd.h b/bertos/hw/hw_sd.h index 754b87ce..d15b5506 100644 --- a/bertos/hw/hw_sd.h +++ b/bertos/hw/hw_sd.h @@ -40,12 +40,14 @@ #ifndef HW_SD_H #define HW_SD_H -#define SD_CS_INIT() do { PIOA_PER = BV(11); PIOA_OER = BV(11); } while(0) -#define SD_CS_ON() do { PIOA_CODR = BV(11); } while(0) -#define SD_CS_OFF() do { PIOA_SODR = BV(11); } while(0) +#warning FIXME: This is an example implementation, you must implement it -#define SD_PIN_INIT() do { PIOA_PER = BV(30) | BV(31); PIOA_PUER = BV(30) | BV(31); } while(0) -#define SD_CARD_PRESENT() (!(PIOA_PDSR & BV(31))) -#define SD_WRITE_PROTECT() ((PIOA_PDSR & BV(30))) +#define SD_CS_INIT() do { /* implement me */} while(0) +#define SD_CS_ON() do { /* implement me */} while(0) +#define SD_CS_OFF() do { /* implement me */} while(0) + +#define SD_PIN_INIT() do { /* implement me */} while(0) +#define SD_CARD_PRESENT() true /* implement me */ +#define SD_WRITE_PROTECT() false /* implement me */ #endif /* HW_SD_H */ diff --git a/bertos/hw/hw_tas5706a.h b/bertos/hw/hw_tas5706a.h index e67a1405..33132ec3 100644 --- a/bertos/hw/hw_tas5706a.h +++ b/bertos/hw/hw_tas5706a.h @@ -43,26 +43,23 @@ #include #include -#define TAS5706A_SETPOWERDOWN(val) do { if (val) PIOA_CODR = BV(6); else PIOA_SODR = BV(6); } while (0) -#define TAS5706A_SETRESET(val) do { if (val) PIOA_CODR = BV(7); else PIOA_SODR = BV(7); } while (0) -#define TAS5706A_SETMUTE(val) do { if (val) PIOA_CODR = BV(8); else PIOA_SODR = BV(8); } while (0) +#warning FIXME: This is an example implementation, you must implement it + +#define TAS5706A_SETPOWERDOWN(val) do { /* implement me */ } while (0) +#define TAS5706A_SETRESET(val) do { /* implement me */ } while (0) +#define TAS5706A_SETMUTE(val) do { /* implement me */ } while (0) #define TAS5706A_PIN_INIT() \ do { \ TAS5706A_SETPOWERDOWN(true); \ TAS5706A_SETRESET(true); \ TAS5706A_SETMUTE(true); \ - PIOA_PER = BV(6) | BV(7) | BV(8); \ - PIOA_OER = BV(6) | BV(7) | BV(8); \ + /* complete me */ \ } while (0) #define TAS5706A_MCLK_INIT() \ do { \ - PIOA_PDR = BV(2); /* enable PWM pin */ \ - PWM_CMR2 = 0; /* set prescaler to MCK, left aligned, start with low level */ \ - PWM_CPRD2 = 4; /* 11.2896 MHz MCLK */ \ - PWM_CDTY2 = 2; /* 50% duty */ \ - PWM_ENA = BV(2); /* Enable PWM on MCLK pin */ \ + /* implement me */ \ } while(0)