rfoverridebaudrate.c

来自「ti-Chipcon CC1010 1G以下Soc源码库。包括rf,powerm」· C语言 代码 · 共 67 行

C
67
字号
/*****************************************************************************
 *                                                                           *
 *        **********                                                         *
 *       ************                                                        *
 *      ***        ***                                                       *
 *      ***   +++   ***                                                      *
 *      ***   + +   ***                                                      *
 *      ***   +                            CHIPCON CC1010                    *
 *      ***   + +   ***                 HAL - RFOverrideBaudRate             *
 *      ***   +++   ***                                                      *
 *      ***       ***                                                        *
 *       ***********                                                         *
 *        *********                                                          *
 *                                                                           *
 *****************************************************************************
 *                                                                           *
 *****************************************************************************
 * Author:              ROH                                                  *
 *****************************************************************************
 * Revision history:                                                         *
 *                                                                           *
 * $Log: RFOverrideBaudRate.c,v $
 * Revision 1.1  2002/10/14 13:04:33  tos
 * Initial version in CVS.
 *
 *                                                                           *
 ****************************************************************************/

#include <chipcon/hal.h>

// Variables that are used to override baudrate and PA output power
extern byte xdata   hal_dataformat_override, 
                    hal_baudrate_override, 
                    hal_pa_pow_override,
                    hal_modem0_original,
                    hal_pa_pow_original;

//----------------------------------------------------------------------------
//  void halRFOverrideBaudRate(...)
//
//  Description:
//      Function used to override the dataformat specified by an RX/TX-pair.
//      If this function is called before halRFSetRxTxOff(...) it uses
//      the parameter passed to this function instead of whatever the
//      RX/TX-pair defines. If it is passed during an RF-operation, i.e. after
//      halRFSetRxTxOff(...) is called, the parameter passed is immediately
//      updated in hardware.
//      Note that for optimal performance, the baudrate can only be changed
//      without a new calibration within the two sets (600, ..., 19200) and
//      (38400, 76800).
//
//  Arguments:
//      byte dataFormat
//          Options given below. To disable the override the function must be
//          called with the parameter RF_NO_OVERRIDE.
//
//  Return value:
//      void
//----------------------------------------------------------------------------
void halRFOverrideBaudRate(byte baudRate) {
    if (hal_baudrate_override=baudRate)
        MODEM0=(MODEM0&0x1F)|(baudRate&0xE0/*0x70*/);//Torgeir
    else
        MODEM0=(MODEM0&0x1F)|(hal_modem0_original&0xE0/*0x70*/); //Torgeir
}

⌨️ 快捷键说明

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