STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
Loading...
Searching...
No Matches
Input and Output operation functions

CEC Transmit/Receive functions. More...

Collaboration diagram for Input and Output operation functions:

Functions

HAL_StatusTypeDef HAL_CEC_Transmit_IT (CEC_HandleTypeDef *hcec, uint8_t InitiatorAddress, uint8_t DestinationAddress, const uint8_t *pData, uint32_t Size)
 Send data in interrupt mode.
 
uint32_t HAL_CEC_GetLastReceivedFrameSize (const CEC_HandleTypeDef *hcec)
 Get size of the received frame.
 
void HAL_CEC_ChangeRxBuffer (CEC_HandleTypeDef *hcec, uint8_t *Rxbuffer)
 Change Rx Buffer.
 
void HAL_CEC_IRQHandler (CEC_HandleTypeDef *hcec)
 This function handles CEC interrupt requests.
 
void HAL_CEC_TxCpltCallback (CEC_HandleTypeDef *hcec)
 Tx Transfer completed callback.
 
void HAL_CEC_RxCpltCallback (CEC_HandleTypeDef *hcec, uint32_t RxFrameSize)
 Rx Transfer completed callback.
 
void HAL_CEC_ErrorCallback (CEC_HandleTypeDef *hcec)
 CEC error callbacks.
 

Detailed Description

CEC Transmit/Receive functions.

 ===============================================================================
                      ##### IO operation functions #####
 ===============================================================================
    This subsection provides a set of functions allowing to manage the CEC data transfers.

    (#) The CEC handle must contain the initiator (TX side) and the destination (RX side)
        logical addresses (4-bit long addresses, 0xF for broadcast messages destination)

    (#) The communication is performed using Interrupts.
           These API's return the HAL status.
           The end of the data processing will be indicated through the
           dedicated CEC IRQ when using Interrupt mode.
           The HAL_CEC_TxCpltCallback(), HAL_CEC_RxCpltCallback() user callbacks
           will be executed respectively at the end of the transmit or Receive process
           The HAL_CEC_ErrorCallback() user callback will be executed when a communication
           error is detected

    (#) API's with Interrupt are :
         (+) HAL_CEC_Transmit_IT()
         (+) HAL_CEC_IRQHandler()

    (#) A set of User Callbacks are provided:
         (+) HAL_CEC_TxCpltCallback()
         (+) HAL_CEC_RxCpltCallback()
         (+) HAL_CEC_ErrorCallback()

Function Documentation

◆ HAL_CEC_Transmit_IT()

HAL_StatusTypeDef HAL_CEC_Transmit_IT ( CEC_HandleTypeDef * hcec,
uint8_t InitiatorAddress,
uint8_t DestinationAddress,
const uint8_t * pData,
uint32_t Size )

#include <stm32f4xx_hal_cec.h>

Send data in interrupt mode.

Parameters
hcecCEC handle
InitiatorAddressInitiator address
DestinationAddressdestination logical address
pDatapointer to input byte data buffer
Sizeamount of data to be sent in bytes (without counting the header). 0 means only the header is sent (ping operation). Maximum TX size is 15 bytes (1 opcode and up to 14 operands).
Return values
HALstatus

Definition at line 697 of file stm32f4xx_hal_cec.c.

References __HAL_CEC_FIRST_BYTE_TX_SET, __HAL_CEC_LAST_BYTE_TX_SET, __HAL_LOCK, __HAL_UNLOCK, assert_param, CEC_INITIATOR_LSB_POS, CEC_HandleTypeDef::ErrorCode, CEC_HandleTypeDef::gState, HAL_BUSY, HAL_CEC_ERROR_NONE, HAL_CEC_STATE_BUSY_TX, HAL_CEC_STATE_READY, HAL_ERROR, HAL_OK, CEC_HandleTypeDef::Instance, IS_CEC_ADDRESS, IS_CEC_MSGSIZE, CEC_HandleTypeDef::pTxBuffPtr, and CEC_HandleTypeDef::TxXferCount.

◆ HAL_CEC_GetLastReceivedFrameSize()

uint32_t HAL_CEC_GetLastReceivedFrameSize ( const CEC_HandleTypeDef * hcec)

#include <stm32f4xx_hal_cec.h>

Get size of the received frame.

Parameters
hcecCEC handle
Return values
Framesize

Definition at line 753 of file stm32f4xx_hal_cec.c.

References CEC_HandleTypeDef::RxXferSize.

◆ HAL_CEC_ChangeRxBuffer()

void HAL_CEC_ChangeRxBuffer ( CEC_HandleTypeDef * hcec,
uint8_t * Rxbuffer )

#include <stm32f4xx_hal_cec.h>

Change Rx Buffer.

Parameters
hcecCEC handle
RxbufferRx Buffer
Note
This function can be called only inside the HAL_CEC_RxCpltCallback()
Return values
Framesize

Definition at line 765 of file stm32f4xx_hal_cec.c.

References CEC_HandleTypeDef::Init, and CEC_InitTypeDef::RxBuffer.

◆ HAL_CEC_IRQHandler()

◆ HAL_CEC_TxCpltCallback()

__weak void HAL_CEC_TxCpltCallback ( CEC_HandleTypeDef * hcec)

#include <stm32f4xx_hal_cec.h>

Tx Transfer completed callback.

Parameters
hcecCEC handle
Return values
None

Definition at line 899 of file stm32f4xx_hal_cec.c.

References UNUSED.

Referenced by HAL_CEC_Init(), and HAL_CEC_IRQHandler().

◆ HAL_CEC_RxCpltCallback()

__weak void HAL_CEC_RxCpltCallback ( CEC_HandleTypeDef * hcec,
uint32_t RxFrameSize )

#include <stm32f4xx_hal_cec.h>

Rx Transfer completed callback.

Parameters
hcecCEC handle
RxFrameSizeSize of frame
Return values
None

Definition at line 914 of file stm32f4xx_hal_cec.c.

References UNUSED.

Referenced by HAL_CEC_Init(), and HAL_CEC_IRQHandler().

◆ HAL_CEC_ErrorCallback()

__weak void HAL_CEC_ErrorCallback ( CEC_HandleTypeDef * hcec)

#include <stm32f4xx_hal_cec.h>

CEC error callbacks.

Parameters
hcecCEC handle
Return values
None

Definition at line 929 of file stm32f4xx_hal_cec.c.

References UNUSED.

Referenced by HAL_CEC_Init(), and HAL_CEC_IRQHandler().