Endpoint.h 46.8 KB
Newer Older
1001
1002
1003
1004
1005
1006
1007
			                                    Endpoint_ConfigureEndpoint_Prv(Number,          \
			                                              ((Type << EPTYPE0) | Direction),      \
			                                              ((1 << ALLOC) | Banks |               \
			                                                (__builtin_constant_p(Size) ?       \
			                                                 Endpoint_BytesToEPSizeMask(Size) :  \
			                                                 Endpoint_BytesToEPSizeMaskDynamic(Size))))
													
1008
		/* Function Prototypes: */
1009
1010
1011
			void    Endpoint_ClearEndpoints(void);
			uint8_t Endpoint_BytesToEPSizeMaskDynamic(const uint16_t Size);
			bool    Endpoint_ConfigureEndpoint_Prv(const uint8_t Number, const uint8_t UECFG0XData, const uint8_t UECFG1XData);
1012
1013
			
		/* Inline Functions: */
1014
			static inline uint8_t Endpoint_BytesToEPSizeMask(const uint16_t Bytes) ATTR_WARN_UNUSED_RESULT ATTR_CONST ATTR_ALWAYS_INLINE;
1015
1016
			static inline uint8_t Endpoint_BytesToEPSizeMask(const uint16_t Bytes)
			{
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
				uint8_t  MaskVal    = 0;
				uint16_t CheckBytes = 8;
				
				while (CheckBytes < Bytes)
				{
					MaskVal++;
					CheckBytes <<= 1;
				}
				
				return (MaskVal << EPSIZE0);
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
			};

	#endif

	/* Disable C linkage for C++ Compilers: */
		#if defined(__cplusplus)
			}
		#endif
		
#endif
1037
1038

/** @} */
For faster browsing, not all history is shown. View entire blame