Download Description of STM32F3xx HAL drivers

Transcript
UM1786
7.2
HAL CEC Generic Driver
CEC Firmware driver API description
The following section lists the various functions of the CEC library.
7.2.1
How to use this driver
The CEC HAL driver can be used as follows:
1.
2.
3.
4.
7.2.2
Declare a CEC_HandleTypeDef handle structure.
Initialize the CEC low level resources by implementing the HAL_CEC_MspInit ()API:

Enable the CEC interface clock.

CEC pins configuration:

Enable the clock for the CEC GPIOs.

Configure these CEC pins as alternate function pull-up.

NVIC configuration if you need to use interrupt process
(HAL_CEC_Transmit_IT() and HAL_CEC_Receive_IT() APIs):

Configure the CEC interrupt priority.

Enable the NVIC CEC IRQ handle.
Program the Signal Free Time (SFT) and SFT option, Tolerance, reception stop in in
case of Bit Rising Error, Error-Bit generation conditions, device logical address and
Listen mode in the hcec Init structure.
Initialize the CEC registers by calling the HAL_CEC_Init() API.

This API configures also the low level Hardware GPIO, CLOCK, CORTEX...etc)
by calling the customed HAL_CEC_MspInit() API. The specific CEC interrupts
(Transmission complete interrupt, RXNE interrupt and Error Interrupts) will be
managed using the macros __HAL_CEC_ENABLE_IT() and
__HAL_CEC_DISABLE_IT() inside the transmit and receive process.
Initialization and Configuration functions
This subsection provides a set of functions allowing to initialize the CEC





7.2.3
The following parameters need to be configured:

SignalFreeTime

Tolerance

BRERxStop (RX stopped or not upon Bit Rising Error)

BREErrorBitGen (Error-Bit generation in case of Bit Rising Error)

LBPEErrorBitGen (Error-Bit generation in case of Long Bit Period Error)

BroadcastMsgNoErrorBitGen (Error-bit generation in case of broadcast message
error)

SignalFreeTimeOption (SFT Timer start definition)

OwnAddress (CEC device address)

ListenMode
HAL_CEC_Init()
HAL_CEC_DeInit()
HAL_CEC_MspInit()
HAL_CEC_MspDeInit()
IO operation function
DOCID026526 Rev 2
173/861