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

📄 csl_i2caux.h

📁 基于ti tms320c672x下音频开发例子程式
💻 H
📖 第 1 页 / 共 3 页
字号:
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_i2cStop (hI2c);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_i2cStop (
    /** Pointer to the object that holds reference to the
     *  instance of I2C requested after the call
     */
    CSL_I2cHandle        hI2c
)
{
    CSL_FINS(hI2c->regs->ICMDR,I2C_ICMDR_STP, TRUE);
}

/** ============================================================================
 *   @n@b CSL_i2cDirTransmit
 *
 *   @b Description
 *   @n This function sets the direction of data as transmit of the I2C module.
 *
 *   @b Arguments
 *   @verbatim

            hI2c            Handle to I2C instance

     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_i2cDirTransmit (hI2c);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_i2cDirTransmit (
    /** Pointer to the object that holds reference to the
     *  instance of I2C requested after the call
     */
    CSL_I2cHandle        hI2c
)
{
    CSL_FINS(hI2c->regs->ICMDR,I2C_ICMDR_TRX, TRUE);
}

/** ============================================================================
 *   @n@b CSL_i2cDirReceive
 *
 *   @b Description
 *   @n This function sets the direction of data as receive of the I2C module.
 *
 *   @b Arguments
 *   @verbatim

            hI2c            Handle to I2C instance

     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_i2cDirReceive (hI2c);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_i2cDirReceive (
    /** Pointer to the object that holds reference to the
     *  instance of I2C requested after the call
     */
    CSL_I2cHandle        hI2c
)
{
    CSL_FINS(hI2c->regs->ICMDR,I2C_ICMDR_TRX, FALSE);
}

/** ============================================================================
 *   @n@b CSL_i2RmEnable
 *
 *   @b Description
 *   @n This function enables the repeat mode of the I2C module.
 *
 *   @b Arguments
 *   @verbatim

            hI2c            Handle to I2C instance

     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_i2RmEnable (hI2c);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_i2cRmEnable (
    /** Pointer to the object that holds reference to the
     *  instance of I2C requested after the call
     */
    CSL_I2cHandle        hI2c
)
{
    CSL_FINS(hI2c->regs->ICMDR,I2C_ICMDR_RM, TRUE);
}

/** ============================================================================
 *   @n@b CSL_i2cRmDisable
 *
 *   @b Description
 *   @n This function disables the repeat mode of the I2C module.
 *
 *   @b Arguments
 *   @verbatim

            hI2c            Handle to I2C instance

     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_i2cRmDisable (hI2c);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_i2cRmDisable (
    /** Pointer to the object that holds reference to the
     *  instance of I2C requested after the call
     */
    CSL_I2cHandle        hI2c
)
{
    CSL_FINS(hI2c->regs->ICMDR,I2C_ICMDR_RM, FALSE);
}

/** ============================================================================
 *   @n@b CSL_i2cDlbEnable
 *
 *   @b Description
 *   @n This function enables the data loop back of the I2C module.
 *
 *   @b Arguments
 *   @verbatim

            hI2c            Handle to I2C instance

     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_i2cDlbEnable (hI2c);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_i2cDlbEnable (
    /** Pointer to the object that holds reference to the
     *  instance of I2C requested after the call
     */
    CSL_I2cHandle        hI2c
)
{
    CSL_FINS(hI2c->regs->ICMDR,I2C_ICMDR_DLB, TRUE);
}

/** ============================================================================
 *   @n@b CSL_i2cDlbDisable
 *
 *   @b Description
 *   @n This function disables the data loop back of I2C module.
 *
 *   @b Arguments
 *   @verbatim

            hI2c            Handle to I2C instance

     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_i2cDlbDisable (hI2c);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_i2cDlbDisable (
    /** Pointer to the object that holds reference to the
     *  instance of I2C requested after the call
     */
    CSL_I2cHandle        hI2c
)
{
    CSL_FINS(hI2c->regs->ICMDR,I2C_ICMDR_DLB, FALSE);
}

/** ============================================================================
 *   @n@b CSL_i2cGetClockSetup
 *
 *   @b Description
 *   @n This function gets the clock setup of the I2C module.
 *
 *   @b Arguments
 *   @verbatim

            hI2c            Handle to I2C instance

            response        Placeholder to return status.

     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_i2cGetClockSetup (hI2c, &response);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_i2cGetClockSetup (
    /** Pointer to the object that holds reference to the
     *  instance of I2C requested after the call
     */
    CSL_I2cHandle        hI2c,

    /** Placeholder to return the status. @a void* casted */
    void                 *response
)
{
    ((CSL_I2cClkSetup *)response)->prescalar
                                = CSL_FEXT(hI2c->regs->ICPSC,I2C_ICPSC_IPSC);
    ((CSL_I2cClkSetup *)response)->clklowdiv
                                = CSL_FEXT(hI2c->regs->ICCLKL,I2C_ICCLKL_ICCL);
    ((CSL_I2cClkSetup *)response)->clkhighdiv
                                = CSL_FEXT(hI2c->regs->ICCLKH,I2C_ICCLKH_ICCH);
}

/** ============================================================================
 *   @n@b CSL_i2cGetBusBusy
 *
 *   @b Description
 *   @n This function gets the bus busy status of I2C module.
 *
 *   @b Arguments
 *   @verbatim

            hI2c            Handle to I2C instance

            response        Placeholder to return status.

     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_i2cGetBusBusy (hI2c, &response);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_i2cGetBusBusy (
    /** Pointer to the object that holds reference to the
     *  instance of I2C requested after the call
     */
    CSL_I2cHandle        hI2c,

    /** Placeholder to return the status. @a void* casted */
    void                 *response
)
{
    *(Uint16 *)response = CSL_FEXT(hI2c->regs->ICSTR,I2C_ICSTR_BB);
}

/** ============================================================================
 *   @n@b CSL_i2cGetRxRdy
 *
 *   @b Description
 *   @n This function gets the receive ready status of the I2C module.
 *
 *   @b Arguments
 *   @verbatim

            hI2c            Handle to I2C instance

            response        Placeholder to return status.

     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_i2cGetRxRdy (hI2c, &response);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_i2cGetRxRdy (
    /** Pointer to the object that holds reference to the
     *  instance of I2C requested after the call
     */
    CSL_I2cHandle        hI2c,

    /** Placeholder to return the status. @a void* casted */
    void                 *response
)
{
    *(Uint16 *)response = CSL_FEXT(hI2c->regs->ICSTR,I2C_ICSTR_ICRRDY);
}

/** ============================================================================
 *   @n@b CSL_i2cGetTxRdy
 *
 *   @b Description
 *   @n This function gets the transmit ready status of the I2C module.
 *
 *   @b Arguments
 *   @verbatim

            hI2c            Handle to I2C instance

            response        Placeholder to return status.

     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_i2cGetTxRdy (hI2c, &response);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_i2cGetTxRdy (
    /** Pointer to the object that holds reference to the
     *  instance of I2C requested after the call
     */
    CSL_I2cHandle        hI2c,

    /** Placeholder to return the status. @a void* casted */
    void                 *response
)
{
    *(Uint16 *)response = CSL_FEXT(hI2c->regs->ICSTR,I2C_ICSTR_ICXRDY);
}

/** ============================================================================
 *   @n@b CSL_i2cGetAcsRdy
 *
 *   @b Description
 *   @n This function gets the ACS ready status of the I2C module.
 *
 *   @b Arguments
 *   @verbatim

            hI2c            Handle to I2C instance

            response        Placeholder to return status.

     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_i2cGetAcsRdy (hI2c, &response);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_i2cGetAcsRdy (
    /** Pointer to the object that holds reference to the
     *  instance of I2C requested after the call
     */
    CSL_I2cHandle        hI2c,

    /** Placeholder to return the status. @a void* casted */
    void                 *response
)
{
    *(Uint16 *)response = CSL_FEXT(hI2c->regs->ICSTR,I2C_ICSTR_ARDY);
}

/** ============================================================================
 *   @n@b CSL_i2cGetScd
 *
 *   @b Description
 *   @n This function gets the SCD status of the I2C module.
 *
 *   @b Arguments
 *   @verbatim

            hI2c            Handle to I2C instance

            response        Placeholder to return status.

     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_i2cGetScd (hI2c, &response);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_i2cGetScd (
    /** Pointer to the object that holds reference to the
     *  instance of I2C requested after the call
     */
    CSL_I2cHandle        hI2c,

    /** Placeholder to return the status. @a void* casted */
    void                 *response
)
{
    *(Uint16 *)response = CSL_FEXT(hI2c->regs->ICSTR,I2C_ICSTR_SCD);
}


/** ============================================================================
 *   @n@b CSL_i2cGetAd0
 *
 *   @b Description
 *   @n This function gets the AD0 status of the I2C module.
 *
 *   @b Arguments
 *   @verbatim

            hI2c            Handle to I2C instance

            response        Placeholder to return status.

     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_i2cGetAd0 (hI2c, &response);

⌨️ 快捷键说明

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