#include <avr/io.h>
#include <avr/interrupt.h>
#include <stdlib.h>
#include "system.h"
#include "xserial.h"
#include "task.h"
#include "cio.h"
Go to the source code of this file.
Functions | |
static void | InitXPort (xSERIAL *pS, unsigned short nTSize, unsigned short nRSize, unsigned short nPort, long nBaudRate) |
static int | ROpen (IOCB *pIOCB) |
static int | RGetC (IOCB *pIOCB) |
static int | RPutC (IOCB *pIOCB, int c) |
static int | RWrite (IOCB *pIOCB, char *b, int l) |
static int | RStatus (IOCB *pIOCB, int m) |
static unsigned short | xCalculateBaudRate (long nBR) |
int | xRInit (void) |
static void | RxIsr (xSERIAL *pI) |
static void | TxIsr (xSERIAL *pI) |
static void | TxDoneIsr (xSERIAL *pI) |
void | INT6_vect (void) |
Variables | |
static xSERIAL * | gXSerial [RS232_N_PORTS] |
static H_JVEC | RJump |
static xRREG | SAdr |
static char * | PNames [2] |
static char * | TNames [2] |
static void(* | irqfunc [3])(xSERIAL *pI) |
static void InitXPort | ( | xSERIAL * | pS, | |
unsigned short | nTSize, | |||
unsigned short | nRSize, | |||
unsigned short | nPort, | |||
long | nBaudRate | |||
) | [static] |
Definition at line 149 of file xserial.c.
References IOREC::buff, IOREC::head, malloc, IOREC::nChar, NewSemaphore(), xRREG::pIER, IOREC::pSem, xRREG::pUBRR, xSERIAL::regs, xSERIAL::Rx, SEMAPHORE_MODE_BLOCKING, IOREC::size, IOREC::tail, xSERIAL::Tx, and xCalculateBaudRate().
Referenced by ROpen().
void INT6_vect | ( | void | ) |
Definition at line 236 of file xserial.c.
References BIT, ExitInterrupt(), InterruptCount, irqfunc, xRREG::pIVR, xSERIAL::regs, RESTORE_IRQ, and SAVE_IRQ.
static int RGetC | ( | IOCB * | pIOCB | ) | [static] |
Definition at line 62 of file xserial.c.
References IOREC::buff, Disable(), Enable(), IOREC::nChar, _iocb::p, PendSemaphore(), IOREC::pSem, xSERIAL::Rx, IOREC::size, and IOREC::tail.
static int ROpen | ( | IOCB * | pIOCB | ) | [static] |
Definition at line 51 of file xserial.c.
References _iocb::devnum, InitXPort(), malloc, _iocb::p, RS232_N_PORTS, XRS232_DEF_BAUDRATE, XRS232_DEF_R_BUFF_SIZE, and XRS232_DEF_T_BUFF_SIZE.
static int RPutC | ( | IOCB * | pIOCB, | |
int | c | |||
) | [static] |
Definition at line 83 of file xserial.c.
References BIT, IOREC::buff, Disable(), Enable(), IOREC::head, IOREC::nChar, _iocb::p, xRREG::pIER, xSERIAL::regs, IOREC::size, xSERIAL::Tx, and XRS232_IER_TXMT.
static int RStatus | ( | IOCB * | pIOCB, | |
int | m | |||
) | [static] |
Definition at line 113 of file xserial.c.
References IOREC::nChar, _iocb::p, RS232_STAT_NREC, RS232_STAT_TMT, xSERIAL::Rx, and xSERIAL::Tx.
static int RWrite | ( | IOCB * | pIOCB, | |
char * | b, | |||
int | l | |||
) | [static] |
Definition at line 101 of file xserial.c.
References _iocb::p, PendSemaphore(), PostSemaphore(), IOREC::pSem, RPutC(), and xSERIAL::Tx.
static void RxIsr | ( | xSERIAL * | pI | ) | [static] |
Definition at line 193 of file xserial.c.
References BIT, IOREC::buff, IOREC::head, IOREC::nChar, PostSemaphore(), xRREG::pRSR, IOREC::pSem, xRREG::pUDR, xSERIAL::regs, xSERIAL::Rx, IOREC::size, and XRS232_RSR_FIFO_MT.
static void TxIsr | ( | xSERIAL * | pI | ) | [static] |
Definition at line 204 of file xserial.c.
References BIT, IOREC::buff, IOREC::nChar, xRREG::pIER, xRREG::pTSR, xRREG::pUDR, xSERIAL::regs, IOREC::size, IOREC::tail, xSERIAL::Tx, XRS232_IER_TXMT, and XRS232_TSR_FIFO_FULL.
static unsigned short xCalculateBaudRate | ( | long | nBR | ) | [static] |
int xRInit | ( | void | ) |