2 * @brief Endpoint data stream transmission and reception management
\r
5 * Copyright(C) NXP Semiconductors, 2012
\r
6 * Copyright(C) Dean Camera, 2011, 2012
\r
7 * All rights reserved.
\r
10 * Software that is described herein is for illustrative purposes only
\r
11 * which provides customers with programming information regarding the
\r
12 * LPC products. This software is supplied "AS IS" without any warranties of
\r
13 * any kind, and NXP Semiconductors and its licensor disclaim any and
\r
14 * all warranties, express or implied, including all implied warranties of
\r
15 * merchantability, fitness for a particular purpose and non-infringement of
\r
16 * intellectual property rights. NXP Semiconductors assumes no responsibility
\r
17 * or liability for the use of the software, conveys no license or rights under any
\r
18 * patent, copyright, mask work right, or any other intellectual property rights in
\r
19 * or to any products. NXP Semiconductors reserves the right to make changes
\r
20 * in the software without notification. NXP Semiconductors also makes no
\r
21 * representation or warranty that such application will be suitable for the
\r
22 * specified use without further testing or modification.
\r
25 * Permission to use, copy, modify, and distribute this software and its
\r
26 * documentation is hereby granted, under NXP Semiconductors' and its
\r
27 * licensor's relevant copyrights in the software, without fee, provided that it
\r
28 * is used in conjunction with NXP Semiconductors microcontrollers. This
\r
29 * copyright, permission, and disclaimer notice must appear in all copies of
\r
33 /** @ingroup Group_EndpointRW
\r
34 * @defgroup Group_EndpointStreamRW Read/Write of Multi-Byte Streams
\r
35 * @brief Endpoint data stream transmission and reception management.
\r
37 * Functions, macros, variables, enums and types related to data reading and writing of data streams from
\r
43 #ifndef __ENDPOINT_STREAM_H__
\r
44 #define __ENDPOINT_STREAM_H__
\r
47 #include "../../../Common/Common.h"
\r
48 #include "USBMode.h"
\r
50 /* Enable C linkage for C++ Compilers: */
\r
51 #if defined(__cplusplus)
\r
55 /* Preprocessor Checks: */
\r
56 #if !defined(__INCLUDE_FROM_USB_DRIVER)
\r
57 #error Do not include this file directly. Include lpcroot/libraries/LPCUSBlib/Drivers/USB/USB.h instead.
\r
60 /* Public Interface - May be used in end-application: */
\r
62 /** Enum for the possible error return codes of the \c Endpoint_*_Stream_* functions. */
\r
63 enum Endpoint_Stream_RW_ErrorCodes_t
\r
65 ENDPOINT_RWSTREAM_NoError = 0, /**< Command completed successfully, no error. */
\r
66 ENDPOINT_RWSTREAM_EndpointStalled = 1, /**< The endpoint was stalled during the stream
\r
67 * transfer by the host or device.
\r
69 ENDPOINT_RWSTREAM_DeviceDisconnected = 2, /**< Device was disconnected from the host during
\r
72 ENDPOINT_RWSTREAM_BusSuspended = 3, /**< The USB bus has been suspended by the host and
\r
73 * no USB endpoint traffic can occur until the bus
\r
76 ENDPOINT_RWSTREAM_Timeout = 4, /**< The host failed to accept or send the next packet
\r
77 * within the software timeout period set by the
\r
78 * @ref USB_STREAM_TIMEOUT_MS macro.
\r
80 ENDPOINT_RWSTREAM_IncompleteTransfer = 5, /**< Indicates that the endpoint bank became full or empty before
\r
81 * the complete contents of the current stream could be
\r
82 * transferred. The endpoint stream function should be called
\r
83 * again to process the next chunk of data in the transfer.
\r
87 /** Enum for the possible error return codes of the \c Endpoint_*_Control_Stream_* functions. */
\r
88 enum Endpoint_ControlStream_RW_ErrorCodes_t
\r
90 ENDPOINT_RWCSTREAM_NoError = 0, /**< Command completed successfully, no error. */
\r
91 ENDPOINT_RWCSTREAM_HostAborted = 1, /**< The aborted the transfer prematurely. */
\r
92 ENDPOINT_RWCSTREAM_DeviceDisconnected = 2, /**< Device was disconnected from the host during
\r
95 ENDPOINT_RWCSTREAM_BusSuspended = 3, /**< The USB bus has been suspended by the host and
\r
96 * no USB endpoint traffic can occur until the bus
\r
101 #include "../../../Common/Common.h"
\r
102 #include "USBTask.h"
\r
104 /* Function Prototypes: */
\r
105 /** \name Stream functions for null data */
\r
108 * @brief Reads and discards the given number of bytes from the currently selected endpoint's bank,
\r
109 * discarding fully read packets from the host as needed. The last packet is not automatically
\r
110 * discarded once the remaining bytes has been read; the user is responsible for manually
\r
111 * discarding the last packet from the host via the @ref Endpoint_ClearOUT() macro.
\r
113 * If the BytesProcessed parameter is \c NULL, the entire stream transfer is attempted at once,
\r
114 * failing or succeeding as a single unit. If the BytesProcessed parameter points to a valid
\r
115 * storage location, the transfer will instead be performed as a series of chunks. Each time
\r
116 * the endpoint bank becomes empty while there is still data to process (and after the current
\r
117 * packet has been acknowledged) the BytesProcessed location will be updated with the total number
\r
118 * of bytes processed in the stream, and the function will exit with an error code of
\r
119 * @ref ENDPOINT_RWSTREAM_IncompleteTransfer. This allows for any abort checking to be performed
\r
120 * in the user code - to continue the transfer, call the function again with identical parameters
\r
121 * and it will resume until the BytesProcessed value reaches the total transfer length.
\r
123 * <b>Single Stream Transfer Example:</b>
\r
125 * uint8_t ErrorCode;
\r
127 * if ((ErrorCode = Endpoint_Discard_Stream(512, NULL)) != ENDPOINT_RWSTREAM_NoError)
\r
129 * // Stream failed to complete - check ErrorCode here
\r
133 * <b>Partial Stream Transfers Example:</b>
\r
135 * uint8_t ErrorCode;
\r
136 * uint16_t BytesProcessed;
\r
138 * BytesProcessed = 0;
\r
139 * while ((ErrorCode = Endpoint_Discard_Stream(512, &BytesProcessed)) == ENDPOINT_RWSTREAM_IncompleteTransfer)
\r
141 * // Stream not yet complete - do other actions here, abort if required
\r
144 * if (ErrorCode != ENDPOINT_RWSTREAM_NoError)
\r
146 * // Stream failed to complete - check ErrorCode here
\r
150 * @note This routine should not be used on CONTROL type endpoints.
\r
152 * @param corenum ID Number of USB Core to be processed.
\r
153 * @param Length Number of bytes to discard via the currently selected endpoint.
\r
154 * @param BytesProcessed Pointer to a location where the total number of bytes processed in the current
\r
155 * transaction should be updated, \c NULL if the entire stream should be read at once.
\r
157 * @param Length : Number of bytes to discard via the currently selected endpoint
\r
158 * @param BytesProcessed : Pointer to a location where the total number of bytes processed in the current
\r
159 * transaction should be updated, NULL if the entire stream should be read at once.
\r
160 * @return A value from the @ref Endpoint_Stream_RW_ErrorCodes_t enum
\r
162 uint8_t Endpoint_Discard_Stream(uint8_t corenum,
\r
164 uint16_t *const BytesProcessed);
\r
167 * @brief Writes a given number of zeroed bytes to the currently selected endpoint's bank, sending
\r
168 * full packets to the host as needed. The last packet is not automatically sent once the
\r
169 * remaining bytes have been written; the user is responsible for manually sending the last
\r
170 * packet to the host via the @ref Endpoint_ClearIN() macro.
\r
172 * If the BytesProcessed parameter is \c NULL, the entire stream transfer is attempted at once,
\r
173 * failing or succeeding as a single unit. If the BytesProcessed parameter points to a valid
\r
174 * storage location, the transfer will instead be performed as a series of chunks. Each time
\r
175 * the endpoint bank becomes full while there is still data to process (and after the current
\r
176 * packet transmission has been initiated) the BytesProcessed location will be updated with the
\r
177 * total number of bytes processed in the stream, and the function will exit with an error code of
\r
178 * @ref ENDPOINT_RWSTREAM_IncompleteTransfer. This allows for any abort checking to be performed
\r
179 * in the user code - to continue the transfer, call the function again with identical parameters
\r
180 * and it will resume until the BytesProcessed value reaches the total transfer length.
\r
182 * <b>Single Stream Transfer Example:</b>
\r
184 * uint8_t ErrorCode;
\r
186 * if ((ErrorCode = Endpoint_Null_Stream(512, NULL)) != ENDPOINT_RWSTREAM_NoError)
\r
188 * // Stream failed to complete - check ErrorCode here
\r
192 * <b>Partial Stream Transfers Example:</b>
\r
194 * uint8_t ErrorCode;
\r
195 * uint16_t BytesProcessed;
\r
197 * BytesProcessed = 0;
\r
198 * while ((ErrorCode = Endpoint_Null_Stream(512, &BytesProcessed)) == ENDPOINT_RWSTREAM_IncompleteTransfer)
\r
200 * // Stream not yet complete - do other actions here, abort if required
\r
203 * if (ErrorCode != ENDPOINT_RWSTREAM_NoError)
\r
205 * // Stream failed to complete - check ErrorCode here
\r
209 * @note This routine should not be used on CONTROL type endpoints.
\r
211 * @param corenum ID Number of USB Core to be processed.
\r
212 * @param Length Number of zero bytes to send via the currently selected endpoint.
\r
213 * @param BytesProcessed Pointer to a location where the total number of bytes processed in the current
\r
214 * transaction should be updated, \c NULL if the entire stream should be read at once.
\r
216 * @param Length : Number of zero bytes to send via the currently selected endpoint
\r
217 * @param BytesProcessed : Pointer to a location where the total number of bytes processed in the current
\r
218 * transaction should be updated, NULL if the entire stream should be read at once
\r
219 * @return A value from the @ref Endpoint_Stream_RW_ErrorCodes_t enum
\r
221 uint8_t Endpoint_Null_Stream(uint8_t corenum,
\r
223 uint16_t *const BytesProcessed);
\r
227 /** \name Stream functions for RAM source/destination data */
\r
230 /** @brief Writes the given number of bytes to the endpoint from the given buffer in little endian,
\r
231 * sending full packets to the host as needed. The last packet filled is not automatically sent;
\r
232 * the user is responsible for manually sending the last written packet to the host via the
\r
233 * @ref Endpoint_ClearIN() macro.
\r
235 * If the BytesProcessed parameter is \c NULL, the entire stream transfer is attempted at once,
\r
236 * failing or succeeding as a single unit. If the BytesProcessed parameter points to a valid
\r
237 * storage location, the transfer will instead be performed as a series of chunks. Each time
\r
238 * the endpoint bank becomes full while there is still data to process (and after the current
\r
239 * packet transmission has been initiated) the BytesProcessed location will be updated with the
\r
240 * total number of bytes processed in the stream, and the function will exit with an error code of
\r
241 * @ref ENDPOINT_RWSTREAM_IncompleteTransfer. This allows for any abort checking to be performed
\r
242 * in the user code - to continue the transfer, call the function again with identical parameters
\r
243 * and it will resume until the BytesProcessed value reaches the total transfer length.
\r
245 * <b>Single Stream Transfer Example:</b>
\r
247 * uint8_t DataStream[512];
\r
248 * uint8_t ErrorCode;
\r
250 * if ((ErrorCode = Endpoint_Write_Stream_LE(DataStream, sizeof(DataStream),
\r
251 * NULL)) != ENDPOINT_RWSTREAM_NoError)
\r
253 * // Stream failed to complete - check ErrorCode here
\r
257 * <b>Partial Stream Transfers Example:</b>
\r
259 * uint8_t DataStream[512];
\r
260 * uint8_t ErrorCode;
\r
261 * uint16_t BytesProcessed;
\r
263 * BytesProcessed = 0;
\r
264 * while ((ErrorCode = Endpoint_Write_Stream_LE(DataStream, sizeof(DataStream),
\r
265 * &BytesProcessed)) == ENDPOINT_RWSTREAM_IncompleteTransfer)
\r
267 * // Stream not yet complete - do other actions here, abort if required
\r
270 * if (ErrorCode != ENDPOINT_RWSTREAM_NoError)
\r
272 * // Stream failed to complete - check ErrorCode here
\r
276 * @note This routine should not be used on CONTROL type endpoints.
\r
278 * @param corenum ID Number of USB Core to be processed.
\r
279 * @param Buffer Pointer to the source data buffer to read from.
\r
280 * @param Length Number of bytes to read for the currently selected endpoint into the buffer.
\r
281 * @param BytesProcessed Pointer to a location where the total number of bytes processed in the current
\r
282 * transaction should be updated, \c NULL if the entire stream should be written at once.
\r
284 * @param Buffer : Pointer to the source data buffer to read from
\r
285 * @param Length : Number of bytes to read for the currently selected endpoint into the buffer
\r
286 * @param BytesProcessed : Pointer to a location where the total number of bytes processed in the current
\r
287 * transaction should be updated, NULL if the entire stream should be written at once
\r
288 * @return A value from the @ref Endpoint_Stream_RW_ErrorCodes_t enum
\r
290 uint8_t Endpoint_Write_Stream_LE(uint8_t corenum,
\r
291 const void *const Buffer,
\r
293 uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(2);
\r
296 * @brief Writes the given number of bytes to the endpoint from the given buffer in big endian,
\r
297 * sending full packets to the host as needed. The last packet filled is not automatically sent;
\r
298 * the user is responsible for manually sending the last written packet to the host via the
\r
299 * @ref Endpoint_ClearIN() macro.
\r
301 * @note This routine should not be used on CONTROL type endpoints.
\r
303 * @param corenum ID Number of USB Core to be processed.
\r
304 * @param Buffer : Pointer to the source data buffer to read from
\r
305 * @param Length : Number of bytes to read for the currently selected endpoint into the buffer
\r
306 * @param BytesProcessed : Pointer to a location where the total number of bytes processed in the current
\r
307 * transaction should be updated, \c NULL if the entire stream should be written at once
\r
308 * @return A value from the @ref Endpoint_Stream_RW_ErrorCodes_t enum
\r
310 uint8_t Endpoint_Write_Stream_BE(uint8_t corenum,
\r
311 const void *const Buffer,
\r
313 uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(2);
\r
316 * @brief Reads the given number of bytes from the endpoint from the given buffer in little endian,
\r
317 * discarding fully read packets from the host as needed. The last packet is not automatically
\r
318 * discarded once the remaining bytes has been read; the user is responsible for manually
\r
319 * discarding the last packet from the host via the @ref Endpoint_ClearOUT() macro.
\r
321 * If the BytesProcessed parameter is \c NULL, the entire stream transfer is attempted at once,
\r
322 * failing or succeeding as a single unit. If the BytesProcessed parameter points to a valid
\r
323 * storage location, the transfer will instead be performed as a series of chunks. Each time
\r
324 * the endpoint bank becomes empty while there is still data to process (and after the current
\r
325 * packet has been acknowledged) the BytesProcessed location will be updated with the total number
\r
326 * of bytes processed in the stream, and the function will exit with an error code of
\r
327 * @ref ENDPOINT_RWSTREAM_IncompleteTransfer. This allows for any abort checking to be performed
\r
328 * in the user code - to continue the transfer, call the function again with identical parameters
\r
329 * and it will resume until the BytesProcessed value reaches the total transfer length.
\r
331 * <b>Single Stream Transfer Example:</b>
\r
333 * uint8_t DataStream[512];
\r
334 * uint8_t ErrorCode;
\r
336 * if ((ErrorCode = Endpoint_Read_Stream_LE(DataStream, sizeof(DataStream),
\r
337 * NULL)) != ENDPOINT_RWSTREAM_NoError)
\r
339 * // Stream failed to complete - check ErrorCode here
\r
343 * <b>Partial Stream Transfers Example:</b>
\r
345 * uint8_t DataStream[512];
\r
346 * uint8_t ErrorCode;
\r
347 * uint16_t BytesProcessed;
\r
349 * BytesProcessed = 0;
\r
350 * while ((ErrorCode = Endpoint_Read_Stream_LE(DataStream, sizeof(DataStream),
\r
351 * &BytesProcessed)) == ENDPOINT_RWSTREAM_IncompleteTransfer)
\r
353 * // Stream not yet complete - do other actions here, abort if required
\r
356 * if (ErrorCode != ENDPOINT_RWSTREAM_NoError)
\r
358 * // Stream failed to complete - check ErrorCode here
\r
362 * @note This routine should not be used on CONTROL type endpoints.
\r
364 * @param corenum ID Number of USB Core to be processed.
\r
365 * \param[out] Buffer Pointer to the destination data buffer to write to.
\r
366 * @param Length Number of bytes to send via the currently selected endpoint.
\r
367 * @param BytesProcessed Pointer to a location where the total number of bytes processed in the current
\r
368 * transaction should be updated, \c NULL if the entire stream should be read at once.
\r
370 * @param Buffer : Pointer to the destination data buffer to write to
\r
371 * @param Length : Number of bytes to send via the currently selected endpoint
\r
372 * @param BytesProcessed : Pointer to a location where the total number of bytes processed in the current
\r
373 * transaction should be updated, NULL if the entire stream should be written at once
\r
374 * @return A value from the @ref Endpoint_Stream_RW_ErrorCodes_t enum
\r
376 uint8_t Endpoint_Read_Stream_LE(uint8_t corenum,
\r
377 void *const Buffer,
\r
379 uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(2);
\r
382 * @brief Reads the given number of bytes from the endpoint from the given buffer in big endian,
\r
383 * discarding fully read packets from the host as needed. The last packet is not automatically
\r
384 * discarded once the remaining bytes has been read; the user is responsible for manually
\r
385 * discarding the last packet from the host via the @ref Endpoint_ClearOUT() macro.
\r
387 * @note This routine should not be used on CONTROL type endpoints.
\r
389 * @param Buffer : Pointer to the destination data buffer to write to
\r
390 * @param Length : Number of bytes to send via the currently selected endpoint
\r
391 * @param BytesProcessed : Pointer to a location where the total number of bytes processed in the current
\r
392 * transaction should be updated, \c NULL if the entire stream should be read at once
\r
393 * @return A value from the @ref Endpoint_Stream_RW_ErrorCodes_t enum
\r
395 uint8_t Endpoint_Read_Stream_BE(void *const Buffer,
\r
397 uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
\r
400 * @brief Writes the given number of bytes to the CONTROL type endpoint from the given buffer in little endian,
\r
401 * sending full packets to the host as needed. The host OUT acknowledgement is not automatically cleared
\r
402 * in both failure and success states; the user is responsible for manually clearing the setup OUT to
\r
403 * finalize the transfer via the @ref Endpoint_ClearOUT() macro.
\r
405 * @note This function automatically clears the control transfer's status stage. Do not manually attempt
\r
406 * to clear the status stage when using this routine in a control transaction.
\r
409 * @note This routine should only be used on CONTROL type endpoints.
\r
411 * \warning Unlike the standard stream read/write commands, the control stream commands cannot be chained
\r
412 * together; i.e. the entire stream data must be read or written at the one time.
\r
414 * @param corenum ID Number of USB Core to be processed.
\r
415 * @param Buffer : Pointer to the source data buffer to read from
\r
416 * @param Length : Number of bytes to read for the currently selected endpoint into the buffer
\r
417 * @return A value from the @ref Endpoint_ControlStream_RW_ErrorCodes_t enum
\r
419 uint8_t Endpoint_Write_Control_Stream_LE(uint8_t corenum, const void *const Buffer,
\r
420 uint16_t Length) ATTR_NON_NULL_PTR_ARG(2);
\r
423 * @brief Writes the given number of bytes to the CONTROL type endpoint from the given buffer in big endian,
\r
424 * sending full packets to the host as needed. The host OUT acknowledgement is not automatically cleared
\r
425 * in both failure and success states; the user is responsible for manually clearing the setup OUT to
\r
426 * finalize the transfer via the @ref Endpoint_ClearOUT() macro.
\r
428 * @note This function automatically clears the control transfer's status stage. Do not manually attempt
\r
429 * to clear the status stage when using this routine in a control transaction.
\r
432 * @note This routine should only be used on CONTROL type endpoints.
\r
434 * \warning Unlike the standard stream read/write commands, the control stream commands cannot be chained
\r
435 * together; i.e. the entire stream data must be read or written at the one time.
\r
437 * @param Buffer : Pointer to the source data buffer to read from
\r
438 * @param Length : Number of bytes to read for the currently selected endpoint into the buffer
\r
439 * @return A value from the @ref Endpoint_ControlStream_RW_ErrorCodes_t enum
\r
441 uint8_t Endpoint_Write_Control_Stream_BE(const void *const Buffer,
\r
442 uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
\r
445 * @brief Reads the given number of bytes from the CONTROL endpoint from the given buffer in little endian,
\r
446 * discarding fully read packets from the host as needed. The device IN acknowledgement is not
\r
447 * automatically sent after success or failure states; the user is responsible for manually sending the
\r
448 * setup IN to finalize the transfer via the @ref Endpoint_ClearIN() macro.
\r
450 * @note This function automatically clears the control transfer's status stage. Do not manually attempt
\r
451 * to clear the status stage when using this routine in a control transaction.
\r
454 * @note This routine should only be used on CONTROL type endpoints.
\r
456 * \warning Unlike the standard stream read/write commands, the control stream commands cannot be chained
\r
457 * together; i.e. the entire stream data must be read or written at the one time.
\r
459 * @param corenum ID Number of USB Core to be processed.
\r
460 * @param Buffer : Pointer to the destination data buffer to write to
\r
461 * @param Length : Number of bytes to send via the currently selected endpoint
\r
462 * @return A value from the @ref Endpoint_ControlStream_RW_ErrorCodes_t enum
\r
464 uint8_t Endpoint_Read_Control_Stream_LE(uint8_t corenum, void *const Buffer,
\r
465 uint16_t Length) ATTR_NON_NULL_PTR_ARG(2);
\r
468 * @brief Reads the given number of bytes from the CONTROL endpoint from the given buffer in big endian,
\r
469 * discarding fully read packets from the host as needed. The device IN acknowledgement is not
\r
470 * automatically sent after success or failure states; the user is responsible for manually sending the
\r
471 * setup IN to finalize the transfer via the @ref Endpoint_ClearIN() macro.
\r
473 * @note This function automatically clears the control transfer's status stage. Do not manually attempt
\r
474 * to clear the status stage when using this routine in a control transaction.
\r
477 * @note This routine should only be used on CONTROL type endpoints.
\r
479 * \warning Unlike the standard stream read/write commands, the control stream commands cannot be chained
\r
480 * together; i.e. the entire stream data must be read or written at the one time.
\r
482 * @param Buffer : Pointer to the destination data buffer to write to
\r
483 * @param Length : Number of bytes to send via the currently selected endpoint
\r
484 * @return A value from the @ref Endpoint_ControlStream_RW_ErrorCodes_t enum
\r
486 uint8_t Endpoint_Read_Control_Stream_BE(void *const Buffer,
\r
487 uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
\r
490 /** \name Stream functions for EEPROM source/destination data */
\r
493 * @brief Endpoint Write EEPROM Stream Little Endian
\r
494 * @param Buffer : Pointer to the source data buffer to read from
\r
495 * @param Length : Number of bytes to read for the currently selected endpoint into the buffer
\r
496 * @param BytesProcessed : Pointer to a location where the total number of bytes processed in the current
\r
497 * transaction should be updated, \c NULL if the entire stream should be written at once
\r
498 * @return A value from the @ref Endpoint_Stream_RW_ErrorCodes_t enum
\r
500 uint8_t Endpoint_Write_EStream_LE(const void *const Buffer,
\r
502 uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
\r
505 * @brief Endpoint Write EEPROM Stream Big Endian
\r
506 * @param Buffer : Pointer to the source data buffer to read from
\r
507 * @param Length : Number of bytes to read for the currently selected endpoint into the buffer
\r
508 * @param BytesProcessed : Pointer to a location where the total number of bytes processed in the current
\r
509 * transaction should be updated, \c NULL if the entire stream should be written at once
\r
510 * @return A value from the @ref Endpoint_Stream_RW_ErrorCodes_t enum
\r
512 uint8_t Endpoint_Write_EStream_BE(const void *const Buffer,
\r
514 uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
\r
517 * @brief Endpoint Read EEPROM Stream Little Endian
\r
518 * @param Buffer : Pointer to the destination data buffer to write to, located in EEPROM memory space
\r
519 * @param Length : Number of bytes to send via the currently selected endpoint
\r
520 * @param BytesProcessed : Pointer to a location where the total number of bytes processed in the current
\r
521 * transaction should be updated, \c NULL if the entire stream should be read at once
\r
522 * @return A value from the @ref Endpoint_Stream_RW_ErrorCodes_t enum
\r
524 uint8_t Endpoint_Read_EStream_LE(void *const Buffer,
\r
526 uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
\r
529 * @brief Endpoint Read EEPROM Stream Big Endian
\r
530 * @param Buffer : Pointer to the destination data buffer to write to, located in EEPROM memory space
\r
531 * @param Length : Number of bytes to send via the currently selected endpoint
\r
532 * @param BytesProcessed : Pointer to a location where the total number of bytes processed in the current
\r
533 * transaction should be updated, \c NULL if the entire stream should be read at once
\r
534 * @return A value from the @ref Endpoint_Stream_RW_ErrorCodes_t enum
\r
536 uint8_t Endpoint_Read_EStream_BE(void *const Buffer,
\r
538 uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
\r
541 * @brief Endpoint Write Control EEPROM Stream Little Endian
\r
543 * @note This function automatically clears the control transfer's status stage. Do not manually attempt
\r
544 * to clear the status stage when using this routine in a control transaction.
\r
547 * @note This routine should only be used on CONTROL type endpoints.
\r
550 * \warning Unlike the standard stream read/write commands, the control stream commands cannot be chained
\r
551 * together; i.e. the entire stream data must be read or written at the one time.
\r
553 * @param Buffer : Pointer to the source data buffer to read from
\r
554 * @param Length : Number of bytes to read for the currently selected endpoint into the buffer
\r
555 * @return A value from the @ref Endpoint_ControlStream_RW_ErrorCodes_t enum
\r
557 uint8_t Endpoint_Write_Control_EStream_LE(const void *const Buffer,
\r
558 uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
\r
561 * @brief Endpoint Write Control EEPROM Stream Big Endian
\r
563 * @note This function automatically clears the control transfer's status stage. Do not manually attempt
\r
564 * to clear the status stage when using this routine in a control transaction.
\r
567 * @note This routine should only be used on CONTROL type endpoints.
\r
570 * \warning Unlike the standard stream read/write commands, the control stream commands cannot be chained
\r
571 * together; i.e. the entire stream data must be read or written at the one time.
\r
573 * @param Buffer : Pointer to the source data buffer to read from
\r
574 * @param Length : Number of bytes to read for the currently selected endpoint into the buffer
\r
575 * @return A value from the @ref Endpoint_ControlStream_RW_ErrorCodes_t enum
\r
577 uint8_t Endpoint_Write_Control_EStream_BE(const void *const Buffer,
\r
578 uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
\r
581 * @brief Endpoint Read Control EEPROM Stream Little Endian
\r
583 * @note This function automatically clears the control transfer's status stage. Do not manually attempt
\r
584 * to clear the status stage when using this routine in a control transaction.
\r
587 * @note This routine should only be used on CONTROL type endpoints.
\r
590 * \warning Unlike the standard stream read/write commands, the control stream commands cannot be chained
\r
591 * together; i.e. the entire stream data must be read or written at the one time.
\r
593 * @param Buffer : Pointer to the destination data buffer to write to
\r
594 * @param Length : Number of bytes to send via the currently selected endpoint
\r
595 * @return A value from the @ref Endpoint_ControlStream_RW_ErrorCodes_t enum
\r
597 uint8_t Endpoint_Read_Control_EStream_LE(void *const Buffer,
\r
598 uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
\r
601 * @brief Endpoint Read Control EEPROM Stream Big Endian
\r
603 * @note This function automatically clears the control transfer's status stage. Do not manually attempt
\r
604 * to clear the status stage when using this routine in a control transaction.
\r
607 * @note This routine should only be used on CONTROL type endpoints.
\r
610 * \warning Unlike the standard stream read/write commands, the control stream commands cannot be chained
\r
611 * together; i.e. the entire stream data must be read or written at the one time.
\r
613 * @param Buffer : Pointer to the destination data buffer to write to
\r
614 * @param Length : Number of bytes to send via the currently selected endpoint
\r
615 * @return A value from the @ref Endpoint_ControlStream_RW_ErrorCodes_t enum
\r
617 uint8_t Endpoint_Read_Control_EStream_BE(void *const Buffer,
\r
618 uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
\r
621 * @brief Endpoint Write PROGMEM Stream Little Endian
\r
623 * @param Buffer : Pointer to the source data buffer to read from
\r
624 * @param Length : Number of bytes to read for the currently selected endpoint into the buffer
\r
625 * @param BytesProcessed : Pointer to a location where the total number of bytes processed in the current
\r
626 * transaction should be updated, NULL if the entire stream should be written at once.
\r
627 * @return A value from the @ref Endpoint_Stream_RW_ErrorCodes_t enum
\r
629 uint8_t Endpoint_Write_PStream_LE(const void *const Buffer,
\r
631 uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
\r
634 * @brief Endpoint Write PROGMEM Stream Big Endian
\r
635 * @param Buffer : Pointer to the source data buffer to read from
\r
636 * @param Length : Number of bytes to read for the currently selected endpoint into the buffer
\r
637 * @param BytesProcessed : Pointer to a location where the total number of bytes processed in the current
\r
638 * transaction should be updated, \c NULL if the entire stream should be written at once.
\r
639 * @return A value from the @ref Endpoint_Stream_RW_ErrorCodes_t enum
\r
641 uint8_t Endpoint_Write_PStream_BE(const void *const Buffer,
\r
643 uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
\r
646 * @brief Endpoint Write Control PROGMEM Stream Little Endian
\r
647 * @param Buffer : Pointer to the source data buffer to read from
\r
648 * @param Length : Number of bytes to read for the currently selected endpoint into the buffer
\r
649 * @return A value from the @ref Endpoint_ControlStream_RW_ErrorCodes_t enum
\r
651 uint8_t Endpoint_Write_Control_PStream_LE(const void *const Buffer,
\r
652 uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
\r
655 * @brief Endpoint Write Control PROGMEM Stream Big Endian
\r
656 * @param Buffer : Pointer to the source data buffer to read from
\r
657 * @param Length : Number of bytes to read for the currently selected endpoint into the buffer
\r
658 * @return A value from the @ref Endpoint_ControlStream_RW_ErrorCodes_t enum
\r
660 uint8_t Endpoint_Write_Control_PStream_BE(const void *const Buffer,
\r
661 uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
\r
664 /* Disable C linkage for C++ Compilers: */
\r
665 #if defined(__cplusplus)
\r