fix i2c bug for camera. small fix camera library/sample.

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/twl_wrapsdk/trunk@93 4ee2a332-4b2b-5046-8439-1ba90f034370
This commit is contained in:
yutaka 2007-05-28 11:27:59 +00:00
parent 9194271a66
commit 5b4309a68b
5 changed files with 22 additions and 16 deletions

View File

@ -31,11 +31,11 @@ extern BOOL CAMERAi_I2CPreset_A3AFX_EVT3_30fps_Subsampling_16_7M_50Hz( void );
typedef BOOL (*CameraI2CPresetFunc)(void);
static CameraI2CPresetFunc gs_preset[] = {
CAMERAi_I2CPreset_A3AFX_EVT2_20fps_16M_PLLoff_hVGA,
CAMERAi_I2CPreset_A3AFX_EVT2_30fps_16M_QVGA,
// CAMERAi_I2CPreset_A3AFX_EVT2_20fps_16M_PLLoff_hVGA,
// CAMERAi_I2CPreset_A3AFX_EVT2_30fps_16M_QVGA,
CAMERAi_I2CPreset_A3AFX_EVT2_20fps_16M,
CAMERAi_I2CPreset_320x240_noPLL_20fps,
CAMERAi_I2CPreset_320x240_PLL_30fps,
// CAMERAi_I2CPreset_320x240_noPLL_20fps,
// CAMERAi_I2CPreset_320x240_PLL_30fps,
CAMERAi_I2CPreset_A3AFX_EVT3_30fps_Scaledown_16_7M_50Hz,
CAMERAi_I2CPreset_A3AFX_EVT3_30fps_Subsampling_16_7M_50Hz,
};

View File

@ -23,9 +23,8 @@ my $file_head_format =<<'EOF';
//#define PRINT_DEBUG
#ifdef PRINT_DEBUG
#include <twl/vlink.h>
#define DBG_PRINTF vlink_dos_printf
#define DBG_CHAR vlink_dos_put_console
#include <nitro/os/common/printf.h>
#define DBG_PRINTF OS_TPrintf
#else
#define DBG_PRINTF( ... ) ((void)0)
#define DBG_CHAR( c ) ((void)0)

View File

@ -35,6 +35,8 @@ static void CameraIntr(void);
*---------------------------------------------------------------------------*/
void TwlMain()
{
CAMERAResult result;
// <20>‰Šú‰»
OS_Init();
GX_Init();
@ -63,8 +65,13 @@ void TwlMain()
CAMERA_SelectCamera(CAMERA_SELECT_FIRST);
CAMERA_PowerOn();
CAMERA_I2CInit();
CAMERA_I2CPreset(CAMERA_PRESET_QVGA_30SD);
result = CAMERA_I2CInit();
if (result != CAMERA_RESULT_SUCCESS_TRUE)
OS_TPrintf("CAMERA_I2CInit was failed. (%d)\n", result);
result = CAMERA_I2CPreset(CAMERA_PRESET_VGA_20);
if (result != CAMERA_RESULT_SUCCESS_TRUE)
OS_TPrintf("CAMERA_I2CPreset was failed. (%d)\n", result);
CAMERA_SetCropping(0, 0, 320, 240);
CAMERA_SetTrimmingParamsCenter(WIDTH, HEIGHT, 320, 240); // clipped by camera i/f
CAMERA_SetTrimming(TRUE);
@ -119,7 +126,7 @@ void CameraIntr(void)
OSTick current = OS_GetTick();
if (MIi_IsExDmaBusy(DMA_NO))
{
OS_TPrintf("Why??? %d\n", (int)current);
OS_TPrintf("DMA was not done until VBlank.\n");
OS_SetIrqCheckFlag(OS_IE_CAM);
return;
}

View File

@ -46,16 +46,16 @@ typedef enum {
} CameraSpecialMode;
typedef enum {
CAMERA_PRESET_HVGA_20,
CAMERA_PRESET_DS_30,
// CAMERA_PRESET_HVGA_20,
// CAMERA_PRESET_DS_30,
CAMERA_PRESET_VGA_20,
CAMERA_PRESET_QVGA_20,
CAMERA_PRESET_QVGA_30,
// CAMERA_PRESET_QVGA_20,
// CAMERA_PRESET_QVGA_30,
CAMERA_PRESET_QVGA_30SD,
CAMERA_PRESET_QVGA_30SS,
CAMERA_PRESET_MAX,
CAMERA_PRESET_DEFAULT = CAMERA_PRESET_HVGA_20
CAMERA_PRESET_DEFAULT = CAMERA_PRESET_QVGA_30SD
} CameraPreset;

View File

@ -32,7 +32,7 @@ extern "C" {
typedef enum
{
I2C_SLAVE_CODEC_TP = 0,
I2C_SLAVE_CAMERA = 2,
I2C_SLAVE_CAMERA,
I2C_SLAVE_NUM
}
I2CSlave;