You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
3.7 KiB

5 years ago
  1. /* --COPYRIGHT--,BSD
  2. * Copyright (c) 2013, Texas Instruments Incorporated
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. *
  9. * * Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. *
  12. * * Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. *
  16. * * Neither the name of Texas Instruments Incorporated nor the names of
  17. * its contributors may be used to endorse or promote products derived
  18. * from this software without specific prior written permission.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  21. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  22. * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  23. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  24. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  25. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  26. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  27. * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  28. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  29. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  30. * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. * --/COPYRIGHT--*/
  32. //*****************************************************************************
  33. //
  34. //! TouchProGUI.h
  35. //
  36. //! TouchProGUI enables interrupt-driven UART communication
  37. //! to the Touch Pro GUI platform tool. The protocol is defined in
  38. //! SLAU486 (The TouchPro GUI User's Guide).
  39. //! The baud rate is fixed at 9600B.
  40. //
  41. //! Resources: UCA0 in UART Mode, USCIAB0TX_VECTOR
  42. //! - UCA0 BR and MOD settings need to be placed in the header file for the
  43. //! to provide 9600B with a given input clock.
  44. //
  45. //! \author Texas Instruments
  46. //! \author MSP430 Strategic Applications
  47. //
  48. //! \version 1.0 - W. Schnoor, 1/7/14: Initial Release
  49. //
  50. //*****************************************************************************
  51. #ifndef TOUCHPROGUI_H_
  52. #define TOUCHPROGUI_H_
  53. #include <msp430.h>
  54. #include <stdint.h>
  55. #include <stdbool.h>
  56. //*****************************************************************************
  57. //
  58. //! \def TOUCHPROGUI_MAX_CHANNELS is user-selectable and defines the maximum
  59. //! number of channels that can be sent to TouchPro GUI. This effects the
  60. //! RAM requirements.
  61. //
  62. //*****************************************************************************
  63. #define TOUCHPROGUI_MAX_CHANNELS (10)
  64. #define UART_BR_LOWER (0x71)
  65. #define UART_BR_UPPER (0x02)
  66. #define UART_MOD (0x00)
  67. //*****************************************************************************
  68. //
  69. //! \def TOUCHPROGUI_SYNC_UPPER defines the upper byte of the sync word.
  70. //
  71. //! \def TOUCHPROGUI_SYNC_LOWER defines the lower byte of the sync word.
  72. //
  73. //! \def TOUCHPROGUI_BUFFER_LENGTH defines the required length of the transmit
  74. //! buffer. This is based upn the TOUCHPROGUI_MAX_CHANNELS definition.
  75. //
  76. //*****************************************************************************
  77. #define TOUCHPROGUI_SYNC_UPPER (0x55)
  78. #define TOUCHPROGUI_SYNC_LOWER (0xAA)
  79. #define TOUCHPROGUI_BUFFER_LENGTH (TOUCHPROGUI_MAX_CHANNELS * 3 + 3)
  80. void TouchProGUI_init(void);
  81. void TouchProGUI_sendData(uint16_t *ui16DataBuffer, uint8_t ui8Length);
  82. #endif /* TOUCHPROGUI_H_ */