r_pdl_sci_rx62nxx.h 4.1 KB
Newer Older
淡漠想敏's avatar
淡漠想敏 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
/*""FILE COMMENT""*******************************************************
* System Name	: Serial Communication Interface API for RX62Nxx
* File Name		: r_pdl_sci_RX62Nxx.h
* Version		: 1.02
* Contents		: Serial Interface API header
* Customer		:
* Model			:
* Order			:
* CPU			: RX
* Compiler		: RXC
* OS			: Nothing
* Programmer	:
* Note			:
************************************************************************
* Copyright, 2011. Renesas Electronics Corporation
* and Renesas Solutions Corporation
************************************************************************
* History		: 2011.04.08
*				: Ver 1.02
*				: CS-5 release.
*""FILE COMMENT END""**************************************************/

#ifndef R_PDL_SCI_RX62Nxx_H
#define R_PDL_SCI_RX62Nxx_H

#define SCI_CHANNELS 7

/* Globals */
extern volatile const uint8_t * rpdl_SCI_tx_string_pointer[SCI_CHANNELS];
extern volatile uint8_t * rpdl_SCI_rx_string_pointer[SCI_CHANNELS];
extern volatile uint8_t * rpdl_SCI_rx_string_start[SCI_CHANNELS];
extern volatile uint16_t rpdl_SCI_rx_counter[SCI_CHANNELS];
extern volatile uint16_t rpdl_SCI_tx_counter[SCI_CHANNELS];
extern volatile uint16_t rpdl_SCI_rx_threshold[SCI_CHANNELS];
extern volatile uint16_t rpdl_SCI_tx_threshold[SCI_CHANNELS];
extern volatile uint8_t rpdl_SCI_tx_using_irq[SCI_CHANNELS];
extern volatile uint8_t rpdl_SCI_rx_using_irq[SCI_CHANNELS];
extern volatile uint8_t rpdl_SCI_sync_simultaneous[SCI_CHANNELS];
extern volatile uint8_t rpdl_SCI_MP_mode[SCI_CHANNELS];
extern volatile uint8_t rpdl_SCI_MP_rx_stationID[SCI_CHANNELS];

/* Callback function prototypes */
extern VoidCallBackFunc rpdl_SCI_TX_End_callback_func[SCI_CHANNELS];
extern VoidCallBackFunc rpdl_SCI_RX_End_callback_func[SCI_CHANNELS];
extern VoidCallBackFunc	rpdl_SCI_RX_Error_callback_func[SCI_CHANNELS];

/* Library prototypes */
bool R_SCI_SetAll(
	const uint8_t
);
bool R_SCI_CreateAll(
	const uint8_t,
	const uint32_t,
	const uint32_t,
	const uint8_t
);
bool R_SCI_CreateAsyncAll(
	const uint8_t,
	const uint32_t,
	const uint32_t,
	const uint8_t
);
bool R_SCI_CreateSyncAll(
	const uint8_t,
	const uint32_t,
	const uint32_t,
	const uint8_t
);
bool R_SCI_CreateSmartAll(
	const uint8_t,
	const uint32_t,
	const uint32_t,
	const uint8_t
);
bool R_SCI_DestroyAll(
	const uint8_t
);
bool R_SCI_SendAll(
	const uint8_t,
	const uint16_t,
	volatile const uint8_t * const,
	const uint16_t,
	VoidCallBackFunc const
);
bool R_SCI_SendStationID(
	const uint8_t,
	const uint16_t 
);
bool R_SCI_SendData(
	const uint8_t,
	const uint16_t,
	volatile const uint8_t * const,
	const uint16_t,
	VoidCallBackFunc const
);
bool R_SCI_ReceiveAll(
	const uint8_t,
	const uint16_t,
	volatile uint8_t * const,
	const uint16_t,
	VoidCallBackFunc const,
	VoidCallBackFunc const
);
bool R_SCI_ReceiveStationID(
	const uint8_t,
	const uint16_t,
	VoidCallBackFunc const,
	VoidCallBackFunc const
);
bool R_SCI_ReceiveData(
	const uint8_t,
	const uint16_t,
	volatile uint8_t * const,
	const uint16_t,
	VoidCallBackFunc const,
	VoidCallBackFunc const
);
bool R_SCI_ControlAll(
	const uint8_t,
	const uint8_t
);
bool R_SCI_GetStatusAll(
	const uint8_t,
	volatile uint8_t * const,
	volatile uint8_t * const,
	volatile uint16_t * const,
	volatile uint16_t * const
);
bool ReturnFalse(void);

/* Macro definitions */
#define R_SCI_Set(a) \
( R_SCI_SetAll( (a) ) )

#define R_SCI_Create(a, b, c, d) \
( \
( ((a) >= SCI_CHANNELS) || ((a) == 4) || ((c) == 0) || ((d) > IPL_MAX) )? \
ReturnFalse(): \
R_SCI_CreateAll( (a), (b), (c), (d) )\
)

#define R_SCI_Destroy(a) \
( \
(((a) < SCI_CHANNELS) && ((a) != 4)) ? \
R_SCI_DestroyAll( (a) ): \
ReturnFalse() \
)

#define R_SCI_Send(a, b, c, d, e) \
( \
(((a) < SCI_CHANNELS) && ((a) != 4)) ? \
R_SCI_SendAll( (a), (b), (c), (d), (e) ): \
ReturnFalse() \
)

#define R_SCI_Receive(a, b, c, d, e, f) \
( \
(((a) < SCI_CHANNELS) && ((a) != 4)) ? \
R_SCI_ReceiveAll( (a), (b), (c), (d), (e), (f) ): \
ReturnFalse() \
)

#define R_SCI_Control(a, b) \
( \
(((a) < SCI_CHANNELS) && ((a) != 4)) ? \
R_SCI_ControlAll( (a), (b) ): \
ReturnFalse() \
)

#define R_SCI_GetStatus(a, b, c, d, e) \
( \
(((a) < SCI_CHANNELS) && ((a) != 4)) ? \
R_SCI_GetStatusAll( (a), (b), (c), (d), (e) ): \
ReturnFalse() \
)

#endif
/* End of file */