forked from len0rd/rockbox
Fuzev2: FM - tested on 2 different models
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25818 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
aec0af5413
commit
a69e1c4a44
3 changed files with 38 additions and 7 deletions
|
@ -21,7 +21,7 @@
|
|||
|
||||
/* Define bitmask of input sources - recordable bitmask can be defined
|
||||
explicitly if different */
|
||||
#define INPUT_SRC_CAPS (SRC_CAP_MIC /*| SRC_CAP_FMRADIO*/)
|
||||
#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO)
|
||||
|
||||
/* define this if you have a bitmap LCD display */
|
||||
#define HAVE_LCD_BITMAP
|
||||
|
@ -117,7 +117,7 @@
|
|||
#define AB_REPEAT_ENABLE 1
|
||||
|
||||
/* FM Tuner - suspected to be the SI4702 */
|
||||
//#define CONFIG_TUNER SI4700
|
||||
#define CONFIG_TUNER SI4700
|
||||
/* #define HAVE_TUNER_PWR_CTRL */
|
||||
|
||||
/* Define this for LCD backlight available */
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "as3525.h"
|
||||
#include "generic_i2c.h"
|
||||
#include "fmradio_i2c.h"
|
||||
#include "system.h"
|
||||
|
||||
#if defined(SANSA_CLIP) || defined(SANSA_C200V2)
|
||||
#define I2C_SCL_GPIO(x) GPIOB_PIN(x)
|
||||
|
@ -63,6 +64,14 @@
|
|||
#define I2C_SCL_PIN 6
|
||||
#define I2C_SDA_PIN 7
|
||||
|
||||
#elif defined(SANSA_FUZEV2)
|
||||
#define I2C_SCL_GPIO(x) GPIOB_PIN(x)
|
||||
#define I2C_SDA_GPIO(x) GPIOA_PIN(x)
|
||||
#define I2C_SCL_GPIO_DIR GPIOB_DIR
|
||||
#define I2C_SDA_GPIO_DIR GPIOA_DIR
|
||||
#define I2C_SCL_PIN 1
|
||||
#define I2C_SDA_PIN 0
|
||||
|
||||
#else
|
||||
#error no FM I2C GPIOPIN defines
|
||||
#endif
|
||||
|
@ -158,13 +167,28 @@ void fmradio_i2c_init(void)
|
|||
|
||||
int fmradio_i2c_write(unsigned char address, const unsigned char* buf, int count)
|
||||
{
|
||||
return i2c_write_data(fm_i2c_bus, address, -1, buf, count);
|
||||
#ifdef SANSA_FUZEV2
|
||||
int s = disable_irq_save();
|
||||
CCU_IO &= ~(1<<12);
|
||||
#endif
|
||||
int ret = i2c_write_data(fm_i2c_bus, address, -1, buf, count);
|
||||
#ifdef SANSA_FUZEV2
|
||||
CCU_IO |= 1<<12;
|
||||
restore_irq(s);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
int fmradio_i2c_read(unsigned char address, unsigned char* buf, int count)
|
||||
{
|
||||
return i2c_read_data(fm_i2c_bus, address, -1, buf, count);
|
||||
#ifdef SANSA_FUZEV2
|
||||
int s = disable_irq_save();
|
||||
CCU_IO &= ~(1<<12);
|
||||
#endif
|
||||
int ret = i2c_read_data(fm_i2c_bus, address, -1, buf, count);
|
||||
#ifdef SANSA_FUZEV2
|
||||
CCU_IO |= 1<<12;
|
||||
restore_irq(s);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -232,6 +232,10 @@ int button_read_device(void)
|
|||
|
||||
CCU_IO &= ~(1<<12);
|
||||
|
||||
/* B1 is shared with FM i2c */
|
||||
bool gpiob_pin0_dir = GPIOB_DIR & (1<<1);
|
||||
GPIOB_DIR &= ~(1<<1);
|
||||
|
||||
GPIOB_PIN(0) = 1<<0;
|
||||
udelay(4);
|
||||
|
||||
|
@ -266,6 +270,9 @@ int button_read_device(void)
|
|||
}
|
||||
}
|
||||
|
||||
if(gpiob_pin0_dir)
|
||||
GPIOB_DIR |= 1<<1;
|
||||
|
||||
CCU_IO |= 1<<12;
|
||||
|
||||
#ifdef HAS_BUTTON_HOLD
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue