Lines Matching refs:pconfig
93 static void MCAN_GetSegments(uint32_t baudRate, uint32_t tqNum, mcan_timing_config_t *pconfig);
103 static void MCAN_FDGetSegments(uint32_t baudRateFD, uint32_t tqNum, mcan_timing_config_t *pconfig);
396 static void MCAN_FDGetSegments(uint32_t baudRateFD, uint32_t tqNum, mcan_timing_config_t *pconfig) in MCAN_FDGetSegments() argument
418 pconfig->dataseg2 = (uint8_t)(tqNum - (tqNum * ideal_sp) / (uint32_t)IDEAL_SP_FACTOR - 1U); in MCAN_FDGetSegments()
420 if (pconfig->dataseg2 > MAX_DTSEG2) in MCAN_FDGetSegments()
422 pconfig->dataseg2 = MAX_DTSEG2; in MCAN_FDGetSegments()
425 seg1Temp = tqNum - pconfig->dataseg2 - 3U; in MCAN_FDGetSegments()
429 pconfig->dataseg2 = (uint8_t)(tqNum - MAX_DTSEG1 - 3U); in MCAN_FDGetSegments()
430 pconfig->dataseg1 = MAX_DTSEG1; in MCAN_FDGetSegments()
434 pconfig->dataseg1 = (uint8_t)seg1Temp; in MCAN_FDGetSegments()
438 …pconfig->datarJumpwidth = (pconfig->dataseg1 > pconfig->dataseg2) ? pconfig->dataseg2 : pconfig->d… in MCAN_FDGetSegments()
439 if (pconfig->datarJumpwidth > (uint8_t)MAX_DSJW) in MCAN_FDGetSegments()
441 pconfig->datarJumpwidth = (uint8_t)MAX_DSJW; in MCAN_FDGetSegments()
459 mcan_timing_config_t *pconfig) in MCAN_CalculateImprovedNominalTimingValues() argument
519 pconfig->preDivider = configTemp.preDivider; in MCAN_CalculateImprovedNominalTimingValues()
520 pconfig->rJumpwidth = configTemp.rJumpwidth; in MCAN_CalculateImprovedNominalTimingValues()
521 pconfig->seg1 = configTemp.seg1; in MCAN_CalculateImprovedNominalTimingValues()
522 pconfig->seg2 = configTemp.seg2; in MCAN_CalculateImprovedNominalTimingValues()
541 mcan_timing_config_t *pconfig) in MCAN_FDCalculateImprovedTimingValues() argument
557 …ile (MCAN_CalculateImprovedNominalTimingValues(baudRate, sourceClock_Hz / preDividerTemp, pconfig)) in MCAN_FDCalculateImprovedTimingValues()
559 pconfig->datapreDivider = 0U; in MCAN_FDCalculateImprovedTimingValues()
573 pconfig->datapreDivider = (uint16_t)(sourceClock_Hz / clk - 1U); in MCAN_FDCalculateImprovedTimingValues()
575 if (pconfig->datapreDivider > MAX_DBRP) in MCAN_FDCalculateImprovedTimingValues()
581 if (pconfig->datapreDivider < ((pconfig->preDivider + 1U) * preDividerTemp - 1U)) in MCAN_FDCalculateImprovedTimingValues()
585 … else if (pconfig->datapreDivider == ((pconfig->preDivider + 1U) * preDividerTemp - 1U)) in MCAN_FDCalculateImprovedTimingValues()
588 MCAN_FDGetSegments(baudRateFD, tqNum, pconfig); in MCAN_FDCalculateImprovedTimingValues()
602 pconfig->preDivider = (pconfig->preDivider + 1U) * preDividerTemp - 1U; in MCAN_FDCalculateImprovedTimingValues()
607 if ((pconfig->datapreDivider <= MAX_DBRP) && (pconfig->datapreDivider != 0U)) in MCAN_FDCalculateImprovedTimingValues()
622 if (MCAN_CalculateImprovedTimingValues(baudRate, sourceClock_Hz, pconfig)) in MCAN_FDCalculateImprovedTimingValues()
626 pconfig->datapreDivider = 0U; in MCAN_FDCalculateImprovedTimingValues()
627 pconfig->datarJumpwidth = 0U; in MCAN_FDCalculateImprovedTimingValues()
628 pconfig->dataseg1 = 0U; in MCAN_FDCalculateImprovedTimingValues()
629 pconfig->dataseg2 = 0U; in MCAN_FDCalculateImprovedTimingValues()
718 static void MCAN_GetSegments(uint32_t baudRate, uint32_t tqNum, mcan_timing_config_t *pconfig) in MCAN_GetSegments() argument
737 pconfig->seg2 = (uint8_t)(tqNum - (tqNum * ideal_sp) / (uint32_t)IDEAL_SP_FACTOR - 1U); in MCAN_GetSegments()
739 if (pconfig->seg2 > MAX_NTSEG2) in MCAN_GetSegments()
741 pconfig->seg2 = MAX_NTSEG2; in MCAN_GetSegments()
744 seg1Temp = tqNum - pconfig->seg2 - 3U; in MCAN_GetSegments()
748 pconfig->seg2 = (uint8_t)(tqNum - MAX_NTSEG1 - 3U); in MCAN_GetSegments()
749 pconfig->seg1 = MAX_NTSEG1; in MCAN_GetSegments()
753 pconfig->seg1 = (uint8_t)seg1Temp; in MCAN_GetSegments()
757 pconfig->rJumpwidth = (pconfig->seg1 > pconfig->seg2) ? pconfig->seg2 : pconfig->seg1; in MCAN_GetSegments()
758 if (pconfig->rJumpwidth > (uint8_t)MAX_NSJW) in MCAN_GetSegments()
760 pconfig->rJumpwidth = (uint8_t)MAX_NSJW; in MCAN_GetSegments()
773 …lateImprovedTimingValues(uint32_t baudRate, uint32_t sourceClock_Hz, mcan_timing_config_t *pconfig) in MCAN_CalculateImprovedTimingValues() argument
810 pconfig->preDivider = configTemp.preDivider; in MCAN_CalculateImprovedTimingValues()
811 pconfig->rJumpwidth = configTemp.rJumpwidth; in MCAN_CalculateImprovedTimingValues()
812 pconfig->seg1 = configTemp.seg1; in MCAN_CalculateImprovedTimingValues()
813 pconfig->seg2 = configTemp.seg2; in MCAN_CalculateImprovedTimingValues()