mac_low_level.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /**************************************************************************************************
  2. Filename: mac_low_level.h
  3. Revised: $Date: 2007-04-24 11:06:07 -0700 (Tue, 24 Apr 2007) $
  4. Revision: $Revision: 14106 $
  5. Description: Describe the purpose and contents of the file.
  6. Copyright 2006-2007 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_LOW_LEVEL_H
  34. #define MAC_LOW_LEVEL_H
  35. /* ------------------------------------------------------------------------------------------------
  36. * Includes
  37. * ------------------------------------------------------------------------------------------------
  38. */
  39. #include "hal_types.h"
  40. #include "mac_high_level.h"
  41. /* ------------------------------------------------------------------------------------------------
  42. * Defines
  43. * ------------------------------------------------------------------------------------------------
  44. */
  45. /* identifies low-level code as specific to Chipcon SmartRF03(tm) technology */
  46. #define MAC_LOW_LEVEL_SMARTRF04
  47. #define MAC_BACKOFF_TIMER_DEFAULT_ROLLOVER (((uint32) MAC_A_BASE_SUPERFRAME_DURATION) << 14)
  48. /* macTxFrame() parameter values for txType */
  49. #define MAC_TX_TYPE_SLOTTED_CSMA 0x00
  50. #define MAC_TX_TYPE_UNSLOTTED_CSMA 0x01
  51. #define MAC_TX_TYPE_SLOTTED 0x02
  52. /* macSleep() parameter values for sleepState */
  53. #define MAC_SLEEP_STATE_OSC_OFF 0x01
  54. #define MAC_SLEEP_STATE_RADIO_OFF 0x02
  55. /* macRxPromiscuousMode() parameter values */
  56. #define MAC_PROMISCUOUS_MODE_OFF 0x00 /* must be zero; reserved for boolean use */
  57. #define MAC_PROMISCUOUS_MODE_COMPLIANT 0x01
  58. #define MAC_PROMISCUOUS_MODE_WITH_BAD_CRC 0x02
  59. /* ------------------------------------------------------------------------------------------------
  60. * Global Externs
  61. * ------------------------------------------------------------------------------------------------
  62. */
  63. extern uint8 const macTxSlottedDelay;
  64. /* beacon interval margin */
  65. extern uint16 macBeaconMargin[];
  66. /* ------------------------------------------------------------------------------------------------
  67. * Prototypes
  68. * ------------------------------------------------------------------------------------------------
  69. */
  70. /* mac_low_level.c */
  71. void macLowLevelInit(void);
  72. void macLowLevelReset(void);
  73. /* mac_sleep.c */
  74. void macSleepWakeUp(void);
  75. uint8 macSleep(uint8 sleepState);
  76. /* mac_radio.c */
  77. uint8 macRadioRandomByte(void);
  78. void macRadioSetPanCoordinator(uint8 panCoordinator);
  79. void macRadioSetPanID(uint16 panID);
  80. void macRadioSetShortAddr(uint16 shortAddr);
  81. void macRadioSetIEEEAddr(uint8 * pIEEEAddr);
  82. void macRadioSetTxPower(uint8 txPower);
  83. void macRadioSetChannel(uint8 channel);
  84. void macRadioStartScan(uint8 scanType);
  85. void macRadioStopScan(void);
  86. void macRadioEnergyDetectStart(void);
  87. uint8 macRadioEnergyDetectStop(void);
  88. /* mac_backoff_timer.c */
  89. void macBackoffTimerSetRollover(uint32 rolloverBackoff);
  90. void macBackoffTimerSetCount(uint32 backoff);
  91. uint32 macBackoffTimerCount(void);
  92. uint32 macBackoffTimerGetTrigger(void);
  93. void macBackoffTimerSetTrigger(uint32 triggerBackoff);
  94. void macBackoffTimerCancelTrigger(void);
  95. void macBackoffTimerTriggerCallback(void);
  96. void macBackoffTimerRolloverCallback(void);
  97. int32 macBackoffTimerRealign(macRx_t *pMsg);
  98. /* mac_tx.c */
  99. void macTxFrame(uint8 txType);
  100. void macTxFrameRetransmit(void);
  101. void macTxCompleteCallback(uint8 status);
  102. /* mac_rx.c */
  103. bool macRxCheckPendingCallback(void);
  104. bool macRxCheckMACPendingCallback(void);
  105. void macRxCompleteCallback(macRx_t * pMsg);
  106. void macRxPromiscuousMode(uint8 mode);
  107. /* mac_rx_onoff.c */
  108. void macRxEnable(uint8 flags);
  109. void macRxSoftEnable(uint8 flags);
  110. void macRxDisable(uint8 flags);
  111. void macRxHardDisable(void);
  112. /**************************************************************************************************
  113. */
  114. #endif