mac_tx.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /**************************************************************************************************
  2. Filename: mac_tx.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-2009 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_TX_H
  34. #define MAC_TX_H
  35. /* ------------------------------------------------------------------------------------------------
  36. * Includes
  37. * ------------------------------------------------------------------------------------------------
  38. */
  39. #include "hal_types.h"
  40. #include "mac_high_level.h"
  41. /* ------------------------------------------------------------------------------------------------
  42. * Define
  43. * ------------------------------------------------------------------------------------------------
  44. */
  45. /* bit value used to form values of macTxActive */
  46. #define MAC_TX_ACTIVE_PHYSICALLY_BV 0x80
  47. /* state values for macTxActive; note zero is reserved for inactive state */
  48. #define MAC_TX_ACTIVE_NO_ACTIVITY 0x00 /* zero reserved for boolean use, e.g. !macTxActive */
  49. #define MAC_TX_ACTIVE_INITIALIZE 0x01
  50. #define MAC_TX_ACTIVE_QUEUED 0x02
  51. #define MAC_TX_ACTIVE_GO (0x03 | MAC_TX_ACTIVE_PHYSICALLY_BV)
  52. #define MAC_TX_ACTIVE_CHANNEL_BUSY 0x04
  53. #define MAC_TX_ACTIVE_DONE (0x05 | MAC_TX_ACTIVE_PHYSICALLY_BV)
  54. #define MAC_TX_ACTIVE_LISTEN_FOR_ACK (0x06 | MAC_TX_ACTIVE_PHYSICALLY_BV)
  55. #define MAC_TX_ACTIVE_POST_ACK (0x07 | MAC_TX_ACTIVE_PHYSICALLY_BV)
  56. /* ------------------------------------------------------------------------------------------------
  57. * Define
  58. * ------------------------------------------------------------------------------------------------
  59. */
  60. #define MAC_TX_IS_PHYSICALLY_ACTIVE() (macTxActive & MAC_TX_ACTIVE_PHYSICALLY_BV)
  61. /* ------------------------------------------------------------------------------------------------
  62. * Global Variable Externs
  63. * ------------------------------------------------------------------------------------------------
  64. */
  65. extern uint8 macTxActive;
  66. extern uint8 macTxBe;
  67. extern uint8 macTxType;
  68. extern uint8 macTxCsmaBackoffDelay;
  69. /* ------------------------------------------------------------------------------------------------
  70. * Prototypes
  71. * ------------------------------------------------------------------------------------------------
  72. */
  73. MAC_INTERNAL_API void macTxInit(void);
  74. MAC_INTERNAL_API void macTxHaltCleanup(void);
  75. MAC_INTERNAL_API void macTxStartQueuedFrame(void);
  76. MAC_INTERNAL_API void macTxChannelBusyCallback(void);
  77. MAC_INTERNAL_API void macTxDoneCallback(void);
  78. MAC_INTERNAL_API void macTxAckReceivedCallback(uint8 seqn, uint8 pendingFlag);
  79. MAC_INTERNAL_API void macTxAckNotReceivedCallback(void);
  80. MAC_INTERNAL_API void macTxTimestampCallback(void);
  81. MAC_INTERNAL_API void macTxCollisionWithRxCallback(void);
  82. /**************************************************************************************************
  83. */
  84. #endif