Intel 386 User Manual page 426

Embedded microprocessor
Table of Contents

Advertisement

Initialization routine for Synchronous Serial I/O Port.
Parameters:
Mode
MasterTxRx
BaudValue
PreScale
Returns:
None
Assumptions:
PINCFG & SIOCFG should be configured before this is called.
Prescale is only used if SIOCFG.2 is clear.
Syntax:
#define SSIO_TX_MASTR
#define SSIO_RX_MASTR
#define SSIO_TX_SLAVE
#define SSIO_RX_SLAVE
#define SSIO_TX_IE
#define SSIO_TX_ENAB
#define SSIO_RX_IE
#define SSIO_RX_ENAB
#define SSIO_BAUD_ENAB
#define SSIO_CLK_SERCLK
#define SSIO_CLK_PSCLK
(CLKPRS+2)
InitSSIO (SSIO_TX_IE| SSIO_TX_ENAB | SSIO_RX_ENAB,
SSIO_RX_MASTR | SSIO_TX_SLAVE,
SSIO_BAUD_ENAB,
SSIO_CLK_PSCLK);
Real/Protected Mode:
No changes required.
*****************************************************************************/
void InitSSIO(BYTE Mode, BYTE MasterTxRx, BYTE BaudValue, BYTE PreScale)
{
/*** Set clocking iff either TX or RX is a master ***/
if(MasterTxRx != 0)
{
/* If 0 using PSCLK, therefore set PreScale */
if((_GetEXRegByte(SIOCFG) & BIT2MSK) == 0)
_SetEXRegByte(CLKPRS, PreScale);
Enables receiver and transmitter; Enables TBE and RHBF
interrupts
Defines whether Tx and/or Rx are in Master Mode
Enables Baud-rate generator and sets Baud-rate Value
9-bit Clock prescale value
0x2
0x1
0
0
0x20
0x10
0x2
0x1
0x80
0x1
0x0
SYNCHRONOUS SERIAL I/O UNIT
// Transmit Master Mode
// Receive Master Mode
// Transmit Slave Mode
// Receive Slave Mode
// Transmit Interrupt Enable
// Transmitter Enable
// Receive Interrupt Enable
// Receiver Enable
// Enable Baud Rate Generator
// Baud Rate Clocking Source:
// SERCLK = CLK2/4
// Baud Rate Clocking Source:
// PSCLK
= (CLK2/2) /
13-27

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Intel386 exIntel386 extbIntel386 extc

Table of Contents