123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- /**************************************************************************************************
- Filename: mac_mem.c
- Revised: $Date: 2009-08-12 14:34:18 -0700 (Wed, 12 Aug 2009) $
- Revision: $Revision: 20549 $
- Description: Describe the purpose and contents of the file.
- Copyright 2006-2009 Texas Instruments Incorporated. All rights reserved.
- IMPORTANT: Your use of this Software is limited to those specific rights
- granted under the terms of a software license agreement between the user
- who downloaded the software, his/her employer (which must be your employer)
- and Texas Instruments Incorporated (the "License"). You may not use this
- Software unless you agree to abide by the terms of the License. The License
- limits your use, and you acknowledge, that the Software may not be modified,
- copied or distributed unless embedded on a Texas Instruments microcontroller
- or used solely and exclusively in conjunction with a Texas Instruments radio
- frequency transceiver, which is integrated into your product. Other than for
- the foregoing purpose, you may not use, reproduce, copy, prepare derivative
- works of, modify, distribute, perform, display or sell this Software and/or
- its documentation for any purpose.
- YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
- PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
- INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
- NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
- TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
- NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
- LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
- INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
- OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
- OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
- (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
- Should you have any questions regarding your right to use this Software,
- contact Texas Instruments Incorporated at www.TI.com.
- **************************************************************************************************/
- /* ------------------------------------------------------------------------------------------------
- * Includes
- * ------------------------------------------------------------------------------------------------
- */
- /* hal */
- #include "hal_types.h"
- /* low-level specific */
- #include "mac_mem.h"
- /* target specific */
- #include "hal_mcu.h"
- /* debug */
- #include "mac_assert.h"
- /**************************************************************************************************
- * @fn macMemReadRamByte
- *
- * @brief Read a byte from RAM.
- *
- * @param pRam - pointer to byte RAM byte to read
- *
- * @return byte read from RAM
- **************************************************************************************************
- */
- uint8 macMemReadRamByte(macRam_t * pRam)
- {
- return(*pRam);
- }
- /**************************************************************************************************
- * @fn macMemWriteRam
- *
- * @brief Write multiple bytes to RAM.
- *
- * @param pRam - pointer to RAM to be written to
- * @param pData - pointer to data to write
- * @param len - number of bytes to write
- *
- * @return none
- **************************************************************************************************
- */
- MAC_INTERNAL_API void macMemWriteRam(macRam_t * pRam, uint8 * pData, uint8 len)
- {
- while (len)
- {
- len--;
- *pRam = *pData;
- pRam++;
- pData++;
- }
- }
- /**************************************************************************************************
- * @fn macMemReadRam
- *
- * @brief Read multiple bytes from RAM.
- *
- * @param pRam - pointer to RAM to be read from
- * @param pData - pointer to location to store read data
- * @param len - number of bytes to read
- *
- * @return none
- **************************************************************************************************
- */
- MAC_INTERNAL_API void macMemReadRam(macRam_t * pRam, uint8 * pData, uint8 len)
- {
- while (len)
- {
- len--;
- *pData = *pRam;
- pRam++;
- pData++;
- }
- }
- /**************************************************************************************************
- * @fn macMemWriteTxFifo
- *
- * @brief Write multiple bytes to the transmit FIFO.
- *
- * @param pData - pointer to bytes to be written to TX FIFO
- * @param len - number of bytes to write
- *
- * @return none
- **************************************************************************************************
- */
- MAC_INTERNAL_API void macMemWriteTxFifo(uint8 * pData, uint8 len)
- {
- MAC_ASSERT(len != 0); /* pointless to write zero bytes */
- do
- {
- RFD = *pData;
- pData++;
- len--;
- }
- while (len);
- }
- /**************************************************************************************************
- * @fn macMemReadRxFifo
- *
- * @brief Read multiple bytes from receive FIFO.
- *
- * @param pData - pointer to location to store read data
- * @param len - number of bytes to read from RX FIFO
- *
- * @return none
- **************************************************************************************************
- */
- MAC_INTERNAL_API void macMemReadRxFifo(uint8 * pData, uint8 len)
- {
- MAC_ASSERT(len != 0); /* pointless to read zero bytes */
- do
- {
- *pData = RFD;
- pData++;
- len--;
- }
- while (len);
- }
- /**************************************************************************************************
- */
|