hai juliana
i want to know the pan1315 bluetooth module is the correct bluetooth module for the ezdsp5515 usbstick .
i was trying to interface the io expander ic pca9534 and i used the csl program for i2c_pollexample and i find it is not working and the code is given below.
in this all address pins are set low
/* ============================================================================
* Copyright (c) Texas Instruments Inc 2002, 2003, 2004, 2005, 2008
*
* Use of this software is controlled by the terms and conditions found in the
* license agreement under which this software has been supplied.
* ============================================================================
*/
/** @file csl_i2c_polled_example.c * * @brief I2C functional layer polled mode example source file * * Path: \(CSLPATH)\example\i2c\example1 */ /* ============================================================================ * Revision History * ================ * 16-Oct-2008 Created * ============================================================================ */ #include <csl_i2c.h> #include <stdio.h>
#define CSL_I2C_TEST_PASSED (0) #define CSL_I2C_TEST_FAILED (1)
#define CSL_I2C_DATA_SIZE (64) #define CSL_EEPROM_ADDR_SIZE (2) #define CSL_I2C_OWN_ADDR (0x2F) #define CSL_I2C_SYS_CLK (12.228) //#define CSL_I2C_SYS_CLK (40) //#define CSL_I2C_SYS_CLK (60) //#define CSL_I2C_SYS_CLK (75) //#define CSL_I2C_SYS_CLK (100) #define CSL_I2C_BUS_FREQ (10) #define CSL_I2C_EEPROM_ADDR (0x50) #define CSL_I2C_CODEC_ADDR (0x18)
Uint16 gI2cWrBuf[CSL_I2C_DATA_SIZE + CSL_EEPROM_ADDR_SIZE]; Uint16 gI2cRdBuf[CSL_I2C_DATA_SIZE]; CSL_I2cSetup i2cSetup; CSL_I2cConfig i2cConfig; CSL_Status CSL_i2cPolledTest( );
CSL_Status portic( );
CSL_Status i2cport( );
/** * \brief main function * * \param none * * \return none */ void )
{ CSL_Status result; printf( );
result = portic(); (result == CSL_I2C_TEST_PASSED)
{ printf( );
} else
{ printf( );
} }
// io expansion ic interface CSL_Status portic( )
{ CSL_Status status; CSL_Status result; Uint16 startStop; Uint16 looper;
result = CSL_I2C_TEST_FAILED; gI2cWrBuf[0] = 0x01; gI2cWrBuf[1] = 0xFF; /* Assign the EEPROM page address */ // gI2cWrBuf[0] = 0x0; // gI2cWrBuf[1] = 0x0; // for(looper = 0; looper < CSL_I2C_DATA_SIZE; looper++) // { // gI2cWrBuf[looper + CSL_EEPROM_ADDR_SIZE] = looper; // gI2cRdBuf[looper] = 0x0000; // } /* Initialize I2C module */ status = I2C_init(CSL_I2C0); (status != CSL_SOK)
{ printf( );
(result);
} /* Setup I2C module */ i2cSetup.addrMode = CSL_I2C_ADDR_7BIT; i2cSetup.bitCount = CSL_I2C_BC_8BITS; i2cSetup.loopBack = CSL_I2C_LOOPBACK_DISABLE; i2cSetup.freeMode = CSL_I2C_FREEMODE_DISABLE; i2cSetup.repeatMode = CSL_I2C_REPEATMODE_DISABLE; i2cSetup.ownAddr = CSL_I2C_OWN_ADDR; i2cSetup.sysInputClk = CSL_I2C_SYS_CLK; i2cSetup.i2cBusFreq = CSL_I2C_BUS_FREQ; startStop = ((CSL_I2C_START) | (CSL_I2C_STOP)); status = I2C_setup(&i2cSetup);
if
(status != CSL_SOK)
{
printf(
"I2C Setup Failed!!\n"
);
return
(result);
}
/* Write data */
status = I2C_write(gI2cWrBuf, 1 , 0x40, TRUE, startStop, CSL_I2C_MAX_TIMEOUT);
if
(status != CSL_SOK)
{
printf(
"I2C Write Failed!!\n"
);
return
(result);
}
result = CSL_I2C_TEST_PASSED;
return
(result);
}