sb_main.h 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /**************************************************************************************************
  2. Filename: sb_main.h
  3. Revised: $Date: 2010-03-10 20:36:55 -0800 (Wed, 10 Mar 2010) $
  4. Revision: $Revision: 21890 $
  5. Description: Serial Bootloader Main functionality.
  6. Copyright 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 SB_MAIN_H
  34. #define SB_MAIN_H
  35. /* ------------------------------------------------------------------------------------------------
  36. * Includes
  37. * ------------------------------------------------------------------------------------------------
  38. */
  39. #include "hal_types.h"
  40. /* ------------------------------------------------------------------------------------------------
  41. * Macros
  42. * ------------------------------------------------------------------------------------------------
  43. */
  44. #define SB_RX(pCH) sbRx((pCH), 1)
  45. #define SB_TX(pBUF, CNT) sbTx((pBUF), (CNT))
  46. #define SRDY_SET() (NP_RDYOut = 0)
  47. #define SRDY_CLR() (NP_RDYOut = 1)
  48. #define MRDY_SET (NP_RDYIn == 0)
  49. /* ------------------------------------------------------------------------------------------------
  50. * Constants
  51. * ------------------------------------------------------------------------------------------------
  52. */
  53. #define NP_RDYIn_BIT BV(3)
  54. #define NP_RDYIn P0_3
  55. #define NP_RDYOut P0_4
  56. #define NP_RDYOut_BIT BV(4)
  57. /* ------------------------------------------------------------------------------------------------
  58. * Global Functions
  59. * ------------------------------------------------------------------------------------------------
  60. */
  61. uint16 sbRx(uint8 *buf, uint16 len);
  62. uint16 sbTx(uint8 *buf, uint16 len);
  63. #endif