bspsim.c

来自「Freescale ARM11系列CPU MX31的WINCE 5.0下的BSP」· C语言 代码 · 共 113 行

C
113
字号
//-----------------------------------------------------------------------------
//
//  Copyright (C) 2004, Motorola Inc. All Rights Reserved
//
//-----------------------------------------------------------------------------
//------------------------------------------------------------------------------
//
// Copyright (C) 2006, Freescale Semiconductor, Inc. All Rights Reserved.
// THIS SOURCE CODE, AND ITS USE AND DISTRIBUTION, IS SUBJECT TO THE TERMS
// AND CONDITIONS OF THE APPLICABLE LICENSE AGREEMENT
//
//------------------------------------------------------------------------------

//-----------------------------------------------------------------------------
//
//  File:  bspsim.c
//
//   This file implements the BSP specific functions for SIM.
//
//-----------------------------------------------------------------------------
#include <windows.h>
#include "bsp.h"


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

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

// This will define the choice of clock source in SIM register

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

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

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

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

//------------------------------------------------------------------------------
//
// Function: BSPGetSIMCLK
//
// This function returns the BSP-specific clock
// source selection value for the SIM.
//
// Parameters:
//      None
//
// Returns:
//      The clock source for the SIM.
//
//------------------------------------------------------------------------------
UINT32 BSPGetSIMCLK(void)
{
    UINT32 freq;

    DDKClockGetFreq(DDK_CLOCK_SIGNAL_PER, &freq);
    return freq;
}


//------------------------------------------------------------------------------
//
// Function: BSPSetSIMClockGatingMode
//
// This function enable or disable CRM clock for SIM.
//
// Parameters:
//      startClocks
//          [in] boolean variable to enable or disable CRM clock
//
// Returns:
//      Return TRUE.
//
//------------------------------------------------------------------------------
BOOL BSPSetSIMClockGatingMode(DWORD port, BOOL startClocks)
{
    BOOL rc = FALSE;

    if (startClocks)
        rc = DDKClockSetGatingMode(DDK_CLOCK_GATE_INDEX_SIM, DDK_CLOCK_GATE_MODE_ENABLED_ALL);
    else
        rc = DDKClockSetGatingMode(DDK_CLOCK_GATE_INDEX_SIM, DDK_CLOCK_GATE_MODE_DISABLED);
    return rc;
}




void BSPSimIomuxSetPin(void)
{
    DDKIomuxSetPinMux(DDK_IOMUX_PIN_SIMPD0,  DDK_IOMUX_OUT_FUNC, DDK_IOMUX_IN_FUNC);
    DDKIomuxSetPinMux(DDK_IOMUX_PIN_STX0,  DDK_IOMUX_OUT_FUNC, DDK_IOMUX_IN_FUNC);
    DDKIomuxSetPinMux(DDK_IOMUX_PIN_SVEN0,  DDK_IOMUX_OUT_FUNC, DDK_IOMUX_IN_FUNC);
    DDKIomuxSetPinMux(DDK_IOMUX_PIN_SRST0,  DDK_IOMUX_OUT_FUNC, DDK_IOMUX_IN_FUNC);
    DDKIomuxSetPinMux(DDK_IOMUX_PIN_SCLK0,  DDK_IOMUX_OUT_FUNC, DDK_IOMUX_IN_FUNC);
    DDKIomuxSetPinMux(DDK_IOMUX_PIN_SRX0,  DDK_IOMUX_OUT_FUNC, DDK_IOMUX_IN_FUNC);
}

void BSPSimSelect3Volts(void)
{
    //Stub function:
    //Nothing to implement here as the power to the SIM interface is hardwired
    //and power is always turned ON as long as the board is powered.
}

⌨️ 快捷键说明

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