BFx Library (Bfx)
AUTOSAR Classic Libraries-Modul BFx Library (Bfx, Spezifikation: AUTOSAR_CP_SWS_BFXLibrary.pdf, AUTOSAR_SWS_BFXLibrary.pdf).
Funktionen — Übersicht
void Bfx_SetBit_<TypeMn>u8 (<Type>* Data, uint8 BitPn); ⚠️This function shall set the logical status of input data as '1' at the requested bit position.void Bfx_ClrBit_<TypeMn>u8 (<Type>* Data, uint8 BitPn); ⚠️This function shall clear the logical status of the input data to '0' at the requested bit position.boolean Bfx_GetBit_<InTypeMn>u8_u8 (<InType> Data, uint8 BitPn);This function shall return the logical status of the input data for the requested bit position.void Bfx_SetBits_<TypeMn>u8u8u8 (<Type>* Data, uint8 BitStartPn, uint8 BitLn, uint8 Status); ⚠️This function shall set the input data as '1' or '0' as per 'Status' value starting from 'BitStartPn' for the length 'BitLn'.<Type> Bfx_GetBits_<TypeMn>u8u8_<TypeMn> (<Type> Data, uint8 BitStartPn, uint8 BitLn); ⚠️This function shall return the Bits of the input data starting from 'BitStartPn' for the length of 'Bit Ln'.void Bfx_SetBitMask_<TypeMn><TypeMn> (<Type>* Data, <Type> Mask); ⚠️This function shall set the data to logical status '1' as per the corresponding Mask bits when set to value 1 and remaining...void Bfx_ClrBitMask_<TypeMn><TypeMn> (<Type>* Data, <Type> Mask); ⚠️This function shall clear the logical status to '0' for the input data for all the bit positions as per the mask.boolean Bfx_TstBitMask_<InTypeMn><InTypeMn>_u8 (<InType> Data, <InType> Mask);This function shall return TRUE, if all bits defined in Mask value are set in the input Data value.boolean Bfx_TstBitLnMask_<InTypeMn><InTypeMn>_u8 (<InType> Data, <InType> Mask);This function makes a test on the input data and if at least one bit is set as per the mask, then the function shall return...boolean Bfx_TstParityEven_<InTypeMn>_u8 (<InTypeMn> Data);This function tests the number of bits set to 1.void Bfx_ToggleBits_<TypeMn> (<Type>* Data); ⚠️This function toggles all the bits of data (1's Complement Data).void Bfx_ToggleBitMask_<TypeMn><TypeMn> (<Type>* Data, <Type> Mask); ⚠️This function toggles the bits of data when the corresponding bit of the mask is enabled and set to 1.void Bfx_ShiftBitRt_<TypeMn>u8 (<Type>* Data, uint8 ShiftCnt); ⚠️This function shall shift data to the right by ShiftCnt.void Bfx_ShiftBitLt_<TypeMn>u8 (<Type>* Data, uint8 ShiftCnt); ⚠️This function shall shift data to the left by ShiftCnt.void Bfx_RotBitRt_<TypeMn>u8 (<Type>* Data, uint8 ShiftCnt); ⚠️This function shall rotate data to the right by ShiftCnt.void Bfx_RotBitLt_<TypeMn>u8 (<Type>* Data, uint8 ShiftCnt); ⚠️This function shall rotate data to the left by ShiftCnt.void Bfx_CopyBit_<TypeMn>u8<TypeMn>u8 (<Type>* DestinationData, uint8 DestinationPosition, <Type> SourceData, uint8 SourcePosition); ⚠️This function shall copy a bit from source data from bit position to destination data at bit position.void Bfx_PutBits_<TypeMn>u8u8<TypeMn> (<Type>* Data, uint8 BitStartPn, uint8 BitLn, <Type> Pattern); ⚠️This function shall put bits as mentioned in Pattern to the input Data from the specified bit position.void Bfx_PutBitsMask_<TypeMn><TypeMn><TypeMn> (<Type>* Data, <Type> Pattern, <Type> Mask); ⚠️This function shall put all bits defined in Pattern and for which the corresponding Mask bit is set to 1 in the input Data.void Bfx_PutBit_<TypeMn>u8u8 (<Type>* Data, uint8 BitPn, boolean Status); ⚠️This function shall update the bit specified by BitPn of input data as '1' or '0' as per 'Status' value.void Bfx_GetVersionInfo (Std_VersionInfoType* Versioninfo);Returns the version information of this library.<Type> Bfx_ShiftBitSat_<TypeMn>s8 (sint8 ShiftCnt, <Type> Data); ⚠️Arithmetic shift with saturationuint8 Bfx_CountLeadingOnes_<TypeMn> (<Type> Data); ⚠️Count the number of consecutive ones in Data starting with the most significant bit and return the result.uint8 Bfx_CountLeadingSigns_<TypeMn> (<Type> Data); ⚠️Count the number of consecutive bits which have the same value as most significant bit in Data, starting with bit at position...uint8 Bfx_CountLeadingZeros_<TypeMn> (<Type> Data); ⚠️Count the number of consecutive zeros in Data starting with the most significant bit and return the result.
Anforderungen — Übersicht
SWS_Bfx_00002Expected functionality: *Data = *Data | (0x01 << BitPn) For Example: Data = 10001010b Bfx_SetBit_u8u8(&Data, 2) The...SWS_Bfx_00008List of implemented functions Function ID[hex] Function prototype Maximum value of BitPn 0x001 void Bfx_SetBit_u8u8(uint8*,...SWS_Bfx_00011Expected functionality: *Data = (*Data & ~(0x01 << BitPn)) For Example: Data = 10001010b Bfx_ClrBit_u8u8(&Data,...SWS_Bfx_00015List of implemented functions Function ID[hex] Function prototype Maximum value of BitPn 0x006 void Bfx_ClrBit_u8u8(uint8*,...SWS_Bfx_00017Result = TRUE, ((Data & (0x01 << BitPn)) != 0) Result = FALSE, else For Example: Bfx_GetBit_u8u8(10001010b, 1)...SWS_Bfx_00020List of implemented functions Function ID[hex] Function prototype maximum value of BitPn 0x00A boolean Bfx_GetBit_u8u8_...SWS_Bfx_0002215 14 13 12 11 10 9 - 2 1 0 1 1 1 0 1 0 0 0 0 0 0SWS_Bfx_00025List of implemented functions: Function ID[hex] Function prototype Maximum value of Bit Ln Maximum value of Bit StartPn...SWS_Bfx_0002915 14 13 12 11 10 9 - 2 1 0 1 1 1 0 1 0 0 0 1 1 1 BitStart PnSWS_Bfx_00034List of implemented functions: Function ID[hex] Function prototype Maximum value of Bit Ln Maximum value of Bit StartPn...SWS_Bfx_00036Expected functionality: *Data = *Data | MaskSWS_Bfx_00038List of implemented functions: Function ID[hex] Function prototype 0X02A void Bfx_SetBitMask_u8u8(uint8*, uint8) 0X02B void...SWS_Bfx_00040This function shall clear the data to logical status '0' as per the corresponding mask bits value when set to 1.SWS_Bfx_00045List of implemented functions: Function ID[hex] Function prototype 0x030 void Bfx_ClrBitMask_u8u8(uint8*, uint8) 0x031 void...SWS_Bfx_00047Result = TRUE, ((Data & Mask) == Mask) Result = FALSE, all other caseSWS_Bfx_00050List of implemented functions: Function ID[hex] Function prototype 0x036 boolean Bfx_TstBitMask_u8u8_u8(uint8,uint8) 0x037...SWS_Bfx_00055List of implemented functions: Function ID[hex] Function prototype 0x03A boolean Bfx_TstBitLnMask_u8u8_u8(uint8,uint8) 0x03B...SWS_Bfx_00060List of implemented functions: Function ID[hex] Function prototype 0x040 boolean Bfx_TstParityEven_u8_u8(uint8) 0x041 boolean...SWS_Bfx_00065List of implemented functions: Function ID[hex] Function prototype 0x046 void Bfx_ToggleBits_u8(uint8*) 0x047 void...SWS_Bfx_00069List of implemented functions: Function ID[hex] Function prototype 0x04A void Bfx_ToggleBitMask_u8u8(uint8*, uint8) 0x04B void...SWS_Bfx_00075List of implemented functions: Function ID[hex] Function prototype Maximum value of ShiftCnt 0X050 void...SWS_Bfx_00080List of implemented functions: Function ID[hex] Function prototype Maximum value of ShiftCnt 0X056 void...SWS_Bfx_00090List of implemented functions: Function ID[hex] Function prototype Maximum value of ShiftCnt 0X05A void...SWS_Bfx_00098List of implemented functions: Function ID[hex] Function prototype Maximum value of ShiftCnt 0X060 void...SWS_Bfx_00108List of implemented functions: Function ID[hex] Function prototype Maximum value for SourcePosition and DestinationPosition...SWS_Bfx_00112List of implemented functions: Function ID[hex] Function prototype Maximum value of Bit Ln Maximum value of Bit StartPn...SWS_Bfx_00124List of implemented functions: Function ID[hex] Function prototype 0x080 void Bfx_PutBitsMask_u8u8u8(uint8*, uint8, uint8)...SWS_Bfx_00132List of implemented functions: Function ID[hex] Function prototype Maximum value of BitPn 0x085 void Bfx_PutBit_u8u8u8(uint8*,...SWS_Bfx_00133The standardized common published parameters as required b y SRS_BSW_00402 in the General Requirements on Basic Software...SWS_Bfx_00134If the shift count is greater than or equal to zero, then shift the value in Data by the amount specified by shift count to left.SWS_Bfx_00135List of Implemented Functions: Function ID[hex] Function prototype Max Shift Left Max Shift Right 0x0F1...SWS_Bfx_00137List of implemented functions: Function ID[hex] Function prototype Maximum return value 0xF0 uint8 Bfx_CountLeadingOnes_u8...SWS_Bfx_00139List of implemented functions: Function ID[hex] Function prototype Maximum return value 0xF4 uint8 Bfx_CountLeadingSigns_s8...SWS_Bfx_00141List of implemented functions: Function ID[hex] Function prototype Maximum return value 0xF8 uint8 Bfx_CountLeadingZeros_u8...SWS_Bfx_00200Bfx library shall not require initialization phase.SWS_Bfx_00201Bfx library shall not require a shutdown operation phase.SWS_Bfx_00203Bfx API can be directly called from BSW modules or SWC.SWS_Bfx_00205Using a library should be documented.SWS_Bfx_00206The Bfx library shall be implemented in a way that the code can be shared among callers in different memory partitions.SWS_Bfx_00207Usage of macros must be avoided in the context of Library.SWS_Bfx_00208A library function shall not call any BSW module functions, e.SWS_Bfx_00209The library, written in C programming language, should confirm to the MISRA C Standard.SWS_Bfx_00212All AUTOSAR library Modules should use the AUTOSAR data types (Integers, Boolean) instead of native C data types, unless this...SWS_Bfx_00213All AUTOSAR library Modules should avoid direct use of compiler and platform specific keyword, unless this library clearly...SWS_Bfx_00214All Bit Library modules shall avoid handling user faults and values outside specified range.SWS_Bfx_00216Error detection: Function should check at runtime (both in pr o- duction and in development code) the value of input...SWS_Bfx_00217A library function can only call library functions: The functions shall not call the DET in case of error.SWS_Bfx_00220The Bfx module shall provide the following files: • C files, Bfx_.SWS_Bfx_00222Implementation & grouping of routines with respect to C files shall be done according to one of the options described below.SWS_Bfx_00223: Section 7.SWS_Bfx_00302If source code for caller and callee of Bfx_GetVersionInfo is avail- able, the Bfx library should realize Bfx_GetVersionInfo...SWS_Bfx_00314The Bfx library shall not have any configuration options that may affect the functional behavior of the routines.SWS_Bfx_00999These requirements are not applicable to this specification.SWS_Bfx_91001Module Header File Imported Type Std Std_Types.
Funktionen — Detailansicht
función Bfx_SetBit_<TypeMn>u8 [SWS_Bfx_00001] 📄 PDF
void Bfx_SetBit_<TypeMn>u8(<Type>* Data, uint8 BitPn); ⚠️
This function shall set the logical status of input data as '1' at the requested bit position.
función Bfx_ClrBit_<TypeMn>u8 [SWS_Bfx_00010] 📄 PDF
void Bfx_ClrBit_<TypeMn>u8(<Type>* Data, uint8 BitPn); ⚠️
This function shall clear the logical status of the input data to '0' at the requested bit position.
función Bfx_GetBit_<InTypeMn>u8_u8 [SWS_Bfx_00016] 📄 PDF
boolean Bfx_GetBit_<InTypeMn>u8_u8(<InType> Data, uint8 BitPn);
This function shall return the logical status of the input data for the requested bit position.
función Bfx_SetBits_<TypeMn>u8u8u8 [SWS_Bfx_00021] 📄 PDF
void Bfx_SetBits_<TypeMn>u8u8u8(<Type>* Data, uint8 BitStartPn, uint8 BitLn, uint8 Status); ⚠️
This function shall set the input data as '1' or '0' as per 'Status' value starting from 'BitStartPn' for the length 'BitLn'.
función Bfx_GetBits_<TypeMn>u8u8_<TypeMn> [SWS_Bfx_00028] 📄 PDF
<Type> Bfx_GetBits_<TypeMn>u8u8_<TypeMn>(<Type> Data, uint8 BitStartPn, uint8 BitLn); ⚠️
This function shall return the Bits of the input data starting from 'BitStartPn' for the length of 'Bit Ln'.
función Bfx_SetBitMask_<TypeMn><TypeMn> [SWS_Bfx_00035] 📄 PDF
void Bfx_SetBitMask_<TypeMn><TypeMn>(<Type>* Data, <Type> Mask); ⚠️
This function shall set the data to logical status '1' as per the corresponding Mask bits when set to value 1 and remaining bits will retain their original values.
función Bfx_ClrBitMask_<TypeMn><TypeMn> [SWS_Bfx_00039] 📄 PDF
void Bfx_ClrBitMask_<TypeMn><TypeMn>(<Type>* Data, <Type> Mask); ⚠️
This function shall clear the logical status to '0' for the input data for all the bit positions as per the mask.
función Bfx_TstBitMask_<InTypeMn><InTypeMn>_u8 [SWS_Bfx_00046] 📄 PDF
boolean Bfx_TstBitMask_<InTypeMn><InTypeMn>_u8(<InType> Data, <InType> Mask);
This function shall return TRUE, if all bits defined in Mask value are set in the input Data value. In all other cases this function shall return FALSE.
función Bfx_TstBitLnMask_<InTypeMn><InTypeMn>_u8 [SWS_Bfx_00051] 📄 PDF
boolean Bfx_TstBitLnMask_<InTypeMn><InTypeMn>_u8(<InType> Data, <InType> Mask);
This function makes a test on the input data and if at least one bit is set as per the mask, then the function shall return TRUE, otherwise it shall return FALSE.
función Bfx_TstParityEven_<InTypeMn>_u8 [SWS_Bfx_00056] 📄 PDF
boolean Bfx_TstParityEven_<InTypeMn>_u8(<InTypeMn> Data);
This function tests the number of bits set to 1. If this number is even, it shall return TRUE, otherwise it returns FALSE.
función Bfx_ToggleBits_<TypeMn> [SWS_Bfx_00061] 📄 PDF
void Bfx_ToggleBits_<TypeMn>(<Type>* Data); ⚠️
This function toggles all the bits of data (1's Complement Data).
función Bfx_ToggleBitMask_<TypeMn><TypeMn> [SWS_Bfx_00066] 📄 PDF
void Bfx_ToggleBitMask_<TypeMn><TypeMn>(<Type>* Data, <Type> Mask); ⚠️
This function toggles the bits of data when the corresponding bit of the mask is enabled and set to 1.
función Bfx_ShiftBitRt_<TypeMn>u8 [SWS_Bfx_00070] 📄 PDF
void Bfx_ShiftBitRt_<TypeMn>u8(<Type>* Data, uint8 ShiftCnt); ⚠️
This function shall shift data to the right by ShiftCnt. The most significant bit (left-most bit) is replaced by a '0' bit and the least significant bit (right-most bit) is discarded for every single bit shift cycle.
función Bfx_ShiftBitLt_<TypeMn>u8 [SWS_Bfx_00076] 📄 PDF
void Bfx_ShiftBitLt_<TypeMn>u8(<Type>* Data, uint8 ShiftCnt); ⚠️
This function shall shift data to the left by ShiftCnt. The least significant bit (right-most bit) is replaced by a '0' bit and the most significant bit (left-most bit) is discarded for every single bit shift cycle.
función Bfx_RotBitRt_<TypeMn>u8 [SWS_Bfx_00086] 📄 PDF
void Bfx_RotBitRt_<TypeMn>u8(<Type>* Data, uint8 ShiftCnt); ⚠️
This function shall rotate data to the right by ShiftCnt. The least significant bit is rotated to the most significant bit location for every single bit shift cycle.
función Bfx_RotBitLt_<TypeMn>u8 [SWS_Bfx_00095] 📄 PDF
void Bfx_RotBitLt_<TypeMn>u8(<Type>* Data, uint8 ShiftCnt); ⚠️
This function shall rotate data to the left by ShiftCnt. The most significant bit is rotated to the least significant bit location for every single bit shift cycle.
función Bfx_CopyBit_<TypeMn>u8<TypeMn>u8 [SWS_Bfx_00101] 📄 PDF
void Bfx_CopyBit_<TypeMn>u8<TypeMn>u8(<Type>* DestinationData, uint8 DestinationPosition, <Type> SourceData, uint8 SourcePosition); ⚠️
This function shall copy a bit from source data from bit position to destination data at bit position.
función Bfx_PutBits_<TypeMn>u8u8<TypeMn> [SWS_Bfx_00110] 📄 PDF
void Bfx_PutBits_<TypeMn>u8u8<TypeMn>(<Type>* Data, uint8 BitStartPn, uint8 BitLn, <Type> Pattern); ⚠️
This function shall put bits as mentioned in Pattern to the input Data from the specified bit position.
función Bfx_PutBitsMask_<TypeMn><TypeMn><TypeMn> [SWS_Bfx_00120] 📄 PDF
void Bfx_PutBitsMask_<TypeMn><TypeMn><TypeMn>(<Type>* Data, <Type> Pattern, <Type> Mask); ⚠️
This function shall put all bits defined in Pattern and for which the corresponding Mask bit is set to 1 in the input Data.
función Bfx_PutBit_<TypeMn>u8u8 [SWS_Bfx_00130] 📄 PDF
void Bfx_PutBit_<TypeMn>u8u8(<Type>* Data, uint8 BitPn, boolean Status); ⚠️
This function shall update the bit specified by BitPn of input data as '1' or '0' as per 'Status' value.
función Bfx_GetVersionInfo [SWS_Bfx_00301] 📄 PDF
void Bfx_GetVersionInfo(Std_VersionInfoType* Versioninfo);
Returns the version information of this library.
función Bfx_ShiftBitSat_<TypeMn>s8 [SWS_Bfx_91002] 📄 PDF
<Type> Bfx_ShiftBitSat_<TypeMn>s8(sint8 ShiftCnt, <Type> Data); ⚠️
Arithmetic shift with saturation
función Bfx_CountLeadingOnes_<TypeMn> [SWS_Bfx_91003] 📄 PDF
uint8 Bfx_CountLeadingOnes_<TypeMn>(<Type> Data); ⚠️
Count the number of consecutive ones in Data starting with the most significant bit and return the result.
función Bfx_CountLeadingSigns_<TypeMn> [SWS_Bfx_91004] 📄 PDF
uint8 Bfx_CountLeadingSigns_<TypeMn>(<Type> Data); ⚠️
Count the number of consecutive bits which have the same value as most significant bit in Data, starting with bit at position msb minus one. Put the result in Data. It is the number of leading sign bits minus one, giving the number of redundant sign bits in Data.
función Bfx_CountLeadingZeros_<TypeMn> [SWS_Bfx_91005] 📄 PDF
uint8 Bfx_CountLeadingZeros_<TypeMn>(<Type> Data); ⚠️
Count the number of consecutive zeros in Data starting with the most significant bit and return the result.
requirement SWS_Bfx_00002 [SWS_Bfx_00002] 📄 PDF
Expected functionality: *Data = *Data | (0x01 << BitPn) For Example: Data = 10001010b Bfx_SetBit_u8u8(&Data, 2) The Data will be updated to 10001110b
requirement SWS_Bfx_00008 [SWS_Bfx_00008] 📄 PDF
List of implemented functions Function ID[hex] Function prototype Maximum value of BitPn 0x001 void Bfx_SetBit_u8u8(uint8*, uint8) 7 0x002 void Bfx_SetBit_u16u8(uint16*, uint8) 15 0x003 void Bfx_SetBit_u32u8(uint32*, uint8) 31 0x004 void Bfx_SetBit_u64u8(uint64*, uint8) 63
requirement SWS_Bfx_00011 [SWS_Bfx_00011] 📄 PDF
Expected functionality: *Data = (*Data & ~(0x01 << BitPn)) For Example: Data = 10001010b Bfx_ClrBit_u8u8(&Data, 1) The Data will be updated to 10001000b
requirement SWS_Bfx_00015 [SWS_Bfx_00015] 📄 PDF
List of implemented functions Function ID[hex] Function prototype Maximum value of BitPn 0x006 void Bfx_ClrBit_u8u8(uint8*, uint8) 7 0x007 void Bfx_ClrBit_u16u8(uint16*, uint8) 15 0x008 void Bfx_ClrBit_u32u8(uint32*, uint8) 31 0x009 void Bfx_ClrBit_u64u8(uint64*, uint8) 63
requirement SWS_Bfx_00017 [SWS_Bfx_00017] 📄 PDF
Result = TRUE, ((Data & (0x01 << BitPn)) != 0) Result = FALSE, else For Example: Bfx_GetBit_u8u8(10001010b, 1) returns TRUE
requirement SWS_Bfx_00020 [SWS_Bfx_00020] 📄 PDF
List of implemented functions Function ID[hex] Function prototype maximum value of BitPn 0x00A boolean Bfx_GetBit_u8u8_ u8(uint8,uint8) 7 0x00B boolean Bfx_GetBit_u16u8_ u8(uint16,uint8) 15 0x00C boolean Bfx_GetBit_u32u8_ u8(uint32,uint8) 31 0x00D boolean Bfx_GetBit_u64u8_ u8(uint64,uint8) 63
requirement SWS_Bfx_00022 [SWS_Bfx_00022] 📄 PDF
15 14 13 12 11 10 9 - 2 1 0 1 1 1 0 1 0 0 0 0 0 0 <Bit Start Pn> < BitLn >
requirement SWS_Bfx_00025 [SWS_Bfx_00025] 📄 PDF
List of implemented functions: Function ID[hex] Function prototype Maximum value of Bit Ln Maximum value of Bit StartPn Maximum value for BitStartPn + BitLn 0x020 void Bfx_SetBits_ u8u8u8u8(uint8*, uint8, uint8, uint8) 8 7 8 0x021 void Bfx_SetBits_ u16u8u8u8(uint16*, uint8, uint8, uint8) 16 15 16 0x022 void Bfx_SetBits_ u32u8u8u8(uint32*, uint8, uint8, uint8) 32 31 32 0x023 void Bfx_SetBits_ u64u8u8u8(uint64*, uint8, uint8, uint8) 64 63 64
requirement SWS_Bfx_00029 [SWS_Bfx_00029] 📄 PDF
15 14 13 12 11 10 9 - 2 1 0 1 1 1 0 1 0 0 0 1 1 1 BitStart Pn < BitLn >
requirement SWS_Bfx_00034 [SWS_Bfx_00034] 📄 PDF
List of implemented functions: Function ID[hex] Function prototype Maximum value of Bit Ln Maximum value of Bit StartPn Maximum value for BitStartPn + BitLn 0x026 uint8 Bfx_GetBits_ u8u8u8_ u8(uint8,uint8,uint8) 8 7 8 0x027 uint16 Bfx_GetBits_ u16u8u8_ u16(uint16,uint8,uint8) 16 15 16 0x028 uint32 Bfx_GetBits_ u32u8u8_ u32(uint32,uint8,uint8) 32 31 32 0x029 uint64 Bfx_GetBits_ u64u8u8_ u64(uint64,uint8,uint8) 64 63 64
requirement SWS_Bfx_00036 [SWS_Bfx_00036] 📄 PDF
Expected functionality: *Data = *Data | Mask
requirement SWS_Bfx_00038 [SWS_Bfx_00038] 📄 PDF
List of implemented functions: Function ID[hex] Function prototype 0X02A void Bfx_SetBitMask_u8u8(uint8*, uint8) 0X02B void Bfx_SetBitMask_u16u16(uint16*, uint16) 0X02C void Bfx_SetBitMask_u32u32(uint32*, uint32) 0x02D void Bfx_SetBitMask_u64u64(uint64*, uint64)
requirement SWS_Bfx_00040 [SWS_Bfx_00040] 📄 PDF
This function shall clear the data to logical status '0' as per the corresponding mask bits value when set to 1. The remaining bits shall retain their original values. Expected functionality: *Data = *Data & ~Mask
requirement SWS_Bfx_00045 [SWS_Bfx_00045] 📄 PDF
List of implemented functions: Function ID[hex] Function prototype 0x030 void Bfx_ClrBitMask_u8u8(uint8*, uint8) 0x031 void Bfx_ClrBitMask_u16u16(uint16*, uint16) 0x032 void Bfx_ClrBitMask_u32u32(uint32*, uint32) 0x033 void Bfx_ClrBitMask_u64u64(uint64*, uint64)
requirement SWS_Bfx_00047 [SWS_Bfx_00047] 📄 PDF
Result = TRUE, ((Data & Mask) == Mask) Result = FALSE, all other case
requirement SWS_Bfx_00050 [SWS_Bfx_00050] 📄 PDF
List of implemented functions: Function ID[hex] Function prototype 0x036 boolean Bfx_TstBitMask_u8u8_u8(uint8,uint8) 0x037 boolean Bfx_TstBitMask_u16u16_u8(uint16,uint16) 0x038 boolean Bfx_TstBitMask_u32u32_u8(uint32,uint32) 0x039 boolean Bfx_TstBitMask_u64u64_u8(uint64,uint64)
requirement SWS_Bfx_00055 [SWS_Bfx_00055] 📄 PDF
List of implemented functions: Function ID[hex] Function prototype 0x03A boolean Bfx_TstBitLnMask_u8u8_u8(uint8,uint8) 0x03B boolean Bfx_TstBitLnMask_u16u16_u8(uint16,uint16) 0x03C boolean Bfx_TstBitLnMask_u32u32_u8(uint32,uint32) 0x03D boolean Bfx_TstBitLnMask_u64u64_u8(uint64,uint64)
requirement SWS_Bfx_00060 [SWS_Bfx_00060] 📄 PDF
List of implemented functions: Function ID[hex] Function prototype 0x040 boolean Bfx_TstParityEven_u8_u8(uint8) 0x041 boolean Bfx_TstParityEven_u16_u8(uint16) 0x042 boolean Bfx_TstParityEven_u32_u8(uint32) 0x043 boolean Bfx_TstParityEven_u64_u8(uint64)
requirement SWS_Bfx_00065 [SWS_Bfx_00065] 📄 PDF
List of implemented functions: Function ID[hex] Function prototype 0x046 void Bfx_ToggleBits_u8(uint8*) 0x047 void Bfx_ToggleBits_u16(uint16*) 0x048 void Bfx_ToggleBits_u32(uint32*) 0x049 void Bfx_ToggleBits_u64(uint64*)
requirement SWS_Bfx_00069 [SWS_Bfx_00069] 📄 PDF
List of implemented functions: Function ID[hex] Function prototype 0x04A void Bfx_ToggleBitMask_u8u8(uint8*, uint8) 0x04B void Bfx_ToggleBitMask_u16u16(uint16*, uint16) 0x04C void Bfx_ToggleBitMask_u32u32(uint32*, uint32) 0x04D void Bfx_ToggleBitMask_u64u64(uint64*, uint64)
requirement SWS_Bfx_00075 [SWS_Bfx_00075] 📄 PDF
List of implemented functions: Function ID[hex] Function prototype Maximum value of ShiftCnt 0X050 void Bfx_ShiftBitRt_u8u8(uint8*, uint8) 7 0X051 void Bfx_ShiftBitRt_u16u8(uint16*, uint8) 15 0X052 void Bfx_ShiftBitRt_u32u8(uint32*, uint8) 31 0x053 void Bfx_ShiftBitRt_u64u8(uint64*, uint8) 63
requirement SWS_Bfx_00080 [SWS_Bfx_00080] 📄 PDF
List of implemented functions: Function ID[hex] Function prototype Maximum value of ShiftCnt 0X056 void Bfx_ShiftBitLt_u8u8(uint8*, uint8) 7 0X057 void Bfx_ShiftBitLt_u16u8(uint16*, uint8) 15 0X058 void Bfx_ShiftBitLt_u32u8(uint32*, uint8) 31 0x059 void Bfx_ShiftBitLt_u64u8(uint64*, uint8) 63
requirement SWS_Bfx_00090 [SWS_Bfx_00090] 📄 PDF
List of implemented functions: Function ID[hex] Function prototype Maximum value of ShiftCnt 0X05A void Bfx_RotBitRt_u8u8(uint8*, uint8) 7 0X05B void Bfx_RotBitRt_u16u8(uint16*, uint8) 15 0X05C void Bfx_RotBitRt_u32u8(uint32*, uint8) 31 0x05D void Bfx_RotBitRt_u64u8(uint64*, uint8) 63
requirement SWS_Bfx_00098 [SWS_Bfx_00098] 📄 PDF
List of implemented functions: Function ID[hex] Function prototype Maximum value of ShiftCnt 0X060 void Bfx_RotBitLt_u8u8(uint8*, uint8) 7 0X061 void Bfx_RotBitLt_u16u8(uint16*, uint8) 15 0X062 void Bfx_RotBitLt_u32u8(uint32*, uint8) 31 0x063 void Bfx_RotBitLt_u64u8(uint64*, uint8) 63
requirement SWS_Bfx_00108 [SWS_Bfx_00108] 📄 PDF
List of implemented functions: Function ID[hex] Function prototype Maximum value for SourcePosition and DestinationPosition 0X066 void Bfx_CopyBit_u8u8u8u8(uint8*, uint8, uint8, uint8) 7 0X067 void Bfx_CopyBit_u16u8u16u8(uint16*, uint8, uint16, uint8) 15 0X068 void Bfx_CopyBit_u32u8u32u8(uint32*, uint8, uint32, uint8) 31 0x069 void Bfx_CopyBit_u64u8u64u8(uint64*, uint8, uint64, uint8) 63
requirement SWS_Bfx_00112 [SWS_Bfx_00112] 📄 PDF
List of implemented functions: Function ID[hex] Function prototype Maximum value of Bit Ln Maximum value of Bit StartPn Maximum value for BitStartPn + BitLn 0x070 void Bfx_PutBits_ u8u8u8u8(uint8*, uint8, uint8, uint8) 8 7 8 0x071 void Bfx_PutBits_ u16u8u8u16(uint16*, uint8, uint8, uint16) 16 15 16 0x072 void Bfx_PutBits_ u32u8u8u32(uint32*, uint8, uint8, uint32) 32 31 32 0x073 void Bfx_PutBits_ u64u8u8u64(uint64*, uint8, uint8, uint64) 64 63 64
requirement SWS_Bfx_00124 [SWS_Bfx_00124] 📄 PDF
List of implemented functions: Function ID[hex] Function prototype 0x080 void Bfx_PutBitsMask_u8u8u8(uint8*, uint8, uint8) 0x081 void Bfx_PutBitsMask_u16u16u16(uint16*, uint16, uint16) 0x082 void Bfx_PutBitsMask_u32u32u32(uint32*, uint32, uint32) 0x083 void Bfx_PutBitsMask_u64u64u64(uint64*, uint64, uint64)
requirement SWS_Bfx_00132 [SWS_Bfx_00132] 📄 PDF
List of implemented functions: Function ID[hex] Function prototype Maximum value of BitPn 0x085 void Bfx_PutBit_u8u8u8(uint8*, uint8, boolean) 7 0x086 void Bfx_PutBit_u16u8u8(uint16*, uint8, boolean) 15 0x087 void Bfx_PutBit_u32u8u8(uint32*, uint8, boolean) 31 0x088 void Bfx_PutBit_u64u8u8(uint64*, uint8, boolean) 63
requirement SWS_Bfx_00133 [SWS_Bfx_00133] 📄 PDF
The standardized common published parameters as required b y SRS_BSW_00402 in the General Requirements on Basic Software Modules [3] shall be published within the header file of this module and need to be provided in the BSW Module Description. The according module a b breviation can be found in the List of Basic Software Modules [1] .
requirement SWS_Bfx_00134 [SWS_Bfx_00134] 📄 PDF
If the shift count is greater than or equal to zero, then shift the value in Data by the amount specified by shift count to left. For signed data an arithmetic shift is performed. The vacated bits are filled with zeros and the result is saturated if its sign bit differs from the sign bits that are shifted out. For unsigned data a logical shift is performed. In this case the result is saturated, if the leading one bit is shifted out. If the shift count is less than zero, right-shift the value in Data by the absolute value of the shift count. The vacated bits are filled with the sign-bit (the most significant bit) and bits shifted out are discarded. Note that a shift right by the word width leaves all zeros or all ones in the result, de- pending on the sign-bit. Example of 32 bit signed integer: The range for shift count is -32 to +31, allowing a shift left up to 31 bit positions and a shift right up to 32 bit positions (a shift right by 32 bits leaves all zeros or all ones in the result, depending on the sign bit).
requirement SWS_Bfx_00135 [SWS_Bfx_00135] 📄 PDF
List of Implemented Functions: Function ID[hex] Function prototype Max Shift Left Max Shift Right 0x0F1 Bfx_ShiftBitSat_s8s8_s8 8 8 0X0F2 Bfx_ShiftBitSat_u8s8_u8 8 8 0X0F3 Bfx_ShiftBitSat_s16s8_s16 16 16 0X0F4 Bfx_ShiftBitSat_u16s8_u16 16 16 Function ID[hex] Function prototype Max Shift Left Max Shift Right 0X0F5 Bfx_ShiftBitSat_s32s8_s32 31 32 0X0F6 Bfx_ShiftBitSat_u32s8_u32 31 32 0X0F7 Bfx_ShiftBitSat_s64s8_s64 63 64 0X0F8 Bfx_ShiftBitSat_u64s8_u64 63 64
requirement SWS_Bfx_00137 [SWS_Bfx_00137] 📄 PDF
List of implemented functions: Function ID[hex] Function prototype Maximum return value 0xF0 uint8 Bfx_CountLeadingOnes_u8 (uint8) 8 0xF1 uint8 Bfx_CountLeadingOnes_u16 (uint16) 16 0xF2 uint8 Bfx_CountLeadingOnes_u32 (uint32) 32 0xF3 uint8 Bfx_CountLeadingOnes_u64 (uint64) 64
requirement SWS_Bfx_00139 [SWS_Bfx_00139] 📄 PDF
List of implemented functions: Function ID[hex] Function prototype Maximum return value 0xF4 uint8 Bfx_CountLeadingSigns_s8 (sint8) 8 0xF5 uint8 Bfx_CountLeadingSigns_s16 (sint16) 16 0xF6 uint8 Bfx_CountLeadingSigns_s32 (sint32) 32 0xF7 uint8 Bfx_CountLeadingSigns_s64 (sint64) 64
requirement SWS_Bfx_00141 [SWS_Bfx_00141] 📄 PDF
List of implemented functions: Function ID[hex] Function prototype Maximum return value 0xF8 uint8 Bfx_CountLeadingZeros_u8 (uint8) 8 0xF9 uint8 Bfx_CountLeadingZeros_u16 (uint16) 16 0xFA uint8 Bfx_CountLeadingZeros_u32 (uint32) 32 0xFB uint8 Bfx_CountLeadingZeros_u64 (uint64) 64
requirement SWS_Bfx_00200 [SWS_Bfx_00200] 📄 PDF
Bfx library shall not require initialization phase. A library function may be called at the very first step of ECU initialization, e.g. even by the OS or EcuM, thus the library shall be ready.
requirement SWS_Bfx_00201 [SWS_Bfx_00201] 📄 PDF
Bfx library shall not require a shutdown operation phase.
requirement SWS_Bfx_00203 [SWS_Bfx_00203] 📄 PDF
Bfx API can be directly called from BSW modules or SWC. No port definition is required. It is a pure function call.
requirement SWS_Bfx_00205 [SWS_Bfx_00205] 📄 PDF
Using a library should be documented. if a BSW module or a SWC uses a Library, the developer should add an Implementation-DependencyOnArtifact in the BSW/SWC template. minVersion and maxVersion parameters correspond to the supplier version. In case of AUTOSAR library, these parameters may be left empty because a SWC or BSW module may rely on library behaviour, not on a supplier implementation. However, the SWC or BSW modules shall be compatible with the AUTOSAR platform where they are integrated.
requirement SWS_Bfx_00206 [SWS_Bfx_00206] 📄 PDF
The Bfx library shall be implemented in a way that the code can be shared among callers in different memory partitions.
requirement SWS_Bfx_00207 [SWS_Bfx_00207] 📄 PDF
Usage of macros must be avoided in the context of Library. The library function must be declared as function or as inline function and Macro #define should not be used.
requirement SWS_Bfx_00208 [SWS_Bfx_00208] 📄 PDF
A library function shall not call any BSW module functions, e.g. the DET. A library function can call any other library functions since all library functions are re-entrant but not BSW module functions, as they may not be re-entrant
requirement SWS_Bfx_00209 [SWS_Bfx_00209] 📄 PDF
The library, written in C programming language, should confirm to the MISRA C Standard. Please refer to SWS_BSW_00115 for more details.
requirement SWS_Bfx_00212 [SWS_Bfx_00212] 📄 PDF
All AUTOSAR library Modules should use the AUTOSAR data types (Integers, Boolean) instead of native C data types, unless this library is clearly identified to be compliant only with a platform.
requirement SWS_Bfx_00213 [SWS_Bfx_00213] 📄 PDF
All AUTOSAR library Modules should avoid direct use of compiler and platform specific keyword, unless this library clearly identified to be compliant only with a platform.
requirement SWS_Bfx_00214 [SWS_Bfx_00214] 📄 PDF
All Bit Library modules shall avoid handling user faults and values outside specified range.
requirement SWS_Bfx_00216 [SWS_Bfx_00216] 📄 PDF
Error detection: Function should check at runtime (both in pr o- duction and in development code) the value of input parameters, e specially cases where erroneous value can bring to fatal error or unpredictable result, if they have the values allowed by the function specification. All the error cases shall be listed in SWS and the function should return a spec i fied value (in SWS) that is not configurable. This value is dependant of the function and the error case so it is determined case by case. If values passed to the library routines are not in valid range, out of boundary cond i- tion and out of the function specification, then such e rror are not detected in the l i- brary routines
requirement SWS_Bfx_00217 [SWS_Bfx_00217] 📄 PDF
A library function can only call library functions: The functions shall not call the DET in case of error.
requirement SWS_Bfx_00220 [SWS_Bfx_00220] 📄 PDF
The Bfx module shall provide the following files: • C files, Bfx_<name>.c used to implement the library. All C files shall be prefixed with 'Bfx'. Header file Bfx.h provides all public function prototypes and types defined by the BFX library specification
requirement SWS_Bfx_00222 [SWS_Bfx_00222] 📄 PDF
Implementation & grouping of routines with respect to C files shall be done according to one of the options described below.
requirement SWS_Bfx_00223 [SWS_Bfx_00223] 📄 PDF
: Section 7.1 "Error Handling" of the document "General Specifi- cation of Basic Software Modules" describes the error handling of the Basic Software in detail. Above all, it constitutes a classification scheme consisting of five error types which may occur in BSW modules.
requirement SWS_Bfx_00302 [SWS_Bfx_00302] 📄 PDF
If source code for caller and callee of Bfx_GetVersionInfo is avail- able, the Bfx library should realize Bfx_GetVersionInfo as a macro defined in the mod- ule's header file.
requirement SWS_Bfx_00314 [SWS_Bfx_00314] 📄 PDF
The Bfx library shall not have any configuration options that may affect the functional behavior of the routines. i.e. for a given set of input parameters, the outputs shall be always the same. For example, the returned value in case of error shall not be configurable.
requirement SWS_Bfx_00999 [SWS_Bfx_00999] 📄 PDF
These requirements are not applicable to this specification.
requirement SWS_Bfx_91001 [SWS_Bfx_91001] 📄 PDF
Module Header File Imported Type Std Std_Types.h Std_VersionInfoType
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/CP_MOD_Bfx- Status
- unspecified
- Version
AUTOSAR/AP/record/CP_MOD_Bfx@rel:R20-11#33174d5f- Content hash
33174d5f- Source
- https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_BFXLibrary.pdf#nameddest=SWS_Bfx_00001