亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ssi.c

?? 飛利浦LM3S系列ARM的庫文件,在進行arm開發(fā)時所必須的庫文件,直接加到工程中,一般不必修改.
?? C
?? 第 1 頁 / 共 2 頁
字號:
//*****************************************************************************
//
// ssi.c - Driver for Synchronous Serial Interface.
//
// Copyright (c) 2005,2006 Luminary Micro, Inc.  All rights reserved.
//
// Software License Agreement
//
// Luminary Micro, Inc. (LMI) is supplying this software for use solely and
// exclusively on LMI's Stellaris Family of microcontroller products.
//
// The software is owned by LMI and/or its suppliers, and is protected under
// applicable copyright laws.  All rights are reserved.  Any use in violation
// of the foregoing restrictions may subject the user to criminal sanctions
// under applicable laws, as well as to civil liability for the breach of the
// terms and conditions of this license.
//
// THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
//
// This is part of revision 687 of the Stellaris Driver Library.
//
//*****************************************************************************

//*****************************************************************************
//
//! \addtogroup ssi_api
//! @{
//
//*****************************************************************************

#include "hw_ints.h"
#include "hw_memmap.h"
#include "hw_ssi.h"
#include "hw_types.h"
#include "debug.h"
#include "interrupt.h"
#include "ssi.h"
#include "sysctl.h"

//*****************************************************************************
//
//! Configures the synchronous serial interface.
//!
//! \param ulBase specifies the SSI module base address.
//! \param ulProtocol specifies the data transfer protocol.
//! \param ulMode specifies the mode of operation.
//! \param ulBitRate specifies the clock rate.
//! \param ulDataWidth specifies number of bits transfered per frame.
//!
//! This function configures the synchronous serial interface. It sets
//! the SSI protocol, mode of operation, bit rate, and data width.
//!
//! The parameter \e ulProtocol defines the data frame format. The parameter
//! \e ulProtocol can be one of the following values: SSI_FRF_MOTO_MODE_0,
//! SSI_FRF_MOTO_MODE_1, SSI_FRF_MOTO_MODE_2, SSI_FRF_MOTO_MODE_3,
//! SSI_FRF_TI, or SSI_FRF_NMW. The Motorola frame formats imply the
//! following polarity and phase configurations:
//! <pre>
//! Polarity Phase       Mode
//!   0       0   SSI_FRF_MOTO_MODE_0
//!   0       1   SSI_FRF_MOTO_MODE_1
//!   1       0   SSI_FRF_MOTO_MODE_2
//!   1       1   SSI_FRF_MOTO_MODE_3
//! </pre>
//!
//! The parameter \e ulMode defines the operating mode of the SSI module. The
//! SSI module can operate as a master or slave; if a slave, the SSI can be
//! configured to disable output on its serial output line. The parameter
//! \e ulMode can be one of the following values: SSI_MODE_MASTER,
//! SSI_MODE_SLAVE, or SSI_MODE_SLAVE_OD.
//!
//! The parameter \e ulBitRate defines the bit rate for the SSI. This bit rate
//! must satisfy the following clock ratio criteria:
//! - FSSI >= 2 * bit rate (master mode)
//! - FSSI >= 12 * bit rate (slave modes)
//!
//! where FSSI is the frequency of the clock supplied to the SSI module.
//!
//! The parameter \e ulDataWidth defines the width of the data transfers.
//! The parameter \e ulDataWidth can be a value between 4 and 16, inclusive.
//!
//! The SSI clocking is dependent upon the system clock rate returned by
//! SysCtlClockGet(); if it does not return the correct system clock rate then
//! the SSI clock rate will be incorrect.
//!
//! \return None.
//
//*****************************************************************************
void
SSIConfig(unsigned long ulBase, unsigned long ulProtocol, unsigned long ulMode,
          unsigned long ulBitRate, unsigned long ulDataWidth)
{
    unsigned long ulMaxBitRate;
    unsigned long ulRegVal;
    unsigned long ulPreDiv;
    unsigned long ulSCR;
    unsigned long ulSPH_SPO;
    unsigned long ulClock;

    //
    // Check the arguments.
    //
    ASSERT(ulBase == SSI_BASE);
    ASSERT((ulProtocol == SSI_FRF_MOTO_MODE_0) ||
           (ulProtocol == SSI_FRF_MOTO_MODE_1) ||
           (ulProtocol == SSI_FRF_MOTO_MODE_2) ||
           (ulProtocol == SSI_FRF_MOTO_MODE_3) ||
           (ulProtocol == SSI_FRF_TI) ||
           (ulProtocol == SSI_FRF_NMW));
    ASSERT((ulMode == SSI_MODE_MASTER) ||
           (ulMode == SSI_MODE_SLAVE) ||
           (ulMode == SSI_MODE_SLAVE_OD));
    ASSERT((ulDataWidth >= 4) && (ulDataWidth <= 16));

    //
    // Get the processor clock rate.
    //
    ulClock = SysCtlClockGet();

    //
    // Validate the clock speed.
    //
    ASSERT(((ulMode == SSI_MODE_MASTER) && (ulBitRate <= (ulClock / 2))) ||
           ((ulMode != SSI_MODE_MASTER) && (ulBitRate <= (ulClock / 12))));
    ASSERT((ulClock / ulBitRate) <= (254 * 256));

    //
    // Set the mode.
    //
    ulRegVal = (ulMode == SSI_MODE_SLAVE_OD) ? SSI_CR1_SOD : 0;
    ulRegVal |= (ulMode == SSI_MODE_MASTER) ? 0 : SSI_CR1_MS;
    HWREG(ulBase + SSI_O_CR1) = ulRegVal;

    //
    // Set the clock predivider.
    //
    ulMaxBitRate = ulClock / ulBitRate;
    ulPreDiv = 0;
    do
    {
        ulPreDiv += 2;
        ulSCR = (ulMaxBitRate / ulPreDiv) - 1;
    }
    while(ulSCR > 255);
    HWREG(ulBase + SSI_O_CPSR) = ulPreDiv;

    //
    // Set protocol and clock rate.
    //
    ulSPH_SPO = ulProtocol << 6;
    ulProtocol &= SSI_CR0_FRF_MASK;
    ulRegVal = (ulSCR << 8) | ulSPH_SPO | ulProtocol | (ulDataWidth - 1);
    HWREG(ulBase + SSI_O_CR0) = ulRegVal;
}

//*****************************************************************************
//
//! Enables the synchronous serial interface.
//!
//! \param ulBase specifies the SSI module base address.
//!
//! This will enable operation of the synchronous serial interface. It must be
//! configured before it is enabled.
//!
//! \return None.
//
//*****************************************************************************
void
SSIEnable(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == SSI_BASE);

    //
    // Read-modify-write the enable bit.
    //
    HWREG(ulBase + SSI_O_CR1) |= SSI_CR1_SSE;
}

//*****************************************************************************
//
//! Disables the synchronous serial interface.
//!
//! \param ulBase specifies the SSI module base address.
//!
//! This will disable operation of the synchronous serial interface.
//!
//! \return None.
//
//*****************************************************************************
void
SSIDisable(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == SSI_BASE);

    //
    // Read-modify-write the enable bit.
    //
    HWREG(ulBase + SSI_O_CR1) &= ~(SSI_CR1_SSE);
}

//*****************************************************************************
//
//! Registers an interrupt.handler for the synchronous serial interface.
//!
//! \param ulBase specifies the SSI module base address.
//! \param pfnHandler is a pointer to the function to be called when the
//! synchronous serial interface interrupt occurs.
//!
//! This sets the handler to be called when an SSI interrupt
//! occurs.  This will enable the global interrupt in the interrupt controller;
//! specific SSI interrupts must be enabled via SSIIntEnable().  If necessary,
//! it is the interrupt.handler's responsibility to clear the interrupt source
//! via SSIIntClear().
//!
//! \sa IntRegister() for important information about registering interrupt
//! handlers.
//!
//! \return None.
//
//*****************************************************************************
void
SSIIntRegister(unsigned long ulBase, void (*pfnHandler)(void))
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == SSI_BASE);

    //
    // Register the interrupt.handler, returning an error if an error occurs.
    //
    IntRegister(INT_SSI, pfnHandler);

    //
    // Enable the synchronous serial interface interrupt.
    //
    IntEnable(INT_SSI);
}

//*****************************************************************************
//
//! Unregisters an interrupt.handler for the synchronous serial interface.
//!
//! \param ulBase specifies the SSI module base address.
//!
//! This function will clear the handler to be called when a SSI
//! interrupt occurs.  This will also mask off the interrupt in the interrupt
//! controller so that the interrupt.handler no longer is called.
//!
//! \sa IntRegister() for important information about registering interrupt
//! handlers.
//!
//! \return None.
//
//*****************************************************************************
void
SSIIntUnregister(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == SSI_BASE);

    //
    // Disable the interrupt.
    //
    IntDisable(INT_SSI);

    //
    // Unregister the interrupt.handler.
    //
    IntUnregister(INT_SSI);
}

//*****************************************************************************
//
//! Enables individual SSI interrupt sources.
//!
//! \param ulBase specifies the SSI module base address.
//! \param ulIntFlags is a bit mask of the interrupt sources to be enabled.
//!
//! Enables the indicated SSI interrupt sources.  Only the sources that are

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色狠狠色狠狠综合| 91无套直看片红桃| 日本精品裸体写真集在线观看| 欧美日韩国产综合一区二区 | a亚洲天堂av| 日韩一区二区三免费高清| 国产精品成人网| 国产在线不卡一区| 欧美日韩国产高清一区二区三区 | 午夜精品福利一区二区三区蜜桃| 国产成人免费9x9x人网站视频| 欧美老年两性高潮| 日韩美女久久久| 国产麻豆9l精品三级站| 欧美一区二区美女| 亚洲国产一区视频| 99re在线视频这里只有精品| 国产亚洲欧洲一区高清在线观看| 人人精品人人爱| 欧美日韩高清一区二区不卡| 亚洲精品一二三| av在线一区二区| 欧美国产日本韩| 国产一区二区精品久久| 欧美日韩aaaaaa| 亚洲一区二区三区四区五区黄 | 韩国v欧美v亚洲v日本v| 欧美一区二区女人| 日韩黄色一级片| 欧美日韩一区二区三区四区五区| 成人欧美一区二区三区黑人麻豆| 国产乱码一区二区三区| 欧美成人国产一区二区| 日本中文一区二区三区| 欧美日韩一二三区| 亚洲国产精品一区二区www在线| 91论坛在线播放| 日韩理论电影院| 99re热这里只有精品免费视频 | 3751色影院一区二区三区| 亚洲在线中文字幕| 在线看国产一区| 一区二区在线观看av| 91麻豆自制传媒国产之光| 亚洲欧美日韩国产一区二区三区| av网站免费线看精品| 亚洲欧美综合色| 92精品国产成人观看免费| 亚洲人成在线观看一区二区| 一本到三区不卡视频| 亚洲精品老司机| 在线亚洲免费视频| 午夜久久久久久| 日韩丝袜美女视频| 韩国av一区二区三区四区| 国产视频一区不卡| 高清视频一区二区| 亚洲欧洲色图综合| 在线观看视频91| 天堂一区二区在线| 日韩免费看网站| 国产成人精品亚洲日本在线桃色| 日本一区二区三区电影| 99热国产精品| 亚洲国产精品精华液网站| 欧美一区二区三区色| 精品无人码麻豆乱码1区2区 | 国产精品成人一区二区三区夜夜夜| 99久久久无码国产精品| 亚洲自拍偷拍麻豆| 欧美一级高清片在线观看| 国产麻豆日韩欧美久久| 亚洲欧洲av色图| 欧美日韩久久不卡| 激情深爱一区二区| 中文字幕一区二区三区四区不卡| 色诱亚洲精品久久久久久| 日韩国产欧美在线视频| 久久综合色婷婷| 91首页免费视频| 日韩国产欧美一区二区三区| 国产日韩欧美制服另类| 色婷婷亚洲综合| 麻豆精品蜜桃视频网站| 国产精品久久久久久久岛一牛影视| 精品视频123区在线观看| 黑人精品欧美一区二区蜜桃| 国产精品福利一区二区| 欧美日韩成人综合在线一区二区| 久久99热狠狠色一区二区| 中文字幕一区二区三中文字幕| 欧美日本一区二区在线观看| 国产精品911| 亚洲已满18点击进入久久| 欧美成人精品3d动漫h| 99久久精品国产精品久久| 蜜臀av一级做a爰片久久| 国产精品萝li| 日韩欧美综合在线| 色琪琪一区二区三区亚洲区| 免播放器亚洲一区| 亚洲欧美一区二区不卡| 精品国内片67194| 91久久一区二区| 精品午夜久久福利影院| 亚洲小说春色综合另类电影| 国产午夜三级一区二区三| 欧美日韩免费在线视频| 丰满亚洲少妇av| 青青国产91久久久久久| 亚洲精品视频在线观看免费 | 欧美在线短视频| 国产精品影音先锋| 日韩经典一区二区| 亚洲人成人一区二区在线观看| 精品剧情在线观看| 欧美亚洲国产bt| 成人h动漫精品| 日本视频一区二区| 一区二区三区四区不卡在线| 久久精品人人做| 欧美大度的电影原声| 欧美午夜一区二区| www.av精品| 国产成人小视频| 精品无人区卡一卡二卡三乱码免费卡| 亚洲国产精品久久久久婷婷884| 国产精品青草久久| 久久蜜臀中文字幕| 日韩欧美一二三| 欧美日韩精品欧美日韩精品一| eeuss国产一区二区三区| 国产高清视频一区| 精品制服美女久久| 日本最新不卡在线| 亚洲成人福利片| 亚洲综合免费观看高清完整版| 亚洲欧洲一区二区在线播放| 亚洲国产激情av| 久久久综合激的五月天| 精品久久人人做人人爱| 欧美一区二区三区色| 欧美另类videos死尸| 欧美日精品一区视频| 色成年激情久久综合| 99久久国产综合精品色伊| jiyouzz国产精品久久| 大桥未久av一区二区三区中文| 国产精一品亚洲二区在线视频| 麻豆91在线播放| 免费不卡在线视频| 蜜桃一区二区三区在线观看| 日韩综合在线视频| 天天综合色天天| 五月激情六月综合| 肉丝袜脚交视频一区二区| 亚洲成人1区2区| 亚洲亚洲人成综合网络| 午夜影院久久久| 午夜av一区二区| 日韩精品一区第一页| 日本欧美一区二区三区乱码| 日韩国产精品大片| 美女视频一区在线观看| 久久精品国产77777蜜臀| 毛片av一区二区| 久草精品在线观看| 国产精品一区免费在线观看| 国产91精品久久久久久久网曝门| 成人精品一区二区三区四区| 99久久精品国产一区| 欧美在线综合视频| 欧美日韩国产影片| 日韩三级视频在线观看| 精品国产91乱码一区二区三区| 久久久国产午夜精品| 国产精品国模大尺度视频| 亚洲美女视频在线| 婷婷国产在线综合| 久久精工是国产品牌吗| 国产在线播放一区| 成人性生交大片免费看中文| 99久久综合99久久综合网站| 在线观看av不卡| 日韩一区二区三区电影| 国产视频视频一区| 亚洲女子a中天字幕| 图片区日韩欧美亚洲| 麻豆成人久久精品二区三区红| 国产iv一区二区三区| 色偷偷一区二区三区| 欧美夫妻性生活| 国产亚洲视频系列| 亚洲精品中文字幕在线观看| 日韩—二三区免费观看av| 国产精品一区二区三区四区| 色婷婷av一区| 日韩欧美成人一区二区| 国产精品欧美一级免费| 五月天欧美精品|