This group of APIs provides access, configuration, and control of the UART Modem interface.
◆ ALT_16550_MODEM_STATUS_t
This type definition enumerates the set of UART modem status conditions as register mask values.
◆ ALT_16550_MODEM_STATUS_e
This type definition enumerates the set of UART modem status conditions as register mask values.
Enumerator |
---|
ALT_16550_MODEM_STATUS_DCD | Data Carrier Detect. This status indicates that the carrier has been detected by the modem. It corresponds to an inverted dcd_n input. DCD is unasserted when dcd_n is logic 1 and asserted when dcd_n is logic 0.
|
ALT_16550_MODEM_STATUS_RI | Ring Indicator. This status indicates that the telephone ringing signal has been redeived by the modem. It corresponds to an inverted ri_n input. RI is unasserted when ri_n is logic 1 and asserted when ri_n is logic 0.
|
ALT_16550_MODEM_STATUS_DSR | Data Set Ready. This status indicates that the modem is ready to establish communications with the UART. It corresponds to an inverted dsr_n input. DSR is unasserted when dsr_n is logic 1 and asserted when dsr_n is logic 0.
|
ALT_16550_MODEM_STATUS_CTS | Clear To Send. This status indicates the current state of the modem cts_n line. It corresponds to an inverted cts_n input. CTS is unasserted when cts_n is logic 1 and asserted when cts_n is logic 0.
|
ALT_16550_MODEM_STATUS_DDCD | Delta Data Carrier Detect. This status condition indicates that the Data Carrier Detect has changed since the last time the modem status was read. Reading the modem status clears this status. For more information about the Data Carrier Detect status, see ALT_16550_MODEM_STATUS_DCD.
|
ALT_16550_MODEM_STATUS_TERI | Trailing Edge of Ring Indicator. This status indicates that the Ring Indicator has changed from asserted to unasserted. Reading the modem status will clear this status. For more information about the Ring Indicator status, reference ALT_16550_MODEM_STATUS_RI.
|
ALT_16550_MODEM_STATUS_DDSR | Delta Data Set Ready. This status condition indicates that the Data Set Ready has changed since the last time the modem status was read. Reading the modem status will clear this status. For more information about the Data Set Ready status, see ALT_16550_MODEM_STATUS_DSR.
|
ALT_16550_MODEM_STATUS_DCTS | Delta Clear To Send. This status condition indicates that the Clear To Send has changed since the last time the modem status was read. Reading the modem status will clear this status. For more information about the Clear To Send status, see ALT_16550_MODEM_STATUS_CTS.
|
◆ alt_16550_flowcontrol_disable()
Disables automatic flow control in the UART modem.
The recommended bring down for flow control is as follows:
The receiver FIFO will still be active after these steps.
- Parameters
-
handle | The UART device handle. |
- Return values
-
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given UART device handle is invalid. |
◆ alt_16550_flowcontrol_enable()
Enables automatic flow control in the UART modem. When in this mode, the rts_n is gated with the threshold trigger condition of the receiver FIFO.
The Altera 16550 Compatible Soft IP UART may not have this option enabled.
The FIFOs must be enabled for flow control to be used.
The recommended bring up for flow control is as follows:
- Enable automatic flow control by calling alt_16550_flowcontrol_enable(). This will allow both the receiver FIFO and user RTS to control the rts_n output. Because the user RTS is not enabled, the rts_n will be inactive high.
- Enable RTS by calling alt_16550_modem_enable_rts(). This will give the receiver FIFO to have full control of the rts_n output.
- Parameters
-
handle | The UART device handle. |
- Return values
-
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given UART device handle is invalid. |
◆ alt_16550_loopback_disable()
Takes the UART out of loopback mode.
- Parameters
-
handle | The UART device handle. |
- Return values
-
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given UART device handle is invalid. |
◆ alt_16550_loopback_enable()
Puts the UART in loopback mode. This is used for diagnostic and test purposes.
The SoCFPGA UARTs does not support automatic flow control when in loopback mode.
The Altera 16550 Compatible Soft IP UART implements this in 13.0sp1 and later. Setting this has no effect with 13.0.
When in this mode, the modem control inputs (dsr_n, cts_n, ri_n, dcd_n) are disconnected and the modem control outputs (dtr_n, rts_n, out1_n, out2_n) are held inactive high externally and internally looped back to the inputs.
- Parameters
-
handle | The UART device handle. |
- Return values
-
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given UART device handle is invalid. |
◆ alt_16550_modem_disable_dtr()
Deasserts the DTR (Data Terminal Ready) output. DTR is inverted then driven out to dtr_n.
There are special considerations when the UART is in loopback mode. See alt_16550_loopback_enable() for more information.
- Parameters
-
handle | The UART device handle. |
- Return values
-
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given UART device handle is invalid. |
◆ alt_16550_modem_disable_out1()
Unasserts the OUT1 output. OUT1 is inverted then driven out to out1_n.
There are special considerations when the UART is in loopback mode. See alt_16550_loopback_enable() for more information.
- Parameters
-
handle | The UART device handle. |
- Return values
-
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given UART device handle is invalid. |
◆ alt_16550_modem_disable_out2()
Unasserts the OUT2 output. OUT2 is inverted then driven out to out2_n.
There are special considerations when the UART is in loopback mode. See alt_16550_loopback_enable() for more information.
- Parameters
-
handle | The UART device handle. |
- Return values
-
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given UART device handle is invalid. |
◆ alt_16550_modem_disable_rts()
Deaserts the RTS (Request To Send) output. RTS is inverted then driven out to rts_n.
There are special considerations when the UART is in automatic flow control mode. See alt_16550_flowcontrol_enable() for more information.
There are special considerations when the UART is in loopback mode. See alt_16550_loopback_enable() for more information.
- Parameters
-
handle | The UART device handle. |
- Return values
-
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given UART device handle is invalid. |
◆ alt_16550_modem_enable_dtr()
Asserts the DTR (Data Terminal Ready) output. DTR is inverted then driven out to dtr_n. DTR is used to inform the modem that UART is ready to establish communications.
There are special considerations when the UART is in loopback mode. See alt_16550_loopback_enable() for more information.
- Parameters
-
handle | The UART device handle. |
- Return values
-
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given UART device handle is invalid. |
◆ alt_16550_modem_enable_out1()
Asserts the OUT1 output. OUT1 is inverted then driven out to out1_n.
There are special considerations when the UART is in loopback mode. See alt_16550_loopback_enable() for more information.
- Parameters
-
handle | The UART device handle. |
- Return values
-
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given UART device handle is invalid. |
◆ alt_16550_modem_enable_out2()
Asserts the OUT2 output. OUT2 is inverted then driven out to out2_n.
There are special considerations when the UART is in loopback mode. See alt_16550_loopback_enable() for more information.
- Parameters
-
handle | The UART device handle. |
- Return values
-
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given UART device handle is invalid. |
◆ alt_16550_modem_enable_rts()
Asserts the RTS (Request To Send) output. RTS is inverted then driven out to rts_n. RTS is used to inform the modem that the UART is ready to receive data.
There are special considerations when the UART is in automatic flow control mode. See alt_16550_flowcontrol_enable() for more information.
There are special considerations when the UART is in loopback mode. See alt_16550_loopback_enable() for more information.
- Parameters
-
handle | The UART device handle. |
- Return values
-
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given UART device handle is invalid. |
◆ alt_16550_modem_status_get()
Reads the modem status from the UART.
- Parameters
-
handle | The UART device handle. |
status | [out] Pointer to an output parameter that contains the current modem status of the UART as a register mask. |
- Return values
-
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given UART device handle is invalid. |