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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ssi.c

?? freertosV4.40 是一種small的嵌入式系統。利于嵌入式開好者入門學習嵌入式操作系統。通過對于源碼的學習可以很好的掌握freertos的運行機制。
?? 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 991 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.
//
//*****************************************************************************
#if defined(GROUP_config) || defined(BUILD_ALL) || defined(DOXYGEN)
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;
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_enable) || defined(BUILD_ALL) || defined(DOXYGEN)
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;
}
#endif

//*****************************************************************************
//
//! Disables the synchronous serial interface.
//!
//! \param ulBase specifies the SSI module base address.
//!
//! This will disable operation of the synchronous serial interface.
//!
//! \return None.
//
//*****************************************************************************
#if defined(GROUP_disable) || defined(BUILD_ALL) || defined(DOXYGEN)
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);
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_intregister) || defined(BUILD_ALL) || defined(DOXYGEN)
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);
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_intunregister) || defined(BUILD_ALL) || defined(DOXYGEN)
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);
}
#endif

//*****************************************************************************
//
//! 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
//! enabled can be reflected to the processor interrupt; disabled sources
//! have no effect on the processor.  The parameter \e ulIntFlags Can be
//! any of the SSI_TXFF, SSI_RXFF, SSI_RXTO, or SSI_RXOR values.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人免费av网站| 国产精品午夜在线| 亚洲最色的网站| 九九**精品视频免费播放| 一区二区三区久久| 国产精品久久久久久久久果冻传媒| 欧美日韩电影在线播放| 99re成人精品视频| 欧美午夜精品理论片a级按摩| 欧美日韩一区二区在线观看| 日韩一级黄色大片| 1000精品久久久久久久久| 午夜不卡在线视频| 国产传媒欧美日韩成人| 91福利视频久久久久| 日韩一区二区免费高清| 自拍偷拍国产精品| 精品一区二区三区不卡 | 欧美撒尿777hd撒尿| 精品福利一二区| 一区二区三区影院| 国产福利一区二区三区视频在线 | 日韩av电影一区| 91在线免费视频观看| 国产午夜精品久久久久久久 | 国产精品五月天| 蜜臀av亚洲一区中文字幕| jlzzjlzz亚洲日本少妇| 欧美一区二区三区公司| 亚洲成人免费影院| 成人动漫在线一区| 亚洲国产高清在线| 国产一区二区h| 日韩欧美一区二区不卡| 亚洲图片有声小说| 欧美在线999| 午夜私人影院久久久久| 欧美体内she精高潮| 亚洲成人免费av| 欧美精品99久久久**| 亚洲一区二区免费视频| 欧美亚洲一区二区在线| 亚洲成人自拍偷拍| 91麻豆精品久久久久蜜臀| 日韩精品亚洲专区| 日韩一级视频免费观看在线| 天堂在线亚洲视频| 日韩西西人体444www| 免费人成精品欧美精品| www久久精品| 风间由美性色一区二区三区| 亚洲男人的天堂在线aⅴ视频| 97久久人人超碰| 亚洲国产成人av好男人在线观看| 欧美亚洲自拍偷拍| 久久99精品国产麻豆不卡| 国产婷婷色一区二区三区在线| 成人免费毛片高清视频| 国产精品福利av| 欧美日韩精品久久久| 久久er99精品| 中文字幕人成不卡一区| 777午夜精品视频在线播放| 狠狠v欧美v日韩v亚洲ⅴ| 国产精品动漫网站| 91麻豆精品国产91久久久久| 国产一区二区三区免费看| 国产精品久久夜| 日韩一区二区不卡| 色综合天天综合在线视频| 欧美aⅴ一区二区三区视频| 国产精品视频一二| 在线观看91av| 99精品久久久久久| 精品影院一区二区久久久| 亚洲免费在线电影| 欧美国产成人精品| 91精品国产91久久久久久一区二区| 国产成人免费视频精品含羞草妖精| 一区二区三区在线观看动漫| 久久久99久久| 91精品国产91久久久久久最新毛片| 97久久精品人人做人人爽50路| 久久99久久精品| 视频一区二区三区入口| 亚洲视频香蕉人妖| 国产日本欧洲亚洲| 久久久久久久久久久久久夜| 91精品国产麻豆国产自产在线| 欧美在线制服丝袜| 一本到不卡免费一区二区| 成+人+亚洲+综合天堂| 国产一区二区不卡| 久久99精品国产麻豆不卡| 日本欧美加勒比视频| 亚州成人在线电影| 日韩精品国产精品| 日日骚欧美日韩| 免费人成精品欧美精品| 蜜乳av一区二区| 免费观看日韩电影| 捆绑紧缚一区二区三区视频| 日本aⅴ免费视频一区二区三区| 婷婷亚洲久悠悠色悠在线播放| 午夜欧美电影在线观看| 奇米亚洲午夜久久精品| 狠狠色综合播放一区二区| 国产成人亚洲综合a∨婷婷| 国产成人精品免费视频网站| 高清在线成人网| 91理论电影在线观看| 精品视频在线看| 9191久久久久久久久久久| 日韩美女天天操| 国产精品成人免费| 天堂久久一区二区三区| 奇米精品一区二区三区四区| 国产盗摄视频一区二区三区| www.亚洲人| 日韩午夜在线播放| 国产精品久久看| 日本怡春院一区二区| 成人午夜av电影| 日韩一区国产二区欧美三区| 中文字幕+乱码+中文字幕一区| 亚洲高清不卡在线观看| 国产高清在线精品| 欧美在线视频日韩| 国产精品免费久久久久| 无吗不卡中文字幕| 91麻豆福利精品推荐| 欧美精品一区二区蜜臀亚洲| 亚洲综合色婷婷| 成人少妇影院yyyy| 久久久久久麻豆| 日韩av午夜在线观看| 色哟哟欧美精品| 国产人妖乱国产精品人妖| 日韩av不卡在线观看| 色爱区综合激月婷婷| 国产精品久久久久久久久免费桃花 | 激情小说欧美图片| 欧美人妇做爰xxxⅹ性高电影| 亚洲视频在线一区观看| 国产成人精品1024| 精品不卡在线视频| 日韩精品成人一区二区三区| 欧美色爱综合网| 亚洲国产精品久久久久秋霞影院| 99re在线精品| 亚洲精品中文字幕乱码三区| 99在线精品免费| 亚洲欧洲成人自拍| 91在线高清观看| 亚洲国产精品一区二区久久| 在线观看国产精品网站| 亚洲成av人片| 欧美一二区视频| 韩国v欧美v日本v亚洲v| 国产午夜一区二区三区| av高清久久久| 一二三区精品视频| 日韩午夜激情视频| 国产精品18久久久久久vr | 亚洲高清视频的网址| 欧美另类z0zxhd电影| 国产成人精品一区二区三区四区| 在线电影国产精品| 黑人巨大精品欧美一区| 亚洲人成影院在线观看| 精品视频免费在线| 国内成+人亚洲+欧美+综合在线| 久久久亚洲精华液精华液精华液| av网站一区二区三区| 午夜视频一区在线观看| 久久亚洲免费视频| 欧美色综合网站| 国产成人自拍在线| 日韩影院精彩在线| 亚洲欧美偷拍三级| 337p日本欧洲亚洲大胆色噜噜| 色综合天天综合在线视频| 久久99国产精品免费网站| 亚洲伦理在线免费看| 欧美大度的电影原声| 91亚洲国产成人精品一区二区三 | 亚洲美女免费在线| 久久综合一区二区| 日韩一卡二卡三卡四卡| 色婷婷国产精品综合在线观看| 国产一区二区三区综合| 五月激情六月综合| 亚洲制服丝袜一区| 亚洲丝袜另类动漫二区| 久久久九九九九| 久久综合色8888| 欧美一区二区三级| 欧美日本韩国一区二区三区视频| 成人a级免费电影| 成人性生交大片免费看在线播放 |