Compare commits

...
7 Commits
9 changed files with 111 additions and 102 deletions
+2 -2
View File
@@ -340,13 +340,13 @@ void L2_FrameStateUpdate(L2_INST *instPtr)
} }
break; break;
case L2_INTRA_W2_ACQ_FRAME: case L2_INTRA_W2_ACQ_FRAME:
instPtr->log.mgmtRecvCnt++; instPtr->log.w2acqRecvCnt++;
if (L2_CrcCheck(instPtr->recvPktData, if (L2_CrcCheck(instPtr->recvPktData,
W2ACQ_FRAME_CRC_DLEN, W2ACQ_FRAME_CRC_POS, W2ACQ_FRAME_CRC_DLEN, W2ACQ_FRAME_CRC_POS,
L2_CRC16_8005) == true) L2_CRC16_8005) == true)
{ {
L2_DataAvailUpdate(instPtr, true); L2_DataAvailUpdate(instPtr, true);
instPtr->log.mgmtCorrectCnt++; instPtr->log.w2acqCorrectCnt++;
} }
else else
{ {
+2 -4
View File
@@ -533,8 +533,7 @@ static int32_t Scan_BmAdvtHandler(L2_INST *instPtr)
return FAILURE; return FAILURE;
} }
DBG_WARNING("BM timeout, restart net scan from L2_SCAN_INIT_STAGE.\n"); DBG_WARNING("BM timeout, restart net scan from L2_SCAN_INIT_STAGE.\n");
scanFsmPtr->bmTimeout = 0; /* reset listen counter. */ ScanNet_Reset(scanFsmPtr);
StageUpdate(scanFsmPtr, L2_SCAN_INIT_STAGE);
} }
else else
{ {
@@ -592,8 +591,7 @@ static int32_t Scan_2WAcqHandler(L2_INST *instPtr)
if (scanFsmPtr->w2acqTimeout >= WAY2_ACQ_SLOT_MAX) if (scanFsmPtr->w2acqTimeout >= WAY2_ACQ_SLOT_MAX)
{ {
DBG_WARNING("2WAcq timeout, restart net scan from L2_SCAN_INIT_STAGE.\n"); DBG_WARNING("2WAcq timeout, restart net scan from L2_SCAN_INIT_STAGE.\n");
scanFsmPtr->w2acqTimeout = 0; // reset counter for next scan. ScanNet_Reset(scanFsmPtr);
StageUpdate(scanFsmPtr, L2_SCAN_INIT_STAGE);
} }
else else
{ {
+12 -12
View File
@@ -69,7 +69,7 @@ int SetupInterruptSystem(XScuGic *instPtr, uint32_t devId);
void PhysicalIntr_Handler(void *callBackRef); void PhysicalIntr_Handler(void *callBackRef);
void PeriodicPull_Handler(void *callBackRef); void PeriodicPull_Handler(void *callBackRef);
#ifdef _MPC_CTRL #ifdef _MPC_CTRL
void MPC_IntrHandler(void *CallBackRef); void MPC_IntrHandler(void *callBackRef);
#endif #endif
/*********************** Driver Instance Definitions **************************/ /*********************** Driver Instance Definitions **************************/
@@ -200,12 +200,12 @@ void MPC_PCIESentStart()
/** /**
* @brief Handler of mater pc contrl interrupt. * @brief Handler of mater pc contrl interrupt.
* *
* @param CallBackRef A pointer to corresponding mpcInstPtr instance. * @param callBackRef A pointer to corresponding mpcInstPtr instance.
* *
* @return None. * @return None.
* *
******************************************************************************/ ******************************************************************************/
void MPC_IntrHandler(void *CallBackRef) void MPC_IntrHandler(void *callBackRef)
{ {
MPC_MsgHandler(mpcInstPtr); MPC_MsgHandler(mpcInstPtr);
} }
@@ -215,18 +215,13 @@ void MPC_IntrHandler(void *CallBackRef)
/** /**
* @brief Handler of physical layer interrupt. * @brief Handler of physical layer interrupt.
* *
* @param CallBackRef A pointer to corresponding physical layer instance. * @param callBackRef A pointer to corresponding physical layer instance.
* *
* @return None. * @return None.
* *
******************************************************************************/ ******************************************************************************/
void PhysicalIntr_Handler(void *callBackRef) void PhysicalIntr_Handler(void *callBackRef)
{ {
uint32_t GpioConfig = XGpio_DiscreteRead(&configGpio, 2);
if (L2_isDataAvail(linkInstPtr) == true)
{
GpioConfig ^= 0x00000001;
}
Phy_UpdateState(phyInstPtr); Phy_UpdateState(phyInstPtr);
if (phyInstPtr->TOR.curr == PHY_TOR_TX) if (phyInstPtr->TOR.curr == PHY_TOR_TX)
{ {
@@ -292,7 +287,6 @@ void PhysicalIntr_Handler(void *callBackRef)
break; break;
} }
} }
XGpio_DiscreteWrite(&configGpio, 2, GpioConfig);
} }
/****************************************************************************/ /****************************************************************************/
@@ -307,7 +301,6 @@ void PhysicalIntr_Handler(void *callBackRef)
void PeriodicPull_Handler(void *callBackRef) void PeriodicPull_Handler(void *callBackRef)
{ {
int32_t Status; int32_t Status;
Status = Linklayer_Proc(linkInstPtr); Status = Linklayer_Proc(linkInstPtr);
if (Status != SUCCESS) if (Status != SUCCESS)
{ {
@@ -337,7 +330,14 @@ void PeriodicPull_Handler(void *callBackRef)
mpcRecord->frame7CntLast = mpcRecord->frame7Recv; mpcRecord->frame7CntLast = mpcRecord->frame7Recv;
mpcRecord->frame8CntLast = mpcRecord->frame8Recv; mpcRecord->frame8CntLast = mpcRecord->frame8Recv;
} }
} // PhyIntr_Handler
uint32_t GpioConfig = XGpio_DiscreteRead(&configGpio, 2);
if (L2_isDataAvail(linkInstPtr) == true)
{
GpioConfig ^= 0x00000001;
}
XGpio_DiscreteWrite(&configGpio, 2, GpioConfig);
} // PeriodicPull_Handler
/*****************************************************************************/ /*****************************************************************************/
/** /**
+6 -6
View File
@@ -666,18 +666,18 @@ double Phy_GetCoarseFreqEst(PHY_INST *instPtr)
return INFINITY; // FIXME return INFINITY; // FIXME
} }
regValue = PhyRead(instPtr, COASE_FREQEST); regValue = PhyRead(instPtr, COASE_FREQEST);
acqFreqIdx = (regValue >> COASE_FREQEST_ACQ_SHIFT) && COASE_FREQEST_ACQ_MASK; acqFreqIdx = (regValue & COASE_FREQEST_ACQ_MASK) >> COASE_FREQEST_ACQ_SHIFT;
acqFreqIdx = 80 - acqFreqIdx; syncFreqIdx = (regValue & COASE_FREQEST_SYNC_MASK) >> COASE_FREQEST_SYNC_SHIFT;
syncFreqIdx = (regValue >> COASE_FREQEST_SYNC_SHIFT) && COASE_FREQEST_SYNC_MASK;
syncFreqIdx = 8 - syncFreqIdx;
if (frameType >= L1_200KBPS_5MS_FRAME) if (frameType >= L1_200KBPS_5MS_FRAME)
{ {
freqEst = (double)acqFreqIdx * (250e3 / 4); // 1.5M Rc
freqEst = (double)(80 - acqFreqIdx) * (31.25e3 / 4);
freqEst += (double)syncFreqIdx * 1.5e6 / 64 / 128; freqEst += (double)syncFreqIdx * 1.5e6 / 64 / 128;
} }
else else
{ {
freqEst = acqFreqIdx * (250e3 / 4); // 12M Rc
freqEst = (double)(8 - acqFreqIdx) * (250e3 / 4);
freqEst += (double)syncFreqIdx * 12e6 / 64 / 128; freqEst += (double)syncFreqIdx * 12e6 / 64 / 128;
} }
+4 -4
View File
@@ -62,12 +62,12 @@
#define L1_FRAME_NONE_COMP UINT32_MAX // *10ns(Timer_L) #define L1_FRAME_NONE_COMP UINT32_MAX // *10ns(Timer_L)
#define L1_FRAME_2KBPS_20MS_COMP 1841158 // *10ns(Timer_L) #define L1_FRAME_2KBPS_20MS_COMP 1841158 // *10ns(Timer_L)
#define L1_FRAME_2KBPS_100MS_COMP 1841158 // *10ns(Timer_L) #define L1_FRAME_2KBPS_100MS_COMP 1841158 // *10ns(Timer_L)
#define L1_FRAME_10KBPS_10MS_COMP 847733 // *10ns(Timer_L) #define L1_FRAME_10KBPS_10MS_COMP 850950 // *10ns(Timer_L)
#define L1_FRAME_10KBPS_20MS_COMP 847733 // *10ns(Timer_L) #define L1_FRAME_10KBPS_20MS_COMP 850950 // *10ns(Timer_L)
#define L1_FRAME_40KBPS_20MS_COMP 110667 // *10ns(Timer_L) #define L1_FRAME_40KBPS_20MS_COMP 110667 // *10ns(Timer_L)
#define L1_FRAME_40KBPS_10MS_COMP 110667 // *10ns(Timer_L) #define L1_FRAME_40KBPS_10MS_COMP 110667 // *10ns(Timer_L)
#define L1_FRAME_200KBPS_5MS_COMP 19725 // *10ns(Timer_L) #define L1_FRAME_200KBPS_5MS_COMP 22493 // *10ns(Timer_L)
#define L1_FRAME_1M2BPS_5MS_COMP 19725 // *10ns(Timer_L) #define L1_FRAME_1M2BPS_5MS_COMP 22493 // *10ns(Timer_L)
#define PHY_TIME_WORD_H_MAX UINT32_MAX #define PHY_TIME_WORD_H_MAX UINT32_MAX
#define PHY_TIME_WORD_L_MAX 0x0007A120 // 5ms/10ns #define PHY_TIME_WORD_L_MAX 0x0007A120 // 5ms/10ns
+2 -2
View File
@@ -225,8 +225,8 @@
#define COASE_FREQEST_ACQ_SHIFT 0 #define COASE_FREQEST_ACQ_SHIFT 0
#define COASE_FREQEST_ACQ_WIDTH 8 #define COASE_FREQEST_ACQ_WIDTH 8
#define COASE_FREQEST_ACQ_MASK 0x000000FFU #define COASE_FREQEST_ACQ_MASK 0x000000FFU
#define COASE_FREQEST_SYNC_SHIFT 0 #define COASE_FREQEST_SYNC_SHIFT 8
#define COASE_FREQEST_SYNC_WIDTH 16 #define COASE_FREQEST_SYNC_WIDTH 8
#define COASE_FREQEST_SYNC_MASK 0x000FF00U #define COASE_FREQEST_SYNC_MASK 0x000FF00U
/** /**
+1 -2
View File
@@ -1,5 +1,4 @@
/*************************************************************************** /*******************************************************************************
//**
* @file util.h * @file util.h
* @brief Implementation of utility functions. * @brief Implementation of utility functions.
* @author DBogdan ([email protected]) * @author DBogdan ([email protected])
+30 -21
View File
@@ -28,56 +28,65 @@
/************************** Constant Definitions *****************************/ /************************** Constant Definitions *****************************/
/***************** Macros (Inline Functions) Definitions *********************/ /***************** Macros (Inline Functions) Definitions *********************/
#define __PRINT_BLOCK(block) do {\ #define __PRINT_BLOCK(block) \
block\ do \
} while(0) { \
block \
} while (0)
#define ASSERT(exp) ((exp) ? (void)0 : AppAssert(__FILE__, __LINE__)) #define ASSERT(exp) ((exp) ? (void)0 : AppAssert(__FILE__, __LINE__))
#define _nop_() __asm__("nop") #define _nop_() __asm__("nop")
/* Stringify */ /* Stringify */
#define STR(x) #x #define STR(x) #x
#define _814_DEBUG_LEVEL 3 // #define _814_DEBUG_LEVEL 3
#if _814_DEBUG_LEVEL > 0 #if _814_DEBUG_LEVEL > 0
#define DBG_PRINT(...) printf(__VA_ARGS__) #define DBG_PRINT(...) printf(__VA_ARGS__)
#endif #endif
#if _814_DEBUG_LEVEL >= 1 #if _814_DEBUG_LEVEL >= 1
#define DBG_ERROR(...) __PRINT_BLOCK( \ #define DBG_ERROR(...) __PRINT_BLOCK( \
printf("in"__FILE__" #%4d [error]\t",__LINE__); \ printf("in"__FILE__ \
printf(__VA_ARGS__); \ " #%4d [error]\t", \
) __LINE__); \
printf(__VA_ARGS__);)
#endif #endif
#if _814_DEBUG_LEVEL >= 2 #if _814_DEBUG_LEVEL >= 2
#define DBG_WARNING(...) __PRINT_BLOCK( \ #define DBG_WARNING(...) __PRINT_BLOCK( \
printf("[warning]\t"); \ printf("[warning]\t"); \
printf(__VA_ARGS__); \ printf(__VA_ARGS__);)
)
#endif #endif
#if _814_DEBUG_LEVEL >= 3 #if _814_DEBUG_LEVEL >= 3
#define DBG_INFO(...) __PRINT_BLOCK( \ #define DBG_INFO(...) __PRINT_BLOCK( \
printf("[Info]\t"); \ printf("[Info]\t"); \
printf(__VA_ARGS__); \ printf(__VA_ARGS__);)
)
#endif #endif
#ifndef DBG_ERROR #ifndef DBG_ERROR
#define DBG_ERROR(...) {} #define DBG_ERROR(...) \
{ \
}
#endif #endif
#ifndef DBG_WARNING #ifndef DBG_WARNING
#define DBG_WARNING(...) {} #define DBG_WARNING(...) \
{ \
}
#endif #endif
#ifndef DBG_INFO #ifndef DBG_INFO
#define DBG_INFO(...) {} #define DBG_INFO(...) \
{ \
}
#endif #endif
#ifndef DBG_PRINT #ifndef DBG_PRINT
#define DBG_PRINT(...) {} #define DBG_PRINT(...) \
{ \
}
#endif #endif
/**************************** Type Definitions *******************************/ /**************************** Type Definitions *******************************/
/************************** Variable Definitions *****************************/ /************************** Variable Definitions *****************************/
/************************** Function Prototypes ******************************/ /************************** Function Prototypes ******************************/
void AppAssert(const char * file, int line); void AppAssert(const char *file, int line);
#endif /* __COMMON_H_ */ #endif /* __COMMON_H_ */
+52 -49
View File
@@ -1,8 +1,8 @@
/***************************************************************************//** /*******************************************************************************
* @file util.h * @file util.h
* @brief Implementation of utility functions. * @brief Implementation of utility functions.
* @author DBogdan ([email protected]) * @author DBogdan ([email protected])
******************************************************************************** ********************************************************************************
* Copyright 2018(c) Analog Devices, Inc. * Copyright 2018(c) Analog Devices, Inc.
* *
* All rights reserved. * All rights reserved.
@@ -35,7 +35,7 @@
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************/ *******************************************************************************/
#ifndef _UTIL_H_ #ifndef _UTIL_H_
#define _UTIL_H_ #define _UTIL_H_
@@ -48,21 +48,21 @@
/******************************************************************************/ /******************************************************************************/
/********************** Macros and Constants Definitions **********************/ /********************** Macros and Constants Definitions **********************/
/******************************************************************************/ /******************************************************************************/
//#define __CRC_LSB // #define __CRC_LSB
#define __BITSWAP_TABLE #define __BITSWAP_TABLE
#define __CRC_LSB #define __CRC_LSB
#define CRC16_INIT 0x0000 #define CRC16_INIT 0x0000
#define CRC8_INIT 0x00 #define CRC8_INIT 0x00
#define BIT(x) (1 << (x)) #define BIT(x) (1 << (x))
#define ASSERT_BIT(x, ofst) (x | BIT(ofst)) #define ASSERT_BIT(x, ofst) (x | BIT(ofst))
#define DEASSERT_BIT(x, ofst) (x & (~BIT(ofst))) #define DEASSERT_BIT(x, ofst) (x & (~BIT(ofst)))
#define ARRAY_SIZE(x) \ #define ARRAY_SIZE(x) \
(sizeof(x) / sizeof((x)[0])) (sizeof(x) / sizeof((x)[0]))
#define DIV_ROUND_UP(x,y) \ #define DIV_ROUND_UP(x, y) \
(((x) + (y) - 1) / (y)) (((x) + (y)-1) / (y))
#define DIV_ROUND_CLOSEST(x, y) \ #define DIV_ROUND_CLOSEST(x, y) \
(((x) + (y) / 2) / (y)) (((x) + (y) / 2) / (y))
#define DIV_ROUND_CLOSEST_ULL(x, y) \ #define DIV_ROUND_CLOSEST_ULL(x, y) \
@@ -71,52 +71,56 @@
#define min(x, y) \ #define min(x, y) \
(((x) < (y)) ? (x) : (y)) (((x) < (y)) ? (x) : (y))
#define min_t(type, x, y) \ #define min_t(type, x, y) \
(type)min((type)(x), (type)(y)) (type) min((type)(x), (type)(y))
#define max(x, y) \ #define max(x, y) \
(((x) > (y)) ? (x) : (y)) (((x) > (y)) ? (x) : (y))
#define max_t(type, x, y) \ #define max_t(type, x, y) \
(type)max((type)(x), (type)(y)) (type) max((type)(x), (type)(y))
#define clamp(val, min_val, max_val) \ #define clamp(val, min_val, max_val) \
(max(min((val), (max_val)), (min_val))) (max(min((val), (max_val)), (min_val)))
#define clamp_t(type, val, min_val, max_val) \ #define clamp_t(type, val, min_val, max_val) \
(type)clamp((type)(val), (type)(min_val), (type)(max_val)) (type) clamp((type)(val), (type)(min_val), (type)(max_val))
#define swap(x, y) \ #define swap(x, y) \
{typeof(x) _tmp_ = (x); (x) = (y); (y) = _tmp_;} { \
typeof(x) _tmp_ = (x); \
(x) = (y); \
(y) = _tmp_; \
}
#define round_up(x,y) \ #define round_up(x, y) \
(((x)+(y)-1)/(y)) (((x) + (y)-1) / (y))
#define BITS_PER_LONG 32 #define BITS_PER_LONG 32
#define GENMASK(h, l) ({ \ #define GENMASK(h, l) ({ \
uint32_t t = (uint32_t)(~0UL); \ uint32_t t = (uint32_t)(~0UL); \
t = t << (BITS_PER_LONG - (h - l + 1)); \ t = t << (BITS_PER_LONG - (h - l + 1)); \
t = t >> (BITS_PER_LONG - (h + 1)); \ t = t >> (BITS_PER_LONG - (h + 1)); \
t; \ t; \
}) })
#define bswap_constant_32(x) \ #define bswap_constant_32(x) \
((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \ ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
(((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
#define bswap_constant_16(x) ((((x) & (uint16_t)0xff00) >> 8) | \ #define bswap_constant_16(x) ((((x) & (uint16_t)0xff00) >> 8) | \
(((x) & (uint16_t)0x00ff) << 8)) (((x) & (uint16_t)0x00ff) << 8))
#define bit_swap_constant_8(x) \ #define bit_swap_constant_8(x) \
((((x) & 0x80) >> 7) | \ ((((x) & 0x80) >> 7) | \
(((x) & 0x40) >> 5) | \ (((x) & 0x40) >> 5) | \
(((x) & 0x20) >> 3) | \ (((x) & 0x20) >> 3) | \
(((x) & 0x10) >> 1) | \ (((x) & 0x10) >> 1) | \
(((x) & 0x08) << 1) | \ (((x) & 0x08) << 1) | \
(((x) & 0x04) << 3) | \ (((x) & 0x04) << 3) | \
(((x) & 0x02) << 5) | \ (((x) & 0x02) << 5) | \
(((x) & 0x01) << 7)) (((x) & 0x01) << 7))
#define U16_MAX ((uint16_t)~0U) #define U16_MAX ((uint16_t)~0U)
#define S16_MAX ((int16_t)(U16_MAX>>1)) #define S16_MAX ((int16_t)(U16_MAX >> 1))
#define DIV_U64(x, y) (x / y) #define DIV_U64(x, y) (x / y)
@@ -149,8 +153,8 @@ uint32_t find_first_set_bit(uint32_t word);
uint32_t find_last_set_bit(uint32_t word); uint32_t find_last_set_bit(uint32_t word);
/* Locate the closest element in an array. */ /* Locate the closest element in an array. */
uint32_t find_closest(int32_t val, uint32_t find_closest(int32_t val,
const int32_t *array, const int32_t *array,
uint32_t size); uint32_t size);
/* Shift the value and apply the specified mask. */ /* Shift the value and apply the specified mask. */
uint32_t field_prep(uint32_t mask, uint32_t val); uint32_t field_prep(uint32_t mask, uint32_t val);
/* Get a field specified by a mask from a word. */ /* Get a field specified by a mask from a word. */
@@ -159,22 +163,22 @@ uint32_t field_get(uint32_t mask, uint32_t word);
int32_t log_base_2(uint32_t x); int32_t log_base_2(uint32_t x);
/* Find greatest common divisor of the given two numbers. */ /* Find greatest common divisor of the given two numbers. */
uint32_t greatest_common_divisor(uint32_t a, uint32_t greatest_common_divisor(uint32_t a,
uint32_t b); uint32_t b);
/* Calculate best rational approximation for a given fraction. */ /* Calculate best rational approximation for a given fraction. */
void rational_best_approximation(uint32_t given_numerator, void rational_best_approximation(uint32_t given_numerator,
uint32_t given_denominator, uint32_t given_denominator,
uint32_t max_numerator, uint32_t max_numerator,
uint32_t max_denominator, uint32_t max_denominator,
uint32_t *best_numerator, uint32_t *best_numerator,
uint32_t *best_denominator); uint32_t *best_denominator);
/* Calculate the number of set bits. */ /* Calculate the number of set bits. */
uint32_t hweight8(uint32_t word); uint32_t hweight8(uint32_t word);
/* Calculate the quotient and the remainder of an integer division. */ /* Calculate the quotient and the remainder of an integer division. */
uint64_t do_div(uint64_t* n, uint64_t do_div(uint64_t *n,
uint64_t base); uint64_t base);
/* Unsigned 64bit divide with 64bit divisor and remainder */ /* Unsigned 64bit divide with 64bit divisor and remainder */
uint64_t div64_u64_rem(uint64_t dividend, uint64_t divisor, uint64_t div64_u64_rem(uint64_t dividend, uint64_t divisor,
uint64_t *remainder); uint64_t *remainder);
/* Unsigned 64bit divide with 32bit divisor with remainder */ /* Unsigned 64bit divide with 32bit divisor with remainder */
uint64_t div_u64_rem(uint64_t dividend, uint32_t divisor, uint32_t *remainder); uint64_t div_u64_rem(uint64_t dividend, uint32_t divisor, uint32_t *remainder);
int64_t div_s64_rem(int64_t dividend, int32_t divisor, int32_t *remainder); int64_t div_s64_rem(int64_t dividend, int32_t divisor, int32_t *remainder);
@@ -186,9 +190,8 @@ int32_t str_to_int32(const char *str);
/* Converts from string to uint32_t */ /* Converts from string to uint32_t */
uint32_t srt_to_uint32(const char *str); uint32_t srt_to_uint32(const char *str);
int crc16_gen(uint8_t* buffPtr, uint32_t dataLen, uint16_t poly, uint16_t* crcVal); int crc16_gen(uint8_t *buffPtr, uint32_t dataLen, uint16_t poly, uint16_t *crcVal);
bool crc16_check(uint8_t* buffPtr, uint32_t dataLen, uint32_t crcOffset, uint16_t poly); bool crc16_check(uint8_t *buffPtr, uint32_t dataLen, uint32_t crcOffset, uint16_t poly);
int crc8_gen(uint8_t* buffPtr, uint32_t dataLen, uint16_t poly, uint8_t* crcVal); int crc8_gen(uint8_t *buffPtr, uint32_t dataLen, uint16_t poly, uint8_t *crcVal);
bool crc8_check(uint8_t* buffPtr, uint32_t dataLen, uint32_t crcOffset, uint16_t poly); bool crc8_check(uint8_t *buffPtr, uint32_t dataLen, uint32_t crcOffset, uint16_t poly);
#endif // UTIL_H_ #endif // UTIL_H_