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.

123 lines
4.0 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. // 430BOOST-SHARP96 example with the MSP430G2553 on a MSP-EXP430G2 LaunchPad
  34. //******************************************************************************
  35. #include "structure.h"
  36. const struct Element leftSlider_Element0 =
  37. {
  38. .inputPxselRegister = (unsigned char *)&P2SEL,
  39. .inputPxsel2Register = (unsigned char *)&P2SEL2,
  40. .inputBits = BIT2,
  41. .maxResponse = 70,
  42. .threshold = 5
  43. };
  44. const struct Element leftSlider_Element1 =
  45. {
  46. .inputPxselRegister = (unsigned char *)&P2SEL,
  47. .inputPxsel2Register = (unsigned char *)&P2SEL2,
  48. .inputBits = BIT1,
  49. .maxResponse = 100,
  50. .threshold = 5
  51. };
  52. const struct Element leftSlider_Element2 =
  53. {
  54. .inputPxselRegister = (unsigned char *)&P2SEL,
  55. .inputPxsel2Register = (unsigned char *)&P2SEL2,
  56. .inputBits = BIT0,
  57. .maxResponse = 95,
  58. .threshold = 5
  59. };
  60. const struct Element rightSlider_Element0 =
  61. {
  62. .inputPxselRegister = (unsigned char *)&P2SEL,
  63. .inputPxsel2Register = (unsigned char *)&P2SEL2,
  64. .inputBits = BIT3,
  65. .maxResponse = 71,
  66. .threshold = 5
  67. };
  68. const struct Element rightSlider_Element1 =
  69. {
  70. .inputPxselRegister = (unsigned char *)&P2SEL,
  71. .inputPxsel2Register = (unsigned char *)&P2SEL2,
  72. .inputBits = BIT4,
  73. .maxResponse = 103,
  74. .threshold = 5
  75. };
  76. const struct Element rightSlider_Element2 =
  77. {
  78. .inputPxselRegister = (unsigned char *)&P2SEL,
  79. .inputPxsel2Register = (unsigned char *)&P2SEL2,
  80. .inputBits = BIT5,
  81. .maxResponse = 105,
  82. .threshold = 5
  83. };
  84. const struct Sensor leftSlider =
  85. {
  86. .halDefinition = RO_PINOSC_TA0_WDTp,
  87. .numElements = 3,
  88. .points = 64,
  89. .sensorThreshold = 72,
  90. .baseOffset = 0,
  91. // Pointer to elements
  92. .arrayPtr[0] = &leftSlider_Element0,
  93. .arrayPtr[1] = &leftSlider_Element1,
  94. .arrayPtr[2] = &leftSlider_Element2,
  95. // Timer Information
  96. .measGateSource= GATE_WDT_SMCLK, // 0->SMCLK, 1-> ACLK
  97. .accumulationCycles= WDTp_GATE_512 //512
  98. };
  99. const struct Sensor rightSlider =
  100. {
  101. .halDefinition = RO_PINOSC_TA0_WDTp,
  102. .numElements = 3,
  103. .points = 64,
  104. .sensorThreshold = 76,
  105. .baseOffset = 3,
  106. // Pointer to elements
  107. .arrayPtr[0] = &rightSlider_Element0,
  108. .arrayPtr[1] = &rightSlider_Element1,
  109. .arrayPtr[2] = &rightSlider_Element2,
  110. // Timer Information
  111. .measGateSource= GATE_WDT_SMCLK, // 0->SMCLK, 1-> ACLK
  112. .accumulationCycles= WDTp_GATE_512 //512
  113. };