Home
last modified time | relevance | path

Searched refs:u32Div (Results 1 – 9 of 9) sorted by relevance

/trusted-firmware-m-3.4.0/platform/ext/target/nuvoton/common/bsp/StdDriver/src/
Dscuart.c50 uint32_t u32ClkSrc = 0, u32Num = 0, u32ClkFreq = __HIRC, u32Div = 0; in SCUART_GetClock() local
57 u32Div = CLK_GetModuleClockDivider(SC0_MODULE); in SCUART_GetClock()
63 u32Div = CLK_GetModuleClockDivider(SC1_MODULE); in SCUART_GetClock()
69 u32Div = CLK_GetModuleClockDivider(SC2_MODULE); in SCUART_GetClock()
103 u32ClkFreq /= (u32Div + 1UL); in SCUART_GetClock()
130 uint32_t u32ClkFreq = SCUART_GetClock(sc), u32Div; in SCUART_Open() local
133 u32Div = (u32ClkFreq + (u32Baudrate >> 1) - 1UL) / u32Baudrate - 1UL; in SCUART_Open()
137 sc->ETUCTL = u32Div; in SCUART_Open()
139 return (u32ClkFreq / (u32Div + 1UL)); in SCUART_Open()
201 uint32_t u32ClkFreq = SCUART_GetClock(sc), u32Div; in SCUART_SetLineConfig() local
[all …]
Dusci_uart.c331 uint32_t u32Div; in UUART_Open() local
344 u32Div = u32PCLKFreq / u32baudrate; in UUART_Open()
345 u32Tmp = (u32PCLKFreq / u32Div) - u32baudrate; in UUART_Open()
346 u32Tmp2 = u32baudrate - (u32PCLKFreq / (u32Div + 1ul)); in UUART_Open()
348 if(u32Tmp >= u32Tmp2) u32Div = u32Div + 1ul; in UUART_Open()
350 if(u32Div >= 65536ul) in UUART_Open()
365 if(u32Div <= (u32Tmp * u32PDSCnt)) break; in UUART_Open()
370 u32Div = u32Div / u32PDSCnt; in UUART_Open()
381 u32ClkDiv = u32Div / u32DSCnt; in UUART_Open()
386 u32Tmp = u32Div - (u32ClkDiv * u32DSCnt); in UUART_Open()
[all …]
Di2c.c41 uint32_t u32Div; in I2C_Open() local
53u32Div = (uint32_t)(((u32Pclk * 10u) / (u32BusClock * 4u) + 5u) / 10u - 1u); /* Compute proper div… in I2C_Open()
54 i2c->CLKDIV = u32Div; in I2C_Open()
59 return (u32Pclk / ((u32Div + 1u) << 2u)); in I2C_Open()
200 uint32_t u32Div; in I2C_SetBusClockFreq() local
212u32Div = (uint32_t)(((u32Pclk * 10u) / (u32BusClock * 4u) + 5u) / 10u - 1u); /* Compute proper div… in I2C_SetBusClockFreq()
213 i2c->CLKDIV = u32Div; in I2C_SetBusClockFreq()
215 return (u32Pclk / ((u32Div + 1u) << 2u)); in I2C_SetBusClockFreq()
557 uint32_t u32Div, u32HclkKHz; in I2C_SMBusIdleTimeout() local
561 u32Div = (((u32Us * u32HclkKHz) / 1000U) >> 2U) - 1U; in I2C_SMBusIdleTimeout()
[all …]
Dsc.c362 uint32_t u32ClkSrc = 0, u32Num = 0, u32ClkFreq = __HIRC, u32Div = 0; in SC_GetInterfaceClock() local
369 u32Div = CLK_GetModuleClockDivider(SC0_MODULE); in SC_GetInterfaceClock()
375 u32Div = CLK_GetModuleClockDivider(SC1_MODULE); in SC_GetInterfaceClock()
381 u32Div = CLK_GetModuleClockDivider(SC2_MODULE); in SC_GetInterfaceClock()
415 u32ClkFreq /= (u32Div + 1UL) * 1000UL; in SC_GetInterfaceClock()
Dspi.c54 uint32_t u32ClkSrc = 0UL, u32Div, u32HCLKFreq, u32PCLK0Freq, u32PCLK1Freq, u32RetValue = 0UL; in SPI_Open() local
204u32Div = (((u32ClkSrc * 10UL) / u32BusClock + 5UL) / 10UL) - 1UL; /* Round to the nearest integer … in SPI_Open()
205 if(u32Div > 0x1FFUL) in SPI_Open()
207 u32Div = 0x1FFUL; in SPI_Open()
214 … spi->CLKDIV = (spi->CLKDIV & (~SPI_CLKDIV_DIVIDER_Msk)) | (u32Div << SPI_CLKDIV_DIVIDER_Pos); in SPI_Open()
216 u32RetValue = (u32ClkSrc / (u32Div + 1UL)); in SPI_Open()
420 uint32_t u32Div, u32RetValue; in SPI_SetBusClock() local
550u32Div = (((u32ClkSrc * 10UL) / u32BusClock + 5UL) / 10UL) - 1UL; /* Round to the nearest integer … in SPI_SetBusClock()
551 if(u32Div > 0x1FFUL) in SPI_SetBusClock()
553 u32Div = 0x1FFUL; in SPI_SetBusClock()
[all …]
/trusted-firmware-m-3.4.0/platform/ext/target/nuvoton/m2354/bsp/Library/StdDriver/src/
Dqspi.c52 uint32_t u32ClkSrc = 0UL, u32Div, u32HCLKFreq, u32PCLK0Freq, u32RetValue = 0UL; in QSPI_Open() local
128u32Div = (((u32ClkSrc * 10UL) / u32BusClock + 5UL) / 10UL) - 1UL; /* Round to the nearest integer … in QSPI_Open()
129 if(u32Div > 0x1FFUL) in QSPI_Open()
131 u32Div = 0x1FFUL; in QSPI_Open()
138 … qspi->CLKDIV = (qspi->CLKDIV & (~QSPI_CLKDIV_DIVIDER_Msk)) | (u32Div << QSPI_CLKDIV_DIVIDER_Pos); in QSPI_Open()
140 u32RetValue = (u32ClkSrc / (u32Div + 1UL)); in QSPI_Open()
269 uint32_t u32Div, u32RetValue; in QSPI_SetBusClock() local
330u32Div = (((u32ClkSrc * 10UL) / u32BusClock + 5UL) / 10UL) - 1UL; /* Round to the nearest integer … in QSPI_SetBusClock()
331 if(u32Div > 0x1FFUL) in QSPI_SetBusClock()
333 u32Div = 0x1FFUL; in QSPI_SetBusClock()
[all …]
Dclk.c603 uint32_t u32Sel = 0UL, u32Div = 0UL; in CLK_SetModuleClock() local
629 u32Div = (uint32_t)&CLK->CLKDIV0 + (au32DivTbl[MODULE_CLKDIV(u32ModuleIdx)]); in CLK_SetModuleClock()
631 …M32(u32Div) = (M32(u32Div) & (~(MODULE_CLKDIV_Msk(u32ModuleIdx) << MODULE_CLKDIV_Pos(u32ModuleIdx)… in CLK_SetModuleClock()
/trusted-firmware-m-3.4.0/platform/ext/target/nuvoton/m2351/bsp/Library/StdDriver/src/
Dqspi.c52 uint32_t u32ClkSrc = 0UL, u32Div, u32HCLKFreq, u32PCLK0Freq, u32RetValue = 0UL; in QSPI_Open() local
128u32Div = (((u32ClkSrc * 10UL) / u32BusClock + 5UL) / 10UL) - 1UL; /* Round to the nearest integer … in QSPI_Open()
129 if(u32Div > 0x1FFUL) in QSPI_Open()
131 u32Div = 0x1FFUL; in QSPI_Open()
138 … qspi->CLKDIV = (qspi->CLKDIV & (~QSPI_CLKDIV_DIVIDER_Msk)) | (u32Div << QSPI_CLKDIV_DIVIDER_Pos); in QSPI_Open()
140 u32RetValue = (u32ClkSrc / (u32Div + 1UL)); in QSPI_Open()
269 uint32_t u32Div, u32RetValue; in QSPI_SetBusClock() local
330u32Div = (((u32ClkSrc * 10UL) / u32BusClock + 5UL) / 10UL) - 1UL; /* Round to the nearest integer … in QSPI_SetBusClock()
331 if(u32Div > 0x1FFUL) in QSPI_SetBusClock()
333 u32Div = 0x1FFUL; in QSPI_SetBusClock()
[all …]
Dclk.c543 uint32_t u32Sel = 0UL, u32Div = 0UL; in CLK_SetModuleClock() local
550 u32Div = (uint32_t)&CLK->CLKDIV0 + (au32DivTbl[MODULE_CLKDIV(u32ModuleIdx)]); in CLK_SetModuleClock()
552 …M32(u32Div) = (M32(u32Div) & (~(MODULE_CLKDIV_Msk(u32ModuleIdx) << MODULE_CLKDIV_Pos(u32ModuleIdx)… in CLK_SetModuleClock()