Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
cubexHal.pdf
Скачиваний:
110
Добавлен:
10.02.2016
Размер:
16.16 Mб
Скачать

UM1725

HAL IRDA Generic Driver

 

contains the configuration information for the specified IRDA

 

module.

Return values

HAL state

34.2.25HAL_IRDA_GetError

Function Name

uint32_t HAL_IRDA_GetError (IRDA_HandleTypeDef * hirda)

Function Description

Return the IARDA error code.

Parameters

 

hirda: : pointer to a IRDA_HandleTypeDef structure that

 

 

contains the configuration information for the specified IRDA.

Return values

 

IRDA Error Code

34.3IRDA Firmware driver defines

34.3.1

IRDA

 

 

IRDA Error Code

 

 

HAL_IRDA_ERROR_NONE

No error

 

HAL_IRDA_ERROR_PE

Parity error

 

HAL_IRDA_ERROR_NE

Noise error

 

HAL_IRDA_ERROR_FE

Frame error

 

HAL_IRDA_ERROR_ORE

Overrun error

 

HAL_IRDA_ERROR_DMA

DMA transfer error

 

IRDA Exported Macros

 

__HAL_IRDA_RESET_HANDLE_STATE

Description:

 

Reset IRDA handle state.

 

Parameters:

 

__HANDLE__: specifies the USART

 

Handle. This parameter can be

 

USARTx where x: 1, 2, 3, 4, 5, 6, 7 or

 

8 to select the USART or UART

 

peripheral.

 

Return value:

 

None

__HAL_IRDA_FLUSH_DRREGISTER

Description:

 

Flushs the IRDA DR register.

 

Parameters:

 

__HANDLE__: specifies the USART

 

Handle. This parameter can be

 

USARTx where x: 1, 2, 3, 4, 5, 6, 7 or

 

8 to select the USART or UART

 

peripheral.

DOCID025834 Rev 2

445/900

HAL IRDA Generic Driver

UM1725

 

__HAL_IRDA_GET_FLAG

Description:

 

 

Checks whether the specified IRDA

 

 

flag is set or not.

 

 

Parameters:

 

 

__HANDLE__: specifies the USART

 

 

Handle. This parameter can be

 

 

USARTx where x: 1, 2, 3, 4, 5, 6, 7 or

 

 

8 to select the USART or UART

 

 

peripheral.

 

 

__FLAG__: specifies the flag to

 

 

check. This parameter can be one of

 

 

the following values:

 

 

IRDA_FLAG_TXE: Transmit data

 

 

register empty flag

 

 

IRDA_FLAG_TC: Transmission

 

 

Complete flag

 

 

IRDA_FLAG_RXNE: Receive

 

 

data register not empty flag

 

 

IRDA_FLAG_IDLE: Idle Line

 

 

detection flag

 

 

IRDA_FLAG_ORE: OverRun

 

 

Error flag

 

 

IRDA_FLAG_NE: Noise Error

 

 

flag

 

 

IRDA_FLAG_FE: Framing Error

 

 

flag

 

 

IRDA_FLAG_PE: Parity Error

 

 

flag

 

 

Return value:

 

 

The: new state of __FLAG__ (TRUE

 

 

or FALSE).

 

__HAL_IRDA_CLEAR_FLAG

Description:

 

 

Clears the specified IRDA pending

 

 

flag.

 

 

Parameters:

 

 

__HANDLE__: specifies the USART

 

 

Handle. This parameter can be

 

 

USARTx where x: 1, 2, 3, 4, 5, 6, 7 or

 

 

8 to select the USART or UART

 

 

peripheral.

 

 

__FLAG__: specifies the flag to

 

 

check. This parameter can be any

 

 

combination of the following values:

 

 

IRDA_FLAG_TC: Transmission

 

 

Complete flag.

 

 

IRDA_FLAG_RXNE: Receive

 

 

data register not empty flag.

 

 

Return value:

446/900

DOCID025834 Rev 2

UM1725

 

HAL IRDA Generic Driver

 

 

None

 

Notes:

 

PE (Parity error), FE (Framing error),

 

 

NE (Noise error), ORE (OverRun

 

 

error) and IDLE (Idle line detected)

 

 

flags are cleared by software

 

 

sequence: a read operation to

 

 

USART_SR register followed by a

 

 

read operation to USART_DR

 

 

register. RXNE flag can be also

 

 

cleared by a read to the USART_DR

 

 

register. TC flag can be also cleared

 

 

by software sequence: a read

 

 

operation to USART_SR register

 

 

followed by a write operation to

 

 

USART_DR register. TXE flag is

 

 

cleared only by a write to the

 

 

USART_DR register.

__HAL_IRDA_CLEAR_PEFLAG

Description:

 

Clear the IRDA PE pending flag.

 

Parameters:

 

__HANDLE__: specifies the USART

 

 

Handle. This parameter can be

 

 

USARTx where x: 1, 2, 3, 4, 5, 6, 7 or

 

 

8 to select the USART or UART

 

 

peripheral.

 

Return value:

 

 

None

__HAL_IRDA_CLEAR_FEFLAG

Description:

 

Clear the IRDA FE pending flag.

 

Parameters:

 

__HANDLE__: specifies the USART

 

 

Handle. This parameter can be

 

 

USARTx where x: 1, 2, 3, 4, 5, 6, 7 or

 

 

8 to select the USART or UART

 

 

peripheral.

 

Return value:

 

 

None

__HAL_IRDA_CLEAR_NEFLAG

Description:

 

Clear the IRDA NE pending flag.

 

Parameters:

 

__HANDLE__: specifies the USART

 

 

Handle. This parameter can be

 

 

USARTx where x: 1, 2, 3, 4, 5, 6, 7 or

 

 

8 to select the USART or UART

DOCID025834 Rev 2

447/900

HAL IRDA Generic Driver

 

UM1725

 

 

 

peripheral.

 

 

Return value:

 

 

 

None

 

__HAL_IRDA_CLEAR_OREFLAG

Description:

 

 

Clear the IRDA ORE pending flag.

 

 

Parameters:

 

 

__HANDLE__: specifies the USART

 

 

 

Handle. This parameter can be

 

 

 

USARTx where x: 1, 2, 3, 4, 5, 6, 7 or

 

 

 

8 to select the USART or UART

 

 

 

peripheral.

 

 

Return value:

 

 

 

None

 

__HAL_IRDA_CLEAR_IDLEFLAG

Description:

 

 

Clear the IRDA IDLE pending flag.

 

 

Parameters:

 

 

__HANDLE__: specifies the USART

 

 

 

Handle. This parameter can be

 

 

 

USARTx where x: 1, 2, 3, 4, 5, 6, 7 or

 

 

 

8 to select the USART or UART

 

 

 

peripheral.

 

 

Return value:

 

 

 

None

 

__HAL_IRDA_ENABLE_IT

Description:

 

 

Enables or disables the specified

 

 

 

IRDA interrupt.

 

 

Parameters:

 

 

__HANDLE__: specifies the USART

 

 

 

Handle. This parameter can be

 

 

 

USARTx where x: 1, 2, 3, 4, 5, 6, 7 or

 

 

 

8 to select the USART or UART

 

 

 

peripheral.

 

 

__INTERRUPT__: specifies the IRDA

 

 

 

interrupt source to check. This

 

 

 

parameter can be one of the following

 

 

 

values:

 

 

 

IRDA_IT_TXE: Transmit Data

 

 

 

Register empty interrupt

 

 

 

IRDA_IT_TC: Transmission

 

 

 

complete interrupt

 

 

 

IRDA_IT_RXNE: Receive Data

 

 

 

register not empty interrupt

 

 

 

IRDA_IT_IDLE: Idle line

 

 

 

detection interrupt

 

 

 

IRDA_IT_PE: Parity Error

448/900

DOCID025834 Rev 2

 

UM1725

HAL IRDA Generic Driver

 

interrupt

 

IRDA_IT_ERR: Error

 

interrupt(Frame error, noise

 

error, overrun error)

 

Return value:

 

 

None

__HAL_IRDA_DISABLE_IT

 

 

__HAL_IRDA_GET_IT_SOURCE

Description:

 

Checks whether the specified IRDA

 

 

interrupt has occurred or not.

 

Parameters:

 

__HANDLE__: specifies the USART

 

 

Handle. This parameter can be

 

 

USARTx where x: 1, 2, 3, 4, 5, 6, 7 or

 

 

8 to select the USART or UART

 

 

peripheral.

 

__IT__: specifies the IRDA interrupt

 

 

source to check. This parameter can

 

 

be one of the following values:

 

 

IRDA_IT_TXE: Transmit Data

 

 

Register empty interrupt

 

 

IRDA_IT_TC: Transmission

 

 

complete interrupt

 

 

IRDA_IT_RXNE: Receive Data

 

 

register not empty interrupt

 

 

IRDA_IT_IDLE: Idle line

 

 

detection interrupt

 

 

USART_IT_ERR: Error interrupt

 

 

IRDA_IT_PE: Parity Error

 

 

interrupt

 

Return value:

 

The: new state of __IT__ (TRUE or

 

 

FALSE).

__HAL_IRDA_ONE_BIT_SAMPLE_ENABLE

Description:

 

Macro to enable the IRDA's one bit

 

 

sample method.

 

Parameters:

 

__HANDLE__: specifies the IRDA

 

 

Handle.

 

Return value:

 

 

None

__HAL_IRDA_ONE_BIT_SAMPLE_DISABLE

Description:

 

Macro to disable the IRDA's one bit

 

 

sample method.

 

Parameters:

DOCID025834 Rev 2

449/900

HAL IRDA Generic Driver

 

UM1725

 

__HANDLE__: specifies the IRDA

 

 

Handle.

 

Return value:

 

 

None

__HAL_IRDA_ENABLE

Description:

 

Enable UART/USART associated to

 

 

IRDA Handle.

 

Parameters:

 

__HANDLE__: specifies the IRDA

 

 

Handle. IRDA Handle selects the

 

 

USARTx or UARTy peripheral

 

 

(USART,UART availability and x,y

 

 

values depending on device).

 

Return value:

 

 

None

__HAL_IRDA_DISABLE

Description:

 

Disable UART/USART associated to

 

 

IRDA Handle.

 

Parameters:

 

__HANDLE__: specifies the IRDA

 

 

Handle. IRDA Handle selects the

 

 

USARTx or UARTy peripheral

 

 

(USART,UART availability and x,y

 

 

values depending on device).

 

Return value:

 

 

None

IRDA Flags

IRDA_FLAG_TXE

IRDA_FLAG_TC

IRDA_FLAG_RXNE

IRDA_FLAG_IDLE

IRDA_FLAG_ORE

IRDA_FLAG_NE

IRDA_FLAG_FE

IRDA_FLAG_PE

IRDA Interrupt Definitions

IRDA_IT_PE

IRDA_IT_TXE

IRDA_IT_TC

IRDA_IT_RXNE

450/900

DOCID025834 Rev 2

UM1725 HAL IRDA Generic Driver

IRDA_IT_IDLE

IRDA_IT_LBD

IRDA_IT_CTS

IRDA_IT_ERR

IRDA Low Power

IRDA_POWERMODE_LOWPOWER

IRDA_POWERMODE_NORMAL

IRDA Transfer Mode

IRDA_MODE_RX

IRDA_MODE_TX

IRDA_MODE_TX_RX

IRDA Parity

IRDA_PARITY_NONE

IRDA_PARITY_EVEN

IRDA_PARITY_ODD

IRDA Private Constants

IRDA_TIMEOUT_VALUE

IRDA_IT_MASK

IRDA_CR1_REG_INDEX

IRDA_CR2_REG_INDEX

IRDA_CR3_REG_INDEX

IRDA Private Macros

IS_IRDA_WORD_LENGTH

IS_IRDA_PARITY

IS_IRDA_MODE

IS_IRDA_POWERMODE

IS_IRDA_BAUDRATE

IRDA_DIV

IRDA_DIVMANT

IRDA_DIVFRAQ

IRDA_BRR

IRDA Word Length

IRDA_WORDLENGTH_8B

IRDA_WORDLENGTH_9B

DOCID025834 Rev 2

451/900

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]