Skip to content

Commit a42cc7f

Browse files
committed
[fix] 缺少文件导致的编译错误
1 parent 0f0093a commit a42cc7f

File tree

1 file changed

+177
-0
lines changed

1 file changed

+177
-0
lines changed
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
/***********************************************************************************************************************
2+
* Copyright [2020-2021] Renesas Electronics Corporation and/or its affiliates. All Rights Reserved.
3+
*
4+
* This software and documentation are supplied by Renesas Electronics America Inc. and may only be used with products
5+
* of Renesas Electronics Corp. and its affiliates ("Renesas"). No other uses are authorized. Renesas products are
6+
* sold pursuant to Renesas terms and conditions of sale. Purchasers are solely responsible for the selection and use
7+
* of Renesas products and Renesas assumes no liability. No license, express or implied, to any intellectual property
8+
* right is granted by Renesas. This software is protected under all applicable laws, including copyright laws. Renesas
9+
* reserves the right to change or discontinue this software and/or this documentation. THE SOFTWARE AND DOCUMENTATION
10+
* IS DELIVERED TO YOU "AS IS," AND RENESAS MAKES NO REPRESENTATIONS OR WARRANTIES, AND TO THE FULLEST EXTENT
11+
* PERMISSIBLE UNDER APPLICABLE LAW, DISCLAIMS ALL WARRANTIES, WHETHER EXPLICITLY OR IMPLICITLY, INCLUDING WARRANTIES
12+
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT, WITH RESPECT TO THE SOFTWARE OR
13+
* DOCUMENTATION. RENESAS SHALL HAVE NO LIABILITY ARISING OUT OF ANY SECURITY VULNERABILITY OR BREACH. TO THE MAXIMUM
14+
* EXTENT PERMITTED BY LAW, IN NO EVENT WILL RENESAS BE LIABLE TO YOU IN CONNECTION WITH THE SOFTWARE OR DOCUMENTATION
15+
* (OR ANY PERSON OR ENTITY CLAIMING RIGHTS DERIVED FROM YOU) FOR ANY LOSS, DAMAGES, OR CLAIMS WHATSOEVER, INCLUDING,
16+
* WITHOUT LIMITATION, ANY DIRECT, CONSEQUENTIAL, SPECIAL, INDIRECT, PUNITIVE, OR INCIDENTAL DAMAGES; ANY LOST PROFITS,
17+
* OTHER ECONOMIC DAMAGE, PROPERTY DAMAGE, OR PERSONAL INJURY; AND EVEN IF RENESAS HAS BEEN ADVISED OF THE POSSIBILITY
18+
* OF SUCH LOSS, DAMAGES, CLAIMS OR COSTS.
19+
**********************************************************************************************************************/
20+
21+
/*******************************************************************************************************************//**
22+
* @ingroup RENESAS_INTERFACES
23+
* @defgroup EXTERNAL_IRQ_API External IRQ Interface
24+
* @brief Interface for detecting external interrupts.
25+
*
26+
* @section EXTERNAL_IRQ_API_Summary Summary
27+
* The External IRQ Interface is for configuring interrupts to fire when a trigger condition is detected on an
28+
* external IRQ pin.
29+
*
30+
* The External IRQ Interface can be implemented by:
31+
* - @ref ICU
32+
*
33+
* @{
34+
**********************************************************************************************************************/
35+
36+
#ifndef R_EXTERNAL_IRQ_API_H
37+
#define R_EXTERNAL_IRQ_API_H
38+
39+
/***********************************************************************************************************************
40+
* Includes
41+
**********************************************************************************************************************/
42+
43+
/* Includes board and MCU related header files. */
44+
#include "bsp_api.h"
45+
46+
/* Common macro for FSP header files. There is also a corresponding FSP_FOOTER macro at the end of this file. */
47+
FSP_HEADER
48+
49+
/**********************************************************************************************************************
50+
* Macro definitions
51+
*********************************************************************************************************************/
52+
53+
/*********************************************************************************************************************
54+
* Typedef definitions
55+
*********************************************************************************************************************/
56+
57+
/** Callback function parameter data */
58+
typedef struct st_external_irq_callback_args
59+
{
60+
/** Placeholder for user data. Set in @ref external_irq_api_t::open function in @ref external_irq_cfg_t. */
61+
void const * p_context;
62+
uint32_t channel; ///< The physical hardware channel that caused the interrupt.
63+
} external_irq_callback_args_t;
64+
65+
/** Condition that will trigger an interrupt when detected. */
66+
typedef enum e_external_irq_trigger
67+
{
68+
EXTERNAL_IRQ_TRIG_FALLING = 0, ///< Falling edge trigger
69+
EXTERNAL_IRQ_TRIG_RISING = 1, ///< Rising edge trigger
70+
EXTERNAL_IRQ_TRIG_BOTH_EDGE = 2, ///< Both edges trigger
71+
EXTERNAL_IRQ_TRIG_LEVEL_LOW = 3, ///< Low level trigger
72+
} external_irq_trigger_t;
73+
74+
/** External IRQ input pin digital filtering sample clock divisor settings. The digital filter rejects trigger
75+
* conditions that are shorter than 3 periods of the filter clock.
76+
*/
77+
typedef enum e_external_irq_pclk_div
78+
{
79+
EXTERNAL_IRQ_PCLK_DIV_BY_1 = 0, ///< Filter using PCLK divided by 1
80+
EXTERNAL_IRQ_PCLK_DIV_BY_8 = 1, ///< Filter using PCLK divided by 8
81+
EXTERNAL_IRQ_PCLK_DIV_BY_32 = 2, ///< Filter using PCLK divided by 32
82+
EXTERNAL_IRQ_PCLK_DIV_BY_64 = 3, ///< Filter using PCLK divided by 64
83+
} external_irq_pclk_div_t;
84+
85+
/** User configuration structure, used in open function */
86+
typedef struct st_external_irq_cfg
87+
{
88+
uint8_t channel; ///< Hardware channel used.
89+
uint8_t ipl; ///< Interrupt priority
90+
IRQn_Type irq; ///< NVIC interrupt number assigned to this instance
91+
external_irq_trigger_t trigger; ///< Trigger setting.
92+
external_irq_pclk_div_t pclk_div; ///< Digital filter clock divisor setting.
93+
bool filter_enable; ///< Digital filter enable/disable setting.
94+
95+
/** Callback provided external input trigger occurs. */
96+
void (* p_callback)(external_irq_callback_args_t * p_args);
97+
98+
/** Placeholder for user data. Passed to the user callback in @ref external_irq_callback_args_t. */
99+
void const * p_context;
100+
void const * p_extend; ///< External IRQ hardware dependent configuration.
101+
} external_irq_cfg_t;
102+
103+
/** External IRQ control block. Allocate an instance specific control block to pass into the external IRQ API calls.
104+
* @par Implemented as
105+
* - icu_instance_ctrl_t
106+
*/
107+
typedef void external_irq_ctrl_t;
108+
109+
/** External interrupt driver structure. External interrupt functions implemented at the HAL layer will follow this API. */
110+
typedef struct st_external_irq_api
111+
{
112+
/** Initial configuration.
113+
* @par Implemented as
114+
* - @ref R_ICU_ExternalIrqOpen()
115+
*
116+
* @param[out] p_ctrl Pointer to control block. Must be declared by user. Value set here.
117+
* @param[in] p_cfg Pointer to configuration structure. All elements of the structure must be set by user.
118+
*/
119+
fsp_err_t (* open)(external_irq_ctrl_t * const p_ctrl, external_irq_cfg_t const * const p_cfg);
120+
121+
/** Enable callback when an external trigger condition occurs.
122+
* @par Implemented as
123+
* - @ref R_ICU_ExternalIrqEnable()
124+
*
125+
* @param[in] p_ctrl Control block set in Open call for this external interrupt.
126+
*/
127+
fsp_err_t (* enable)(external_irq_ctrl_t * const p_ctrl);
128+
129+
/** Disable callback when external trigger condition occurs.
130+
* @par Implemented as
131+
* - @ref R_ICU_ExternalIrqDisable()
132+
*
133+
* @param[in] p_ctrl Control block set in Open call for this external interrupt.
134+
*/
135+
fsp_err_t (* disable)(external_irq_ctrl_t * const p_ctrl);
136+
137+
/**
138+
* Specify callback function and optional context pointer and working memory pointer.
139+
* @par Implemented as
140+
* - R_ICU_ExternalIrqCallbackSet()
141+
*
142+
* @param[in] p_ctrl Pointer to the Extneral IRQ control block.
143+
* @param[in] p_callback Callback function
144+
* @param[in] p_context Pointer to send to callback function
145+
* @param[in] p_working_memory Pointer to volatile memory where callback structure can be allocated.
146+
* Callback arguments allocated here are only valid during the callback.
147+
*/
148+
fsp_err_t (* callbackSet)(external_irq_ctrl_t * const p_api_ctrl,
149+
void ( * p_callback)(external_irq_callback_args_t *),
150+
void const * const p_context,
151+
external_irq_callback_args_t * const p_callback_memory);
152+
153+
/** Allow driver to be reconfigured. May reduce power consumption.
154+
* @par Implemented as
155+
* - @ref R_ICU_ExternalIrqClose()
156+
*
157+
* @param[in] p_ctrl Control block set in Open call for this external interrupt.
158+
*/
159+
fsp_err_t (* close)(external_irq_ctrl_t * const p_ctrl);
160+
} external_irq_api_t;
161+
162+
/** This structure encompasses everything that is needed to use an instance of this interface. */
163+
typedef struct st_external_irq_instance
164+
{
165+
external_irq_ctrl_t * p_ctrl; ///< Pointer to the control structure for this instance
166+
external_irq_cfg_t const * p_cfg; ///< Pointer to the configuration structure for this instance
167+
external_irq_api_t const * p_api; ///< Pointer to the API structure for this instance
168+
} external_irq_instance_t;
169+
170+
/* Common macro for FSP header files. There is also a corresponding FSP_HEADER macro at the top of this file. */
171+
FSP_FOOTER
172+
173+
/*******************************************************************************************************************//**
174+
* @} (end defgroup EXTERNAL_IRQ_API)
175+
**********************************************************************************************************************/
176+
177+
#endif

0 commit comments

Comments
 (0)