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

HAL SMARTCARD Generic Driver

UM1725

HAL_SMARTCARD_Transmit()

HAL_SMARTCARD_Receive()

HAL_SMARTCARD_Transmit_IT()

HAL_SMARTCARD_Receive_IT()

HAL_SMARTCARD_Transmit_DMA()

HAL_SMARTCARD_Receive_DMA()

HAL_SMARTCARD_IRQHandler()

HAL_SMARTCARD_TxCpltCallback()

HAL_SMARTCARD_RxCpltCallback()

HAL_SMARTCARD_ErrorCallback()

54.2.4Peripheral State and Errors functions

This subsection provides a set of functions allowing to control the SmartCard.

HAL_SMARTCARD_GetState() API can be helpful to check in run-time the state of the SmartCard peripheral.

HAL_SMARTCARD_GetError() check in run-time errors that could be occurred during communication.

This section contains the following APIs:

HAL_SMARTCARD_GetState()

HAL_SMARTCARD_GetError()

54.2.5HAL_SMARTCARD_Init

Function Name

HAL_StatusTypeDef HAL_SMARTCARD_Init

 

(SMARTCARD_HandleTypeDef * hsc)

Function Description

Initializes the SmartCard mode according to the specified

 

parameters in the SMARTCARD_InitTypeDef and create the

 

associated handle .

Parameters

 

hsc: pointer to a SMARTCARD_HandleTypeDef structure

 

 

that contains the configuration information for SMARTCARD

 

 

module.

Return values

 

HAL status

54.2.6HAL_SMARTCARD_DeInit

Function Name

HAL_StatusTypeDef HAL_SMARTCARD_DeInit

 

(SMARTCARD_HandleTypeDef * hsc)

Function Description

DeInitializes the USART SmartCard peripheral.

Parameters

 

hsc: pointer to a SMARTCARD_HandleTypeDef structure

 

 

that contains the configuration information for SMARTCARD

 

 

module.

Return values

 

HAL status

54.2.7HAL_SMARTCARD_MspInit

Function Name

void HAL_SMARTCARD_MspInit

 

(SMARTCARD_HandleTypeDef * hsc)

Function Description

SMARTCARD MSP Init.

728/900

DOCID025834 Rev 2

UM1725

 

HAL SMARTCARD Generic Driver

Parameters

 

hsc: pointer to a SMARTCARD_HandleTypeDef structure

 

 

that contains the configuration information for SMARTCARD

 

 

module.

Return values

 

None

54.2.8HAL_SMARTCARD_MspDeInit

Function Name

void HAL_SMARTCARD_MspDeInit

 

(SMARTCARD_HandleTypeDef * hsc)

Function Description

SMARTCARD MSP DeInit.

Parameters

 

hsc: pointer to a SMARTCARD_HandleTypeDef structure

 

 

that contains the configuration information for SMARTCARD

 

 

module.

Return values

 

None

54.2.9HAL_SMARTCARD_ReInit

Function Name

HAL_StatusTypeDef HAL_SMARTCARD_ReInit

 

(SMARTCARD_HandleTypeDef * hsc)

Function Description

 

54.2.10HAL_SMARTCARD_Transmit

Function Name

HAL_StatusTypeDef HAL_SMARTCARD_Transmit

 

(SMARTCARD_HandleTypeDef * hsc, uint8_t * pData, uint16_t

 

Size, uint32_t Timeout)

Function Description

Send an amount of data in blocking mode.

Parameters

 

hsc: pointer to a SMARTCARD_HandleTypeDef structure

 

 

that contains the configuration information for SMARTCARD

 

 

module.

 

pData: pointer to data buffer

 

Size: amount of data to be sent

 

 

Timeout: Timeout duration

Return values

 

HAL status

54.2.11HAL_SMARTCARD_Receive

Function Name

HAL_StatusTypeDef HAL_SMARTCARD_Receive

 

 

(SMARTCARD_HandleTypeDef * hsc, uint8_t * pData, uint16_t

 

Size, uint32_t Timeout)

 

Function Description

Receive an amount of data in blocking mode.

 

Parameters

 

hsc: pointer to a SMARTCARD_HandleTypeDef structure

 

 

that contains the configuration information for SMARTCARD

 

 

module.

 

 

pData: pointer to data buffer

 

 

Size: amount of data to be received

 

 

 

Timeout: Timeout duration

 

Return values

 

HAL status

 

 

 

DOCID025834 Rev 2

729/900

HAL SMARTCARD Generic Driver

UM1725

54.2.12HAL_SMARTCARD_Transmit_IT

Function Name

HAL_StatusTypeDef HAL_SMARTCARD_Transmit_IT

 

(SMARTCARD_HandleTypeDef * hsc, uint8_t * pData, uint16_t

 

Size)

Function Description

Send an amount of data in non blocking mode.

Parameters

 

hsc: pointer to a SMARTCARD_HandleTypeDef structure

 

 

that contains the configuration information for SMARTCARD

 

 

module.

 

pData: pointer to data buffer

 

Size: amount of data to be sent

Return values

 

HAL status

54.2.13HAL_SMARTCARD_Receive_IT

Function Name

HAL_StatusTypeDef HAL_SMARTCARD_Receive_IT

 

(SMARTCARD_HandleTypeDef * hsc, uint8_t * pData, uint16_t

 

Size)

Function Description

Receive an amount of data in non blocking mode.

Parameters

 

hsc: pointer to a SMARTCARD_HandleTypeDef structure

 

 

that contains the configuration information for SMARTCARD

 

 

module.

 

pData: pointer to data buffer

 

Size: amount of data to be received

Return values

 

HAL status

54.2.14HAL_SMARTCARD_Transmit_DMA

Function Name

HAL_StatusTypeDef HAL_SMARTCARD_Transmit_DMA

 

(SMARTCARD_HandleTypeDef * hsc, uint8_t * pData, uint16_t

 

Size)

Function Description

Send an amount of data in non blocking mode.

Parameters

 

hsc: pointer to a SMARTCARD_HandleTypeDef structure

 

 

that contains the configuration information for SMARTCARD

 

 

module.

 

pData: pointer to data buffer

 

Size: amount of data to be sent

Return values

 

HAL status

54.2.15HAL_SMARTCARD_Receive_DMA

Function Name

HAL_StatusTypeDef HAL_SMARTCARD_Receive_DMA

 

(SMARTCARD_HandleTypeDef * hsc, uint8_t * pData, uint16_t

 

Size)

Function Description

Receive an amount of data in non blocking mode.

Parameters

hsc: pointer to a SMARTCARD_HandleTypeDef structure

 

that contains the configuration information for SMARTCARD

 

module.

 

pData: pointer to data buffer

730/900

DOCID025834 Rev 2

UM1725

 

HAL SMARTCARD Generic Driver

 

Size: amount of data to be received

Return values

 

HAL status

Notes

 

When the SMARTCARD parity is enabled (PCE = 1) the data

 

 

received contain the parity bit.s

54.2.16HAL_SMARTCARD_IRQHandler

Function Name

void HAL_SMARTCARD_IRQHandler

 

(SMARTCARD_HandleTypeDef * hsc)

Function Description

This function handles SMARTCARD interrupt request.

Parameters

 

hsc: pointer to a SMARTCARD_HandleTypeDef structure

 

 

that contains the configuration information for SMARTCARD

 

 

module.

Return values

 

None

54.2.17HAL_SMARTCARD_TxCpltCallback

Function Name

void HAL_SMARTCARD_TxCpltCallback

 

(SMARTCARD_HandleTypeDef * hsc)

Function Description

Tx Transfer completed callbacks.

Parameters

 

hsc: pointer to a SMARTCARD_HandleTypeDef structure

 

 

that contains the configuration information for SMARTCARD

 

 

module.

Return values

 

None

54.2.18HAL_SMARTCARD_RxCpltCallback

Function Name

void HAL_SMARTCARD_RxCpltCallback

 

(SMARTCARD_HandleTypeDef * hsc)

Function Description

Rx Transfer completed callbacks.

Parameters

 

hsc: pointer to a SMARTCARD_HandleTypeDef structure

 

 

that contains the configuration information for SMARTCARD

 

 

module.

Return values

 

None

54.2.19HAL_SMARTCARD_ErrorCallback

Function Name

void HAL_SMARTCARD_ErrorCallback

 

(SMARTCARD_HandleTypeDef * hsc)

Function Description

SMARTCARD error callbacks.

Parameters

 

hsc: pointer to a SMARTCARD_HandleTypeDef structure

 

 

that contains the configuration information for SMARTCARD

 

 

module.

Return values

 

None

54.2.20HAL_SMARTCARD_GetState

DOCID025834 Rev 2

731/900

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