mac_rx.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /**************************************************************************************************
  2. Filename: mac_rx.h
  3. Revised: $Date: 2007-09-11 10:58:41 -0700 (Tue, 11 Sep 2007) $
  4. Revision: $Revision: 15371 $
  5. Description: Describe the purpose and contents of the file.
  6. Copyright 2006-2010 Texas Instruments Incorporated. All rights reserved.
  7. IMPORTANT: Your use of this Software is limited to those specific rights
  8. granted under the terms of a software license agreement between the user
  9. who downloaded the software, his/her employer (which must be your employer)
  10. and Texas Instruments Incorporated (the "License"). You may not use this
  11. Software unless you agree to abide by the terms of the License. The License
  12. limits your use, and you acknowledge, that the Software may not be modified,
  13. copied or distributed unless embedded on a Texas Instruments microcontroller
  14. or used solely and exclusively in conjunction with a Texas Instruments radio
  15. frequency transceiver, which is integrated into your product. Other than for
  16. the foregoing purpose, you may not use, reproduce, copy, prepare derivative
  17. works of, modify, distribute, perform, display or sell this Software and/or
  18. its documentation for any purpose.
  19. YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
  20. PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
  21. INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
  22. NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
  23. TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
  24. NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
  25. LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
  26. INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
  27. OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
  28. OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
  29. (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
  30. Should you have any questions regarding your right to use this Software,
  31. contact Texas Instruments Incorporated at www.TI.com.
  32. **************************************************************************************************/
  33. #ifndef MAC_RX_H
  34. #define MAC_RX_H
  35. /* ------------------------------------------------------------------------------------------------
  36. * Includes
  37. * ------------------------------------------------------------------------------------------------
  38. */
  39. #include "hal_types.h"
  40. #include "mac_high_level.h"
  41. /* ------------------------------------------------------------------------------------------------
  42. * Defines
  43. * ------------------------------------------------------------------------------------------------
  44. */
  45. #define RX_FILTER_OFF 0
  46. #define RX_FILTER_ALL 1
  47. #define RX_FILTER_NON_BEACON_FRAMES 2
  48. #define RX_FILTER_NON_COMMAND_FRAMES 3
  49. /* bit value used to form values of macRxActive */
  50. #define MAC_RX_ACTIVE_PHYSICAL_BV 0x80
  51. #define MAC_RX_ACTIVE_NO_ACTIVITY 0x00 /* zero reserved for boolean use, e.g. !macRxActive */
  52. #define MAC_RX_ACTIVE_STARTED (0x01 | MAC_RX_ACTIVE_PHYSICAL_BV)
  53. #define MAC_RX_ACTIVE_DONE 0x02
  54. /* ------------------------------------------------------------------------------------------------
  55. * Macros
  56. * ------------------------------------------------------------------------------------------------
  57. */
  58. #define MAC_RX_IS_PHYSICALLY_ACTIVE() ((macRxActive & MAC_RX_ACTIVE_PHYSICAL_BV) || macRxOutgoingAckFlag)
  59. /* ------------------------------------------------------------------------------------------------
  60. * Global Variable Externs
  61. * ------------------------------------------------------------------------------------------------
  62. */
  63. extern uint8 macRxActive;
  64. extern uint8 macRxFilter;
  65. extern uint8 macRxOutgoingAckFlag;
  66. #ifdef PACKET_FILTER_STATS
  67. extern uint32 rxCrcFailure;
  68. extern uint32 rxCrcSuccess;
  69. #endif /* PACKET_FILTER_STATS */
  70. #ifdef CC2591_COMPRESSION_WORKAROUND
  71. extern void macRxResetRssi(void);
  72. #endif
  73. /* ------------------------------------------------------------------------------------------------
  74. * Prototypes
  75. * ------------------------------------------------------------------------------------------------
  76. */
  77. MAC_INTERNAL_API void macRxInit(void);
  78. MAC_INTERNAL_API void macRxRadioPowerUpInit(void);
  79. MAC_INTERNAL_API void macRxTxReset(void);
  80. MAC_INTERNAL_API void macRxHaltCleanup(void);
  81. MAC_INTERNAL_API void macRxThresholdIsr(void);
  82. MAC_INTERNAL_API void macRxFifoOverflowIsr(void);
  83. MAC_INTERNAL_API void macRxAckTxDoneCallback(void);
  84. /**************************************************************************************************
  85. */
  86. #endif