4 Replies Latest reply on May 30, 2019 3:37 AM by AnjanaM_61

    CYW20706  Modify IIC pin

    guta_2945091

      Dear:

      我的项目中需要用到IIS、IIC、SPI三个外设,但是我在调试过程中遇到了一些问题。

      问题1:

      在初始化IIC的时候使用wiced_hal_i2c_init,根据API中介绍Configure patch可以选择如下三个参数,但是我在设置过程中,如果使用WICED_I2C_SDA_P35_SCL_P37,就会出现系统复位

      enum
      {
          /* Enable if configuring P35 and P37 for  I2C */
          WICED_I2C_SDA_P35_SCL_P37 = 0,
      
      
          /* Enable if configuring I2S_DOUT/PCM_OUT and I2S_DIN/PCM_IN for I2C */
          WICED_I2C_SDA_I2S_DOUT_PCM_OUT_SCL_I2S_DIN_PCM_IN = 1,
      
      
          /* Enable if configuring SFLASH_MOSI/SDA and SFLASH_MISO/SCL for I2C */
          WICED_I2C_SDA_SFLASH_MOSI_SCL_SFLASH_MISO = 2,
      };
      
      
      /******************************************************************************
      *** Function prototypes.
      ******************************************************************************/
      ///////////////////////////////////////////////////////////////////////////////
      /// Initializes the I2C driver and its private values. This initialization 
      /// sets the bus speed to 100KHz by default (I2CM_SPEED_100KHZ). To make
      /// the bus run at another speed, call wiced_hal_i2c_setSpeed(<speed>)
      /// right after this call.
      /// 
      /// (!) Note that it is the user's responsibility to configure the desired 
      /// GPIOs, since different HW platforms will have different configuration 
      /// parameters. Please see the Kit Guide for your device for more information.
      ///     
      /// \param configure_path : WICED_I2C_SDA_P35_SCL_P37 OR
      ///                         WICED_I2C_SDA_I2S_DOUT_PCM_OUT_SCL_I2S_DIN_PCM_IN  OR
      ///                         WICED_I2C_SDA_SFLASH_MOSI_SCL_SFLASH_MISO
      /// 
      /// \return wiced_result_t : On success WICED_SUCCESS otherwise WICED_ERROR
      ///////////////////////////////////////////////////////////////////////////////
      wiced_result_t wiced_hal_i2c_init(UINT8 configure_path);
      

       

      问题二:

      当IIS与SPI 的PIN冲突的时候,我参考了论坛中的帖子,修改了#define MASTER1_P36_CLK_P00_MOSI_P25_MISO  0x00240019,但是无效。

      SPI example for CYW20706  

      ///
      /// All the available GPIO combinations for SPI-1 Master mode.
      ///
      typedef enum Spi1MasterGpioConfigType
      {
      
      
          //Generate SPIFFY-1 available combinations
          //SPIFFY-1 Master Mode
          MASTER1_P03_CLK_P00_MOSI_P01_MISO = 0x00030001,
          MASTER1_P03_CLK_P00_MOSI_P05_MISO = 0x00030005,
          MASTER1_P03_CLK_P02_MOSI_P01_MISO = 0x00030201,
          MASTER1_P03_CLK_P02_MOSI_P05_MISO = 0x00030205,
          MASTER1_P03_CLK_P04_MOSI_P01_MISO = 0x00030401,
          MASTER1_P03_CLK_P04_MOSI_P05_MISO = 0x00030405,
          MASTER1_P03_CLK_P27_MOSI_P01_MISO = 0x00031b01,
          MASTER1_P03_CLK_P27_MOSI_P05_MISO = 0x00031b05,
          MASTER1_P03_CLK_P38_MOSI_P01_MISO = 0x00032601,
          MASTER1_P03_CLK_P38_MOSI_P05_MISO = 0x00032605,
          MASTER1_P07_CLK_P00_MOSI_P01_MISO = 0x00070001,
          MASTER1_P07_CLK_P00_MOSI_P05_MISO = 0x00070005,
          MASTER1_P07_CLK_P02_MOSI_P01_MISO = 0x00070201,
          MASTER1_P07_CLK_P02_MOSI_P05_MISO = 0x00070205,
          MASTER1_P07_CLK_P04_MOSI_P01_MISO = 0x00070401,
          MASTER1_P07_CLK_P04_MOSI_P05_MISO = 0x00070405,
          MASTER1_P07_CLK_P27_MOSI_P01_MISO = 0x00071b01,
          MASTER1_P07_CLK_P27_MOSI_P05_MISO = 0x00071b05,
          MASTER1_P07_CLK_P38_MOSI_P01_MISO = 0x00072601,
          MASTER1_P07_CLK_P38_MOSI_P05_MISO = 0x00072605,
          MASTER1_P24_CLK_P00_MOSI_P25_MISO = 0x00180019,
          MASTER1_P24_CLK_P02_MOSI_P25_MISO = 0x00180219,
          MASTER1_P24_CLK_P04_MOSI_P25_MISO = 0x00180419,
          MASTER1_P24_CLK_P27_MOSI_P25_MISO = 0x00181b19,
          MASTER1_P24_CLK_P38_MOSI_P25_MISO = 0x00182619,
          MASTER1_P36_CLK_P00_MOSI_P25_MISO = 0x00240019,
          MASTER1_P36_CLK_P02_MOSI_P25_MISO = 0x00240219,
          MASTER1_P36_CLK_P04_MOSI_P25_MISO = 0x00240419,
          MASTER1_P36_CLK_P27_MOSI_P25_MISO = 0x00241b19,
          MASTER1_P36_CLK_P38_MOSI_P25_MISO = 0x00242619,
          //Total SPIFFYD_1 Master Available combinations=30
      } Spi1MasterGpioConfigType;