1 /*""FILE COMMENT""*******************************************************
2 * System Name	: External interrupt API for RX62Nxx
3 * File Name		: r_pdl_intc_RX62Nxx.h
4 * Version		: 1.02
5 * Contents		: INTC API header
6 * Customer		:
7 * Model			:
8 * Order			:
9 * CPU			: RX
10 * Compiler		: RXC
11 * OS			: Nothing
12 * Programmer	:
13 * Note			:
14 ************************************************************************
15 * Copyright, 2011. Renesas Electronics Corporation
16 * and Renesas Solutions Corporation
17 ************************************************************************
18 * History		: 2011.04.08
19 *				: Ver 1.02
20 *				: CS-5 release.
21 *""FILE COMMENT END""**************************************************/
22 
23 #ifndef R_PDL_INTC_RX62Nxx_H
24 #define R_PDL_INTC_RX62Nxx_H
25 
26 /* Callback function storage */
27 extern VoidCallBackFunc rpdl_INTC_callback_func[];
28 
29 /* Library prototypes */
30 bool R_INTC_CreateExtInterruptAll(
31 	const uint8_t,
32 	const uint32_t,
33 	VoidCallBackFunc const,
34 	const uint8_t
35 );
36 bool R_INTC_CreateSoftwareInterruptAll(
37 	const uint8_t,
38 	VoidCallBackFunc const,
39 	const uint8_t
40 );
41 bool R_INTC_CreateFastInterruptAll(
42 	const uint8_t
43 );
44 bool R_INTC_CreateExceptionHandlersAll(
45 	VoidCallBackFunc const,
46 	VoidCallBackFunc const,
47 	VoidCallBackFunc const
48 );
49 bool R_INTC_ControlExtInterruptAll(
50 	const uint8_t,
51 	const uint32_t
52 );
53 bool R_INTC_GetExtInterruptStatusAll(
54 	const uint8_t,
55 	volatile uint8_t * const
56 );
57 bool R_INTC_ReadAll(
58 	const uint16_t,
59 	volatile uint8_t * const
60 );
61 bool R_INTC_WriteAll(
62 	const uint16_t,
63 	const uint8_t
64 );
65 bool R_INTC_ModifyAll(
66 	const uint16_t,
67 	const uint8_t,
68 	const uint8_t
69 );
70 bool ReturnFalse(void);
71 
72 /* Macro definitions */
73 
74 #define R_INTC_CreateExtInterrupt(a, b, c, d) \
75 ( \
76 ( ( (a) <= PDL_INTC_NMI ) && ((d) <= IPL_MAX) ) ? \
77 R_INTC_CreateExtInterruptAll( (a), (b), (c), (d) ) : \
78 ReturnFalse() \
79 )
80 
81 #define R_INTC_CreateSoftwareInterrupt(a, b, c) \
82 ( \
83 ( (c) <= IPL_MAX ) ? \
84 R_INTC_CreateSoftwareInterruptAll( (a), (b), (c) ) : \
85 ReturnFalse() \
86 )
87 
88 #define R_INTC_ControlExtInterrupt(a, b) \
89 ( \
90 ( (a) <= PDL_INTC_NMI ) ? \
91 R_INTC_ControlExtInterruptAll( (a), (b) ) : \
92 ReturnFalse() \
93 )
94 
95 #define R_INTC_GetExtInterruptStatus(a, b) \
96 ( \
97 ( (a) <= PDL_INTC_NMI ) ? \
98 R_INTC_GetExtInterruptStatusAll( (a), (b) ) : \
99 ReturnFalse() \
100 )
101 
102 #define R_INTC_CreateFastInterrupt(a) \
103 ( R_INTC_CreateFastInterruptAll( (a) ) )
104 
105 #define R_INTC_CreateExceptionHandlers(a, b, c) \
106 ( R_INTC_CreateExceptionHandlersAll( (a), (b), (c) ) )
107 
108 #define R_INTC_Read(a, b) \
109 ( R_INTC_ReadAll( (a), (b) ) )
110 
111 #define R_INTC_Write(a, b) \
112 ( R_INTC_WriteAll( (a), (b) ) )
113 
114 #define R_INTC_Modify(a, b, c) \
115 ( R_INTC_ModifyAll( (a), (b), (c) ) )
116 
117 #endif
118 /* End of file */
119