si47xx 驱动代码


si47xx驱动源代码 稍作修改即可使用到产品中去!车机开发人员懂得
资源截图
代码片段和文件信息
//-----------------------------------------------------------------------------
// Includes
//-----------------------------------------------------------------------------
#include 
#include 
#include “typedefs.h“
#include “si47xxAMRX.h“

//-----------------------------------------------------------------------------
// Defines
//-----------------------------------------------------------------------------
#define NUM_SEEK_PRESETS 15

//-----------------------------------------------------------------------------
// Global variables
//-----------------------------------------------------------------------------
u16 xdata am_seek_preset[NUM_SEEK_PRESETS];

//-----------------------------------------------------------------------------
// Function prototypes
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
// Inserts a channel in the preset array. First it finds the channel with the
// lowest rssi.  If the current channel has a higher rssi the channel with the
// lowest rssi is replaced. Channels are kept in order of increasing frequency.
//
// Inputs:
//      frequency:          Frequency of station found
//      rssi:               Rssi of station found
//      seek_prset_rssi:    Array of rsssi values for each preset
//-----------------------------------------------------------------------------
static void am_insert_preset(u16 frequency u8 rssi u8 *seek_preset_rssi)
{
    u8 i;
    u8 min_rssi = 0xff;
    u8 min_rssi_preset = 0;

    // first find the minimum rssi and its location
    // this will always stop at the first location with a zero rssi
    for ( i = 0; i < NUM_SEEK_PRESETS; i++ )
    {
        if(seek_preset_rssi[i] < min_rssi)
        {
            min_rssi = seek_preset_rssi[i];
            min_rssi_preset = i;
        }
    }

    // return if current preset rssi is less than minimum preset in array
    if(rssi < min_rssi)
        return;

    // delete the preset with the minimum rssi and clear the last preset
    // since it would only be a copy of the second to last preset after
    // the deletion
    for ( i = min_rssi_preset; i < NUM_SEEK_PRESETS - 1; i++ )
    {
        am_seek_preset[i] = am_seek_preset[i + 1];
        seek_preset_rssi[i] = seek_preset_rssi[i + 1];
    }

    am_seek_preset[i] = 0;
    seek_preset_rssi[i] = 0;

    // fill the first preset with a zero for the frequency.  This will
    // always overwrite the last preset once all presets have been filled.
    for ( i = min_rssi_preset; i < NUM_SEEK_PRESETS; i++ )
    {
        if(am_seek_preset[i] == 0)
        {
            am_seek_preset[i] = frequency;
            seek_preset_rssi[i] = rssi;
            break;
        }
    }
}

//-----------------------------------------------------------------------------
// This routine scans the band a

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        1776  2007-08-17 16:07  si47xxFMTX.h
     文件        1482  2008-03-31 14:20  si47xxWBRX.h
     文件          98  2007-03-20 11:59  typedefs.h
     文件        1009  2008-03-31 14:00  WBRXsame.h
     文件        1031  2008-03-28 15:38  WBRXtest.h
     文件       56047  2008-03-28 13:37  example.wsp
     文件        5753  2007-08-01 15:17  AMRXautoseek.c
     文件        4477  2007-11-20 12:53  AMRXtest.c
     文件        5477  2007-07-30 15:49  FMRXautoseek.c
     文件       31290  2008-03-27 15:30  FMRXrds.c
     文件        7456  2008-03-28 14:36  FMRXtest.c
     文件        4125  2007-08-14 12:45  FMTXScan.c
     文件       12006  2007-11-20 12:53  FMTXtest.c
     文件        8306  2007-07-26 11:51  io2w.c
     文件        6968  2007-08-01 12:45  io3w.c
     文件       12920  2008-04-01 07:41  main.c
     文件        9116  2008-04-01 08:28  si47xx_low.c
     文件       18097  2008-04-01 08:28  si47xxAMRX.c
     文件       22958  2008-04-01 08:28  si47xxFMRX.c
     文件       18220  2008-04-01 08:28  si47xxFMTX.c
     文件       15826  2008-04-01 10:33  si47xxWBRX.c
     文件        7003  2008-04-01 11:01  WBRXsame.c
     文件        5414  2008-04-01 09:50  WBRXtest.c
     文件        1038  2007-11-20 12:27  AMRXtest.h
     文件       17265  2008-03-27 15:45  c8051F320.h
     文件        6803  2008-03-31 13:59  commanddefs.h
     文件        1017  2007-07-31 09:08  FMRXrds.h
     文件        1067  2007-08-27 10:27  FMRXtest.h
     文件        1050  2007-08-27 10:27  FMTXtest.h
     文件         695  2007-07-18 12:48  io.h
     文件        2679  2007-11-20 12:53  portdef.h
............此处省略4个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)