82 uint32 singleDistance = ((
uint32)&MODULE_ASCLIN1) - base;
84 uint32 index = distance / singleDistance;
127 volatile Ifx_ASCLIN_RXDATA *rxData = (
volatile Ifx_ASCLIN_RXDATA *)&asclin->RXDATA.U;
131 *data++ = (
uint16)rxData->U;
141 volatile Ifx_ASCLIN_RXDATA *rxData = (
volatile Ifx_ASCLIN_RXDATA *)&asclin->RXDATA.U;
155 volatile Ifx_ASCLIN_RXDATA *rxData = (
volatile Ifx_ASCLIN_RXDATA *)&asclin->RXDATA.U;
159 *data++ = (
uint8)rxData->U;
183 uint32 d, n, dBest = 1, nBest = 1;
188 oversampling =
__maxu(oversampling, 4);
189 samplepoint =
__maxu(samplepoint, 1);
190 fOvs = baudrate * oversampling;
194 boolean terminated =
FALSE;
196 uint32 adder_facL, adder_facH, adder_facL_min, count;
205 relError =
__absf(fOvs - f);
207 if (relError <= limit)
212 for (n = 2; ((!terminated) && ((n * d) <= 0xFFF)); n++)
221 adder_facL = (adder_facL_min * n) / nBest;
222 adder_facH = adder_facL + 1;
225 for (count = adder_facL; count <= adder_facH; count++)
227 f = (fpd * n) / (n * d + count);
228 newRelError =
__absf(fOvs - f);
230 if (relError > (newRelError))
232 relError = newRelError;
234 dBest = (n * d + count);
235 adder_facL_min = count;
239 if (relError <= limit)
246 asclin->BRG.B.DENOMINATOR = dBest;
247 asclin->BRG.B.NUMERATOR = nBest;
250 asclin->BITCON.B.OVERSAMPLING = oversampling - 1;
253 asclin->BITCON.B.SAMPLEPOINT = samplepoint;
256 asclin->BITCON.B.SM = medianFilter ? 1 : 0;
266 asclin->CSR.B.CLKSEL = clockSource;
284 volatile Ifx_ASCLIN_TXDATA *txData = (
volatile Ifx_ASCLIN_TXDATA *)&asclin->TXDATA.U;
298 volatile Ifx_ASCLIN_TXDATA *txData = (
volatile Ifx_ASCLIN_TXDATA *)&asclin->TXDATA.U;
312 volatile Ifx_ASCLIN_TXDATA *txData = (
volatile Ifx_ASCLIN_TXDATA *)&asclin->TXDATA.U;
329 asclin->KRST0.B.RST = 1;
330 asclin->KRST1.B.RST = 1;
333 while (0 == asclin->KRST0.B.RSTSTAT)
337 asclin->KRSTCLR.B.CLR = 1;