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

📄 bspirda.c

📁 freescale i.mx31 BSP CE5.0全部源码
💻 C
字号:
//-----------------------------------------------------------------------------
//
//  Copyright (C) 2004, Motorola Inc. All Rights Reserved
//
//-----------------------------------------------------------------------------
//
//  Copyright (C) 2004, Freescale Semiconductor, Inc. All Rights Reserved
//  THIS SOURCE CODE IS CONFIDENTIAL AND PROPRIETARY AND MAY NOT
//  BE USED OR DISTRIBUTED WITHOUT THE WRITTEN PERMISSION OF
//  FREESCALE SEMICONDUCTOR, INC.
//
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
//
//  File:  bspIR.c
//
//  Provides BSP-specific configuration routines for the UART peripheral.
//
//-----------------------------------------------------------------------------
#include <windows.h>
#include "bsp.h"
#include "uart.h"

//-----------------------------------------------------------------------------
// External Functions

//-----------------------------------------------------------------------------
// External Variables

//-----------------------------------------------------------------------------
// Defines

//-----------------------------------------------------------------------------
// Types

//-----------------------------------------------------------------------------
// Global Variables

//-----------------------------------------------------------------------------
// Local Variables

//------------------------------------------------------------------------------
// Local Functions

//-----------------------------------------------------------------------------
//
// Function: BSPIrdaEnable
//
// This is a private function to enable the IRDA.
//
// Parameters:
//      bEnable
//          [in]    TRUE if enable IRDA. FALSE if disable.
//
// Returns:
//      none.
//-----------------------------------------------------------------------------
VOID BSPIrdaEnable(BOOL bEnable)
{
	if (bEnable)
    {
		// Enable IRDA transceiver
		DDKGpioWriteDataPin(DDK_GPIO_PORT3, BSP_GPIO_PWR_EN_IRDA, 0);
		DDKGpioWriteDataPin(DDK_GPIO_PORT3, BSP_GPIO_IRDA_RS232, 0);
    }
    else
    {
		// Disable IRDA transceiver
		DDKGpioWriteDataPin(DDK_GPIO_PORT3, BSP_GPIO_PWR_EN_IRDA, 1);
		DDKGpioWriteDataPin(DDK_GPIO_PORT3, BSP_GPIO_IRDA_RS232, 1);
    }
}


//-----------------------------------------------------------------------------
//
// Function: BSPIrdaSetMode
//
// This is a private function to set the IRDA mode.
//
// Parameters:
//      none.
//
// Returns:
//      none.
//-----------------------------------------------------------------------------
VOID BSPIrdaSetMode(irMode_c mode)
{
	switch (mode)
    {
        case SIR_MODE:
			DDKGpioWriteDataPin(DDK_GPIO_PORT2, BSP_GPIO_IRDA_MODE_SET, 0);
			break;
        case MIR_MODE:
        case FIR_MODE:
            break;
    }
    return;
}

⌨️ 快捷键说明

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