1 /*""FILE COMMENT""*******************************************************
2 * System Name	: A/D converter API for RX62Nxx
3 * File Name		: r_pdl_adc_10_RX62Nxx.h
4 * Version		: 1.02
5 * Contents		: ADC 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_ADC_10_RX62Nxx_H
24 #define R_PDL_ADC_10_RX62Nxx_H
25 
26 #define ADC_10_UNITS 2
27 
28 extern VoidCallBackFunc rpdl_ADC_10_callback_func[];
29 
30 /* Library prototypes */
31 bool R_ADC_10_CreateAll(
32 	const uint8_t,
33 	const uint32_t,
34 	const uint32_t,
35 	const float,
36 	VoidCallBackFunc const,
37 	const uint8_t
38 );
39 bool R_ADC_10_DestroyAll(
40 	const uint8_t
41 );
42 bool R_ADC_10_ControlAll(
43 	const uint16_t
44 );
45 bool R_ADC_10_ReadAll(
46 	const uint8_t,
47 	volatile uint16_t * const
48 );
49 bool ReturnFalse(void);
50 
51 /* Macro definitions */
52 
53 #define R_ADC_10_Create(a, b, c, d, e, f) \
54 ( \
55 ( ( ((a) < ADC_10_UNITS) && ((f) <= IPL_MAX) ) ) ? \
56 R_ADC_10_CreateAll( (a), (b), (c), (d), (e), (f)): \
57 ReturnFalse() \
58 )
59 
60 #define R_ADC_10_Destroy(a) \
61 ( \
62 ( (a) < ADC_10_UNITS ) ? \
63 R_ADC_10_DestroyAll( (a) ): \
64 ReturnFalse() \
65 )
66 
67 #define R_ADC_10_Control(a) \
68 ( \
69 ( ((a) & 0xFFu) != 0x00u ) ? \
70 R_ADC_10_ControlAll( (a) ): \
71 ReturnFalse() \
72 )
73 
74 #define R_ADC_10_Read(a, b) \
75 ( \
76 ( (a) < ADC_10_UNITS ) ? \
77 R_ADC_10_ReadAll( (a), (b) ): \
78 ReturnFalse() \
79 )
80 
81 #endif
82 /* End of file */
83