Driver_Common.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /** \addtogroup hal */
  2. /** @{*/
  3. /*
  4. * Copyright (c) 2006-2016, ARM Limited, All Rights Reserved
  5. * SPDX-License-Identifier: Apache-2.0
  6. *
  7. * Licensed under the Apache License, Version 2.0 (the "License"); you may
  8. * not use this file except in compliance with the License.
  9. * You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  15. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. * See the License for the specific language governing permissions and
  17. * limitations under the License.
  18. */
  19. #ifndef __DRIVER_COMMON_H
  20. #define __DRIVER_COMMON_H
  21. #include <stddef.h>
  22. #include <stdint.h>
  23. #include <stdbool.h>
  24. /****** This file has been deprecated since mbed-os-5.5 *****/
  25. #define ARM_DRIVER_VERSION_MAJOR_MINOR(major,minor) (((major) << 8) | (minor))
  26. /**
  27. \brief Driver Version
  28. */
  29. typedef struct _ARM_DRIVER_VERSION {
  30. uint16_t api; ///< API version
  31. uint16_t drv; ///< Driver version
  32. } ARM_DRIVER_VERSION;
  33. /* General return codes */
  34. #define ARM_DRIVER_OK 0 ///< Operation succeeded
  35. #define ARM_DRIVER_ERROR -1 ///< Unspecified error
  36. #define ARM_DRIVER_ERROR_BUSY -2 ///< Driver is busy
  37. #define ARM_DRIVER_ERROR_TIMEOUT -3 ///< Timeout occurred
  38. #define ARM_DRIVER_ERROR_UNSUPPORTED -4 ///< Operation not supported
  39. #define ARM_DRIVER_ERROR_PARAMETER -5 ///< Parameter error
  40. #define ARM_DRIVER_ERROR_SPECIFIC -6 ///< Start of driver specific errors
  41. /**
  42. \brief General power states
  43. */
  44. typedef enum _ARM_POWER_STATE {
  45. ARM_POWER_OFF, ///< Power off: no operation possible
  46. ARM_POWER_LOW, ///< Low Power mode: retain state, detect and signal wake-up events
  47. ARM_POWER_FULL ///< Power on: full operation at maximum performance
  48. } ARM_POWER_STATE;
  49. #endif /* __DRIVER_COMMON_H */
  50. /** @}*/