Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

Studio Bluetooth Forum Discussions

guta_2945091
Level 2
Level 2
First like given

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;

0 Likes
1 Solution

SPI query is answered here: SPI example for CYW20706

Note: as OwenZ_26​ mentioned WICED 6.4 is not broad market yet, so please create a case for queries on the same.

Regards,

Anjana

View solution in original post

4 Replies
AnjanaM_61
Moderator
Moderator
Moderator
First comment on KBA 5 questions asked First question asked

Regarding the I2C issue, we have forwarded the issue to our software team.

Regarding your SPI query, can you please clarify?

0 Likes

Hi,AnjanaM:

我参考了附件的帖子,来修改SPI的硬件PIN的映射,但是修改之后,会导致芯片死机重启。

#define MASTER1_P36_CLK_P00_MOSI_P25_MISO  0x00240019

    wiced_hal_pspi_init( MASTER1_CONFIG,

                         INPUT_PIN_FLOATING,

                         MASTER1_P36_CLK_P00_MOSI_P25_MISO  ,//

                         SPI_CLOCK_SPEED,

                         SPI_LSB_FIRST,

                         SPI_SS_ACTIVE_LOW,

                         SPI_MODE_0,

                         CS);

    spi_master_configure_gpio();

我使用的版本为WICED 6.4

0 Likes

WICED 6.4不是broad market的版本,不在community讨论,如果有问题,请建case解决。

0 Likes

SPI query is answered here: SPI example for CYW20706

Note: as OwenZ_26​ mentioned WICED 6.4 is not broad market yet, so please create a case for queries on the same.

Regards,

Anjana