URL
https://opencores.org/ocsvn/test_project/test_project/trunk
Show entire file |
Details |
Blame |
View Log
Rev 52 |
Rev 55 |
Line 20... |
Line 20... |
|
|
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
|
|
// $Id: $
|
// $Id: $
|
|
|
// Todo: calculate clocks_per_bit properly! At the moment it is hardcoded!!
|
|
|
|
#include <iostream>
|
#include <iostream>
|
#include <iomanip>
|
#include <iomanip>
|
#include <cmath>
|
#include <cmath>
|
|
|
#include "UartSC.h"
|
#include "UartSC.h"
|
Line 53... |
Line 51... |
UartSC::initUart (int clk_freq_hz, // Presume in NS
|
UartSC::initUart (int clk_freq_hz, // Presume in NS
|
int uart_baud
|
int uart_baud
|
)
|
)
|
{
|
{
|
// Calculate number of clocks per UART bit
|
// Calculate number of clocks per UART bit
|
// This doesn't work! Fix it...
|
clocks_per_bit = (int)(clk_freq_hz/uart_baud);
|
//clocks_per_bit = (int)(clk_freq_hz/uart_baud);
|
|
//printf("initUart: clocks_per_bit: %d\n", clocks_per_bit);
|
|
|
|
// debug: hardset for now
|
|
clocks_per_bit= 208;
|
|
|
|
}
|
}
|
|
|
|
|
// Maybe do this with threads instead?!
|
// Maybe do this with threads instead?!
|
void
|
void
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.