Changeset beaaf49f in rtems


Ignore:
Timestamp:
Jun 23, 1998, 4:02:52 PM (22 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
ae21568c
Parents:
a5d0c7c
Message:

Added numerous comments.

Location:
c/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libchip/serial/mc68681.c

    ra5d0c7c rbeaaf49f  
    7575 */
    7676
     77/*
     78 *  mc68681_probe
     79 *
     80 *  Default probe routine which simply say the port is present.
     81 */
     82
    7783static boolean mc68681_probe(int minor)
    7884{
     
    8389  return(TRUE);
    8490}
     91
     92/*
     93 *  mc68681_baud_rate
     94 *
     95 *  This routine returns the proper ACR bit and baud rate field values
     96 *  based on the requested baud rate.  The baud rate set to be used
     97 *  must be configured by the user.
     98 */
    8599
    86100static int mc68681_baud_rate(
     
    167181}
    168182
     183/*
     184 *  mc68681_set_attributes
     185 *
     186 *  This function sets the DUART channel to reflect the requested termios
     187 *  port settings.
     188 */
     189
    169190static int mc68681_set_attributes(
    170191  int minor,
     
    248269}
    249270
     271/*
     272 *  mc68681_initialize_context
     273 *
     274 *  This function sets the default values of the per port context structure.
     275 */
     276
    250277static void mc68681_initialize_context(
    251278  int               minor,
     
    269296  pmc68681Context->ucModemCtrl = 0x00;   /* XXX */
    270297}
     298
     299/*
     300 *  mc68681_build_imr
     301 *
     302 *  This function returns the value for the interrupt mask register for this
     303 *  DUART.  Since this is a shared register, we must look at the other port
     304 *  on this chip to determine whether or not it is using interrupts.
     305 */
    271306
    272307static unsigned int mc68681_build_imr(
     
    304339  }
    305340
    306 
    307341  /*
    308342   *  Add in minor's mask
     
    319353  return mask | mate_mask;
    320354}
     355
     356/*
     357 *  mc68681_init
     358 *
     359 *  This function initializes the DUART to a quiecsent state.
     360 */
    321361
    322362static void mc68681_init(int minor)
     
    357397
    358398/*
    359  *  Initialize to 9600, 8, N, 1
     399 *  mc68681_open
     400 *
     401 *  This function opens a port for communication.
     402 *
     403 *  Default state is 9600 baud, 8 bits, No parity, and 1 stop bit.
    360404 */
    361405
     
    409453}
    410454
     455/*
     456 *  mc68681_close
     457 *
     458 *  This function shuts down the requested port.
     459 */
     460
    411461static int mc68681_close(
    412462  int      major,
     
    443493/*
    444494 *  mc68681_write_polled
     495 *
     496 *  This routine polls out the requested character.
    445497 */
    446498
     
    525577 *  mc68681_negate_RTS
    526578 */
     579
    527580static int mc68681_negate_RTS(int minor)
    528581{
     
    551604
    552605/*
    553  * These flow control routines utilise a connection from the local DTR
     606 * These flow control routines utilize a connection from the local DTR
    554607 * line to the remote CTS line
    555608 */
     
    617670 *
    618671 *  This routine is the console interrupt handler.
    619  *
    620  *  Input parameters:
    621  *    vector - vector number
    622  *
    623  *  Output parameters: NONE
    624  *
    625  *  Return values:     NONE
    626672 */
    627673
     
    714760/*
    715761 *  mc68681_flush
     762 *
     763 *  This routine waits before all output is completed before closing
     764 *  the requested port.
     765 *
     766 *  NOTE:  This is the "interrupt mode" close entry point.
    716767 */
    717768
     
    733784
    734785/*
     786 *  mc68681_enable_interrupts
     787 *
     788 *  This function initializes the hardware for this port to use interrupts.
     789 */
     790
     791static void mc68681_enable_interrupts(
     792  int minor
     793)
     794{
     795  unsigned32            pMC68681;
     796  setRegister_f         setReg;
     797
     798  pMC68681 = Console_Port_Tbl[minor].ulCtrlPort1;
     799  setReg   = Console_Port_Tbl[minor].setRegister;
     800
     801  /*
     802   *  Enable interrupts on RX and TX -- not break
     803   */
     804
     805  (*setReg)( pMC68681, MC68681_INTERRUPT_MASK_REG, mc68681_build_imr( minor ));
     806}
     807
     808/*
    735809 *  mc68681_initialize_interrupts
    736810 *
     
    739813 */
    740814
    741 static void mc68681_enable_interrupts(
    742   int minor
    743 )
    744 {
    745   unsigned32            pMC68681;
    746   setRegister_f         setReg;
    747 
    748   pMC68681 = Console_Port_Tbl[minor].ulCtrlPort1;
    749   setReg   = Console_Port_Tbl[minor].setRegister;
    750 
    751   /*
    752    *  Enable interrupts on RX and TX -- not break
    753    */
    754 
    755   (*setReg)( pMC68681, MC68681_INTERRUPT_MASK_REG, mc68681_build_imr( minor ));
    756 }
    757 
    758815static void mc68681_initialize_interrupts(int minor)
    759816{
     
    772829 *  mc68681_write_support_int
    773830 *
    774  *  Console Termios output entry point.
     831 *  Console Termios output entry point when using interrupt driven output.
    775832 */
    776833
     
    838895 *  mc68681_write_support_polled
    839896 *
    840  *  Console Termios output entry point.
     897 *  Console Termios output entry point when using polled output.
    841898 *
    842899 */
  • c/src/libchip/serial/mc68681.c

    ra5d0c7c rbeaaf49f  
    7575 */
    7676
     77/*
     78 *  mc68681_probe
     79 *
     80 *  Default probe routine which simply say the port is present.
     81 */
     82
    7783static boolean mc68681_probe(int minor)
    7884{
     
    8389  return(TRUE);
    8490}
     91
     92/*
     93 *  mc68681_baud_rate
     94 *
     95 *  This routine returns the proper ACR bit and baud rate field values
     96 *  based on the requested baud rate.  The baud rate set to be used
     97 *  must be configured by the user.
     98 */
    8599
    86100static int mc68681_baud_rate(
     
    167181}
    168182
     183/*
     184 *  mc68681_set_attributes
     185 *
     186 *  This function sets the DUART channel to reflect the requested termios
     187 *  port settings.
     188 */
     189
    169190static int mc68681_set_attributes(
    170191  int minor,
     
    248269}
    249270
     271/*
     272 *  mc68681_initialize_context
     273 *
     274 *  This function sets the default values of the per port context structure.
     275 */
     276
    250277static void mc68681_initialize_context(
    251278  int               minor,
     
    269296  pmc68681Context->ucModemCtrl = 0x00;   /* XXX */
    270297}
     298
     299/*
     300 *  mc68681_build_imr
     301 *
     302 *  This function returns the value for the interrupt mask register for this
     303 *  DUART.  Since this is a shared register, we must look at the other port
     304 *  on this chip to determine whether or not it is using interrupts.
     305 */
    271306
    272307static unsigned int mc68681_build_imr(
     
    304339  }
    305340
    306 
    307341  /*
    308342   *  Add in minor's mask
     
    319353  return mask | mate_mask;
    320354}
     355
     356/*
     357 *  mc68681_init
     358 *
     359 *  This function initializes the DUART to a quiecsent state.
     360 */
    321361
    322362static void mc68681_init(int minor)
     
    357397
    358398/*
    359  *  Initialize to 9600, 8, N, 1
     399 *  mc68681_open
     400 *
     401 *  This function opens a port for communication.
     402 *
     403 *  Default state is 9600 baud, 8 bits, No parity, and 1 stop bit.
    360404 */
    361405
     
    409453}
    410454
     455/*
     456 *  mc68681_close
     457 *
     458 *  This function shuts down the requested port.
     459 */
     460
    411461static int mc68681_close(
    412462  int      major,
     
    443493/*
    444494 *  mc68681_write_polled
     495 *
     496 *  This routine polls out the requested character.
    445497 */
    446498
     
    525577 *  mc68681_negate_RTS
    526578 */
     579
    527580static int mc68681_negate_RTS(int minor)
    528581{
     
    551604
    552605/*
    553  * These flow control routines utilise a connection from the local DTR
     606 * These flow control routines utilize a connection from the local DTR
    554607 * line to the remote CTS line
    555608 */
     
    617670 *
    618671 *  This routine is the console interrupt handler.
    619  *
    620  *  Input parameters:
    621  *    vector - vector number
    622  *
    623  *  Output parameters: NONE
    624  *
    625  *  Return values:     NONE
    626672 */
    627673
     
    714760/*
    715761 *  mc68681_flush
     762 *
     763 *  This routine waits before all output is completed before closing
     764 *  the requested port.
     765 *
     766 *  NOTE:  This is the "interrupt mode" close entry point.
    716767 */
    717768
     
    733784
    734785/*
     786 *  mc68681_enable_interrupts
     787 *
     788 *  This function initializes the hardware for this port to use interrupts.
     789 */
     790
     791static void mc68681_enable_interrupts(
     792  int minor
     793)
     794{
     795  unsigned32            pMC68681;
     796  setRegister_f         setReg;
     797
     798  pMC68681 = Console_Port_Tbl[minor].ulCtrlPort1;
     799  setReg   = Console_Port_Tbl[minor].setRegister;
     800
     801  /*
     802   *  Enable interrupts on RX and TX -- not break
     803   */
     804
     805  (*setReg)( pMC68681, MC68681_INTERRUPT_MASK_REG, mc68681_build_imr( minor ));
     806}
     807
     808/*
    735809 *  mc68681_initialize_interrupts
    736810 *
     
    739813 */
    740814
    741 static void mc68681_enable_interrupts(
    742   int minor
    743 )
    744 {
    745   unsigned32            pMC68681;
    746   setRegister_f         setReg;
    747 
    748   pMC68681 = Console_Port_Tbl[minor].ulCtrlPort1;
    749   setReg   = Console_Port_Tbl[minor].setRegister;
    750 
    751   /*
    752    *  Enable interrupts on RX and TX -- not break
    753    */
    754 
    755   (*setReg)( pMC68681, MC68681_INTERRUPT_MASK_REG, mc68681_build_imr( minor ));
    756 }
    757 
    758815static void mc68681_initialize_interrupts(int minor)
    759816{
     
    772829 *  mc68681_write_support_int
    773830 *
    774  *  Console Termios output entry point.
     831 *  Console Termios output entry point when using interrupt driven output.
    775832 */
    776833
     
    838895 *  mc68681_write_support_polled
    839896 *
    840  *  Console Termios output entry point.
     897 *  Console Termios output entry point when using polled output.
    841898 *
    842899 */
Note: See TracChangeset for help on using the changeset viewer.