1 /*******************************************************************************
2 * File Name: cyhal.h
3 *
4 * Description:
5 * Top-level HAL header file that can be referenced to pull in all relevant
6 * drivers for the current device architecture. Not all of these may be
7 * supported in the current target device. The implementation must provide a
8 * cyhal_hw_types.h and a cyhal_drivers.h file in the include path for this
9 * to depend on.
10 * The cyhal_hw_types.h file must provide the following:
11 *   1) definitions for each of the resource types consumed by the HAL driver
12 *      functions.
13 *   2) A CYHAL_ISR_PRIORITY_DEFAULT define for the default interrupt priority
14 *   3) A CYHAL_MAIN_FLASH_BASE define for the base address of flash memory
15 *   4) OPTIONAL: Implementation specific header files can be used by creating
16 *      a #define in cyhal_hw_types.h with a name of CYHAL_<DRIVER>_IMPL_HEADER
17 *      and the value being the name of the header file.  eg:
18 *      #define CYHAL_GPIO_IMPL_HEADER "cyhal_gpio_impl.h"
19 * The cyhal_drivers.h file must simply be a list of include directives to pull
20 * in the relevant driver header files.
21 *
22 ********************************************************************************
23 * \copyright
24 * Copyright 2018-2022 Cypress Semiconductor Corporation (an Infineon company) or
25 * an affiliate of Cypress Semiconductor Corporation
26 *
27 * SPDX-License-Identifier: Apache-2.0
28 *
29 * Licensed under the Apache License, Version 2.0 (the "License");
30 * you may not use this file except in compliance with the License.
31 * You may obtain a copy of the License at
32 *
33 *     http://www.apache.org/licenses/LICENSE-2.0
34 *
35 * Unless required by applicable law or agreed to in writing, software
36 * distributed under the License is distributed on an "AS IS" BASIS,
37 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
38 * See the License for the specific language governing permissions and
39 * limitations under the License.
40 *******************************************************************************/
41 
42 /**
43 * \addtogroup group_hal_types HAL General Types/Macros
44 * This section documents the basic types and macros that are used by multiple HAL drivers.
45 */
46 
47 /**
48 * \addtogroup group_result Result Type
49 * \ingroup group_hal_types
50 */
51 
52 /**
53 * \addtogroup group_hal_availability HAL Driver Availability
54 * This section documents the macros that can be used to check if a specific driver is available
55 * for the current device. This includes macros for all HAL drivers that exist for any device, even
56 * those that are not applicable (included) with this library. This is intended to help write code
57 * that can port between device categories that might not have the same drivers available.
58 */
59 
60 /**
61 * \addtogroup group_hal HAL Drivers
62 * This section documents the drivers which form the stable API of the ModusToolbox™ HAL.
63 * In order to remain portable across platforms and HAL versions, applications should
64 * rely only on functionality documented in this section.
65 */
66 
67 /**
68 * \addtogroup group_hal_impl
69 */
70 
71 #pragma once
72 
73 #if defined(CY_USING_HAL)
74 #include "cyhal_general_types.h"
75 #include "cyhal_hw_types.h"
76 #include "cyhal_drivers.h"
77 #endif
78 
79 /** Macro specifying the major version number of the HAL API. Since there are multiple HAL library
80  * implementations, this is not necessarily the same as the major version number of the library. It
81  * is instead intended as a single version number that can be used across implementation libraries
82  * to know what signatures to use in the case an API is updated in the future. Once an API is
83  * available, its API will remain consistant across libraries sharing the same version here.
84  * \note Support for new drivers/functionality may be added without changing the version number, to
85  * check for whether a specific driver is available, the CYHAL_DRIVER_AVAILABLE_X macros defined in
86  * \ref group_hal_availability should be used.
87  * \def CYHAL_API_VERSION
88 */
89 
90 /**
91 * \ingroup group_hal_availability
92 * \{
93 */
94 
95 /** Macro specifying whether the ADC driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_ADC
96 */
97 /** Macro specifying whether the Clock driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_CLOCK
98 */
99 /** Macro specifying whether the COMP driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_COMP
100 */
101 /** Macro specifying whether the CRC driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_CRC
102 */
103 /** Macro specifying whether the DAC driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_DAC
104 */
105 /** Macro specifying whether the DMA driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_DMA
106 */
107 /** Macro specifying whether the EzI2C driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_EZI2C
108 */
109 /** Macro specifying whether the NVM driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_NVM
110 */
111 /** Deprecated. Macro specifying whether the NVM driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_FLASH
112 */
113 /** Macro specifying whether the GPIO driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_GPIO
114 */
115 /** Macro specifying whether the HwMgr driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_HWMGR
116 */
117 /** Macro specifying whether the I2C driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_I2C
118 */
119 /** Macro specifying whether the I2S driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_I2S
120 */
121 /** Macro specifying whether the IPC driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_IPC
122 */
123 /** Macro specifying whether the TX functionality is available on the I2S driver for the current device \def CYHAL_DRIVER_AVAILABLE_I2S_TX
124 */
125 /** Macro specifying whether the RX functionality is available on the I2S driver for the current device \def CYHAL_DRIVER_AVAILABLE_I2S_RX
126 */
127 /** Macro specifying whether the Interconnect driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_INTERCONNECT
128 */
129 /** Macro specifying whether the KeyScan driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_KEYSCAN
130 */
131 /** Macro specifying whether the LPTimer driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_LPTIMER
132 */
133 /** Macro specifying whether the OpAmp driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_OPAMP
134 */
135 /** Macro specifying whether the PDM/PCM driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_PDMPCM
136 */
137 /** Macro specifying whether the PWM driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_PWM
138 */
139 /** Macro specifying whether the QSPI driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_QSPI
140 */
141 /** Macro specifying whether the QuadDec driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_QUADDEC
142 */
143 /** Macro specifying whether the RTC driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_RTC
144 */
145 /** Macro specifying whether the SDHC driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_SDHC
146 */
147 /** Macro specifying whether the SDIO driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_SDIO
148 */
149 /** Macro specifying whether the SDIO host driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_SDIO_HOST
150 */
151 /** Macro specifying whether the SDIO dev driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_SDIO_DEV
152 */
153 /** Macro specifying whether the SPI driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_SPI
154 */
155 /** Macro specifying whether the SysPM driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_SYSPM
156 */
157 /** Macro specifying whether the System driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_SYSTEM
158 */
159 /** Macro specifying whether the TDM driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_TDM
160 */
161 /** Macro specifying whether the TX functionality is available on the TDM driver for the current device \def CYHAL_DRIVER_AVAILABLE_TDM_TX
162 */
163 /** Macro specifying whether the RX functionality is available on the TDM driver for the current device \def CYHAL_DRIVER_AVAILABLE_TDM_RX
164 */
165 /** Macro specifying whether the Timer driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_TIMER
166 */
167 /** Macro specifying whether the TRNG driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_TRNG
168 */
169 /** Macro specifying whether the UART driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_UART
170 */
171 /** Macro specifying whether the USB Dev driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_USB_DEV
172 */
173 /** Macro specifying whether the WDT driver is available for the current device \def CYHAL_DRIVER_AVAILABLE_WDT
174 */
175 
176 /** \} group_hal_availability */
177