| BlueNRG-1 Peripherals drivers APIs

- Main Page
- Modules
- Classes
- Files

Functions
Public Functions
BLUENRG1 Peripheral Driver » UART Peripheral

## Functions

void | UART_Cmd (FunctionalState NewState)
| Enables or disables the UART peripheral. More...
void | UART_DeInit (void)
| Deinitializes the UART peripheral registers to their default reset values. More...
void | UART_Init (UART_InitType *UART_InitStruct)
| Initializes the UART peripheral according to the specified parameters in the UART_InitStruct. More...
void | UART_StructInit (UART_InitType *UART_InitStruct)
| Fills each UART_InitStruct member with its default value. More...
void | UART_ITConfig (uint16_t UART_IT, FunctionalState NewState)
| Enables or disables the specified UART interrupts. More...
void | UART_SendData (uint16_t Data)
| Transmits single data through the UART peripheral. More...
uint16_t | UART_ReceiveData (void)
| Returns the most recent received data by the UART peripheral. More...
void | UART_BreakCmd (FunctionalState NewState)
| Enables or disables the break command. More...
void | UART_RequestToSendCmd (FunctionalState NewState)
| Enables or disables the request to send command. More...
FlagStatus | UART_GetFlagStatus (uint32_t UART_FLAG)
| Checks whether the specified UART flag is set or not. More...
void | UART_ClearFlag (uint32_t UART_FLAG)
| Clears the UART pending flags. More...
ITStatus | UART_GetITStatus (uint16_t UART_IT)
| Checks whether the specified UART interrupt has occurred or not. More...
void | UART_ClearITPendingBit (uint16_t UART_IT)
| Clears the UART interrupt pending bits. More...
void | UART_TxFifoIrqLevelConfig (uint8_t UART_TxFifo_Level)
| Sets the UART interrupt FIFO level. More...
void | UART_RxFifoIrqLevelConfig (uint8_t UART_RxFifo_Level)
| Sets the UART interrupt FIFO level. More...
void | UART_TimeoutConfig (uint32_t UART_Timeout)
| UART timeout value for the interrupt. The receive timeout interrupt is asserted when the RX FIFO is not empty and no further data is received over a programmed timeout period. More...
void | UART_DMACmd (uint8_t UART_DMAReq, FunctionalState NewState)
| Enables or disables the UART DMA interface. More...
void | UART_SwFlowControl (FunctionalState NewState)
| Enables or disables the UART software flow control. More...
void | UART_RxSwFlowControlMode (uint8_t UART_RxSwFlowCtrlMode)
| Sets the UART flow control mode for reception. More...
void | UART_TxSwFlowControlMode (uint8_t UART_TxSwFlowCtrlMode)
| Sets the UART flow control mode for transmission. More...
void | UART_XonAnyBit (FunctionalState NewState)
| Enables or disables the UART XON any bit. More...
void | UART_SpecialCharDetect (FunctionalState NewState)
| Enables or disables the UART special character detection. More...
void | UART_Xon1Char (uint8_t UART_XonChar)
| Sets the UART flow control mode for transmission. More...
void | UART_Xon2Char (uint8_t UART_XonChar)
| Sets the UART flow control mode for transmission. More...
void | UART_Xoff1Char (uint8_t UART_XoffChar)
| Sets the UART flow control mode for transmission. More...
void | UART_Xoff2Char (uint8_t UART_XoffChar)
| Sets the UART flow control mode for transmission. More...

## Detailed Description

## Function Documentation

void UART_BreakCmd | ( | FunctionalState | NewState | ) |

Enables or disables the break command.

Parameters

  NewState | functional state FunctionalState This parameter can be: ENABLE or DISABLE.

Return values

  None |

Definition at line 288 of file BlueNRG1_uart.c.

void UART_ClearFlag | ( | uint32_t | UART_FLAG | ) |

Clears the UART pending flags.

Parameters

  UART_FLAG | specifies the flag to clear. This parameter can be any combination of the following values:
  - UART_FLAG_FE: Framing error
  - UART_FLAG_PE: Parity error
  - UART_FLAG_BE: Break error
  - UART_FLAG_OE: Overrun error

Return values

  None |

Definition at line 362 of file BlueNRG1_uart.c.

void UART_ClearITPendingBit | ( | uint16_t | UART_IT | ) |

Clears the UART interrupt pending bits.

Parameters

  UART_IT | specifies the interrupt pending bit to clear. This parameter can be any combination of the following values:
  - UART_IT_TXFE: Tx FIFO empty interrupt
  - UART_IT_XO: XOFF interrupt
  - UART_IT_OE: Overrun error interrupt
  - UART_IT_BE: Break error interrupt
  - UART_IT_PE: Parity error interrupt
  - UART_IT_FE: Framing error interrupt
  - UART_IT_RT: Receive timeout interrupt
  - UART_IT_TX: Transmit interrupt
  - UART_IT_RX: Receive interrupt
  - UART_IT_CTS: CTS interrupt

Return values

  None |

Definition at line 417 of file BlueNRG1_uart.c.

void UART_Cmd | ( | FunctionalState | NewState | ) |

Enables or disables the UART peripheral.

Parameters

  NewState | functional state FunctionalState This parameter can be: ENABLE or DISABLE.

Return values

  None |

Definition at line 85 of file BlueNRG1_uart.c.

void UART_DeInit | ( | void |  | ) |

Deinitializes the UART peripheral registers to their default reset values.

Parameters

  None |

Return values

  None |

Definition at line 107 of file BlueNRG1_uart.c.

void UART_DMACmd | ( | uint8_t | UART_DMAReq,
|  | FunctionalState | NewState
| ) |  |

Enables or disables the UART DMA interface.

Parameters

  UART_DMAReq | specifies the DMA request. This parameter can be any combination of the following values:
  - UART_DMAReq_Tx: UART DMA transmit request.
  - UART_DMAReq_Rx: UART DMA receive request.
  NewState | functional state FunctionalState This parameter can be: ENABLE or DISABLE.

Return values

  None |

Definition at line 495 of file BlueNRG1_uart.c.

FlagStatus UART_GetFlagStatus | ( | uint32_t | UART_FLAG | ) |

Checks whether the specified UART flag is set or not.

Parameters

  UART_FLAG | specifies the flag to check. This parameter can be one of the following values:
  - UART_FLAG_CTS: Clear to send
  - UART_FLAG_BUSY: UART busy
  - UART_FLAG_RXFE: Receive FIFO empty
  - UART_FLAG_TXFF: Transmit FIFO full
  - UART_FLAG_RXFF: Receive FIFO full
  - UART_FLAG_TXFE: Transmit FIFO empty
  - UART_FLAG_FE: Framing error
  - UART_FLAG_PE: Parity error
  - UART_FLAG_BE: Break error
  - UART_FLAG_OE: Overrun error.

Return values

  FlagStatus | functional state FlagStatus This parameter can be: SET or RESET.

Definition at line 328 of file BlueNRG1_uart.c.

ITStatus UART_GetITStatus | ( | uint16_t | UART_IT | ) |

Checks whether the specified UART interrupt has occurred or not.

Parameters

  UART_IT | specifies the UART interrupt source to check. This parameter can be one of the following values:
  - UART_IT_TXFE: Tx FIFO empty interrupt
  - UART_IT_XO: XOFF interrupt
  - UART_IT_OE: Overrun error interrupt
  - UART_IT_BE: Break error interrupt
  - UART_IT_PE: Parity error interrupt
  - UART_IT_FE: Framing error interrupt
  - UART_IT_RT: Receive timeout interrupt
  - UART_IT_TX: Transmit interrupt
  - UART_IT_RX: Receive interrupt
  - UART_IT_CTS: CTS interrupt

Return values

  ITStatus | functional state ITStatus This parameter can be: SET or RESET.

Definition at line 387 of file BlueNRG1_uart.c.

void UART_Init | ( | UART_InitType * | UART_InitStruct | ) |

Initializes the UART peripheral according to the specified parameters in the UART_InitStruct.

Parameters

  UART_InitStruct | pointer to a UART_InitType structure that contains the configuration information for the specified UART.

Return values

  None |

Definition at line 134 of file BlueNRG1_uart.c.

void UART_ITConfig | ( | uint16_t | UART_IT,
|  | FunctionalState | NewState
| ) |  |

Enables or disables the specified UART interrupts.

Parameters

  UART_IT | specifies the UART interrupt sources to be enabled or disabled. This parameter can be a any combination of the following values:
  - UART_IT_TXFE: Tx FIFO empty interrupt
  - UART_IT_XO: XOFF interrupt
  - UART_IT_OE: Overrun error interrupt
  - UART_IT_BE: Break error interrupt
  - UART_IT_PE: Parity error interrupt
  - UART_IT_FE: Framing error interrupt
  - UART_IT_RT: Receive timeout interrupt
  - UART_IT_TX: Transmit interrupt
  - UART_IT_RX: Receive interrupt
  - UART_IT_CTS: CTS interrupt.
  NewState | functional state FunctionalState This parameter can be: ENABLE or DISABLE.

Return values

  None |

Definition at line 239 of file BlueNRG1_uart.c.

uint16_t UART_ReceiveData | ( | void |  | ) |

Returns the most recent received data by the UART peripheral.

Parameters

  None |

Return values

  uint16_t | The received data.

Definition at line 274 of file BlueNRG1_uart.c.

void UART_RequestToSendCmd | ( | FunctionalState | NewState | ) |

Enables or disables the request to send command.

Parameters

  NewState | functional state FunctionalState This parameter can be: ENABLE or DISABLE.

Return values

  None |

Definition at line 302 of file BlueNRG1_uart.c.

void UART_RxFifoIrqLevelConfig | ( | uint8_t | UART_RxFifo_Level | ) |

Sets the UART interrupt FIFO level.

Parameters

  UART_RxFifo_Level | specifies the receive interrupt FIFO level. This parameter can be one of the following values:
  - FIFO_RX_LEV_1_8: interrupt when Rx FIFO becomes >= 1/8 full
  - FIFO_RX_LEV_1_4: interrupt when Rx FIFO becomes >= 1/4 full
  - FIFO_RX_LEV_1_2: interrupt when Rx FIFO becomes >= 1/2 full
  - FIFO_RX_LEV_3_4: interrupt when Rx FIFO becomes >= 3/4 full
  - FIFO_RX_LEV_7_8: interrupt when Rx FIFO becomes >= 7/8 full

Return values

  None |

Definition at line 456 of file BlueNRG1_uart.c.

void UART_RxSwFlowControlMode | ( | uint8_t | UART_RxSwFlowCtrlMode | ) |

Sets the UART flow control mode for reception.

Parameters

  UART_RxSwFlowCtrlMode | specifies the software flow control used for RX. This parameter can be one of the following values:
  - NO_SW_FLOW_CTRL: No software flow control
  - SW_FLOW_CTRL_XON1_XOFF1: Software flow control XON1 and XOFF1
  - SW_FLOW_CTRL_XON2_XOFF2: Software flow control XON2 and XOFF2
  - SW_FLOW_CTRL_ALL_CHARS: Software flow control XON1 and XOFF1, XON2 and XOFF2

Return values

  None |

Definition at line 549 of file BlueNRG1_uart.c.

void UART_SendData | ( | uint16_t | Data | ) |

Transmits single data through the UART peripheral.

Parameters

  Data | the data to transmit.

Return values

  None |

Definition at line 260 of file BlueNRG1_uart.c.

void UART_SpecialCharDetect | ( | FunctionalState | NewState | ) |

Enables or disables the UART special character detection.

Parameters

  NewState | functional state FunctionalState This parameter can be: ENABLE or DISABLE.

Return values

  None |

Definition at line 604 of file BlueNRG1_uart.c.

void UART_StructInit | ( | UART_InitType * | UART_InitStruct | ) |

Fills each UART_InitStruct member with its default value.

Parameters

  UART_InitStruct | pointer to a UART_InitTypeDef structure which will be initialized.

Return values

  None |

Definition at line 208 of file BlueNRG1_uart.c.

void UART_SwFlowControl | ( | FunctionalState | NewState | ) |

Enables or disables the UART software flow control.

Parameters

  NewState | functional state FunctionalState This parameter can be: ENABLE or DISABLE.

Return values

  None |

Definition at line 523 of file BlueNRG1_uart.c.

void UART_TimeoutConfig | ( | uint32_t | UART_Timeout | ) |

UART timeout value for the interrupt. The receive timeout interrupt is asserted when the RX FIFO is not empty and no further data is received over a programmed timeout period.

Parameters

  UART_Timeout | is a value less than 0x400000. The value is calculated as: timeout = UART_Timeout * Baudrate_Divisor * 62.5ns

Return values

  None |

Definition at line 474 of file BlueNRG1_uart.c.

void UART_TxFifoIrqLevelConfig | ( | uint8_t | UART_TxFifo_Level | ) |

Sets the UART interrupt FIFO level.

Parameters

  UART_TxFifo_Level | specifies the transmit interrupt FIFO level. This parameter can be one of the following values:
  - FIFO_TX_LEV_1_8: interrupt when Tx FIFO becomes <= 1/8 full
  - FIFO_TX_LEV_1_4: interrupt when Tx FIFO becomes <= 1/4 full
  - FIFO_TX_LEV_1_2: interrupt when Tx FIFO becomes <= 1/2 full
  - FIFO_TX_LEV_3_4: interrupt when Tx FIFO becomes <= 3/4 full
  - FIFO_TX_LEV_7_8: interrupt when Tx FIFO becomes <= 7/8 full

Return values

  None |

Definition at line 437 of file BlueNRG1_uart.c.

void UART_TxSwFlowControlMode | ( | uint8_t | UART_TxSwFlowCtrlMode | ) |

Sets the UART flow control mode for transmission.

Parameters

  UART_TxSwFlowCtrlMode | specifies the software flow control used for TX. This parameter can be one of the following values:
  - NO_SW_FLOW_CTRL: No software flow control
  - SW_FLOW_CTRL_XON1_XOFF1: Software flow control XON1 and XOFF1
  - SW_FLOW_CTRL_XON2_XOFF2: Software flow control XON2 and XOFF2
  - SW_FLOW_CTRL_ALL_CHARS: Software flow control XON1 and XOFF1, XON2 and XOFF2

Return values

  None |

Definition at line 567 of file BlueNRG1_uart.c.

void UART_Xoff1Char | ( | uint8_t | UART_XoffChar | ) |

Sets the UART flow control mode for transmission.

Parameters

  uint8_t | specifies the flow control character.

Return values

  None |

Definition at line 651 of file BlueNRG1_uart.c.

void UART_Xoff2Char | ( | uint8_t | UART_XoffChar | ) |

Sets the UART flow control mode for transmission.

Parameters

  uint8_t | specifies the flow control character.

Return values

  None |

Definition at line 664 of file BlueNRG1_uart.c.

void UART_Xon1Char | ( | uint8_t | UART_XonChar | ) |

Sets the UART flow control mode for transmission.

Parameters

  uint8_t | specifies the flow control character.

Return values

  None |

Definition at line 625 of file BlueNRG1_uart.c.

void UART_Xon2Char | ( | uint8_t | UART_XonChar | ) |

Sets the UART flow control mode for transmission.

Parameters

  uint8_t | specifies the flow control character.

Return values

  None |

Definition at line 638 of file BlueNRG1_uart.c.

void UART_XonAnyBit | ( | FunctionalState | NewState | ) |

Enables or disables the UART XON any bit.

Parameters

  NewState | functional state FunctionalState This parameter can be: ENABLE or DISABLE.

Return values

  None |

Definition at line 582 of file BlueNRG1_uart.c.