fix interfaccia
This commit is contained in:
@@ -10,6 +10,17 @@
|
||||
* + Peripheral Control functions
|
||||
* + Peripheral State and Error functions
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2019 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
@verbatim
|
||||
==============================================================================
|
||||
##### How to use this driver #####
|
||||
@@ -167,17 +178,6 @@
|
||||
|
||||
@endverbatim
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
@@ -809,11 +809,11 @@ HAL_StatusTypeDef HAL_SMARTCARD_UnRegisterCallback(SMARTCARD_HandleTypeDef *hsma
|
||||
* @param Timeout Timeout duration.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_SMARTCARD_Transmit(SMARTCARD_HandleTypeDef *hsmartcard, uint8_t *pData, uint16_t Size,
|
||||
HAL_StatusTypeDef HAL_SMARTCARD_Transmit(SMARTCARD_HandleTypeDef *hsmartcard, const uint8_t *pData, uint16_t Size,
|
||||
uint32_t Timeout)
|
||||
{
|
||||
uint32_t tickstart;
|
||||
uint8_t *ptmpdata = pData;
|
||||
const uint8_t *ptmpdata = pData;
|
||||
|
||||
/* Check that a Tx process is not already ongoing */
|
||||
if (hsmartcard->gState == HAL_SMARTCARD_STATE_READY)
|
||||
@@ -983,7 +983,7 @@ HAL_StatusTypeDef HAL_SMARTCARD_Receive(SMARTCARD_HandleTypeDef *hsmartcard, uin
|
||||
* @param Size amount of data to be sent.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_SMARTCARD_Transmit_IT(SMARTCARD_HandleTypeDef *hsmartcard, uint8_t *pData, uint16_t Size)
|
||||
HAL_StatusTypeDef HAL_SMARTCARD_Transmit_IT(SMARTCARD_HandleTypeDef *hsmartcard, const uint8_t *pData, uint16_t Size)
|
||||
{
|
||||
/* Check that a Tx process is not already ongoing */
|
||||
if (hsmartcard->gState == HAL_SMARTCARD_STATE_READY)
|
||||
@@ -1141,7 +1141,7 @@ HAL_StatusTypeDef HAL_SMARTCARD_Receive_IT(SMARTCARD_HandleTypeDef *hsmartcard,
|
||||
* @param Size amount of data to be sent.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_SMARTCARD_Transmit_DMA(SMARTCARD_HandleTypeDef *hsmartcard, uint8_t *pData, uint16_t Size)
|
||||
HAL_StatusTypeDef HAL_SMARTCARD_Transmit_DMA(SMARTCARD_HandleTypeDef *hsmartcard, const uint8_t *pData, uint16_t Size)
|
||||
{
|
||||
/* Check that a Tx process is not already ongoing */
|
||||
if (hsmartcard->gState == HAL_SMARTCARD_STATE_READY)
|
||||
@@ -2420,25 +2420,25 @@ static HAL_StatusTypeDef SMARTCARD_SetConfig(SMARTCARD_HandleTypeDef *hsmartcard
|
||||
{
|
||||
case SMARTCARD_CLOCKSOURCE_PCLK1:
|
||||
pclk = HAL_RCC_GetPCLK1Freq();
|
||||
tmpreg = (uint16_t)(((pclk / SMARTCARDPrescTable[hsmartcard->Init.ClockPrescaler]) +
|
||||
tmpreg = (uint32_t)(((pclk / SMARTCARDPrescTable[hsmartcard->Init.ClockPrescaler]) +
|
||||
(hsmartcard->Init.BaudRate / 2U)) / hsmartcard->Init.BaudRate);
|
||||
break;
|
||||
case SMARTCARD_CLOCKSOURCE_PCLK2:
|
||||
pclk = HAL_RCC_GetPCLK2Freq();
|
||||
tmpreg = (uint16_t)(((pclk / SMARTCARDPrescTable[hsmartcard->Init.ClockPrescaler]) +
|
||||
tmpreg = (uint32_t)(((pclk / SMARTCARDPrescTable[hsmartcard->Init.ClockPrescaler]) +
|
||||
(hsmartcard->Init.BaudRate / 2U)) / hsmartcard->Init.BaudRate);
|
||||
break;
|
||||
case SMARTCARD_CLOCKSOURCE_HSI:
|
||||
tmpreg = (uint16_t)(((HSI_VALUE / SMARTCARDPrescTable[hsmartcard->Init.ClockPrescaler]) +
|
||||
tmpreg = (uint32_t)(((HSI_VALUE / SMARTCARDPrescTable[hsmartcard->Init.ClockPrescaler]) +
|
||||
(hsmartcard->Init.BaudRate / 2U)) / hsmartcard->Init.BaudRate);
|
||||
break;
|
||||
case SMARTCARD_CLOCKSOURCE_SYSCLK:
|
||||
pclk = HAL_RCC_GetSysClockFreq();
|
||||
tmpreg = (uint16_t)(((pclk / SMARTCARDPrescTable[hsmartcard->Init.ClockPrescaler]) +
|
||||
tmpreg = (uint32_t)(((pclk / SMARTCARDPrescTable[hsmartcard->Init.ClockPrescaler]) +
|
||||
(hsmartcard->Init.BaudRate / 2U)) / hsmartcard->Init.BaudRate);
|
||||
break;
|
||||
case SMARTCARD_CLOCKSOURCE_LSE:
|
||||
tmpreg = (uint16_t)(((uint16_t)(LSE_VALUE / SMARTCARDPrescTable[hsmartcard->Init.ClockPrescaler]) +
|
||||
tmpreg = (uint32_t)(((uint16_t)(LSE_VALUE / SMARTCARDPrescTable[hsmartcard->Init.ClockPrescaler]) +
|
||||
(hsmartcard->Init.BaudRate / 2U)) / hsmartcard->Init.BaudRate);
|
||||
break;
|
||||
default:
|
||||
@@ -2449,7 +2449,7 @@ static HAL_StatusTypeDef SMARTCARD_SetConfig(SMARTCARD_HandleTypeDef *hsmartcard
|
||||
/* USARTDIV must be greater than or equal to 0d16 */
|
||||
if ((tmpreg >= USART_BRR_MIN) && (tmpreg <= USART_BRR_MAX))
|
||||
{
|
||||
hsmartcard->Instance->BRR = tmpreg;
|
||||
hsmartcard->Instance->BRR = (uint16_t)tmpreg;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2580,11 +2580,12 @@ static HAL_StatusTypeDef SMARTCARD_CheckIdleState(SMARTCARD_HandleTypeDef *hsmar
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Handle SMARTCARD Communication Timeout.
|
||||
* @brief Handle SMARTCARD Communication Timeout. It waits
|
||||
* until a flag is no longer in the specified status.
|
||||
* @param hsmartcard Pointer to a SMARTCARD_HandleTypeDef structure that contains
|
||||
* the configuration information for the specified SMARTCARD module.
|
||||
* @param Flag Specifies the SMARTCARD flag to check.
|
||||
* @param Status The new Flag status (SET or RESET).
|
||||
* @param Status The actual Flag status (SET or RESET).
|
||||
* @param Tickstart Tick start value
|
||||
* @param Timeout Timeout duration.
|
||||
* @retval HAL status
|
||||
@@ -3184,4 +3185,3 @@ static void SMARTCARD_RxISR_FIFOEN(SMARTCARD_HandleTypeDef *hsmartcard)
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
|
||||
Reference in New Issue
Block a user