fix interfaccia
This commit is contained in:
@@ -10,7 +10,17 @@
|
||||
* + IO operation functions
|
||||
* + Peripheral Configuration and 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 #####
|
||||
@@ -88,10 +98,10 @@
|
||||
|
||||
The compilation define USE_HAL_FDCAN_REGISTER_CALLBACKS when set to 1
|
||||
allows the user to configure dynamically the driver callbacks.
|
||||
Use Function @ref HAL_FDCAN_RegisterCallback() or HAL_FDCAN_RegisterXXXCallback()
|
||||
Use Function HAL_FDCAN_RegisterCallback() or HAL_FDCAN_RegisterXXXCallback()
|
||||
to register an interrupt callback.
|
||||
|
||||
Function @ref HAL_FDCAN_RegisterCallback() allows to register following callbacks:
|
||||
Function HAL_FDCAN_RegisterCallback() allows to register following callbacks:
|
||||
(+) TxFifoEmptyCallback : Tx Fifo Empty Callback.
|
||||
(+) HighPriorityMessageCallback : High Priority Message Callback.
|
||||
(+) TimestampWraparoundCallback : Timestamp Wraparound Callback.
|
||||
@@ -104,14 +114,14 @@
|
||||
|
||||
For specific callbacks TxEventFifoCallback, RxFifo0Callback, RxFifo1Callback,
|
||||
TxBufferCompleteCallback, TxBufferAbortCallback and ErrorStatusCallback use dedicated
|
||||
register callbacks : respectively @ref HAL_FDCAN_RegisterTxEventFifoCallback(),
|
||||
@ref HAL_FDCAN_RegisterRxFifo0Callback(), @ref HAL_FDCAN_RegisterRxFifo1Callback(),
|
||||
@ref HAL_FDCAN_RegisterTxBufferCompleteCallback(), @ref HAL_FDCAN_RegisterTxBufferAbortCallback()
|
||||
and @ref HAL_FDCAN_RegisterErrorStatusCallback().
|
||||
register callbacks : respectively HAL_FDCAN_RegisterTxEventFifoCallback(),
|
||||
HAL_FDCAN_RegisterRxFifo0Callback(), HAL_FDCAN_RegisterRxFifo1Callback(),
|
||||
HAL_FDCAN_RegisterTxBufferCompleteCallback(), HAL_FDCAN_RegisterTxBufferAbortCallback()
|
||||
and HAL_FDCAN_RegisterErrorStatusCallback().
|
||||
|
||||
Use function @ref HAL_FDCAN_UnRegisterCallback() to reset a callback to the default
|
||||
Use function HAL_FDCAN_UnRegisterCallback() to reset a callback to the default
|
||||
weak function.
|
||||
@ref HAL_FDCAN_UnRegisterCallback takes as parameters the HAL peripheral handle,
|
||||
HAL_FDCAN_UnRegisterCallback takes as parameters the HAL peripheral handle,
|
||||
and the Callback ID.
|
||||
This function allows to reset following callbacks:
|
||||
(+) TxFifoEmptyCallback : Tx Fifo Empty Callback.
|
||||
@@ -124,18 +134,18 @@
|
||||
|
||||
For specific callbacks TxEventFifoCallback, RxFifo0Callback, RxFifo1Callback,
|
||||
TxBufferCompleteCallback and TxBufferAbortCallback, use dedicated
|
||||
unregister callbacks : respectively @ref HAL_FDCAN_UnRegisterTxEventFifoCallback(),
|
||||
@ref HAL_FDCAN_UnRegisterRxFifo0Callback(), @ref HAL_FDCAN_UnRegisterRxFifo1Callback(),
|
||||
@ref HAL_FDCAN_UnRegisterTxBufferCompleteCallback(), @ref HAL_FDCAN_UnRegisterTxBufferAbortCallback()
|
||||
and @ref HAL_FDCAN_UnRegisterErrorStatusCallback().
|
||||
unregister callbacks : respectively HAL_FDCAN_UnRegisterTxEventFifoCallback(),
|
||||
HAL_FDCAN_UnRegisterRxFifo0Callback(), HAL_FDCAN_UnRegisterRxFifo1Callback(),
|
||||
HAL_FDCAN_UnRegisterTxBufferCompleteCallback(), HAL_FDCAN_UnRegisterTxBufferAbortCallback()
|
||||
and HAL_FDCAN_UnRegisterErrorStatusCallback().
|
||||
|
||||
By default, after the @ref HAL_FDCAN_Init() and when the state is HAL_FDCAN_STATE_RESET,
|
||||
By default, after the HAL_FDCAN_Init() and when the state is HAL_FDCAN_STATE_RESET,
|
||||
all callbacks are set to the corresponding weak functions:
|
||||
examples @ref HAL_FDCAN_ErrorCallback().
|
||||
examples HAL_FDCAN_ErrorCallback().
|
||||
Exception done for MspInit and MspDeInit functions that are
|
||||
reset to the legacy weak function in the @ref HAL_FDCAN_Init()/ @ref HAL_FDCAN_DeInit() only when
|
||||
reset to the legacy weak function in the HAL_FDCAN_Init()/ HAL_FDCAN_DeInit() only when
|
||||
these callbacks are null (not registered beforehand).
|
||||
if not, MspInit or MspDeInit are not null, the @ref HAL_FDCAN_Init()/ @ref HAL_FDCAN_DeInit()
|
||||
if not, MspInit or MspDeInit are not null, the HAL_FDCAN_Init()/ HAL_FDCAN_DeInit()
|
||||
keep and use the user MspInit/MspDeInit callbacks (registered beforehand)
|
||||
|
||||
Callbacks can be registered/unregistered in HAL_FDCAN_STATE_READY state only.
|
||||
@@ -143,8 +153,8 @@
|
||||
in HAL_FDCAN_STATE_READY or HAL_FDCAN_STATE_RESET state,
|
||||
thus registered (user) MspInit/DeInit callbacks can be used during the Init/DeInit.
|
||||
In that case first register the MspInit/MspDeInit user callbacks
|
||||
using @ref HAL_FDCAN_RegisterCallback() before calling @ref HAL_FDCAN_DeInit()
|
||||
or @ref HAL_FDCAN_Init() function.
|
||||
using HAL_FDCAN_RegisterCallback() before calling HAL_FDCAN_DeInit()
|
||||
or HAL_FDCAN_Init() function.
|
||||
|
||||
When The compilation define USE_HAL_FDCAN_REGISTER_CALLBACKS is set to 0 or
|
||||
not defined, the callback registration feature is not available and all callbacks
|
||||
@@ -152,17 +162,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 ------------------------------------------------------------------*/
|
||||
@@ -241,19 +240,19 @@
|
||||
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
static const uint8_t DLCtoBytes[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 20, 24, 32, 48, 64};
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
/** @addtogroup FDCAN_Private_Functions_Prototypes
|
||||
/** @addtogroup FDCAN_Private_Variables
|
||||
* @{
|
||||
*/
|
||||
static void FDCAN_CalcultateRamBlockAddresses(FDCAN_HandleTypeDef *hfdcan);
|
||||
static void FDCAN_CopyMessageToRAM(FDCAN_HandleTypeDef *hfdcan, FDCAN_TxHeaderTypeDef *pTxHeader, uint8_t *pTxData,
|
||||
uint32_t BufferIndex);
|
||||
static const uint8_t DLCtoBytes[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 20, 24, 32, 48, 64};
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
static void FDCAN_CalcultateRamBlockAddresses(FDCAN_HandleTypeDef *hfdcan);
|
||||
static void FDCAN_CopyMessageToRAM(FDCAN_HandleTypeDef *hfdcan, FDCAN_TxHeaderTypeDef *pTxHeader, uint8_t *pTxData,
|
||||
uint32_t BufferIndex);
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/** @defgroup FDCAN_Exported_Functions FDCAN Exported Functions
|
||||
* @{
|
||||
@@ -3383,7 +3382,7 @@ uint32_t HAL_FDCAN_GetError(FDCAN_HandleTypeDef *hfdcan)
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup FDCAN_Private_Functions
|
||||
/** @defgroup FDCAN_Private_Functions FDCAN Private Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
@@ -3515,5 +3514,3 @@ static void FDCAN_CopyMessageToRAM(FDCAN_HandleTypeDef *hfdcan, FDCAN_TxHeaderTy
|
||||
*/
|
||||
|
||||
#endif /* FDCAN1 */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
|
||||
Reference in New Issue
Block a user