85 uint32 singleDistance = ((
uint32)&MODULE_ASCLIN1) - base;
87 uint32 index = distance / singleDistance;
130 volatile Ifx_ASCLIN_RXDATA *rxData = (
volatile Ifx_ASCLIN_RXDATA *)&asclin->RXDATA.U;
134 *data++ = (
uint16)rxData->U;
144 volatile Ifx_ASCLIN_RXDATA *rxData = (
volatile Ifx_ASCLIN_RXDATA *)&asclin->RXDATA.U;
158 volatile Ifx_ASCLIN_RXDATA *rxData = (
volatile Ifx_ASCLIN_RXDATA *)&asclin->RXDATA.U;
162 *data++ = (
uint8)rxData->U;
186 uint32 d, n, dBest = 1, nBest = 1;
191 oversampling =
__maxu(oversampling, 4);
192 samplepoint =
__maxu(samplepoint, 1);
193 fOvs = baudrate * oversampling;
197 boolean terminated =
FALSE;
199 uint32 adder_facL, adder_facH, adder_facL_min, count;
208 relError =
__absf(fOvs - f);
210 if (relError <= limit)
215 for (n = 2; ((!terminated) && ((n * d) <= 0xFFF)); n++)
224 adder_facL = (adder_facL_min * n) / nBest;
225 adder_facH = adder_facL + 1;
228 for (count = adder_facL; count <= adder_facH; count++)
230 f = (fpd * n) / (n * d + count);
231 newRelError =
__absf(fOvs - f);
233 if (relError > (newRelError))
235 relError = newRelError;
237 dBest = (n * d + count);
238 adder_facL_min = count;
242 if (relError <= limit)
249 asclin->BRG.B.DENOMINATOR = dBest;
250 asclin->BRG.B.NUMERATOR = nBest;
253 asclin->BITCON.B.OVERSAMPLING = oversampling - 1;
256 asclin->BITCON.B.SAMPLEPOINT = samplepoint;
259 asclin->BITCON.B.SM = medianFilter ? 1 : 0;
269 asclin->CSR.B.CLKSEL = clockSource;
287 volatile Ifx_ASCLIN_TXDATA *txData = (
volatile Ifx_ASCLIN_TXDATA *)&asclin->TXDATA.U;
301 volatile Ifx_ASCLIN_TXDATA *txData = (
volatile Ifx_ASCLIN_TXDATA *)&asclin->TXDATA.U;
315 volatile Ifx_ASCLIN_TXDATA *txData = (
volatile Ifx_ASCLIN_TXDATA *)&asclin->TXDATA.U;
332 asclin->KRST0.B.RST = 1;
333 asclin->KRST1.B.RST = 1;
336 while (0 == asclin->KRST0.B.RSTSTAT)
340 asclin->KRSTCLR.B.CLR = 1;