A Atmel RF2xx Radio Library for Mbed
Dependents: xBedRadio MxSniffer
MxRadio_trx_rf230_bitwr.cpp
00001 /* Copyright (c) 2008 Axel Wachtler 00002 All rights reserved. 00003 00004 Redistribution and use in source and binary forms, with or without 00005 modification, are permitted provided that the following conditions 00006 are met: 00007 00008 * Redistributions of source code must retain the above copyright 00009 notice, this list of conditions and the following disclaimer. 00010 * Redistributions in binary form must reproduce the above copyright 00011 notice, this list of conditions and the following disclaimer in the 00012 documentation and/or other materials provided with the distribution. 00013 * Neither the name of the authors nor the names of its contributors 00014 may be used to endorse or promote products derived from this software 00015 without specific prior written permission. 00016 00017 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00018 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00019 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00020 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00021 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00022 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00023 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00024 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00025 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00026 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00027 POSSIBILITY OF SUCH DAMAGE. */ 00028 00029 /* 00030 * =========================================================================== 00031 * This file contains refactored code from hif_rf230.c, 00032 * which is part of Atmels software package "IEEE 802.15.4 MAC for AVR Z-Link" 00033 * =========================================================================== 00034 */ 00035 /* 00036 * Copyright (c) 2006, Atmel Corporation All rights reserved. 00037 * 00038 * Redistribution and use in source and binary forms, with or without 00039 * modification, are permitted provided that the following conditions are met: 00040 * 00041 * 1. Redistributions of source code must retain the above copyright notice, 00042 * this list of conditions and the following disclaimer. 00043 * 00044 * 2. Redistributions in binary form must reproduce the above copyright notice, 00045 * this list of conditions and the following disclaimer in the documentation 00046 * and/or other materials provided with the distribution. 00047 * 00048 * 3. The name of ATMEL may not be used to endorse or promote products derived 00049 * from this software without specific prior written permission. 00050 * 00051 * THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED 00052 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00053 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND 00054 * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, 00055 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00056 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00057 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00058 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00059 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 00060 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00061 */ 00062 00063 00064 /* $Id$ */ 00065 /** 00066 * @file 00067 * @brief .... 00068 * @addtogroup grpApp... 00069 */ 00070 00071 00072 /* === includes ========================================== */ 00073 00074 #include <MxRadio.h> 00075 00076 /* === functions ========================================= */ 00077 void cMxRadio::trx_bit_write(uint8_t addr, trx_regval_t mask, uint8_t pos, trx_regval_t value) 00078 { 00079 00080 trx_regval_t tmp; 00081 tmp = trx_reg_read(addr); 00082 tmp &= ~mask; 00083 value <<= pos; 00084 value &=mask; 00085 value |= tmp; 00086 trx_reg_write(addr, value); 00087 return; 00088 } 00089 00090 00091 /* EOF */
Generated on Thu Jul 14 2022 01:09:40 by
1.7.2