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

📄 csl_pmxaux.h

📁 TI达芬奇dm644x各硬件模块测试代码
💻 H
字号:
/*  ============================================================================
 *   Copyright (c) Texas Instruments Inc 2002, 2003, 2004, 2005                 
 *                                                                              
 *   Use of this software is controlled by the terms and conditions found in the
 *   license agreement under which this software has been supplied.             
 *   ===========================================================================
 */ 

/** @file csl_pmxAux.h
 *
 * @brief   Header file for functional layer of CSL
 *
 *  Path: \\(CSLPATH)\\ipmodules\\pmx\\src
 *
 * Description
 *    - The defines inline function definitions
 *
 */

/*  ============================================================================
 *   Copyright (c) Texas Instruments Inc 2002, 2003, 2004
 *
 *   Use of this software is controlled by the terms and conditions found in the
 *   license agreement under which this software has been supplied.
 *   ===========================================================================
 */

/* =============================================================================
 *  Revision History
 *  ===============
 *  
 *  20-dec-2004 BRN File Created 
 *
 * =============================================================================
 */

#ifndef _CSL_PMXAUX_H_
#define _CSL_PMXAUX_H_

#include <csl_pmx.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 *  Control Functions of pmx.
 */
/** ============================================================================
 *   @n@b CSL_pmxSetPinMux0
 *
 *   @b Description
 *   @n This function sets the PinMux0 register values of PMX module.
 *
 *   @b Arguments
 *   @verbatim

            hPmx            Handle to PMX instance
            *pinMux0Setup   Pointer to the PinMux0 Group Function Selection 
                            structure
     @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_pmxSetEpgfs (hPmx, pinMux0Setup);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_pmxSetPinMux0 (
    /** Pointer to the object that holds reference to the
     *  instance of PMX requested after the call
     */
    CSL_PmxHandle         hPmx,
    CSL_PinMux0Setup      *pinMux0Setup
) 
{
    CSL_FINS (hPmx->regs->PinMux0, PMX_PINMUX0_EMACEN,  pinMux0Setup->emacEn );
    CSL_FINS (hPmx->regs->PinMux0, PMX_PINMUX0_1394EN,  pinMux0Setup->En1394 );
    CSL_FINS (hPmx->regs->PinMux0, PMX_PINMUX0_HPIEN,   pinMux0Setup->hpiEn  );
    CSL_FINS (hPmx->regs->PinMux0, PMX_PINMUX0_CFLDEN,  pinMux0Setup->cfldEn );
    CSL_FINS (hPmx->regs->PinMux0, PMX_PINMUX0_CWEN,    pinMux0Setup->cwEn   );
    CSL_FINS (hPmx->regs->PinMux0, PMX_PINMUX0_LFLDEN,  pinMux0Setup->lfldEn );
    CSL_FINS (hPmx->regs->PinMux0, PMX_PINMUX0_LOEEN,   pinMux0Setup->loeEn  );
    CSL_FINS (hPmx->regs->PinMux0, PMX_PINMUX0_RGB888,  pinMux0Setup->rgb888 );
    CSL_FINS (hPmx->regs->PinMux0, PMX_PINMUX0_ATAEN,   pinMux0Setup->ataEn  );
    CSL_FINS (hPmx->regs->PinMux0, PMX_PINMUX0_HDIREN,  pinMux0Setup->hdirEn );
    CSL_FINS (hPmx->regs->PinMux0, PMX_PINMUX0_VLYNQEN, pinMux0Setup->vlynqEn);    
    CSL_FINS (hPmx->regs->PinMux0, PMX_PINMUX0_VLSCREN, pinMux0Setup->vlscrEn);
    CSL_FINS (hPmx->regs->PinMux0, PMX_PINMUX0_VLYNQWD, pinMux0Setup->vlynqWd);
    CSL_FINS (hPmx->regs->PinMux0, PMX_PINMUX0_AECS5,   pinMux0Setup->aeCs5  );
    CSL_FINS (hPmx->regs->PinMux0, PMX_PINMUX0_AECS4,   pinMux0Setup->aeCs4  );
    CSL_FINS (hPmx->regs->PinMux0, PMX_PINMUX0_AEAW,    pinMux0Setup->aeAw   );
}                                                                 
                                               

/** ============================================================================
 *   @n@b CSL_pmxSetPinMux1
 *
 *   @b Description
 *   @n This function sets the PinMux0 register values of PMX module. 
 *
 *   @b Arguments
 *   @verbatim

            hPmx            Handle to PMX instance
            *pinMux1Setup   Pointer to the PinMux1 Group Function Selection 
                            structure
     @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_pmxSetEpgfs (hPmx, pinMux1Setup);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_pmxSetPinMux1 (
    /** Pointer to the object that holds reference to the
     *  instance of PMX requested after the call
     */
    CSL_PmxHandle         hPmx,
    CSL_PinMux1Setup      *pinMux1Setup
) 
{
    CSL_FINS (hPmx->regs->PinMux1, PMX_PINMUX1_TIMIN, pinMux1Setup->timin);
    CSL_FINS (hPmx->regs->PinMux1, PMX_PINMUX1_CLK1,  pinMux1Setup->clk1 );
    CSL_FINS (hPmx->regs->PinMux1, PMX_PINMUX1_CLK0,  pinMux1Setup->clk0 );
    CSL_FINS (hPmx->regs->PinMux1, PMX_PINMUX1_MCBSP, pinMux1Setup->mcbsp);
    CSL_FINS (hPmx->regs->PinMux1, PMX_PINMUX1_MSTK,  pinMux1Setup->mstk );
    CSL_FINS (hPmx->regs->PinMux1, PMX_PINMUX1_SPI,   pinMux1Setup->spi  );
    CSL_FINS (hPmx->regs->PinMux1, PMX_PINMUX1_I2C,   pinMux1Setup->i2c  );
    CSL_FINS (hPmx->regs->PinMux1, PMX_PINMUX1_PWM2,  pinMux1Setup->pwm2 );
    CSL_FINS (hPmx->regs->PinMux1, PMX_PINMUX1_PWM1,  pinMux1Setup->pwm1 );
    CSL_FINS (hPmx->regs->PinMux1, PMX_PINMUX1_PWM0,  pinMux1Setup->pwm0 );
    CSL_FINS (hPmx->regs->PinMux1, PMX_PINMUX1_U2FLO, pinMux1Setup->u2Flo);    
    CSL_FINS (hPmx->regs->PinMux1, PMX_PINMUX1_UART2, pinMux1Setup->uart2);
    CSL_FINS (hPmx->regs->PinMux1, PMX_PINMUX1_UART1, pinMux1Setup->uart1);
    CSL_FINS (hPmx->regs->PinMux1, PMX_PINMUX1_UART0, pinMux1Setup->uart0);
}                                                                 
                                               

/* Status query Functions */

/** ============================================================================
 *   @n@b CSL_pmxGetPinMUX0Status
 *
 *   @b Description
 *   @n This function gets the PinMox0 register, i.e the status of AEMIF, VLYNQ,
 *      ATA, VideoOut, and CCD control muxing status information of the PMX 
 *      module.
 *
 *   @b Arguments
 *   @verbatim

            hPmx            Handle to PMX instance

            response        Place holder 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_pmxGetPinMUX0Status (hPmx, &response);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_pmxGetPinMux0Status (
    /** Pointer to the object that holds reference to the
     *  instance of PMX requested after the call
     */
    CSL_PmxHandle        hPmx,

    /** Placeholder to return the status. @a CSL_PinMux0Setup * casted */
    CSL_PinMux0Setup     *response
) 
{
    response->emacEn  = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_EMACEN );
    response->En1394  = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_1394EN );
    response->hpiEn   = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_HPIEN  );
    response->cfldEn  = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_CFLDEN );
    response->cwEn    = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_CWEN   );
    response->lfldEn  = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_LFLDEN );
    response->loeEn   = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_LOEEN  );
    response->rgb888  = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_RGB888 );
    response->ataEn   = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_ATAEN  );
    response->hdirEn  = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_HDIREN );
    response->vlynqEn = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_VLYNQEN);
    response->vlscrEn = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_VLSCREN);
    response->vlynqWd = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_VLYNQWD);
    response->aeCs5   = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_AECS5  );
    response->aeCs4   = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_AECS4  );
    response->aeAw    = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_AEAW   );
}


/** ============================================================================
 *   @n@b CSL_pmxGetPinMUX1Status
 *
 *   @b Description
 *   @n This function gets the PinMox1 register, i.e the status of TIMIN on 
 *      GPIO, CLK of GPIO, McBSP, MSTK, SPI, I2C, PWM2, PWM1, PWM0, UART2 flow 
 *      control UART2, UART1 and UART0 peripherals muxing information of the 
 *      PMX module.
 *
 *   @b Arguments
 *   @verbatim

            hPmx            Handle to PMX instance

            response        Place holder 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_pmxGetPinMUX01tatus (hPmx, &response);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_pmxGetPinMux1Status (
    /** Pointer to the object that holds reference to the
     *  instance of PMX requested after the call
     */
    CSL_PmxHandle        hPmx,

    /** Placeholder to return the status. @a CSL_PinMux0Setup * casted */
    CSL_PinMux1Setup     *response
) 
{
    response->timin = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_TIMIN);
    response->clk1  = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_CLK1 );
    response->clk0  = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_CLK0 );
    response->mcbsp = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_MCBSP);
    response->mstk  = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_MSTK );
    response->spi   = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_SPI  );
    response->i2c   = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_I2C  );
    response->pwm2  = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_PWM2 );
    response->pwm1  = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_PWM1 );
    response->pwm0  = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_PWM0 );
    response->u2Flo = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_U2FLO);
    response->uart2 = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_UART2);
    response->uart1 = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_UART1);
    response->uart0 = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_UART0);   
}


#ifdef __cplusplus
}
#endif

#endif /* CSL_PMXAUX_H_ */


⌨️ 快捷键说明

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