|
Software APIs
|
Go to the documentation of this file.
5 #ifndef OPENTITAN_SW_DEVICE_LIB_ARCH_DEVICE_H_
6 #define OPENTITAN_SW_DEVICE_LIB_ARCH_DEVICE_H_
126 #define CALCULATE_UART_NCO_(baudrate, peripheral_clock) \
127 (baudrate == 1500000 && peripheral_clock == 24000000) \
129 : (uint32_t)(((uint64_t)(baudrate) << (16 + 4)) / (peripheral_clock))
131 #define CALCULATE_UART_NCO(baudrate, peripheral_clock) \
132 CALCULATE_UART_NCO_(baudrate, peripheral_clock) < 0x10000 \
133 ? CALCULATE_UART_NCO_(baudrate, peripheral_clock) \
146 extern const uint32_t kUartBaud230K;
147 extern const uint32_t kUartBaud460K;
148 extern const uint32_t kUartBaud921K;
149 extern const uint32_t kUartBaud1M33;
150 extern const uint32_t kUartBaud1M50;
159 #define CALCULATE_UART_TX_FIFO_CPU_CYCLES(baud_rate_, cpu_freq_, fifo_depth_) \
160 ((cpu_freq_)*10 * (fifo_depth_) / (baud_rate_))
173 #define CALCULATE_AST_CHECK_POLL_CPU_CYCLES(cpu_freq_) \
174 ((cpu_freq_)*100 / 1000000)