gpio_common.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Copyright 2018 Canaan Inc.
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. #ifndef _GPIO_COMMON_H
  16. #define _GPIO_COMMON_H
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. typedef enum _gpio_drive_mode
  21. {
  22. GPIO_DM_INPUT,
  23. GPIO_DM_INPUT_PULL_DOWN,
  24. GPIO_DM_INPUT_PULL_UP,
  25. GPIO_DM_OUTPUT,
  26. } gpio_drive_mode_t;
  27. typedef enum _gpio_pin_edge
  28. {
  29. GPIO_PE_NONE,
  30. GPIO_PE_FALLING,
  31. GPIO_PE_RISING,
  32. GPIO_PE_BOTH,
  33. GPIO_PE_LOW,
  34. GPIO_PE_HIGH = 8,
  35. } gpio_pin_edge_t;
  36. typedef enum _gpio_pin_value
  37. {
  38. GPIO_PV_LOW,
  39. GPIO_PV_HIGH
  40. } gpio_pin_value_t;
  41. #ifdef __cplusplus
  42. }
  43. #endif
  44. #endif /* _GPIO_COMMON_H */