RTEMS 6.1-rc2
Loading...
Searching...
No Matches
Typedefs | Enumerations | Functions

Typedefs

typedef enum ALT_16550_MODEM_STATUS_e ALT_16550_MODEM_STATUS_t
 

Enumerations

enum  ALT_16550_MODEM_STATUS_e {
  ALT_16550_MODEM_STATUS_DCD = 1 << 7 , ALT_16550_MODEM_STATUS_RI = 1 << 6 , ALT_16550_MODEM_STATUS_DSR = 1 << 5 , ALT_16550_MODEM_STATUS_CTS = 1 << 4 ,
  ALT_16550_MODEM_STATUS_DDCD = 1 << 3 , ALT_16550_MODEM_STATUS_TERI = 1 << 2 , ALT_16550_MODEM_STATUS_DDSR = 1 << 1 , ALT_16550_MODEM_STATUS_DCTS = 1 << 0
}
 

Functions

ALT_STATUS_CODE alt_16550_flowcontrol_enable (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_flowcontrol_disable (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_loopback_enable (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_loopback_disable (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_modem_enable_out1 (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_modem_disable_out1 (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_modem_enable_out2 (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_modem_disable_out2 (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_modem_enable_rts (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_modem_disable_rts (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_modem_enable_dtr (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_modem_disable_dtr (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_modem_status_get (ALT_16550_HANDLE_t *handle, uint32_t *status)
 

Detailed Description

This group of APIs provides access, configuration, and control of the UART Modem interface.

Typedef Documentation

◆ ALT_16550_MODEM_STATUS_t

This type definition enumerates the set of UART modem status conditions as register mask values.

Enumeration Type Documentation

◆ 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.

Function Documentation

◆ alt_16550_flowcontrol_disable()

ALT_STATUS_CODE alt_16550_flowcontrol_disable ( ALT_16550_HANDLE_t handle)

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
handleThe UART device handle.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given UART device handle is invalid.

◆ alt_16550_flowcontrol_enable()

ALT_STATUS_CODE alt_16550_flowcontrol_enable ( ALT_16550_HANDLE_t handle)

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
handleThe UART device handle.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given UART device handle is invalid.

◆ alt_16550_loopback_disable()

ALT_STATUS_CODE alt_16550_loopback_disable ( ALT_16550_HANDLE_t handle)

Takes the UART out of loopback mode.

Parameters
handleThe UART device handle.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given UART device handle is invalid.

◆ alt_16550_loopback_enable()

ALT_STATUS_CODE alt_16550_loopback_enable ( ALT_16550_HANDLE_t handle)

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
handleThe UART device handle.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given UART device handle is invalid.

◆ alt_16550_modem_disable_dtr()

ALT_STATUS_CODE alt_16550_modem_disable_dtr ( ALT_16550_HANDLE_t handle)

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
handleThe UART device handle.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given UART device handle is invalid.

◆ alt_16550_modem_disable_out1()

ALT_STATUS_CODE alt_16550_modem_disable_out1 ( ALT_16550_HANDLE_t handle)

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
handleThe UART device handle.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given UART device handle is invalid.

◆ alt_16550_modem_disable_out2()

ALT_STATUS_CODE alt_16550_modem_disable_out2 ( ALT_16550_HANDLE_t handle)

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
handleThe UART device handle.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given UART device handle is invalid.

◆ alt_16550_modem_disable_rts()

ALT_STATUS_CODE alt_16550_modem_disable_rts ( ALT_16550_HANDLE_t handle)

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
handleThe UART device handle.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given UART device handle is invalid.

◆ alt_16550_modem_enable_dtr()

ALT_STATUS_CODE alt_16550_modem_enable_dtr ( ALT_16550_HANDLE_t handle)

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
handleThe UART device handle.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given UART device handle is invalid.

◆ alt_16550_modem_enable_out1()

ALT_STATUS_CODE alt_16550_modem_enable_out1 ( ALT_16550_HANDLE_t handle)

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
handleThe UART device handle.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given UART device handle is invalid.

◆ alt_16550_modem_enable_out2()

ALT_STATUS_CODE alt_16550_modem_enable_out2 ( ALT_16550_HANDLE_t handle)

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
handleThe UART device handle.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given UART device handle is invalid.

◆ alt_16550_modem_enable_rts()

ALT_STATUS_CODE alt_16550_modem_enable_rts ( ALT_16550_HANDLE_t handle)

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
handleThe UART device handle.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given UART device handle is invalid.

◆ alt_16550_modem_status_get()

ALT_STATUS_CODE alt_16550_modem_status_get ( ALT_16550_HANDLE_t handle,
uint32_t *  status 
)

Reads the modem status from the UART.

Parameters
handleThe 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_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given UART device handle is invalid.