OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [branches/] [stable_0_2_x/] [or1ksim/] [peripheral/] [16450.c] - Diff between revs 1503 and 1504

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 1503 Rev 1504
Line 375... Line 375...
/* Called when all the bits have been shifted out of the shift register */
/* Called when all the bits have been shifted out of the shift register */
void uart_char_clock(void *dat)
void uart_char_clock(void *dat)
{
{
  struct dev_16450 *uart = dat;
  struct dev_16450 *uart = dat;
 
 
  TRACE("Sending data in shift reg: 0x%02lx\n", uart->iregs.txser);
  TRACE("Sending data in shift reg: 0x%02"PRIx8"\n", uart->iregs.txser);
  /* We've sent all bits */
  /* We've sent all bits */
  send_char(uart, (uart->regs.lcr & UART_LCR_WLEN8) + 5);
  send_char(uart, (uart->regs.lcr & UART_LCR_WLEN8) + 5);
 
 
  if(!uart->istat.txbuf_full)
  if(!uart->istat.txbuf_full)
    uart->regs.lsr |= UART_LSR_TXSERE;
    uart->regs.lsr |= UART_LSR_TXSERE;
Line 417... Line 417...
  uart->iregs.txser = uart->regs.txbuf[uart->istat.txbuf_tail];
  uart->iregs.txser = uart->regs.txbuf[uart->istat.txbuf_tail];
  uart->istat.txbuf_tail = (uart->istat.txbuf_tail + 1) % uart->fifo_len;
  uart->istat.txbuf_tail = (uart->istat.txbuf_tail + 1) % uart->fifo_len;
  uart->istat.txbuf_full--;
  uart->istat.txbuf_full--;
  uart->regs.lsr &= ~UART_LSR_TXSERE;
  uart->regs.lsr &= ~UART_LSR_TXSERE;
 
 
  TRACE("Moveing head of TX fifo (fill: %i) to shift reg 0x%02lx\n",
  TRACE("Moveing head of TX fifo (fill: %i) to shift reg 0x%02"PRIx8"\n",
        uart->istat.txbuf_full, uart->iregs.txser);
        uart->istat.txbuf_full, uart->iregs.txser);
 
 
  /* Schedules a char_clock to run in the correct amount of time */
  /* Schedules a char_clock to run in the correct amount of time */
  if(!(uart->regs.lcr & UART_LCR_SBC)) {
  if(!(uart->regs.lcr & UART_LCR_SBC)) {
    SCHED_ADD(uart_char_clock, uart, uart->char_clks * UART_CLOCK_DIVIDER);
    SCHED_ADD(uart_char_clock, uart, uart->char_clks * UART_CLOCK_DIVIDER);
Line 933... Line 933...
  PRINTF("LCR  : %.2x  MCR  : %.2x\n", uart->regs.lcr, uart->regs.mcr);
  PRINTF("LCR  : %.2x  MCR  : %.2x\n", uart->regs.lcr, uart->regs.mcr);
  PRINTF("LSR  : %.2x  MSR  : %.2x\n", uart->regs.lsr, uart->regs.msr);
  PRINTF("LSR  : %.2x  MSR  : %.2x\n", uart->regs.lsr, uart->regs.msr);
  PRINTF("SCR  : %.2x\n", uart->regs.scr);
  PRINTF("SCR  : %.2x\n", uart->regs.scr);
 
 
  PRINTF("\nInternal registers (sim debug):\n");
  PRINTF("\nInternal registers (sim debug):\n");
  PRINTF("RXSER: %.2lx  TXSER: %.2lx\n", uart->iregs.rxser, uart->iregs.txser);
  PRINTF("RXSER: %.2"PRIx16"  TXSER: %.2"PRIx8"\n", uart->iregs.rxser,
 
         uart->iregs.txser);
 
 
  PRINTF("\nInternal status (sim debug):\n");
  PRINTF("\nInternal status (sim debug):\n");
  PRINTF("char_clks: %ld\n", uart->char_clks);
  PRINTF("char_clks: %ld\n", uart->char_clks);
  PRINTF("rxbuf_full: %d  txbuf_full: %d\n", uart->istat.rxbuf_full, uart->istat.txbuf_full);
  PRINTF("rxbuf_full: %d  txbuf_full: %d\n", uart->istat.rxbuf_full, uart->istat.txbuf_full);
  PRINTF("Using IRQ%i\n", uart->irq);
  PRINTF("Using IRQ%i\n", uart->irq);

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.