cybsp.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /***************************************************************************//**
  2. * \file cybsp.h
  3. *
  4. * \brief
  5. * Basic API for setting up boards containing a Cypress MCU.
  6. *
  7. ********************************************************************************
  8. * \copyright
  9. * Copyright 2018-2019 Cypress Semiconductor Corporation
  10. * SPDX-License-Identifier: Apache-2.0
  11. *
  12. * Licensed under the Apache License, Version 2.0 (the "License");
  13. * you may not use this file except in compliance with the License.
  14. * You may obtain a copy of the License at
  15. *
  16. * http://www.apache.org/licenses/LICENSE-2.0
  17. *
  18. * Unless required by applicable law or agreed to in writing, software
  19. * distributed under the License is distributed on an "AS IS" BASIS,
  20. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  21. * See the License for the specific language governing permissions and
  22. * limitations under the License.
  23. *******************************************************************************/
  24. #pragma once
  25. #include "cy_result.h"
  26. #include "cybsp_types.h"
  27. #include "cycfg.h"
  28. #if defined(CYBSP_WIFI_CAPABLE) && defined(CY_USING_HAL)
  29. #include "cyhal_sdio.h"
  30. #endif
  31. #if defined(__cplusplus)
  32. extern "C" {
  33. #endif
  34. /**
  35. * \addtogroup group_bsp_macros Macros
  36. * \{
  37. */
  38. /** Failed to configure sysclk power management callback */
  39. #define CYBSP_RSLT_ERR_SYSCLK_PM_CALLBACK (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_ABSTRACTION_BSP, 0))
  40. /** \} group_bsp_macros */
  41. /**
  42. * \addtogroup group_bsp_functions Functions
  43. * \{
  44. */
  45. /**
  46. * \brief Initialize all hardware on the board
  47. * \returns CY_RSLT_SUCCESS if the board is sucessfully initialized, if there is
  48. * a problem initializing any hardware it returns an error code specific
  49. * to the hardware module that had a problem.
  50. */
  51. cy_rslt_t cybsp_init(void);
  52. #if defined(CYBSP_WIFI_CAPABLE) && defined(CY_USING_HAL)
  53. /**
  54. * \brief Get the initialized sdio object used for communicating with the WiFi Chip.
  55. * \note This function should only be called after cybsp_init();
  56. * \returns The initialized sdio object.
  57. */
  58. cyhal_sdio_t* cybsp_get_wifi_sdio_obj(void);
  59. #endif /* defined(CYBSP_WIFI_CAPABLE) */
  60. /** \} group_bsp_functions */
  61. #ifdef __cplusplus
  62. }
  63. #endif /* __cplusplus */