Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
This application snippet demonstrates the I2C device interface using WICED SDK-3.x.
The sample application sets up the I2C device interface and send commands to the I2C device then receives replies, if any, from the I2C device.
For this example "BlinkM - I2C Controlled RGB LED" (www.sparkfun.com/products/8579) I2C device is used to test the code. It could be any other I2C device chosen for your platform as well.
For BCM943362WCD4 evaluation platform update the platform.c and platform.h files for I2C device.
Update the .../platforms/BCM943362WCD4/platform.c file by adding the following changes to the file:
const platform_i2c_t platform_i2c_peripherals =
.port = I2C1,
.pin_scl = &platform_gpio_pins[WICED_GPIO_11],
.pin_sda = &platform_gpio_pins[WICED_GPIO_12],
.peripheral_clock_reg = RCC_APB1Periph_I2C1,
.tx_dma = DMA1,
.tx_dma_peripheral_clock = RCC_AHB1Periph_DMA1,
.tx_dma_stream = DMA1_Stream7,
.rx_dma_stream = DMA1_Stream0,
.tx_dma_stream_id = 7,
.rx_dma_stream_id = 0,
.tx_dma_channel = DMA_Channel_1,
.rx_dma_channel = DMA_Channel_1,
.gpio_af = GPIO_AF_I2C1
For platforms/BCM943362WCD4/platform.h file add the WICED_I2C_1 to the wiced_i2c_t as below:
WICED_I2C_32BIT = 0x7FFFFFFF,
The platform files for BCM943362WCD4 are attached.
For BCM943341WCD1 I2C device of WICED_I2C_1 is already defined in the platform files. For completeness the platform files are attached. The I2C device of WICED_I2C_1 for BCM943362WCD1 is already defined in the platform files. For completeness the platform files are attached.
Your application specific platform files can be updated as above to interface the chosen I2C device to the WICED SDK 3.x platform.
1. To run the test, connect the I2C device to the evaluation board as following:
Connection setup for I2C device to STM32F4xx based WICED evaluation board
I2C-Device BCM943341WCD1 J7 Header
Connection setup for I2C device to STM32F2xx based WICED evaluation board
I2C-Device BCM943362WCD4 J7 Header
2. Unzip and copy the attached files to the WICED SDK-3.x version.
For I2C LED application snippet:
Copy the content of the i2c_led.7z source to .../apps/snip/i2c_led
Copy the content of the BCM943362WCD4.7z source to .../platforms/BCM943362WCD4
Copy the content of the BCM943341WCD1.7z source to .../platforms/BCM943341WCD1
3. To build, download and run the application below
For STM32F4xx MCU BCM943341WCD1:
snip.i2c_led-BCM943341WCD1-debug download run
For STM32F2xx MCU BCM943362WCD4:
snip.i2c_led-BCM943362WCD4-debug download run
This is the modified STM32F4xx MCU BCM943341WCD1 WICED evaluation board:
NOTE: There are no hardware nor platform file changes needed on the BCM943341WCD1 evaluation because the already defined I2C lines ,with pull-up resistors, are used.
This is the modified STM32F2xx MCU BCM943362WCD4 Wiced evaluation board:
NOTE: On BCM943362WCD4 evaluation board, SDA and SCL signals needs 4.7K pull up resistors.