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

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

?? aio.c

?? DMDD的嵌入式系統(tǒng)構(gòu)件源代碼
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
* Arguments   : None
* Returns     : None.
*********************************************************************************************************
*/

static  void  AOInit (void)
{
    INT8U   i;
    AIO    *paio;


    paio = &AOTbl[0];
    for (i = 0; i < AIO_MAX_AO; i++) {
        paio->AIOBypassEn     = FALSE;           /* Analog channel is not bypassed                     */
        paio->AIORaw          = 0x0000;          /* Raw counts of ADC or DAC                           */
        paio->AIOEU           =  (FP32)0.0;      /* Engineering units of AI channel                    */
        paio->AIOGain         =  (FP32)1.0;      /* Total gain                                         */
        paio->AIOOffset       =  (FP32)0.0;      /* Total offset                                       */
        paio->AIOLim          =      0;          /* Maximum count of an analog output channel          */
        paio->AIOPassCnts     =      1;          /* Pass counts                                        */
        paio->AIOPassCtr      =      1;          /* Pass counter                                       */
        paio->AIOCalGain      =  (FP32)1.0;      /* Calibration gain                                   */
        paio->AIOCalOffset    =  (FP32)0.0;      /* Calibration offset                                 */
        paio->AIOConvGain     =  (FP32)1.0;      /* Conversion gain                                    */
        paio->AIOConvOffset   =  (FP32)0.0;      /* Conversion offset                                  */
        paio->AIOScaleIn      =  (FP32)0.0;      /* Input  to scaling function                         */
        paio->AIOScaleOut     =  (FP32)0.0;      /* Output of scaling function                         */
        paio->AIOScaleFnct    = (void *)0;       /* No function to execute                             */
        paio->AIOScaleFnctArg = (void *)0;       /* No arguments to scale function                     */
        paio++;
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                SET THE VALUE OF AN ANALOG OUTPUT CHANNEL
*
* Description : This function is used to set the currect value of an analog output channel
*               (in engineering units).
* Arguments   : n     is the analog output channel (0..AIO_MAX_AO-1).
*               val   is the desired analog output value in Engineering Units
* Returns     : 0     if successfull.
*               1     if you specified an invalid analog output channel number.
*********************************************************************************************************
*/

INT8U  AOSet (INT8U n, FP32 val)
{
    if (n < AIO_MAX_AO) {
        OS_ENTER_CRITICAL();
        AOTbl[n].AIOEU = val;          /* Set the engineering units of the analog output channel       */
        OS_EXIT_CRITICAL();
        return (0);
    } else {
        return (1);
    }
}

/*$PAGE*/
/*
*********************************************************************************************************
*                           SET THE STATE OF THE BYPASSED ANALOG OUTPUT CHANNEL
*
* Description : This function is used to set the engineering units of a bypassed analog output channel.
* Arguments   : n     is the analog output channel (0..AIO_MAX_AO-1).
*               val   is the value of the bypassed analog output channel:
* Returns     : 0     if successfull.
*               1     if you specified an invalid analog output channel number.
*               2     if AIOBypassEn is not set to TRUE
*********************************************************************************************************
*/

INT8U  AOSetBypass (INT8U n, FP32 val)
{
    AIO *paio;


    if (n < AIO_MAX_AO) {
        paio = &AOTbl[n];                        /* Faster to use a pointer to the structure           */
        if (paio->AIOBypassEn == TRUE) {         /* See if the analog output channel is bypassed       */
            OS_ENTER_CRITICAL();
            paio->AIOScaleIn = val;              /* Yes, then set the new value of the channel         */
            OS_EXIT_CRITICAL();
            return (0);
        } else {
            return (2);
        }
    } else {
        return (1);
    }
}

/*$PAGE*/
/*
*********************************************************************************************************
*                                  SET THE STATE OF THE BYPASS SWITCH
*
* Description : This function is used to set the state of the bypass switch.  The analog output channel
*               is bypassed when the 'switch' is open (i.e. AIOBypassEn is set to TRUE).
* Arguments   : n      is the analog output channel (0..AIO_MAX_AO-1).
*               state  is the state of the bypass switch:
*                         FALSE disables the bypass (i.e. the bypass 'switch' is closed)
*                         TRUE  enables  the bypass (i.e. the bypass 'switch' is open)
* Returns     : 0      if successfull.
*               1      if you specified an invalid analog output channel number.
*********************************************************************************************************
*/

INT8U  AOSetBypassEn (INT8U n, BOOLEAN state)
{
    INT8U err;


    if (n < AIO_MAX_AO) {
        AOTbl[n].AIOBypassEn = state;
        return (0);
    } else {
        return (1);
    }
}

/*$PAGE*/
/*
*********************************************************************************************************
*                                   UPDATE ALL ANALOG OUTPUT CHANNELS
*
* Description : This function processes all of the analog output channels.
* Arguments   : None.
* Returns     : None.
*********************************************************************************************************
*/

static  void  AOUpdate (void)
{
    INT8U     i;
    AIO      *paio;
    INT16S    raw;


    paio = &AOTbl[0];                            /* Point at first analog output channel               */
    for (i = 0; i < AIO_MAX_AO; i++) {           /* Process all analog output channels                 */
        if (paio->AIOBypassEn == FALSE) {        /* See if analog output channel is bypassed           */
            paio->AIOScaleIn = paio->AIOEU;      /* No                                                 */
        }
        paio->AIOPassCtr--;                      /* Decrement pass counter                             */
        if (paio->AIOPassCtr == 0) {             /* When pass counter reaches 0, read and scale AI     */
            paio->AIOPassCtr = paio->AIOPassCnts;          /* Reload pass counter                      */
            if ((void *)paio->AIOScaleFnct != (void *)0) { /* See if function defined                  */
                (*paio->AIOScaleFnct)(paio);               /* Yes, execute function                    */
            } else {
                paio->AIOScaleOut = paio->AIOScaleIn;      /* No,  bypass scaling function             */
            }
            raw = (INT16S)(paio->AIOScaleOut * paio->AIOGain + paio->AIOOffset);
            if (raw > paio->AIOLim) {                      /* Never output > maximum DAC counts        */
                raw = paio->AIOLim;
            } else if (raw < 0) {                          /* DAC counts must always be >= 0           */
                raw = 0;
            }
            paio->AIORaw = raw;
            AOWr(i, paio->AIORaw);                         /* Write counts to DAC                      */
        }
        paio++;                                            /* Point at next AO channel                 */
    }
}

/*$PAGE*/
#ifndef CFG_C
/*
*********************************************************************************************************
*                                      INITIALIZE PHYSICAL I/Os
*
* Description : This function is called by AIOInit() to initialize the physical I/O used by the AIO
*               driver.
* Arguments   : None.
* Returns     : None.
*********************************************************************************************************
*/

void  AIOInitIO (void)
{
    /* This is where you will need to put you initialization code for the ADCs and DACs                */
    /* You should also consider initializing the contents of your DAC(s) to a known value.             */
}

/*
*********************************************************************************************************
*                                         READ PHYSICAL INPUTS
*
* Description : This function is called to read a physical ADC channel.  The function is assumed to
*               also control a multiplexer if more than one analog input is connected to the ADC.
* Arguments   : ch     is the ADC logical channel number (0..AIO_MAX_AI-1).
* Returns     : The raw ADC counts from the physical device.
*********************************************************************************************************
*/

INT16S  AIRd (INT8U ch)
{
    /* This is where you will need to provide the code to read your ADC(s).                            */
    /* AIRd() is passed a 'LOGICAL' channel number.  You will have to convert this logical channel     */
    /* number into actual physical port locations (or addresses) where your MUX. and ADCs are located. */
    /* AIRd() is responsible for:                                                                      */
    /*     1) Selecting the proper MUX. channel,                                                       */
    /*     2) Waiting for the MUX. to stabilize,                                                       */
    /*     3) Starting the ADC,                                                                        */
    /*     4) Waiting for the ADC to complete its conversion,                                          */
    /*     5) Reading the counts from the ADC and,                                                     */
    /*     6) Returning the counts to the calling function.                                            */

    return (ch);
}

/*$PAGE*/
/*
*********************************************************************************************************
*                                       UPDATE PHYSICAL OUTPUTS
*
* Description : This function is called to write the 'raw' counts to the proper analog output device
*               (i.e. DAC).  It is up to this function to direct the DAC counts to the proper DAC if more
*               than one DAC is used.
* Arguments   : ch     is  the DAC logical channel number (0..AIO_MAX_AO-1).
*               cnts   are the DAC counts to write to the DAC
* Returns     : None.
*********************************************************************************************************
*/

void  AOWr (INT8U ch, INT16S cnts)
{
    ch   = ch;
    cnts = cnts;

    /* This is where you will need to provide the code to update your DAC(s).                          */
    /* AOWr() is passed a 'LOGICAL' channel number.  You will have to convert this logical channel     */
    /* number into actual physical port locations (or addresses) where your DACs are located.          */
    /* AOWr() is responsible for writing the counts to the selected DAC based on a logical number.     */
}
#endif

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区免费在线观看| 国产91精品露脸国语对白| 麻豆专区一区二区三区四区五区| 免费欧美在线视频| 国产91丝袜在线观看| 91久久精品网| 日韩欧美卡一卡二| 国产精品不卡一区| 水蜜桃久久夜色精品一区的特点| 精品一区二区免费看| www.色精品| 777午夜精品免费视频| 久久久精品日韩欧美| 亚洲欧美日韩一区| 欧美aⅴ一区二区三区视频| 国产一区二区三区黄视频| 91麻豆免费在线观看| 欧美一区二区视频网站| 国产精品视频一二三区| 亚洲 欧美综合在线网络| 精品系列免费在线观看| 色哟哟一区二区三区| 精品国产乱码久久久久久久久| 亚洲视频一区在线| 另类欧美日韩国产在线| 99re成人在线| 久久在线观看免费| 亚洲成av人片一区二区| 成人国产亚洲欧美成人综合网| 91精品国产综合久久小美女| 国产精品久久久久一区二区三区 | 国产白丝网站精品污在线入口| 在线观看免费亚洲| 日本一区二区三区高清不卡| 日韩影院免费视频| 99久久精品99国产精品| 精品日韩在线一区| 亚洲.国产.中文慕字在线| www.爱久久.com| 精品日韩一区二区| 天堂蜜桃91精品| 91香蕉视频污在线| 欧美极品xxx| 久久精品国产精品青草| 欧美在线免费观看视频| 中文字幕中文字幕一区二区| 韩国精品在线观看| 在线91免费看| 亚洲一区二区影院| 99re热视频精品| 欧美国产一区在线| 国产在线不卡视频| 日韩免费观看2025年上映的电影| 亚洲国产成人av网| 色一情一伦一子一伦一区| 国产精品美日韩| 国产精品99久久久久久久vr| 欧美成人艳星乳罩| 欧美a级理论片| 欧美日韩另类国产亚洲欧美一级| 尤物av一区二区| 色综合婷婷久久| 精品一区二区三区免费毛片爱| 欧美亚洲综合网| 亚洲乱码精品一二三四区日韩在线| 成人激情黄色小说| 国产精品污www在线观看| 国产成人av电影在线| 久久久久久久免费视频了| 老司机精品视频线观看86| 欧美一区二区久久| 秋霞午夜鲁丝一区二区老狼| 69p69国产精品| 视频一区中文字幕| 欧美精品一卡二卡| 五月婷婷久久综合| 91精品啪在线观看国产60岁| 青青青爽久久午夜综合久久午夜| 欧美精品一卡二卡| 免费一区二区视频| 日韩欧美亚洲国产精品字幕久久久| 日本在线不卡视频一二三区| 日韩欧美一区中文| 国内精品免费在线观看| 国产欧美精品区一区二区三区 | 亚洲国产精品精华液2区45| 高清视频一区二区| 国产精品免费看片| 色呦呦日韩精品| 偷拍一区二区三区四区| 日韩精品一区国产麻豆| 国产精品一区二区在线看| 亚洲国产高清不卡| 99riav一区二区三区| 亚洲一区在线视频| 欧美一激情一区二区三区| 国产在线精品一区二区三区不卡| 国产欧美精品国产国产专区| 99国产精品一区| 亚洲国产精品人人做人人爽| 欧美一二三四在线| 国产成人午夜电影网| 亚洲欧美综合在线精品| 欧美综合一区二区三区| 美腿丝袜亚洲三区| 久久精品一区二区三区四区| 不卡大黄网站免费看| 亚洲一级电影视频| 精品福利在线导航| 99久久婷婷国产| 日韩vs国产vs欧美| 欧美激情一区二区在线| 色久综合一二码| 老汉av免费一区二区三区| 国产精品人人做人人爽人人添| 欧洲精品视频在线观看| 久久99国产精品免费| 国产精品电影一区二区| 91精品在线免费| 成人av午夜电影| 日韩精品视频网站| 国产精品久久午夜夜伦鲁鲁| 51精品秘密在线观看| 成人激情图片网| 日本视频中文字幕一区二区三区| 国产亚洲精品久| 在线亚洲人成电影网站色www| 久久精品久久久精品美女| 亚洲丝袜精品丝袜在线| 精品免费一区二区三区| 色婷婷狠狠综合| 韩国精品免费视频| 亚洲高清在线精品| 中文一区在线播放| 91精品福利在线一区二区三区 | 亚洲免费av在线| 欧美精品一区在线观看| 在线这里只有精品| 国产高清无密码一区二区三区| 香蕉成人啪国产精品视频综合网| 久久久久国产一区二区三区四区| 欧美日韩免费电影| 成人h动漫精品| 国产另类ts人妖一区二区| 亚洲国产日韩一级| 中文字幕中文在线不卡住| 26uuu欧美| 91精品国产入口| 欧美中文字幕亚洲一区二区va在线 | 不卡一区二区在线| 久久精品国产77777蜜臀| 亚洲自拍与偷拍| 国产精品―色哟哟| 精品盗摄一区二区三区| 538在线一区二区精品国产| 色噜噜狠狠成人中文综合| 懂色av一区二区夜夜嗨| 精品一区二区免费看| 日韩精品欧美精品| 亚洲午夜激情av| 一区二区三区四区av| 国产精品人妖ts系列视频| 精品国产乱码久久久久久免费| 欧美浪妇xxxx高跟鞋交| 91在线免费播放| 成人综合婷婷国产精品久久蜜臀 | 欧美不卡视频一区| 欧美欧美午夜aⅴ在线观看| 91麻豆蜜桃一区二区三区| 国产成人在线视频免费播放| 韩国欧美国产1区| 日韩成人dvd| 亚洲国产日日夜夜| 亚洲综合一区二区三区| 亚洲日本护士毛茸茸| 中文字幕日韩欧美一区二区三区| 精品少妇一区二区三区在线视频 | 久久国产精品99精品国产| 天天色天天操综合| 亚洲电影一区二区三区| 一区二区三区在线视频免费观看| 亚洲日本青草视频在线怡红院 | 欧美色综合影院| 欧美亚洲图片小说| 91福利视频网站| 欧美午夜理伦三级在线观看| 在线视频你懂得一区二区三区| 色94色欧美sute亚洲线路二| 色8久久精品久久久久久蜜| 91九色最新地址| 在线观看区一区二| 欧美三区在线视频| 777欧美精品| 日韩欧美久久一区| 久久这里只有精品6| 国产欧美日韩精品一区| 国产精品每日更新在线播放网址| 国产精品二区一区二区aⅴ污介绍| 最新久久zyz资源站| 最近日韩中文字幕|