STM32L486xx HAL User Manual
|
SMBUS HAL module driver. This file provides firmware functions to manage the following functionalities of the System Management Bus (SMBus) peripheral, based on I2C principles of operation : + Initialization and de-initialization functions + IO operation functions + Peripheral State and Errors functions. More...
#include "stm32l4xx_hal.h"
Go to the source code of this file.
Defines | |
#define | TIMING_CLEAR_MASK (0xF0FFFFFFU) |
#define | HAL_TIMEOUT_ADDR (10000U) |
#define | HAL_TIMEOUT_BUSY (25U) |
#define | HAL_TIMEOUT_DIR (25U) |
#define | HAL_TIMEOUT_RXNE (25U) |
#define | HAL_TIMEOUT_STOPF (25U) |
#define | HAL_TIMEOUT_TC (25U) |
#define | HAL_TIMEOUT_TCR (25U) |
#define | HAL_TIMEOUT_TXIS (25U) |
#define | MAX_NBYTE_SIZE 255U |
Functions | |
static HAL_StatusTypeDef | SMBUS_WaitOnFlagUntilTimeout (SMBUS_HandleTypeDef *hsmbus, uint32_t Flag, FlagStatus Status, uint32_t Timeout) |
Handle SMBUS Communication Timeout. | |
static void | SMBUS_Enable_IRQ (SMBUS_HandleTypeDef *hsmbus, uint16_t InterruptRequest) |
Manage the enabling of Interrupts. | |
static void | SMBUS_Disable_IRQ (SMBUS_HandleTypeDef *hsmbus, uint16_t InterruptRequest) |
Manage the disabling of Interrupts. | |
static HAL_StatusTypeDef | SMBUS_Master_ISR (SMBUS_HandleTypeDef *hsmbus) |
Interrupt Sub-Routine which handle the Interrupt Flags Master Mode. | |
static HAL_StatusTypeDef | SMBUS_Slave_ISR (SMBUS_HandleTypeDef *hsmbus) |
Interrupt Sub-Routine which handle the Interrupt Flags Slave Mode. | |
static void | SMBUS_ConvertOtherXferOptions (SMBUS_HandleTypeDef *hsmbus) |
Convert SMBUSx OTHER_xxx XferOptions to functionnal XferOptions. | |
static void | SMBUS_ITErrorHandler (SMBUS_HandleTypeDef *hsmbus) |
SMBUS interrupts error handler. | |
static void | SMBUS_TransferConfig (SMBUS_HandleTypeDef *hsmbus, uint16_t DevAddress, uint8_t Size, uint32_t Mode, uint32_t Request) |
Handle SMBUSx communication when starting transfer or during transfer (TC or TCR flag are set). | |
HAL_StatusTypeDef | HAL_SMBUS_Init (SMBUS_HandleTypeDef *hsmbus) |
Initialize the SMBUS according to the specified parameters in the SMBUS_InitTypeDef and initialize the associated handle. | |
HAL_StatusTypeDef | HAL_SMBUS_DeInit (SMBUS_HandleTypeDef *hsmbus) |
DeInitialize the SMBUS peripheral. | |
__weak void | HAL_SMBUS_MspInit (SMBUS_HandleTypeDef *hsmbus) |
Initialize the SMBUS MSP. | |
__weak void | HAL_SMBUS_MspDeInit (SMBUS_HandleTypeDef *hsmbus) |
DeInitialize the SMBUS MSP. | |
HAL_StatusTypeDef | HAL_SMBUS_ConfigAnalogFilter (SMBUS_HandleTypeDef *hsmbus, uint32_t AnalogFilter) |
Configure Analog noise filter. | |
HAL_StatusTypeDef | HAL_SMBUS_ConfigDigitalFilter (SMBUS_HandleTypeDef *hsmbus, uint32_t DigitalFilter) |
Configure Digital noise filter. | |
HAL_StatusTypeDef | HAL_SMBUS_RegisterCallback (SMBUS_HandleTypeDef *hsmbus, HAL_SMBUS_CallbackIDTypeDef CallbackID, pSMBUS_CallbackTypeDef pCallback) |
Register a User SMBUS Callback To be used instead of the weak predefined callback. | |
HAL_StatusTypeDef | HAL_SMBUS_UnRegisterCallback (SMBUS_HandleTypeDef *hsmbus, HAL_SMBUS_CallbackIDTypeDef CallbackID) |
Unregister an SMBUS Callback SMBUS callback is redirected to the weak predefined callback. | |
HAL_StatusTypeDef | HAL_SMBUS_RegisterAddrCallback (SMBUS_HandleTypeDef *hsmbus, pSMBUS_AddrCallbackTypeDef pCallback) |
Register the Slave Address Match SMBUS Callback To be used instead of the weak HAL_SMBUS_AddrCallback() predefined callback. | |
HAL_StatusTypeDef | HAL_SMBUS_UnRegisterAddrCallback (SMBUS_HandleTypeDef *hsmbus) |
UnRegister the Slave Address Match SMBUS Callback Info Ready SMBUS Callback is redirected to the weak HAL_SMBUS_AddrCallback() predefined callback. | |
HAL_StatusTypeDef | HAL_SMBUS_Master_Transmit_IT (SMBUS_HandleTypeDef *hsmbus, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions) |
Transmit in master/host SMBUS mode an amount of data in non-blocking mode with Interrupt. | |
HAL_StatusTypeDef | HAL_SMBUS_Master_Receive_IT (SMBUS_HandleTypeDef *hsmbus, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions) |
Receive in master/host SMBUS mode an amount of data in non-blocking mode with Interrupt. | |
HAL_StatusTypeDef | HAL_SMBUS_Master_Abort_IT (SMBUS_HandleTypeDef *hsmbus, uint16_t DevAddress) |
Abort a master/host SMBUS process communication with Interrupt. | |
HAL_StatusTypeDef | HAL_SMBUS_Slave_Transmit_IT (SMBUS_HandleTypeDef *hsmbus, uint8_t *pData, uint16_t Size, uint32_t XferOptions) |
Transmit in slave/device SMBUS mode an amount of data in non-blocking mode with Interrupt. | |
HAL_StatusTypeDef | HAL_SMBUS_Slave_Receive_IT (SMBUS_HandleTypeDef *hsmbus, uint8_t *pData, uint16_t Size, uint32_t XferOptions) |
Receive in slave/device SMBUS mode an amount of data in non-blocking mode with Interrupt. | |
HAL_StatusTypeDef | HAL_SMBUS_EnableListen_IT (SMBUS_HandleTypeDef *hsmbus) |
Enable the Address listen mode with Interrupt. | |
HAL_StatusTypeDef | HAL_SMBUS_DisableListen_IT (SMBUS_HandleTypeDef *hsmbus) |
Disable the Address listen mode with Interrupt. | |
HAL_StatusTypeDef | HAL_SMBUS_EnableAlert_IT (SMBUS_HandleTypeDef *hsmbus) |
Enable the SMBUS alert mode with Interrupt. | |
HAL_StatusTypeDef | HAL_SMBUS_DisableAlert_IT (SMBUS_HandleTypeDef *hsmbus) |
Disable the SMBUS alert mode with Interrupt. | |
HAL_StatusTypeDef | HAL_SMBUS_IsDeviceReady (SMBUS_HandleTypeDef *hsmbus, uint16_t DevAddress, uint32_t Trials, uint32_t Timeout) |
Check if target device is ready for communication. | |
void | HAL_SMBUS_EV_IRQHandler (SMBUS_HandleTypeDef *hsmbus) |
Handle SMBUS event interrupt request. | |
void | HAL_SMBUS_ER_IRQHandler (SMBUS_HandleTypeDef *hsmbus) |
Handle SMBUS error interrupt request. | |
__weak void | HAL_SMBUS_MasterTxCpltCallback (SMBUS_HandleTypeDef *hsmbus) |
Master Tx Transfer completed callback. | |
__weak void | HAL_SMBUS_MasterRxCpltCallback (SMBUS_HandleTypeDef *hsmbus) |
Master Rx Transfer completed callback. | |
__weak void | HAL_SMBUS_SlaveTxCpltCallback (SMBUS_HandleTypeDef *hsmbus) |
Slave Tx Transfer completed callback. | |
__weak void | HAL_SMBUS_SlaveRxCpltCallback (SMBUS_HandleTypeDef *hsmbus) |
Slave Rx Transfer completed callback. | |
__weak void | HAL_SMBUS_AddrCallback (SMBUS_HandleTypeDef *hsmbus, uint8_t TransferDirection, uint16_t AddrMatchCode) |
Slave Address Match callback. | |
__weak void | HAL_SMBUS_ListenCpltCallback (SMBUS_HandleTypeDef *hsmbus) |
Listen Complete callback. | |
__weak void | HAL_SMBUS_ErrorCallback (SMBUS_HandleTypeDef *hsmbus) |
SMBUS error callback. | |
uint32_t | HAL_SMBUS_GetState (SMBUS_HandleTypeDef *hsmbus) |
Return the SMBUS handle state. | |
uint32_t | HAL_SMBUS_GetError (SMBUS_HandleTypeDef *hsmbus) |
Return the SMBUS error code. |
SMBUS HAL module driver. This file provides firmware functions to manage the following functionalities of the System Management Bus (SMBus) peripheral, based on I2C principles of operation : + Initialization and de-initialization functions + IO operation functions + Peripheral State and Errors functions.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file stm32l4xx_hal_smbus.c.