stm322xg_eval_io.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /**
  2. ******************************************************************************
  3. * @file stm322xg_eval_io.h
  4. * @author MCD Application Team
  5. * @brief This file contains the common defines and functions prototypes for
  6. * the stm322xg_eval_io.c driver.
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
  11. *
  12. * Redistribution and use in source and binary forms, with or without modification,
  13. * are permitted provided that the following conditions are met:
  14. * 1. Redistributions of source code must retain the above copyright notice,
  15. * this list of conditions and the following disclaimer.
  16. * 2. Redistributions in binary form must reproduce the above copyright notice,
  17. * this list of conditions and the following disclaimer in the documentation
  18. * and/or other materials provided with the distribution.
  19. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  20. * may be used to endorse or promote products derived from this software
  21. * without specific prior written permission.
  22. *
  23. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  24. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  25. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  26. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  27. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  28. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  29. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  30. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  31. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  32. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  33. *
  34. ******************************************************************************
  35. */
  36. /* Define to prevent recursive inclusion -------------------------------------*/
  37. #ifndef __STM322xG_EVAL_IO_H
  38. #define __STM322xG_EVAL_IO_H
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42. /* Includes ------------------------------------------------------------------*/
  43. #include "stm322xg_eval.h"
  44. /* Include IO component driver */
  45. #include "../Components/stmpe811/stmpe811.h"
  46. /** @addtogroup BSP
  47. * @{
  48. */
  49. /** @addtogroup STM322xG_EVAL
  50. * @{
  51. */
  52. /** @defgroup STM322xG_EVAL_IO STM322xG EVAL IO
  53. * @{
  54. */
  55. /** @defgroup STM322xG_EVAL_IO_Exported_Types STM322xG EVAL IO Exported Types
  56. * @{
  57. */
  58. typedef enum
  59. {
  60. IO_OK = 0x00,
  61. IO_ERROR = 0x01,
  62. IO_TIMEOUT = 0x02
  63. }IO_StatusTypeDef;
  64. /**
  65. * @}
  66. */
  67. /** @defgroup STM322xG_EVAL_IO_Exported_Constants STM322xG EVAL IO Exported Constants
  68. * @{
  69. */
  70. #define IO_PIN_0 0x01
  71. #define IO_PIN_1 0x02
  72. #define IO_PIN_2 0x04
  73. #define IO_PIN_3 0x08
  74. #define IO_PIN_4 0x10
  75. #define IO_PIN_5 0x20
  76. #define IO_PIN_6 0x40
  77. #define IO_PIN_7 0x80
  78. #define IO_PIN_ALL 0xFF
  79. /**
  80. * @}
  81. */
  82. /** @defgroup STM322xG_EVAL_IO_Exported_Functions STM322xG EVAL IO Exported Functions
  83. * @{
  84. */
  85. uint8_t BSP_IO_Init(void);
  86. void BSP_IO_ITClear(uint16_t IO_Pin);
  87. uint8_t BSP_IO_ITGetStatus(uint16_t IO_Pin);
  88. uint8_t BSP_IO_ConfigPin(uint16_t IO_Pin, IO_ModeTypedef IO_Mode);
  89. void BSP_IO_WritePin(uint16_t IO_Pin, uint8_t PinState);
  90. uint16_t BSP_IO_ReadPin(uint16_t IO_Pin);
  91. void BSP_IO_TogglePin(uint16_t IO_Pin);
  92. /**
  93. * @}
  94. */
  95. /**
  96. * @}
  97. */
  98. /**
  99. * @}
  100. */
  101. /**
  102. * @}
  103. */
  104. #ifdef __cplusplus
  105. }
  106. #endif
  107. #endif /* __STM322xG_EVAL_IO_H */
  108. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/