Main Page   Hardware Class Hierarchy   Hardware API     Mapping Class Hierarchy  Mapping API 

oUART Class Reference

A class implementing a Univeral Asyncronous Receiver Transmitter via the UART TPU function. More...

#include <ouart.h>

Inheritance diagram for oUART:

OOMRM oTPU oEB500

Public Member Functions

void init (IOLINE channel, UART_MODE mode, int dsize, PARITY_TYPE parity, int BAUD_RATE)
 Init specifying channel on TPU port, mode of transmission, parity, and baud rate.

void priority (PRIORITY p)
 Sets TPU priority. Ref TPU Channel Utilization)
PRIORITY: Priority of channel.


bool havebyte ()
 Returns true if a byte was received;
bool: Return true if data in internal buffer; otherwise false.


word inbyte (void)
 returns the last unreturned data word

void outbyte (word txbyte)
 puts character out.

int sendingbyte (void)
 Whether module is still sending a byte or not.

int send (const char *const buf, int nbytes)
 Write a string of characters.

void buffer (volatile word *inbuffer, uint16 ilen)
 Provide a working buffer for the UART channel.

bool active (uint8 r=FALSE)
 Used to determine stale information.

void dump (void)
 Reset receiving counter after syncronizing messages.

uint16 byte_count (void)
 Returns number of bytes in signal buffer.

void baud_rate (int dsize, PARITY_TYPE parity, int BAUD_RATE)
 Allows reconfiguring of baud rate...basically reinitiales the channel.


Static Public Member Functions

int TCR1 (void)
void TMCR (int iarb)
bool HSQR (int chan, int val)
 Configures the host sequence register.

bool HSRR (int chan, int val)
 Configures the host sequence request register.

bool CPR (int chan, int val)
 Configures the channel priority register (Ref. TPU Channel Utilization).

bool CIER (int chan, int cie)
 Configures the channel interrupt enable register.

int CISR (int chan)
 Returns the channel interrupt status register.

void CISR_clear (int chan)
 Clears the channel interrupt status register for the channel.

bool TICR (int cirl, int cibv)
 Configures the TPU interrupt configuration register.

int tpu_vector (IOLINE channel)
 Given a channel, returns the vector number to use for an interrupt.


Detailed Description

A class implementing a Univeral Asyncronous Receiver Transmitter via the UART TPU function.

Implements single channel receiver or transmitter. If you need both, then simply declare a seperate receiver and trasmitter. Usually will be attached to same device, but the UART function doesn't care one way or the other. Modified for 16 channels of UART.

Note:
Only receive is implemented. Furthermore, if you need more than one channel, it must be expanded to support multiple channels.
Remarks
Interesting, Look at the TPU Reference Manual Table on A-3 has HSRR for UART 0=No Host Service 1=Not Used 2=Receive 3=Transmit But A-38, A-39 has Host Service Bits 0=Not Used 1=Not Used 2=Transmit 3=Receive Very Interestingly, The Asyncronous Serial Interface TPU Function tpup07r1.pdf (page 7) has: 0=Not Used 1=Not Used 2=Transmit 3=Receive But if you look at the sample code for receiver, setting the HSRR (page 8 and Assembly code on 11) 2=receive, 3=transmit.


Member Function Documentation

bool CIER int  chan,
int  cie
[static, inherited]
 

Configures the channel interrupt enable register.

Parameters:
int: channel
int: 1 enables; 0 disables

bool CPR int  chan,
int  val
[static, inherited]
 

Configures the channel priority register (Ref. TPU Channel Utilization).

Parameters:
int: channel
int: priority

bool havebyte  ) 
 

Returns true if a byte was received;
bool: Return true if data in internal buffer; otherwise false.

bool HSQR int  chan,
int  val
[static, inherited]
 

Configures the host sequence register.

Parameters:
int: channel
int dependent upon function (CFSR) selected

bool HSRR int  chan,
int  val
[static, inherited]
 

Configures the host sequence request register.

Parameters:
int: channel
int: dependend upon function

int TCR1 void   )  [static, inherited]
 

misnomer--should be TCR1 divisor--return number of clocks (PSCK,TCR1P modifications) Globally available object. Can be used in combination with TPU_REGISTER definition to say TPU_REGISTER->CFSR.BITS...

void TMCR int  iarb  )  [static, inherited]
 

was tpu_init Configures the channel function select register


The documentation for this class was generated from the following file:
Generated on Mon Oct 8 19:32:45 2007 for OOMRM Hardware API by doxygen1.3