⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 csl_i2c.h

📁 基于ti tms320c672x下音频开发例子程式
💻 H
📖 第 1 页 / 共 3 页
字号:
 */
typedef enum {
      /**
       * @brief   Get current clock setup parameters
       * @param   ( )
       */
       CSL_I2C_QUERY_CLOCK_SETUP   = 1,
      /**
       * @brief   Get the Bus Busy status information
       * @param   ( )
       */
       CSL_I2C_QUERY_BUS_BUSY      = 2,
      /**
       * @brief   Get the Receive Ready status information
       * @param   ( )
       */
       CSL_I2C_QUERY_RX_RDY        = 3,
      /**
       * @brief   Get the Transmit Ready status information
       * @param   ( )
       */
       CSL_I2C_QUERY_TX_RDY        = 4,
      /**
       * @brief   Get the Register Ready status information
       * @param   ( )
       */
       CSL_I2C_QUERY_ACS_RDY       = 5,
      /**
       * @brief   Get the Stop Condition Data bit information
       * @param   ( )
       */
       CSL_I2C_QUERY_SCD           = 6,
      /**
       * @brief   Get the Address Zero Status (General Call) detection status
       * @param   ( )
       */
       CSL_I2C_QUERY_AD0           = 7,
      /**
       * @brief   Get the Receive overflow status information
       * @param   ( )
       */
       CSL_I2C_QUERY_RSFULL        = 8,
      /**
       * @brief   Get the Transmit underflow status information
       * @param   ( )
       */
       CSL_I2C_QUERY_XSMT          = 9,
      /**
       * @brief   Get the Address as Slave bit information
       * @param   ( )
       */
       CSL_I2C_QUERY_AAS           = 10,
      /**
       * @brief   Get the Arbitration Lost status information
       * @param   ( )
       */
       CSL_I2C_QUERY_AL            = 11,
      /**
       * @brief   Get the Reset Done status bit information
       * @param   ( )
       */
       CSL_I2C_QUERY_RDONE         = 12,
      /**
       * @brief   Get no of bits of next byte to be received or transmitted
       * @param   ( )
       */
       CSL_I2C_QUERY_BITCOUNT      = 13,
      /**
       * @brief   Get the interrupt code for the interrupt that occured
       * @param   ( )
       */
       CSL_I2C_QUERY_INTCODE       = 14,
      /**
       * @brief   Get the revision level of the I2C
       * @param   ( )
       */
       CSL_I2C_QUERY_REV           = 15,
       /**
       * @brief   Get the class of the peripheral
       * @param   ( )
       */
       CSL_I2C_QUERY_CLASS         = 16,
      /**
       * @brief   Get the type of the peripheral
       * @param   ( )
       */
       CSL_I2C_QUERY_TYPE          = 17,
      /**
       * @brief   Get the slave direction
       * @param   ( )
       */
       CSL_I2C_QUERY_SDIR          = 18,
      /**
       * @brief   Get the acknowledgement status
       * @param   ( )
       */
       CSL_I2C_QUERY_NACKSNT       = 19
       

} CSL_I2cHwStatusQuery;


/** @brief Enumeration for queries passed to @a CSL_i2cHwControl()
 *
 * This is used to select the commands to control the operations
 * existing setup of I2C. The arguments to be passed with each
 * enumeration if any are specified next to the enumeration.
 */
 typedef enum {
      /**
       * @brief   Enable the I2C
       * @param   (None)
       */
       CSL_I2C_CMD_ENABLE           = 1,
      /**
       * @brief   Configure the I2C pins as GPIO
       * @param   (None)
       */
       CSL_I2C_CMD_CONFIG_AS_GIO   = 2,
      /**
       * @brief   Reset command to the I2C
       * @param   (None)
       */
       CSL_I2C_CMD_RESET            = 3,

      /**
       * @brief   Bring the I2C out of reset
       * @param   (None)
       */
       CSL_I2C_CMD_OUTOFRESET       = 4,

      /**
       * @brief   Clear the status bits. The argument next to the command
       *          specifies the status bit to be cleared. The status bit
       *          can be :
       *            CSL_I2C_CLEAR_AL,
       *            CSL_I2C_CLEAR_NACK,
       *            CSL_I2C_CLEAR_ARDY,
       *            CSL_I2C_CLEAR_RRDY,
       *            CSL_I2C_CLEAR_XRDY,
       *            CSL_I2C_CLEAR_GC
       * @param   (None)
       */
       CSL_I2C_CMD_CLEAR_STATUS     = 5,

      /**
       * @brief   Set the address of the Slave device
       * @param   (Uint16 *)
       */
       CSL_I2C_CMD_SET_SLAVE_ADDR   = 6,

      /**
       * @brief   Set the Data Count
       * @param   (Uint16 *)
       */
       CSL_I2C_CMD_SET_DATA_COUNT   = 7,

      /**
       * @brief   Set the start condition
       * @param   (None)
       */
       CSL_I2C_CMD_START            = 8,

      /**
       * @brief   Set the stop condition
       * @param   (None)
       */
       CSL_I2C_CMD_STOP             = 9,

      /**
       * @brief   Set the transmission mode
       * @param   (None)
       */
       CSL_I2C_CMD_DIR_TRANSMIT     = 10,

      /**
       * @brief   Set the receiver mode
       * @param   (None)
       */
       CSL_I2C_CMD_DIR_RECEIVE      = 11,

      /**
       * @brief   Set the Repeat Mode
       * @param   (None)
       */
       CSL_I2C_CMD_RM_ENABLE        = 12,

      /**
       * @brief   Disable the Repeat Mode
       * @param   (None)
       */
       CSL_I2C_CMD_RM_DISABLE       = 13,

      /**
       * @brief   Set the loop back mode
       * @param   (None)
       */
       CSL_I2C_CMD_DLB_ENABLE       = 14,

      /**
       * @brief   Set the loop back mode
       * @param   (None)
       */
       CSL_I2C_CMD_DLB_DISABLE      = 15,

     /**
      * @brief   Unmask all interrupts
      * @param   (None)
      */ 
       CSL_I2C_CMD_INTR_ENABLE      = 16,

     /**
      * @brief   Mask all interrupts
      * @param   (None)
      */ 

       CSL_I2C_CMD_INTR_DISABLE     = 17,

     /**
      * @brief   Set the own address 
      * @param   (Uint16 *)
      */
      CSL_I2C_CMD_SET_OWN_ADDR   = 18,

      /**
      * @brief   Set the Clock
      * @param   (CSL_I2cClkSetup *)
      */
      CSL_I2C_CMD_SET_CLOCK   = 19  


} CSL_I2cHwControlCmd;



/**************************************************************************\
* I2C global function declarations
\**************************************************************************/

/*
 * =============================================================================
 *   @func CSL_i2cInit
 *
 *   @desc
 *        This function is idempotent in that calling it many times is same as
 *        calling it once. This function initializes the I2C CSL data structures.
 *
 *   @arg pContext
 *        Context information for I2C
 *
 *   @ret CSL_Status
 *        CSL_SOK - Always returns
 *
 *   @eg
 *     CSL_i2cInit (NULL);
 * =============================================================================
 */
CSL_Status  CSL_i2cInit(
    CSL_I2cContext * pContext
);


/*
 *============================================================================
 *   @func CSL_i2cOpen
 *
 *   @desc
 *        This function populates the peripheral data object for the instance
 *        and returns a handle to the instance.
 *        The open call sets up the data structures for the particular instance
 *        of I2C device. The device can be re-opened anytime after it has been
 *        normally closed if so required. I2C Hardware setup will be performed
 *        at the end of the open call only if the HwSetup Pointer supplied was
 *        non- NULL. The handle returned by this call is input as an essential
 *        argument for rest of the APIs described for this module.
 *
 *   @arg pI2cObj
 *        Pointer to the I2C instance object
 *
 *   @arg i2cNum
 *        Instance of the I2C to be opened.
 *
 *   @arg pI2cParam
 *        Pointer to module specific parameters
 *
 *   @arg pStatus
 *        pointer for returning status of the function call
 *
 *   @ret CSL_I2cHandle
 *        Valid I2C instance handle will be returned if status value is
 *        equal to CSL_SOK.
 *
 *   @eg
 *        CSL_status        status;
 *        CSL_I2cObj        i2cObj;
 *        CSL_I2cHandle     hI2c;
 *
 *        hI2c = CSL_I2cOpen (&i2cObj,
 *                            CSL_I2C_PER_CNT,
 *                            NULL,
 *                            &status
 *                            );
 *
 * ===========================================================================
 */
CSL_I2cHandle CSL_i2cOpen (
    /** Pointer to the object that holds reference to the
     *  instance of I2C requested after the call
     */
    CSL_I2cObj              *hI2cObj,
    /** Instance of I2C to which a handle is requested
     */
    CSL_InstNum              i2cNum,
    /** Specifies if I2C should be opened with exclusive or
     *  shared access to the associate pins
     */
    CSL_I2cParam            *pI2cParam,
    /** This returns the status (success/errors) of the call
     */
    CSL_Status              *status
);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -