EasyManua.ls Logo

Texas Instruments CC3235 SimpleLink Series - Page 513

Texas Instruments CC3235 SimpleLink Series
799 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
www.ti.com
Developer’s Guide
513
SWRU543–January 2019
Submit Documentation Feedback
Copyright © 2019, Texas Instruments Incorporated
Parallel Camera Interface Module
12. The capture can be stopped by using the peripheral driver API CameraCaptureStop. This function
disables the sensor interface of the camera core module. The sensor interface can be disabled
immediately, or at the end of current frame.
13. To stop the image capture after a frame, disable the sensor interface immediately after the
CAM_INT_FE interrupt.
14.8.2 Using Peripheral Driver APIs for Communicating With Image Sensors
Most image sensors provide a 2-wire serial interface for external MCUs to control them. This section
shows how to use the CC32xx I
2
C interface to communicate with these image sensors. The CC32xx
includes one I2C module operating with standard (100 kbps) or fast (400 kbps) transmission speeds.
First, configure and enable the clock for the I2C peripheral. Peripherals are clock-gated by default and
generate a bus fault if accessed without enabling the clock. The peripheral should be ready to use after
the software reset.
MAP_PRCMPeripheralClkEnable(PRCM_I2CA0, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralReset(PRCM_I2CA0);
The I2C master block must be configured and enabled next in either standard or fast mode, by using the
peripheral driver API MAP_I2CMasterInitExpClk. The function internally computes the clock divider to
achieve the fastest speed less than or equal to the desired speed.
MAP_I2CMasterInitExpClk (I2C_BASE, SYS_CLK, true); /* SYS_CLK is set to 80MHz */
The commands to the image sensor can then be written, and responses can be read. Normally, a
standard communication consists of:
• Generating a START condition
• Setting an I
2
C slave address
• Transferring data
• Generating a STOP condition
The master sends the slave address followed by the START condition. A slave with an address that
matches this address responds by returning an acknowledgment bit. When the slave addressing is
achieved, data transfer can proceed byte-by-byte.
Peripheral driver APIs for writing and reading to and from an I2C slave:
I2CMasterSlaveAddrSet
• Description: Sets the address that the I2C master places on the bus.
• Parameters:
– ui32Base – the base address of the I2C master module
– ui8SlaveAddr – a 7-bit slave address
– bReceive – the flag indicating the type of communication with the slave
I2CMasterDataPut
• Description: Transmits a byte from the I2C master.
• Parameters:
– ui32Base – the base address of the I2C master module
– ui8Data – data to be transmitted from the I2C master
I2CMasterDataGet
• Description: Receives a byte that has been sent to the I2C master.
• Parameters:
– ui32Base – the base address of the I2C master module

Table of Contents