0% found this document useful (0 votes)
46 views1 page

Esquema resumen funciones HAL

Uploaded by

pepa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views1 page

Esquema resumen funciones HAL

Uploaded by

pepa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

FUNCIONES HAL DE ICI

ADC: UART: SPI:


HAL_ADC_Start: HAL_UART_Transmit: HAL_SPI_Transmit / _Receive / _IT:
/** @brief: Enables ADC, starts conversion of regular group. /** @brief Sends an amount of data in blocking/non- /** @brief Transmit/Receive an amount of data in blocking /
* Interruptions enabled in this function: None / Yes(IT). * blocking(IT) mode. * non-blocking(IT) mode.
* @param: hadc ADC handle * @param huart UART handle. * @param hspi pointer to a SPI_HandleTypeDef structure that
* @retval:HAL status */ * @param pData Pointer to data buffer (u8 or u16 data). * contains the configuration information for SPI module.
HAL_StatusTypeDef HAL_ADC_Start(ADC_HandleTypeDef* hadc); * @param Size Amount of data elements (u8/u16) to send. * @param pData pointer to data buffer
HAL_StatusTypeDef HAL_ADC_Start_IT(ADC_HandleTypeDef* hadc); * @param Timeout Timeout duration. * @param Size amount of data to be sent
* @retval HAL status */ * @param Timeout Timeout duration
HAL_ADC_Stop: HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, * @retval HAL status */
/** @brief: Stop ADC conversion of regular group, disable uint8_t *pData, uint16_t Size, uint32_t Timeout); HAL_StatusTypeDef HAL_SPI_Transmit(SPI_HandleTypeDef *hspi,
* ADC peripheral. HAL_StatusTypeDef HAL_UART_Transmit_IT(UART_HandleTypeDef uint8_t *pData, uint16_t Size, uint32_t Timeout);
* @param: hadc ADC handle *huart, uint8_t *pData, uint16_t Size); HAL_StatusTypeDef HAL_SPI_Transmit_IT(SPI_HandleTypeDef *hspi,
* @retval:HAL status. */ uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_ADC_Stop(ADC_HandleTypeDef* hadc); HAL_UART_Receive: HAL_StatusTypeDef HAL_SPI_Receive(SPI_HandleTypeDef *hspi,
HAL_StatusTypeDef HAL_ADC_Stop_IT(ADC_HandleTypeDef* hadc); /** @brief Receive an amount of data in blocking/non-
uint8_t *pData, uint16_t Size, uint32_t Timeout);
* blocking(IT) mode.
HAL_StatusTypeDef HAL_SPI_Receive_IT(SPI_HandleTypeDef *hspi,
HAL_ADC_PollForConversion: * @param huart UART handle. uint8_t *pData, uint16_t Size);
/** @brief: Wait for regular group conversion to be completed. * @param pData Pointer to data buffer (u8/u16).
* @param: hadc ADC handle * @param Size Amount of data elements (u8/u16) to receive
* @param Timeout Timeout duration. HAL_StatusTypeDef HAL_SPI_TransmitReceive(SPI_HandleTypeDef
* @param: Timeout Timeout value in millisecond. *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size,
* @retval: HAL status */ * @retval HAL status */
HAL_StatusTypeDef HAL_UART_Receive(UART_HandleTypeDef *huart, uint32_t Timeout);
HAL_StatusTypeDef HAL_ADC_PollForConversion(ADC_HandleTypeDef* HAL_StatusTypeDef HAL_SPI_TransmitReceive_IT(SPI_HandleTypeDef
hadc, uint32_t Timeout) uint8_t *pData, uint16_t Size, uint32_t Timeout);
HAL_StatusTypeDef HAL_UART_Receive_IT(UART_HandleTypeDef *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size);
*huart, uint8_t *pData, uint16_t Size);
HAL_ADC_GetValue:
/** @brief Get ADC regular group conversion result. Interruptions:
* @param hadc ADC handle Interruptions: /** @brief Tx/Rx Transfer completed callback.
* @retval ADC group regular conversion data */ /** @brief Tx Transfer completed callback. * @param hspi pointer to a SPI_HandleTypeDef structure that
uint32_t HAL_ADC_GetValue(ADC_HandleTypeDef* hadc) * @param huart UART handle. * contains the configuration information for SPI module.
* @retval None */ * @retval None */
/** @brief Conversion complete callback in non blocking mode __weak void HAL_UART_TxCpltCallback(UART_HandleTypeDef __weak void HAL_SPI_TxCpltCallback(SPI_HandleTypeDef *hspi);
* @param hadc ADC handle *huart); __weak void HAL_SPI_RxCpltCallback(SPI_HandleTypeDef *hspi);
* @retval None */ __weak void HAL_UART_RxCpltCallback(UART_HandleTypeDef __weak void HAL_SPI_TxRxCpltCallback(SPI_HandleTypeDef *hspi);
__weak void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc) *huart);

GPIOs: CANSPI: CANSPI: Iconos


HAL_GPIO_ReadPin / Write / Toggle: #define CAN &hspi1 /* Recomendación por facilidad de uso */ /* uCAN_MSG declaration*/
/** @brief Read / Write / Toggle the specified port pin. typedef union {
* @param GPIOx where x can be (A..F) to select the GPIO /* Enable Interrupt */ struct {
* peripheral for STM32F0 family void CANSPI_EN_Int(SPI_HandleTypeDef *SPI_CAN) ; uint8_t idType;
* @param GPIO_Pin specifies the port bit to read. /* Clear CAN bus wakeup interrupt */ uint32_t id;
* This parameter can be GPIO_PIN_x where x can be (0..15). void CANSPI_CL_Flag_Int(SPI_HandleTypeDef *SPI_CAN); uint8_t dlc;
uint8_t data0;
* @retval The input port pin value. */ /* CAN Initialization: returns true if OK*/
GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef* GPIOx, uint16_t uint8_t data1;
bool CANSPI_Initialize(SPI_HandleTypeDef *SPI_CAN); uint8_t data2;
GPIO_Pin);
void HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, /* CAN Transmit: message in uCAN_MSG struct is sent to MCP2515 uint8_t data3;
uint8_t data4;
GPIO_PinState PinState); TXbuffer to be TX. Returns 1 if OK, 0 otherwise */
void HAL_GPIO_TogglePin(GPIO_TypeDef* GPIOx, uint16_t uint8_t data5;
uint8_t CANSPI_Transmit(SPI_HandleTypeDef *SPI_CAN, uCAN_MSG uint8_t data6;
GPIO_Pin); *tempCanMsg); uint8_t data7;
Interruptions: /* CAN Receive: if a message arrived, it is copied into uCAN_MSG struct. } frame;
/** @brief EXTI line detection callback. Returns 1 if OK, 0 otherwise */ uint8_t array[14];
* @param GPIO_Pin Specifies the port pin connected to } uCAN_MSG;
uint8_t CANSPI_Receive(SPI_HandleTypeDef *SPI_CAN, uCAN_MSG
* corresponding EXTI line. *tempCanMsg)
* @retval None */
__weak void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin);

You might also like