update IOC & regenerate
This commit is contained in:
parent
60ddc046d0
commit
9aca436798
@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<projectDescription>
|
|
||||||
<name>Core</name>
|
|
||||||
<comment></comment>
|
|
||||||
<projects>
|
|
||||||
</projects>
|
|
||||||
<buildSpec>
|
|
||||||
</buildSpec>
|
|
||||||
<natures>
|
|
||||||
</natures>
|
|
||||||
</projectDescription>
|
|
@ -92,6 +92,7 @@ extern volatile uint8_t canmsg_received;
|
|||||||
*/
|
*/
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* USER CODE BEGIN 1 */
|
/* USER CODE BEGIN 1 */
|
||||||
|
|
||||||
/* USER CODE END 1 */
|
/* USER CODE END 1 */
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
/* USER CODE BEGIN Includes */
|
/* USER CODE BEGIN Includes */
|
||||||
|
|
||||||
/* USER CODE END Includes */
|
/* USER CODE END Includes */
|
||||||
@ -68,6 +67,7 @@ void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
|
|||||||
*/
|
*/
|
||||||
void HAL_MspInit(void)
|
void HAL_MspInit(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* USER CODE BEGIN MspInit 0 */
|
/* USER CODE BEGIN MspInit 0 */
|
||||||
|
|
||||||
/* USER CODE END MspInit 0 */
|
/* USER CODE END MspInit 0 */
|
||||||
|
176
Core/Src/syscalls.c
Normal file
176
Core/Src/syscalls.c
Normal file
@ -0,0 +1,176 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file syscalls.c
|
||||||
|
* @author Auto-generated by STM32CubeMX
|
||||||
|
* @brief Minimal System calls file
|
||||||
|
*
|
||||||
|
* For more information about which c-functions
|
||||||
|
* need which of these lowlevel functions
|
||||||
|
* please consult the Newlib libc-manual
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2020-2024 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.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Includes */
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <sys/times.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* Variables */
|
||||||
|
extern int __io_putchar(int ch) __attribute__((weak));
|
||||||
|
extern int __io_getchar(void) __attribute__((weak));
|
||||||
|
|
||||||
|
|
||||||
|
char *__env[1] = { 0 };
|
||||||
|
char **environ = __env;
|
||||||
|
|
||||||
|
|
||||||
|
/* Functions */
|
||||||
|
void initialise_monitor_handles()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
int _getpid(void)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _kill(int pid, int sig)
|
||||||
|
{
|
||||||
|
(void)pid;
|
||||||
|
(void)sig;
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void _exit (int status)
|
||||||
|
{
|
||||||
|
_kill(status, -1);
|
||||||
|
while (1) {} /* Make sure we hang here */
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__((weak)) int _read(int file, char *ptr, int len)
|
||||||
|
{
|
||||||
|
(void)file;
|
||||||
|
int DataIdx;
|
||||||
|
|
||||||
|
for (DataIdx = 0; DataIdx < len; DataIdx++)
|
||||||
|
{
|
||||||
|
*ptr++ = __io_getchar();
|
||||||
|
}
|
||||||
|
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__((weak)) int _write(int file, char *ptr, int len)
|
||||||
|
{
|
||||||
|
(void)file;
|
||||||
|
int DataIdx;
|
||||||
|
|
||||||
|
for (DataIdx = 0; DataIdx < len; DataIdx++)
|
||||||
|
{
|
||||||
|
__io_putchar(*ptr++);
|
||||||
|
}
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _close(int file)
|
||||||
|
{
|
||||||
|
(void)file;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int _fstat(int file, struct stat *st)
|
||||||
|
{
|
||||||
|
(void)file;
|
||||||
|
st->st_mode = S_IFCHR;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _isatty(int file)
|
||||||
|
{
|
||||||
|
(void)file;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _lseek(int file, int ptr, int dir)
|
||||||
|
{
|
||||||
|
(void)file;
|
||||||
|
(void)ptr;
|
||||||
|
(void)dir;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _open(char *path, int flags, ...)
|
||||||
|
{
|
||||||
|
(void)path;
|
||||||
|
(void)flags;
|
||||||
|
/* Pretend like we always fail */
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _wait(int *status)
|
||||||
|
{
|
||||||
|
(void)status;
|
||||||
|
errno = ECHILD;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _unlink(char *name)
|
||||||
|
{
|
||||||
|
(void)name;
|
||||||
|
errno = ENOENT;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _times(struct tms *buf)
|
||||||
|
{
|
||||||
|
(void)buf;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _stat(char *file, struct stat *st)
|
||||||
|
{
|
||||||
|
(void)file;
|
||||||
|
st->st_mode = S_IFCHR;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _link(char *old, char *new)
|
||||||
|
{
|
||||||
|
(void)old;
|
||||||
|
(void)new;
|
||||||
|
errno = EMLINK;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _fork(void)
|
||||||
|
{
|
||||||
|
errno = EAGAIN;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _execve(char *name, char **argv, char **env)
|
||||||
|
{
|
||||||
|
(void)name;
|
||||||
|
(void)argv;
|
||||||
|
(void)env;
|
||||||
|
errno = ENOMEM;
|
||||||
|
return -1;
|
||||||
|
}
|
79
Core/Src/sysmem.c
Normal file
79
Core/Src/sysmem.c
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file sysmem.c
|
||||||
|
* @author Generated by STM32CubeMX
|
||||||
|
* @brief System Memory calls file
|
||||||
|
*
|
||||||
|
* For more information about which C functions
|
||||||
|
* need which of these lowlevel functions
|
||||||
|
* please consult the newlib libc manual
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2024 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.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Includes */
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pointer to the current high watermark of the heap usage
|
||||||
|
*/
|
||||||
|
static uint8_t *__sbrk_heap_end = NULL;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief _sbrk() allocates memory to the newlib heap and is used by malloc
|
||||||
|
* and others from the C library
|
||||||
|
*
|
||||||
|
* @verbatim
|
||||||
|
* ############################################################################
|
||||||
|
* # .data # .bss # newlib heap # MSP stack #
|
||||||
|
* # # # # Reserved by _Min_Stack_Size #
|
||||||
|
* ############################################################################
|
||||||
|
* ^-- RAM start ^-- _end _estack, RAM end --^
|
||||||
|
* @endverbatim
|
||||||
|
*
|
||||||
|
* This implementation starts allocating at the '_end' linker symbol
|
||||||
|
* The '_Min_Stack_Size' linker symbol reserves a memory for the MSP stack
|
||||||
|
* The implementation considers '_estack' linker symbol to be RAM end
|
||||||
|
* NOTE: If the MSP stack, at any point during execution, grows larger than the
|
||||||
|
* reserved size, please increase the '_Min_Stack_Size'.
|
||||||
|
*
|
||||||
|
* @param incr Memory size
|
||||||
|
* @return Pointer to allocated memory
|
||||||
|
*/
|
||||||
|
void *_sbrk(ptrdiff_t incr)
|
||||||
|
{
|
||||||
|
extern uint8_t _end; /* Symbol defined in the linker script */
|
||||||
|
extern uint8_t _estack; /* Symbol defined in the linker script */
|
||||||
|
extern uint32_t _Min_Stack_Size; /* Symbol defined in the linker script */
|
||||||
|
const uint32_t stack_limit = (uint32_t)&_estack - (uint32_t)&_Min_Stack_Size;
|
||||||
|
const uint8_t *max_heap = (uint8_t *)stack_limit;
|
||||||
|
uint8_t *prev_heap_end;
|
||||||
|
|
||||||
|
/* Initialize heap end at first call */
|
||||||
|
if (NULL == __sbrk_heap_end)
|
||||||
|
{
|
||||||
|
__sbrk_heap_end = &_end;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Protect heap from growing into the reserved MSP stack */
|
||||||
|
if (__sbrk_heap_end + incr > max_heap)
|
||||||
|
{
|
||||||
|
errno = ENOMEM;
|
||||||
|
return (void *)-1;
|
||||||
|
}
|
||||||
|
|
||||||
|
prev_heap_end = __sbrk_heap_end;
|
||||||
|
__sbrk_heap_end += incr;
|
||||||
|
|
||||||
|
return (void *)prev_heap_end;
|
||||||
|
}
|
@ -1996,9 +1996,9 @@ typedef struct
|
|||||||
#define ADC34_CSR_ADRDY_EOS_SLV_Pos (19U)
|
#define ADC34_CSR_ADRDY_EOS_SLV_Pos (19U)
|
||||||
#define ADC34_CSR_ADRDY_EOS_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_EOS_SLV_Pos) /*!< 0x00080000 */
|
#define ADC34_CSR_ADRDY_EOS_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_EOS_SLV_Pos) /*!< 0x00080000 */
|
||||||
#define ADC34_CSR_ADRDY_EOS_SLV ADC34_CSR_ADRDY_EOS_SLV_Msk /*!< End of regular sequence flag of the slave ADC */
|
#define ADC34_CSR_ADRDY_EOS_SLV ADC34_CSR_ADRDY_EOS_SLV_Msk /*!< End of regular sequence flag of the slave ADC */
|
||||||
#define ADC12_CSR_ADRDY_OVR_SLV_Pos (20U)
|
#define ADC34_CSR_ADRDY_OVR_SLV_Pos (20U)
|
||||||
#define ADC12_CSR_ADRDY_OVR_SLV_Msk (0x1UL << ADC12_CSR_ADRDY_OVR_SLV_Pos) /*!< 0x00100000 */
|
#define ADC34_CSR_ADRDY_OVR_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_OVR_SLV_Pos) /*!< 0x00100000 */
|
||||||
#define ADC12_CSR_ADRDY_OVR_SLV ADC12_CSR_ADRDY_OVR_SLV_Msk /*!< Overrun flag of the slave ADC */
|
#define ADC34_CSR_ADRDY_OVR_SLV ADC34_CSR_ADRDY_OVR_SLV_Msk /*!< Overrun flag of the slave ADC */
|
||||||
#define ADC34_CSR_ADRDY_JEOC_SLV_Pos (21U)
|
#define ADC34_CSR_ADRDY_JEOC_SLV_Pos (21U)
|
||||||
#define ADC34_CSR_ADRDY_JEOC_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_JEOC_SLV_Pos) /*!< 0x00200000 */
|
#define ADC34_CSR_ADRDY_JEOC_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_JEOC_SLV_Pos) /*!< 0x00200000 */
|
||||||
#define ADC34_CSR_ADRDY_JEOC_SLV ADC34_CSR_ADRDY_JEOC_SLV_Msk /*!< End of injected conversion of the slave ADC */
|
#define ADC34_CSR_ADRDY_JEOC_SLV ADC34_CSR_ADRDY_JEOC_SLV_Msk /*!< End of injected conversion of the slave ADC */
|
||||||
|
@ -2107,9 +2107,9 @@ typedef struct
|
|||||||
#define ADC34_CSR_ADRDY_EOS_SLV_Pos (19U)
|
#define ADC34_CSR_ADRDY_EOS_SLV_Pos (19U)
|
||||||
#define ADC34_CSR_ADRDY_EOS_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_EOS_SLV_Pos) /*!< 0x00080000 */
|
#define ADC34_CSR_ADRDY_EOS_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_EOS_SLV_Pos) /*!< 0x00080000 */
|
||||||
#define ADC34_CSR_ADRDY_EOS_SLV ADC34_CSR_ADRDY_EOS_SLV_Msk /*!< End of regular sequence flag of the slave ADC */
|
#define ADC34_CSR_ADRDY_EOS_SLV ADC34_CSR_ADRDY_EOS_SLV_Msk /*!< End of regular sequence flag of the slave ADC */
|
||||||
#define ADC12_CSR_ADRDY_OVR_SLV_Pos (20U)
|
#define ADC34_CSR_ADRDY_OVR_SLV_Pos (20U)
|
||||||
#define ADC12_CSR_ADRDY_OVR_SLV_Msk (0x1UL << ADC12_CSR_ADRDY_OVR_SLV_Pos) /*!< 0x00100000 */
|
#define ADC34_CSR_ADRDY_OVR_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_OVR_SLV_Pos) /*!< 0x00100000 */
|
||||||
#define ADC12_CSR_ADRDY_OVR_SLV ADC12_CSR_ADRDY_OVR_SLV_Msk /*!< Overrun flag of the slave ADC */
|
#define ADC34_CSR_ADRDY_OVR_SLV ADC34_CSR_ADRDY_OVR_SLV_Msk /*!< Overrun flag of the slave ADC */
|
||||||
#define ADC34_CSR_ADRDY_JEOC_SLV_Pos (21U)
|
#define ADC34_CSR_ADRDY_JEOC_SLV_Pos (21U)
|
||||||
#define ADC34_CSR_ADRDY_JEOC_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_JEOC_SLV_Pos) /*!< 0x00200000 */
|
#define ADC34_CSR_ADRDY_JEOC_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_JEOC_SLV_Pos) /*!< 0x00200000 */
|
||||||
#define ADC34_CSR_ADRDY_JEOC_SLV ADC34_CSR_ADRDY_JEOC_SLV_Msk /*!< End of injected conversion of the slave ADC */
|
#define ADC34_CSR_ADRDY_JEOC_SLV ADC34_CSR_ADRDY_JEOC_SLV_Msk /*!< End of injected conversion of the slave ADC */
|
||||||
|
@ -1998,9 +1998,9 @@ typedef struct
|
|||||||
#define ADC34_CSR_ADRDY_EOS_SLV_Pos (19U)
|
#define ADC34_CSR_ADRDY_EOS_SLV_Pos (19U)
|
||||||
#define ADC34_CSR_ADRDY_EOS_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_EOS_SLV_Pos) /*!< 0x00080000 */
|
#define ADC34_CSR_ADRDY_EOS_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_EOS_SLV_Pos) /*!< 0x00080000 */
|
||||||
#define ADC34_CSR_ADRDY_EOS_SLV ADC34_CSR_ADRDY_EOS_SLV_Msk /*!< End of regular sequence flag of the slave ADC */
|
#define ADC34_CSR_ADRDY_EOS_SLV ADC34_CSR_ADRDY_EOS_SLV_Msk /*!< End of regular sequence flag of the slave ADC */
|
||||||
#define ADC12_CSR_ADRDY_OVR_SLV_Pos (20U)
|
#define ADC34_CSR_ADRDY_OVR_SLV_Pos (20U)
|
||||||
#define ADC12_CSR_ADRDY_OVR_SLV_Msk (0x1UL << ADC12_CSR_ADRDY_OVR_SLV_Pos) /*!< 0x00100000 */
|
#define ADC34_CSR_ADRDY_OVR_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_OVR_SLV_Pos) /*!< 0x00100000 */
|
||||||
#define ADC12_CSR_ADRDY_OVR_SLV ADC12_CSR_ADRDY_OVR_SLV_Msk /*!< Overrun flag of the slave ADC */
|
#define ADC34_CSR_ADRDY_OVR_SLV ADC34_CSR_ADRDY_OVR_SLV_Msk /*!< Overrun flag of the slave ADC */
|
||||||
#define ADC34_CSR_ADRDY_JEOC_SLV_Pos (21U)
|
#define ADC34_CSR_ADRDY_JEOC_SLV_Pos (21U)
|
||||||
#define ADC34_CSR_ADRDY_JEOC_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_JEOC_SLV_Pos) /*!< 0x00200000 */
|
#define ADC34_CSR_ADRDY_JEOC_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_JEOC_SLV_Pos) /*!< 0x00200000 */
|
||||||
#define ADC34_CSR_ADRDY_JEOC_SLV ADC34_CSR_ADRDY_JEOC_SLV_Msk /*!< End of injected conversion of the slave ADC */
|
#define ADC34_CSR_ADRDY_JEOC_SLV ADC34_CSR_ADRDY_JEOC_SLV_Msk /*!< End of injected conversion of the slave ADC */
|
||||||
|
@ -1954,9 +1954,9 @@ typedef struct
|
|||||||
#define ADC34_CSR_ADRDY_EOS_SLV_Pos (19U)
|
#define ADC34_CSR_ADRDY_EOS_SLV_Pos (19U)
|
||||||
#define ADC34_CSR_ADRDY_EOS_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_EOS_SLV_Pos) /*!< 0x00080000 */
|
#define ADC34_CSR_ADRDY_EOS_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_EOS_SLV_Pos) /*!< 0x00080000 */
|
||||||
#define ADC34_CSR_ADRDY_EOS_SLV ADC34_CSR_ADRDY_EOS_SLV_Msk /*!< End of regular sequence flag of the slave ADC */
|
#define ADC34_CSR_ADRDY_EOS_SLV ADC34_CSR_ADRDY_EOS_SLV_Msk /*!< End of regular sequence flag of the slave ADC */
|
||||||
#define ADC12_CSR_ADRDY_OVR_SLV_Pos (20U)
|
#define ADC34_CSR_ADRDY_OVR_SLV_Pos (20U)
|
||||||
#define ADC12_CSR_ADRDY_OVR_SLV_Msk (0x1UL << ADC12_CSR_ADRDY_OVR_SLV_Pos) /*!< 0x00100000 */
|
#define ADC34_CSR_ADRDY_OVR_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_OVR_SLV_Pos) /*!< 0x00100000 */
|
||||||
#define ADC12_CSR_ADRDY_OVR_SLV ADC12_CSR_ADRDY_OVR_SLV_Msk /*!< Overrun flag of the slave ADC */
|
#define ADC34_CSR_ADRDY_OVR_SLV ADC34_CSR_ADRDY_OVR_SLV_Msk /*!< Overrun flag of the slave ADC */
|
||||||
#define ADC34_CSR_ADRDY_JEOC_SLV_Pos (21U)
|
#define ADC34_CSR_ADRDY_JEOC_SLV_Pos (21U)
|
||||||
#define ADC34_CSR_ADRDY_JEOC_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_JEOC_SLV_Pos) /*!< 0x00200000 */
|
#define ADC34_CSR_ADRDY_JEOC_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_JEOC_SLV_Pos) /*!< 0x00200000 */
|
||||||
#define ADC34_CSR_ADRDY_JEOC_SLV ADC34_CSR_ADRDY_JEOC_SLV_Msk /*!< End of injected conversion of the slave ADC */
|
#define ADC34_CSR_ADRDY_JEOC_SLV ADC34_CSR_ADRDY_JEOC_SLV_Msk /*!< End of injected conversion of the slave ADC */
|
||||||
|
@ -7363,9 +7363,13 @@ typedef struct
|
|||||||
#define CEC_TXDR_TXD CEC_TXDR_TXD_Msk /*!< CEC Tx Data */
|
#define CEC_TXDR_TXD CEC_TXDR_TXD_Msk /*!< CEC Tx Data */
|
||||||
|
|
||||||
/******************* Bit definition for CEC_RXDR register *******************/
|
/******************* Bit definition for CEC_RXDR register *******************/
|
||||||
#define CEC_TXDR_RXD_Pos (0U)
|
#define CEC_RXDR_RXD_Pos (0U)
|
||||||
#define CEC_TXDR_RXD_Msk (0xFFUL << CEC_TXDR_RXD_Pos) /*!< 0x000000FF */
|
#define CEC_RXDR_RXD_Msk (0xFFUL << CEC_RXDR_RXD_Pos) /*!< 0x000000FF */
|
||||||
#define CEC_TXDR_RXD CEC_TXDR_RXD_Msk /*!< CEC Rx Data */
|
#define CEC_RXDR_RXD CEC_RXDR_RXD_Msk /*!< CEC Rx Data */
|
||||||
|
/* Legacy aliases */
|
||||||
|
#define CEC_TXDR_RXD_Pos CEC_RXDR_RXD_Pos
|
||||||
|
#define CEC_TXDR_RXD_Msk CEC_RXDR_RXD_Msk
|
||||||
|
#define CEC_TXDR_RXD CEC_RXDR_RXD
|
||||||
|
|
||||||
/******************* Bit definition for CEC_ISR register ********************/
|
/******************* Bit definition for CEC_ISR register ********************/
|
||||||
#define CEC_ISR_RXBR_Pos (0U)
|
#define CEC_ISR_RXBR_Pos (0U)
|
||||||
|
@ -7304,9 +7304,13 @@ typedef struct
|
|||||||
#define CEC_TXDR_TXD CEC_TXDR_TXD_Msk /*!< CEC Tx Data */
|
#define CEC_TXDR_TXD CEC_TXDR_TXD_Msk /*!< CEC Tx Data */
|
||||||
|
|
||||||
/******************* Bit definition for CEC_RXDR register *******************/
|
/******************* Bit definition for CEC_RXDR register *******************/
|
||||||
#define CEC_TXDR_RXD_Pos (0U)
|
#define CEC_RXDR_RXD_Pos (0U)
|
||||||
#define CEC_TXDR_RXD_Msk (0xFFUL << CEC_TXDR_RXD_Pos) /*!< 0x000000FF */
|
#define CEC_RXDR_RXD_Msk (0xFFUL << CEC_RXDR_RXD_Pos) /*!< 0x000000FF */
|
||||||
#define CEC_TXDR_RXD CEC_TXDR_RXD_Msk /*!< CEC Rx Data */
|
#define CEC_RXDR_RXD CEC_RXDR_RXD_Msk /*!< CEC Rx Data */
|
||||||
|
/* Legacy aliases */
|
||||||
|
#define CEC_TXDR_RXD_Pos CEC_RXDR_RXD_Pos
|
||||||
|
#define CEC_TXDR_RXD_Msk CEC_RXDR_RXD_Msk
|
||||||
|
#define CEC_TXDR_RXD CEC_RXDR_RXD
|
||||||
|
|
||||||
/******************* Bit definition for CEC_ISR register ********************/
|
/******************* Bit definition for CEC_ISR register ********************/
|
||||||
#define CEC_ISR_RXBR_Pos (0U)
|
#define CEC_ISR_RXBR_Pos (0U)
|
||||||
|
@ -2063,9 +2063,9 @@ typedef struct
|
|||||||
#define ADC34_CSR_ADRDY_EOS_SLV_Pos (19U)
|
#define ADC34_CSR_ADRDY_EOS_SLV_Pos (19U)
|
||||||
#define ADC34_CSR_ADRDY_EOS_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_EOS_SLV_Pos) /*!< 0x00080000 */
|
#define ADC34_CSR_ADRDY_EOS_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_EOS_SLV_Pos) /*!< 0x00080000 */
|
||||||
#define ADC34_CSR_ADRDY_EOS_SLV ADC34_CSR_ADRDY_EOS_SLV_Msk /*!< End of regular sequence flag of the slave ADC */
|
#define ADC34_CSR_ADRDY_EOS_SLV ADC34_CSR_ADRDY_EOS_SLV_Msk /*!< End of regular sequence flag of the slave ADC */
|
||||||
#define ADC12_CSR_ADRDY_OVR_SLV_Pos (20U)
|
#define ADC34_CSR_ADRDY_OVR_SLV_Pos (20U)
|
||||||
#define ADC12_CSR_ADRDY_OVR_SLV_Msk (0x1UL << ADC12_CSR_ADRDY_OVR_SLV_Pos) /*!< 0x00100000 */
|
#define ADC34_CSR_ADRDY_OVR_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_OVR_SLV_Pos) /*!< 0x00100000 */
|
||||||
#define ADC12_CSR_ADRDY_OVR_SLV ADC12_CSR_ADRDY_OVR_SLV_Msk /*!< Overrun flag of the slave ADC */
|
#define ADC34_CSR_ADRDY_OVR_SLV ADC34_CSR_ADRDY_OVR_SLV_Msk /*!< Overrun flag of the slave ADC */
|
||||||
#define ADC34_CSR_ADRDY_JEOC_SLV_Pos (21U)
|
#define ADC34_CSR_ADRDY_JEOC_SLV_Pos (21U)
|
||||||
#define ADC34_CSR_ADRDY_JEOC_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_JEOC_SLV_Pos) /*!< 0x00200000 */
|
#define ADC34_CSR_ADRDY_JEOC_SLV_Msk (0x1UL << ADC34_CSR_ADRDY_JEOC_SLV_Pos) /*!< 0x00200000 */
|
||||||
#define ADC34_CSR_ADRDY_JEOC_SLV ADC34_CSR_ADRDY_JEOC_SLV_Msk /*!< End of injected conversion of the slave ADC */
|
#define ADC34_CSR_ADRDY_JEOC_SLV ADC34_CSR_ADRDY_JEOC_SLV_Msk /*!< End of injected conversion of the slave ADC */
|
||||||
|
@ -102,11 +102,11 @@
|
|||||||
#endif /* USE_HAL_DRIVER */
|
#endif /* USE_HAL_DRIVER */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief CMSIS Device version number V2.3.7
|
* @brief CMSIS Device version number V2.3.8
|
||||||
*/
|
*/
|
||||||
#define __STM32F3_CMSIS_VERSION_MAIN (0x02) /*!< [31:24] main version */
|
#define __STM32F3_CMSIS_VERSION_MAIN (0x02) /*!< [31:24] main version */
|
||||||
#define __STM32F3_CMSIS_VERSION_SUB1 (0x03) /*!< [23:16] sub1 version */
|
#define __STM32F3_CMSIS_VERSION_SUB1 (0x03) /*!< [23:16] sub1 version */
|
||||||
#define __STM32F3_CMSIS_VERSION_SUB2 (0x07) /*!< [15:8] sub2 version */
|
#define __STM32F3_CMSIS_VERSION_SUB2 (0x08) /*!< [15:8] sub2 version */
|
||||||
#define __STM32F3_CMSIS_VERSION_RC (0x00) /*!< [7:0] release candidate */
|
#define __STM32F3_CMSIS_VERSION_RC (0x00) /*!< [7:0] release candidate */
|
||||||
#define __STM32F3_CMSIS_VERSION ((__STM32F3_CMSIS_VERSION_MAIN << 24)\
|
#define __STM32F3_CMSIS_VERSION ((__STM32F3_CMSIS_VERSION_MAIN << 24)\
|
||||||
|(__STM32F3_CMSIS_VERSION_SUB1 << 16)\
|
|(__STM32F3_CMSIS_VERSION_SUB1 << 16)\
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
*
|
*
|
||||||
* Copyright (c) 2023 STMicroelectronics.
|
* Copyright (c) 2021 STMicroelectronics.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This software is licensed under terms that can be found in the LICENSE file
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
@ -37,16 +37,12 @@ extern "C" {
|
|||||||
#define AES_CLEARFLAG_CCF CRYP_CLEARFLAG_CCF
|
#define AES_CLEARFLAG_CCF CRYP_CLEARFLAG_CCF
|
||||||
#define AES_CLEARFLAG_RDERR CRYP_CLEARFLAG_RDERR
|
#define AES_CLEARFLAG_RDERR CRYP_CLEARFLAG_RDERR
|
||||||
#define AES_CLEARFLAG_WRERR CRYP_CLEARFLAG_WRERR
|
#define AES_CLEARFLAG_WRERR CRYP_CLEARFLAG_WRERR
|
||||||
#if defined(STM32U5) || defined(STM32H7) || defined(STM32MP1)
|
#if defined(STM32H7) || defined(STM32MP1)
|
||||||
#define CRYP_DATATYPE_32B CRYP_NO_SWAP
|
#define CRYP_DATATYPE_32B CRYP_NO_SWAP
|
||||||
#define CRYP_DATATYPE_16B CRYP_HALFWORD_SWAP
|
#define CRYP_DATATYPE_16B CRYP_HALFWORD_SWAP
|
||||||
#define CRYP_DATATYPE_8B CRYP_BYTE_SWAP
|
#define CRYP_DATATYPE_8B CRYP_BYTE_SWAP
|
||||||
#define CRYP_DATATYPE_1B CRYP_BIT_SWAP
|
#define CRYP_DATATYPE_1B CRYP_BIT_SWAP
|
||||||
#if defined(STM32U5)
|
#endif /* STM32H7 || STM32MP1 */
|
||||||
#define CRYP_CCF_CLEAR CRYP_CLEAR_CCF
|
|
||||||
#define CRYP_ERR_CLEAR CRYP_CLEAR_RWEIF
|
|
||||||
#endif /* STM32U5 */
|
|
||||||
#endif /* STM32U5 || STM32H7 || STM32MP1 */
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
@ -279,7 +275,7 @@ extern "C" {
|
|||||||
#define DAC_WAVEGENERATION_NOISE DAC_WAVE_NOISE
|
#define DAC_WAVEGENERATION_NOISE DAC_WAVE_NOISE
|
||||||
#define DAC_WAVEGENERATION_TRIANGLE DAC_WAVE_TRIANGLE
|
#define DAC_WAVEGENERATION_TRIANGLE DAC_WAVE_TRIANGLE
|
||||||
|
|
||||||
#if defined(STM32G4) || defined(STM32L5) || defined(STM32H7) || defined (STM32U5)
|
#if defined(STM32G4) || defined(STM32H7) || defined (STM32U5)
|
||||||
#define DAC_CHIPCONNECT_DISABLE DAC_CHIPCONNECT_EXTERNAL
|
#define DAC_CHIPCONNECT_DISABLE DAC_CHIPCONNECT_EXTERNAL
|
||||||
#define DAC_CHIPCONNECT_ENABLE DAC_CHIPCONNECT_INTERNAL
|
#define DAC_CHIPCONNECT_ENABLE DAC_CHIPCONNECT_INTERNAL
|
||||||
#endif
|
#endif
|
||||||
@ -552,6 +548,16 @@ extern "C" {
|
|||||||
#define OB_SRAM134_RST_ERASE OB_SRAM_RST_ERASE
|
#define OB_SRAM134_RST_ERASE OB_SRAM_RST_ERASE
|
||||||
#define OB_SRAM134_RST_NOT_ERASE OB_SRAM_RST_NOT_ERASE
|
#define OB_SRAM134_RST_NOT_ERASE OB_SRAM_RST_NOT_ERASE
|
||||||
#endif /* STM32U5 */
|
#endif /* STM32U5 */
|
||||||
|
#if defined(STM32U0)
|
||||||
|
#define OB_USER_nRST_STOP OB_USER_NRST_STOP
|
||||||
|
#define OB_USER_nRST_STDBY OB_USER_NRST_STDBY
|
||||||
|
#define OB_USER_nRST_SHDW OB_USER_NRST_SHDW
|
||||||
|
#define OB_USER_nBOOT_SEL OB_USER_NBOOT_SEL
|
||||||
|
#define OB_USER_nBOOT0 OB_USER_NBOOT0
|
||||||
|
#define OB_USER_nBOOT1 OB_USER_NBOOT1
|
||||||
|
#define OB_nBOOT0_RESET OB_NBOOT0_RESET
|
||||||
|
#define OB_nBOOT0_SET OB_NBOOT0_SET
|
||||||
|
#endif /* STM32U0 */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
@ -1243,10 +1249,10 @@ extern "C" {
|
|||||||
#define RTC_TAMPERPIN_PA0 RTC_TAMPERPIN_POS1
|
#define RTC_TAMPERPIN_PA0 RTC_TAMPERPIN_POS1
|
||||||
#define RTC_TAMPERPIN_PI8 RTC_TAMPERPIN_POS1
|
#define RTC_TAMPERPIN_PI8 RTC_TAMPERPIN_POS1
|
||||||
|
|
||||||
#if defined(STM32H5)
|
#if defined(STM32H5) || defined(STM32H7RS)
|
||||||
#define TAMP_SECRETDEVICE_ERASE_NONE TAMP_DEVICESECRETS_ERASE_NONE
|
#define TAMP_SECRETDEVICE_ERASE_NONE TAMP_DEVICESECRETS_ERASE_NONE
|
||||||
#define TAMP_SECRETDEVICE_ERASE_BKP_SRAM TAMP_DEVICESECRETS_ERASE_BKPSRAM
|
#define TAMP_SECRETDEVICE_ERASE_BKP_SRAM TAMP_DEVICESECRETS_ERASE_BKPSRAM
|
||||||
#endif /* STM32H5 */
|
#endif /* STM32H5 || STM32H7RS */
|
||||||
|
|
||||||
#if defined(STM32WBA)
|
#if defined(STM32WBA)
|
||||||
#define TAMP_SECRETDEVICE_ERASE_NONE TAMP_DEVICESECRETS_ERASE_NONE
|
#define TAMP_SECRETDEVICE_ERASE_NONE TAMP_DEVICESECRETS_ERASE_NONE
|
||||||
@ -1258,10 +1264,10 @@ extern "C" {
|
|||||||
#define TAMP_SECRETDEVICE_ERASE_ALL TAMP_DEVICESECRETS_ERASE_ALL
|
#define TAMP_SECRETDEVICE_ERASE_ALL TAMP_DEVICESECRETS_ERASE_ALL
|
||||||
#endif /* STM32WBA */
|
#endif /* STM32WBA */
|
||||||
|
|
||||||
#if defined(STM32H5) || defined(STM32WBA)
|
#if defined(STM32H5) || defined(STM32WBA) || defined(STM32H7RS)
|
||||||
#define TAMP_SECRETDEVICE_ERASE_DISABLE TAMP_DEVICESECRETS_ERASE_NONE
|
#define TAMP_SECRETDEVICE_ERASE_DISABLE TAMP_DEVICESECRETS_ERASE_NONE
|
||||||
#define TAMP_SECRETDEVICE_ERASE_ENABLE TAMP_SECRETDEVICE_ERASE_ALL
|
#define TAMP_SECRETDEVICE_ERASE_ENABLE TAMP_SECRETDEVICE_ERASE_ALL
|
||||||
#endif /* STM32H5 || STM32WBA */
|
#endif /* STM32H5 || STM32WBA || STM32H7RS */
|
||||||
|
|
||||||
#if defined(STM32F7)
|
#if defined(STM32F7)
|
||||||
#define RTC_TAMPCR_TAMPXE RTC_TAMPER_ENABLE_BITS_MASK
|
#define RTC_TAMPCR_TAMPXE RTC_TAMPER_ENABLE_BITS_MASK
|
||||||
@ -1599,6 +1605,8 @@ extern "C" {
|
|||||||
#define ETH_MAC_SMALL_FIFO_RW_ACTIVE 0x00000006U /* MAC small FIFO read / write controllers active */
|
#define ETH_MAC_SMALL_FIFO_RW_ACTIVE 0x00000006U /* MAC small FIFO read / write controllers active */
|
||||||
#define ETH_MAC_MII_RECEIVE_PROTOCOL_ACTIVE 0x00000001U /* MAC MII receive protocol engine active */
|
#define ETH_MAC_MII_RECEIVE_PROTOCOL_ACTIVE 0x00000001U /* MAC MII receive protocol engine active */
|
||||||
|
|
||||||
|
#define ETH_TxPacketConfig ETH_TxPacketConfigTypeDef /* Transmit Packet Configuration structure definition */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
@ -1991,12 +1999,12 @@ extern "C" {
|
|||||||
/** @defgroup HAL_RTC_Aliased_Functions HAL RTC Aliased Functions maintained for legacy purpose
|
/** @defgroup HAL_RTC_Aliased_Functions HAL RTC Aliased Functions maintained for legacy purpose
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#if defined(STM32H5) || defined(STM32WBA)
|
#if defined(STM32H5) || defined(STM32WBA) || defined(STM32H7RS)
|
||||||
#define HAL_RTCEx_SetBoothardwareKey HAL_RTCEx_LockBootHardwareKey
|
#define HAL_RTCEx_SetBoothardwareKey HAL_RTCEx_LockBootHardwareKey
|
||||||
#define HAL_RTCEx_BKUPBlock_Enable HAL_RTCEx_BKUPBlock
|
#define HAL_RTCEx_BKUPBlock_Enable HAL_RTCEx_BKUPBlock
|
||||||
#define HAL_RTCEx_BKUPBlock_Disable HAL_RTCEx_BKUPUnblock
|
#define HAL_RTCEx_BKUPBlock_Disable HAL_RTCEx_BKUPUnblock
|
||||||
#define HAL_RTCEx_Erase_SecretDev_Conf HAL_RTCEx_ConfigEraseDeviceSecrets
|
#define HAL_RTCEx_Erase_SecretDev_Conf HAL_RTCEx_ConfigEraseDeviceSecrets
|
||||||
#endif /* STM32H5 || STM32WBA */
|
#endif /* STM32H5 || STM32WBA || STM32H7RS */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
@ -2723,6 +2731,12 @@ extern "C" {
|
|||||||
#define __APB1_RELEASE_RESET __HAL_RCC_APB1_RELEASE_RESET
|
#define __APB1_RELEASE_RESET __HAL_RCC_APB1_RELEASE_RESET
|
||||||
#define __APB2_FORCE_RESET __HAL_RCC_APB2_FORCE_RESET
|
#define __APB2_FORCE_RESET __HAL_RCC_APB2_FORCE_RESET
|
||||||
#define __APB2_RELEASE_RESET __HAL_RCC_APB2_RELEASE_RESET
|
#define __APB2_RELEASE_RESET __HAL_RCC_APB2_RELEASE_RESET
|
||||||
|
#if defined(STM32C0)
|
||||||
|
#define __HAL_RCC_APB1_FORCE_RESET __HAL_RCC_APB1_GRP1_FORCE_RESET
|
||||||
|
#define __HAL_RCC_APB1_RELEASE_RESET __HAL_RCC_APB1_GRP1_RELEASE_RESET
|
||||||
|
#define __HAL_RCC_APB2_FORCE_RESET __HAL_RCC_APB1_GRP2_FORCE_RESET
|
||||||
|
#define __HAL_RCC_APB2_RELEASE_RESET __HAL_RCC_APB1_GRP2_RELEASE_RESET
|
||||||
|
#endif /* STM32C0 */
|
||||||
#define __BKP_CLK_DISABLE __HAL_RCC_BKP_CLK_DISABLE
|
#define __BKP_CLK_DISABLE __HAL_RCC_BKP_CLK_DISABLE
|
||||||
#define __BKP_CLK_ENABLE __HAL_RCC_BKP_CLK_ENABLE
|
#define __BKP_CLK_ENABLE __HAL_RCC_BKP_CLK_ENABLE
|
||||||
#define __BKP_FORCE_RESET __HAL_RCC_BKP_FORCE_RESET
|
#define __BKP_FORCE_RESET __HAL_RCC_BKP_FORCE_RESET
|
||||||
@ -3646,8 +3660,12 @@ extern "C" {
|
|||||||
#define RCC_MCOSOURCE_PLLCLK_NODIV RCC_MCO1SOURCE_PLLCLK
|
#define RCC_MCOSOURCE_PLLCLK_NODIV RCC_MCO1SOURCE_PLLCLK
|
||||||
#define RCC_MCOSOURCE_PLLCLK_DIV2 RCC_MCO1SOURCE_PLLCLK_DIV2
|
#define RCC_MCOSOURCE_PLLCLK_DIV2 RCC_MCO1SOURCE_PLLCLK_DIV2
|
||||||
|
|
||||||
|
#if defined(STM32U0)
|
||||||
|
#define RCC_SYSCLKSOURCE_STATUS_PLLR RCC_SYSCLKSOURCE_STATUS_PLLCLK
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(STM32L4) || defined(STM32WB) || defined(STM32G0) || defined(STM32G4) || defined(STM32L5) || \
|
#if defined(STM32L4) || defined(STM32WB) || defined(STM32G0) || defined(STM32G4) || defined(STM32L5) || \
|
||||||
defined(STM32WL) || defined(STM32C0)
|
defined(STM32WL) || defined(STM32C0) || defined(STM32H7RS) || defined(STM32U0)
|
||||||
#define RCC_RTCCLKSOURCE_NO_CLK RCC_RTCCLKSOURCE_NONE
|
#define RCC_RTCCLKSOURCE_NO_CLK RCC_RTCCLKSOURCE_NONE
|
||||||
#else
|
#else
|
||||||
#define RCC_RTCCLKSOURCE_NONE RCC_RTCCLKSOURCE_NO_CLK
|
#define RCC_RTCCLKSOURCE_NONE RCC_RTCCLKSOURCE_NO_CLK
|
||||||
@ -3749,8 +3767,10 @@ extern "C" {
|
|||||||
#define __HAL_RCC_GET_DFSDM_SOURCE __HAL_RCC_GET_DFSDM1_SOURCE
|
#define __HAL_RCC_GET_DFSDM_SOURCE __HAL_RCC_GET_DFSDM1_SOURCE
|
||||||
#define RCC_DFSDM1CLKSOURCE_PCLK RCC_DFSDM1CLKSOURCE_PCLK2
|
#define RCC_DFSDM1CLKSOURCE_PCLK RCC_DFSDM1CLKSOURCE_PCLK2
|
||||||
#define RCC_SWPMI1CLKSOURCE_PCLK RCC_SWPMI1CLKSOURCE_PCLK1
|
#define RCC_SWPMI1CLKSOURCE_PCLK RCC_SWPMI1CLKSOURCE_PCLK1
|
||||||
|
#if !defined(STM32U0)
|
||||||
#define RCC_LPTIM1CLKSOURCE_PCLK RCC_LPTIM1CLKSOURCE_PCLK1
|
#define RCC_LPTIM1CLKSOURCE_PCLK RCC_LPTIM1CLKSOURCE_PCLK1
|
||||||
#define RCC_LPTIM2CLKSOURCE_PCLK RCC_LPTIM2CLKSOURCE_PCLK1
|
#define RCC_LPTIM2CLKSOURCE_PCLK RCC_LPTIM2CLKSOURCE_PCLK1
|
||||||
|
#endif
|
||||||
|
|
||||||
#define RCC_DFSDM1AUDIOCLKSOURCE_I2SAPB1 RCC_DFSDM1AUDIOCLKSOURCE_I2S1
|
#define RCC_DFSDM1AUDIOCLKSOURCE_I2SAPB1 RCC_DFSDM1AUDIOCLKSOURCE_I2S1
|
||||||
#define RCC_DFSDM1AUDIOCLKSOURCE_I2SAPB2 RCC_DFSDM1AUDIOCLKSOURCE_I2S2
|
#define RCC_DFSDM1AUDIOCLKSOURCE_I2SAPB2 RCC_DFSDM1AUDIOCLKSOURCE_I2S2
|
||||||
@ -3896,7 +3916,8 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
#if defined (STM32G0) || defined (STM32L5) || defined (STM32L412xx) || defined (STM32L422xx) || \
|
#if defined (STM32G0) || defined (STM32L5) || defined (STM32L412xx) || defined (STM32L422xx) || \
|
||||||
defined (STM32L4P5xx)|| defined (STM32L4Q5xx) || defined (STM32G4) || defined (STM32WL) || defined (STM32U5) || \
|
defined (STM32L4P5xx)|| defined (STM32L4Q5xx) || defined (STM32G4) || defined (STM32WL) || defined (STM32U5) || \
|
||||||
defined (STM32WBA) || defined (STM32H5) || defined (STM32C0)
|
defined (STM32WBA) || defined (STM32H5) || \
|
||||||
|
defined (STM32C0) || defined (STM32H7RS) || defined (STM32U0)
|
||||||
#else
|
#else
|
||||||
#define __HAL_RTC_CLEAR_FLAG __HAL_RTC_EXTI_CLEAR_FLAG
|
#define __HAL_RTC_CLEAR_FLAG __HAL_RTC_EXTI_CLEAR_FLAG
|
||||||
#endif
|
#endif
|
||||||
@ -3931,6 +3952,13 @@ extern "C" {
|
|||||||
__HAL_RTC_TAMPER_TIMESTAMP_EXTI_GENERATE_SWIT()))
|
__HAL_RTC_TAMPER_TIMESTAMP_EXTI_GENERATE_SWIT()))
|
||||||
#endif /* STM32F1 */
|
#endif /* STM32F1 */
|
||||||
|
|
||||||
|
#if defined (STM32F0) || defined (STM32F2) || defined (STM32F3) || defined (STM32F4) || defined (STM32F7) || \
|
||||||
|
defined (STM32H7) || \
|
||||||
|
defined (STM32L0) || defined (STM32L1) || \
|
||||||
|
defined (STM32WB)
|
||||||
|
#define __HAL_RTC_TAMPER_GET_IT __HAL_RTC_TAMPER_GET_FLAG
|
||||||
|
#endif
|
||||||
|
|
||||||
#define IS_ALARM IS_RTC_ALARM
|
#define IS_ALARM IS_RTC_ALARM
|
||||||
#define IS_ALARM_MASK IS_RTC_ALARM_MASK
|
#define IS_ALARM_MASK IS_RTC_ALARM_MASK
|
||||||
#define IS_TAMPER IS_RTC_TAMPER
|
#define IS_TAMPER IS_RTC_TAMPER
|
||||||
@ -4212,6 +4240,9 @@ extern "C" {
|
|||||||
#define __HAL_TIM_GetCompare __HAL_TIM_GET_COMPARE
|
#define __HAL_TIM_GetCompare __HAL_TIM_GET_COMPARE
|
||||||
|
|
||||||
#define TIM_BREAKINPUTSOURCE_DFSDM TIM_BREAKINPUTSOURCE_DFSDM1
|
#define TIM_BREAKINPUTSOURCE_DFSDM TIM_BREAKINPUTSOURCE_DFSDM1
|
||||||
|
|
||||||
|
#define TIM_OCMODE_ASSYMETRIC_PWM1 TIM_OCMODE_ASYMMETRIC_PWM1
|
||||||
|
#define TIM_OCMODE_ASSYMETRIC_PWM2 TIM_OCMODE_ASYMMETRIC_PWM2
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
@ -204,7 +204,11 @@ typedef struct
|
|||||||
/**
|
/**
|
||||||
* @brief CAN handle Structure definition
|
* @brief CAN handle Structure definition
|
||||||
*/
|
*/
|
||||||
|
#if USE_HAL_CAN_REGISTER_CALLBACKS == 1
|
||||||
typedef struct __CAN_HandleTypeDef
|
typedef struct __CAN_HandleTypeDef
|
||||||
|
#else
|
||||||
|
typedef struct
|
||||||
|
#endif /* USE_HAL_CAN_REGISTER_CALLBACKS */
|
||||||
{
|
{
|
||||||
CAN_TypeDef *Instance; /*!< Register base address */
|
CAN_TypeDef *Instance; /*!< Register base address */
|
||||||
|
|
||||||
|
@ -271,6 +271,8 @@ uint32_t HAL_SYSTICK_Config(uint32_t TicksNumb);
|
|||||||
*/
|
*/
|
||||||
/* Peripheral Control functions ***********************************************/
|
/* Peripheral Control functions ***********************************************/
|
||||||
#if (__MPU_PRESENT == 1U)
|
#if (__MPU_PRESENT == 1U)
|
||||||
|
void HAL_MPU_EnableRegion(uint32_t RegionNumber);
|
||||||
|
void HAL_MPU_DisableRegion(uint32_t RegionNumber);
|
||||||
void HAL_MPU_ConfigRegion(MPU_Region_InitTypeDef *MPU_Init);
|
void HAL_MPU_ConfigRegion(MPU_Region_InitTypeDef *MPU_Init);
|
||||||
#endif /* __MPU_PRESENT */
|
#endif /* __MPU_PRESENT */
|
||||||
uint32_t HAL_NVIC_GetPriorityGrouping(void);
|
uint32_t HAL_NVIC_GetPriorityGrouping(void);
|
||||||
|
@ -318,7 +318,7 @@ uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t
|
|||||||
/** @defgroup CRC_Exported_Functions_Group3 Peripheral State functions
|
/** @defgroup CRC_Exported_Functions_Group3 Peripheral State functions
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
HAL_CRC_StateTypeDef HAL_CRC_GetState(CRC_HandleTypeDef *hcrc);
|
HAL_CRC_StateTypeDef HAL_CRC_GetState(const CRC_HandleTypeDef *hcrc);
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
@ -118,8 +118,6 @@ typedef enum
|
|||||||
HAL_I2C_STATE_BUSY_RX_LISTEN = 0x2AU, /*!< Address Listen Mode and Data Reception
|
HAL_I2C_STATE_BUSY_RX_LISTEN = 0x2AU, /*!< Address Listen Mode and Data Reception
|
||||||
process is ongoing */
|
process is ongoing */
|
||||||
HAL_I2C_STATE_ABORT = 0x60U, /*!< Abort user request ongoing */
|
HAL_I2C_STATE_ABORT = 0x60U, /*!< Abort user request ongoing */
|
||||||
HAL_I2C_STATE_TIMEOUT = 0xA0U, /*!< Timeout state */
|
|
||||||
HAL_I2C_STATE_ERROR = 0xE0U /*!< Error */
|
|
||||||
|
|
||||||
} HAL_I2C_StateTypeDef;
|
} HAL_I2C_StateTypeDef;
|
||||||
|
|
||||||
|
@ -24,10 +24,10 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(FMC_BANK3)
|
||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
#include "stm32f3xx_ll_fmc.h"
|
#include "stm32f3xx_ll_fmc.h"
|
||||||
#if defined(FMC_BANK3)
|
|
||||||
|
|
||||||
/** @addtogroup STM32F3xx_HAL_Driver
|
/** @addtogroup STM32F3xx_HAL_Driver
|
||||||
* @{
|
* @{
|
||||||
@ -105,7 +105,6 @@ typedef struct
|
|||||||
FunctionalState ExtraCommandEnable; /*!< NAND extra command needed for Page reading mode. This
|
FunctionalState ExtraCommandEnable; /*!< NAND extra command needed for Page reading mode. This
|
||||||
parameter is mandatory for some NAND parts after the read
|
parameter is mandatory for some NAND parts after the read
|
||||||
command (NAND_CMD_AREA_TRUE1) and before DATA reading sequence.
|
command (NAND_CMD_AREA_TRUE1) and before DATA reading sequence.
|
||||||
Example: Toshiba THTH58BYG3S0HBAI6.
|
|
||||||
This parameter could be ENABLE or DISABLE
|
This parameter could be ENABLE or DISABLE
|
||||||
Please check the Read Mode sequence in the NAND device datasheet */
|
Please check the Read Mode sequence in the NAND device datasheet */
|
||||||
} NAND_DeviceConfigTypeDef;
|
} NAND_DeviceConfigTypeDef;
|
||||||
|
@ -24,10 +24,10 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(FMC_BANK1)
|
||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
#include "stm32f3xx_ll_fmc.h"
|
#include "stm32f3xx_ll_fmc.h"
|
||||||
#if defined(FMC_BANK1)
|
|
||||||
|
|
||||||
/** @addtogroup STM32F3xx_HAL_Driver
|
/** @addtogroup STM32F3xx_HAL_Driver
|
||||||
* @{
|
* @{
|
||||||
@ -184,7 +184,7 @@ HAL_StatusTypeDef HAL_NOR_Init(NOR_HandleTypeDef *hnor, FMC_NORSRAM_TimingTypeDe
|
|||||||
HAL_StatusTypeDef HAL_NOR_DeInit(NOR_HandleTypeDef *hnor);
|
HAL_StatusTypeDef HAL_NOR_DeInit(NOR_HandleTypeDef *hnor);
|
||||||
void HAL_NOR_MspInit(NOR_HandleTypeDef *hnor);
|
void HAL_NOR_MspInit(NOR_HandleTypeDef *hnor);
|
||||||
void HAL_NOR_MspDeInit(NOR_HandleTypeDef *hnor);
|
void HAL_NOR_MspDeInit(NOR_HandleTypeDef *hnor);
|
||||||
void HAL_NOR_MspWait(const NOR_HandleTypeDef *hnor, uint32_t Timeout);
|
void HAL_NOR_MspWait(NOR_HandleTypeDef *hnor, uint32_t Timeout);
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
@ -235,7 +235,7 @@ HAL_StatusTypeDef HAL_NOR_WriteOperation_Disable(NOR_HandleTypeDef *hnor);
|
|||||||
|
|
||||||
/* NOR State functions ********************************************************/
|
/* NOR State functions ********************************************************/
|
||||||
HAL_NOR_StateTypeDef HAL_NOR_GetState(const NOR_HandleTypeDef *hnor);
|
HAL_NOR_StateTypeDef HAL_NOR_GetState(const NOR_HandleTypeDef *hnor);
|
||||||
HAL_NOR_StatusTypeDef HAL_NOR_GetStatus(const NOR_HandleTypeDef *hnor, uint32_t Address, uint32_t Timeout);
|
HAL_NOR_StatusTypeDef HAL_NOR_GetStatus(NOR_HandleTypeDef *hnor, uint32_t Address, uint32_t Timeout);
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
@ -334,7 +334,7 @@ HAL_StatusTypeDef HAL_PCD_EP_Flush(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
|
|||||||
HAL_StatusTypeDef HAL_PCD_EP_Abort(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
|
HAL_StatusTypeDef HAL_PCD_EP_Abort(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
|
||||||
HAL_StatusTypeDef HAL_PCD_ActivateRemoteWakeup(PCD_HandleTypeDef *hpcd);
|
HAL_StatusTypeDef HAL_PCD_ActivateRemoteWakeup(PCD_HandleTypeDef *hpcd);
|
||||||
HAL_StatusTypeDef HAL_PCD_DeActivateRemoteWakeup(PCD_HandleTypeDef *hpcd);
|
HAL_StatusTypeDef HAL_PCD_DeActivateRemoteWakeup(PCD_HandleTypeDef *hpcd);
|
||||||
uint32_t HAL_PCD_EP_GetRxCount(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
|
uint32_t HAL_PCD_EP_GetRxCount(PCD_HandleTypeDef const *hpcd, uint8_t ep_addr);
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
@ -343,7 +343,7 @@ uint32_t HAL_PCD_EP_GetRxCount(PCD_HandleTypeDef *hpcd, uint8_t ep_addr
|
|||||||
/** @addtogroup PCD_Exported_Functions_Group4 Peripheral State functions
|
/** @addtogroup PCD_Exported_Functions_Group4 Peripheral State functions
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
PCD_StateTypeDef HAL_PCD_GetState(PCD_HandleTypeDef *hpcd);
|
PCD_StateTypeDef HAL_PCD_GetState(PCD_HandleTypeDef const *hpcd);
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
@ -801,20 +801,17 @@ PCD_StateTypeDef HAL_PCD_GetState(PCD_HandleTypeDef *hpcd);
|
|||||||
\
|
\
|
||||||
*(pdwReg) &= 0x3FFU; \
|
*(pdwReg) &= 0x3FFU; \
|
||||||
\
|
\
|
||||||
if ((wCount) > 62U) \
|
|
||||||
{ \
|
|
||||||
PCD_CALC_BLK32((pdwReg), (wCount), wNBlocks); \
|
|
||||||
} \
|
|
||||||
else \
|
|
||||||
{ \
|
|
||||||
if ((wCount) == 0U) \
|
if ((wCount) == 0U) \
|
||||||
{ \
|
{ \
|
||||||
*(pdwReg) |= USB_CNTRX_BLSIZE; \
|
*(pdwReg) |= USB_CNTRX_BLSIZE; \
|
||||||
} \
|
} \
|
||||||
else \
|
else if ((wCount) <= 62U) \
|
||||||
{ \
|
{ \
|
||||||
PCD_CALC_BLK2((pdwReg), (wCount), wNBlocks); \
|
PCD_CALC_BLK2((pdwReg), (wCount), wNBlocks); \
|
||||||
} \
|
} \
|
||||||
|
else \
|
||||||
|
{ \
|
||||||
|
PCD_CALC_BLK32((pdwReg), (wCount), wNBlocks); \
|
||||||
} \
|
} \
|
||||||
} while(0) /* PCD_SET_EP_CNT_RX_REG */
|
} while(0) /* PCD_SET_EP_CNT_RX_REG */
|
||||||
|
|
||||||
|
@ -795,7 +795,7 @@ HAL_RTCStateTypeDef HAL_RTC_GetState(RTC_HandleTypeDef *hrtc);
|
|||||||
|
|
||||||
#define RTC_TIMEOUT_VALUE 1000U
|
#define RTC_TIMEOUT_VALUE 1000U
|
||||||
|
|
||||||
#define RTC_EXTI_LINE_ALARM_EVENT EXTI_IMR_MR17 /*!< External interrupt line 17 Connected to the RTC Alarm event */
|
#define RTC_EXTI_LINE_ALARM_EVENT EXTI_IMR_MR17 /*!< External interrupt line 17 connected to the RTC Alarm event */
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
@ -650,19 +650,6 @@ typedef struct
|
|||||||
*/
|
*/
|
||||||
#define __HAL_RTC_TAMPER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAFCR &= ~(__INTERRUPT__))
|
#define __HAL_RTC_TAMPER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAFCR &= ~(__INTERRUPT__))
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Check whether the specified RTC Tamper interrupt has occurred or not.
|
|
||||||
* @param __HANDLE__ specifies the RTC handle.
|
|
||||||
* @param __INTERRUPT__ specifies the RTC Tamper interrupt to check.
|
|
||||||
* This parameter can be:
|
|
||||||
* @arg RTC_IT_TAMP1: Tamper 1 interrupt
|
|
||||||
* @arg RTC_IT_TAMP2: Tamper 2 interrupt
|
|
||||||
* @arg RTC_IT_TAMP3: Tamper 3 interrupt
|
|
||||||
* @note RTC_IT_TAMP3 is not applicable to all devices.
|
|
||||||
* @retval None
|
|
||||||
*/
|
|
||||||
#define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__) >> 4U)) != 0U) ? 1U : 0U)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Check whether the specified RTC Tamper interrupt has been enabled or not.
|
* @brief Check whether the specified RTC Tamper interrupt has been enabled or not.
|
||||||
* @param __HANDLE__ specifies the RTC handle.
|
* @param __HANDLE__ specifies the RTC handle.
|
||||||
@ -680,8 +667,9 @@ typedef struct
|
|||||||
* This parameter can be:
|
* This parameter can be:
|
||||||
* @arg RTC_FLAG_TAMP1F: Tamper 1 interrupt flag
|
* @arg RTC_FLAG_TAMP1F: Tamper 1 interrupt flag
|
||||||
* @arg RTC_FLAG_TAMP2F: Tamper 2 interrupt flag
|
* @arg RTC_FLAG_TAMP2F: Tamper 2 interrupt flag
|
||||||
* @arg RTC_FLAG_TAMP3F: Tamper 3 interrupt flag
|
* @arg RTC_FLAG_TAMP3F: Tamper 3 interrupt flag (*)
|
||||||
* @note RTC_FLAG_TAMP3F is not applicable to all devices.
|
*
|
||||||
|
* (*) value not applicable to all devices.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != 0U)? 1U : 0U)
|
#define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != 0U)? 1U : 0U)
|
||||||
@ -693,8 +681,9 @@ typedef struct
|
|||||||
* This parameter can be:
|
* This parameter can be:
|
||||||
* @arg RTC_FLAG_TAMP1F: Tamper 1 interrupt flag
|
* @arg RTC_FLAG_TAMP1F: Tamper 1 interrupt flag
|
||||||
* @arg RTC_FLAG_TAMP2F: Tamper 2 interrupt flag
|
* @arg RTC_FLAG_TAMP2F: Tamper 2 interrupt flag
|
||||||
* @arg RTC_FLAG_TAMP3F: Tamper 3 interrupt flag
|
* @arg RTC_FLAG_TAMP3F: Tamper 3 interrupt flag (*)
|
||||||
* @note RTC_FLAG_TAMP3F is not applicable to all devices.
|
*
|
||||||
|
* (*) value not applicable to all devices.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
|
#define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
|
||||||
|
@ -100,8 +100,6 @@ typedef struct
|
|||||||
#define HAL_SMBUS_STATE_MASTER_BUSY_RX (0x00000022U) /*!< Master Data Reception process is ongoing */
|
#define HAL_SMBUS_STATE_MASTER_BUSY_RX (0x00000022U) /*!< Master Data Reception process is ongoing */
|
||||||
#define HAL_SMBUS_STATE_SLAVE_BUSY_TX (0x00000032U) /*!< Slave Data Transmission process is ongoing */
|
#define HAL_SMBUS_STATE_SLAVE_BUSY_TX (0x00000032U) /*!< Slave Data Transmission process is ongoing */
|
||||||
#define HAL_SMBUS_STATE_SLAVE_BUSY_RX (0x00000042U) /*!< Slave Data Reception process is ongoing */
|
#define HAL_SMBUS_STATE_SLAVE_BUSY_RX (0x00000042U) /*!< Slave Data Reception process is ongoing */
|
||||||
#define HAL_SMBUS_STATE_TIMEOUT (0x00000003U) /*!< Timeout state */
|
|
||||||
#define HAL_SMBUS_STATE_ERROR (0x00000004U) /*!< Reception process is ongoing */
|
|
||||||
#define HAL_SMBUS_STATE_LISTEN (0x00000008U) /*!< Address Listen Mode is ongoing */
|
#define HAL_SMBUS_STATE_LISTEN (0x00000008U) /*!< Address Listen Mode is ongoing */
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
|
@ -48,7 +48,7 @@ extern "C" {
|
|||||||
/** @addtogroup SPIEx_Exported_Functions_Group1
|
/** @addtogroup SPIEx_Exported_Functions_Group1
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
HAL_StatusTypeDef HAL_SPIEx_FlushRxFifo(SPI_HandleTypeDef *hspi);
|
HAL_StatusTypeDef HAL_SPIEx_FlushRxFifo(const SPI_HandleTypeDef *hspi);
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
@ -24,10 +24,10 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(FMC_BANK1)
|
||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
#include "stm32f3xx_ll_fmc.h"
|
#include "stm32f3xx_ll_fmc.h"
|
||||||
#if defined(FMC_BANK1)
|
|
||||||
|
|
||||||
/** @addtogroup STM32F3xx_HAL_Driver
|
/** @addtogroup STM32F3xx_HAL_Driver
|
||||||
* @{
|
* @{
|
||||||
|
@ -398,7 +398,7 @@ typedef struct
|
|||||||
void (* BreakCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM Break Callback */
|
void (* BreakCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM Break Callback */
|
||||||
#if defined(TIM_BDTR_BK2E)
|
#if defined(TIM_BDTR_BK2E)
|
||||||
void (* Break2Callback)(struct __TIM_HandleTypeDef *htim); /*!< TIM Break2 Callback */
|
void (* Break2Callback)(struct __TIM_HandleTypeDef *htim); /*!< TIM Break2 Callback */
|
||||||
#endif /* */
|
#endif /* TIM_BDTR_BK2E */
|
||||||
#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */
|
#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */
|
||||||
} TIM_HandleTypeDef;
|
} TIM_HandleTypeDef;
|
||||||
|
|
||||||
@ -426,7 +426,6 @@ typedef enum
|
|||||||
, HAL_TIM_PERIOD_ELAPSED_HALF_CB_ID = 0x0FU /*!< TIM Period Elapsed half complete Callback ID */
|
, HAL_TIM_PERIOD_ELAPSED_HALF_CB_ID = 0x0FU /*!< TIM Period Elapsed half complete Callback ID */
|
||||||
, HAL_TIM_TRIGGER_CB_ID = 0x10U /*!< TIM Trigger Callback ID */
|
, HAL_TIM_TRIGGER_CB_ID = 0x10U /*!< TIM Trigger Callback ID */
|
||||||
, HAL_TIM_TRIGGER_HALF_CB_ID = 0x11U /*!< TIM Trigger half complete Callback ID */
|
, HAL_TIM_TRIGGER_HALF_CB_ID = 0x11U /*!< TIM Trigger half complete Callback ID */
|
||||||
|
|
||||||
, HAL_TIM_IC_CAPTURE_CB_ID = 0x12U /*!< TIM Input Capture Callback ID */
|
, HAL_TIM_IC_CAPTURE_CB_ID = 0x12U /*!< TIM Input Capture Callback ID */
|
||||||
, HAL_TIM_IC_CAPTURE_HALF_CB_ID = 0x13U /*!< TIM Input Capture half complete Callback ID */
|
, HAL_TIM_IC_CAPTURE_HALF_CB_ID = 0x13U /*!< TIM Input Capture half complete Callback ID */
|
||||||
, HAL_TIM_OC_DELAY_ELAPSED_CB_ID = 0x14U /*!< TIM Output Compare Delay Elapsed Callback ID */
|
, HAL_TIM_OC_DELAY_ELAPSED_CB_ID = 0x14U /*!< TIM Output Compare Delay Elapsed Callback ID */
|
||||||
@ -1037,8 +1036,8 @@ typedef void (*pTIM_CallbackTypeDef)(TIM_HandleTypeDef *htim); /*!< pointer to
|
|||||||
#define TIM_OCMODE_RETRIGERRABLE_OPM2 (TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_0) /*!< Retrigerrable OPM mode 2 */
|
#define TIM_OCMODE_RETRIGERRABLE_OPM2 (TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_0) /*!< Retrigerrable OPM mode 2 */
|
||||||
#define TIM_OCMODE_COMBINED_PWM1 (TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_2) /*!< Combined PWM mode 1 */
|
#define TIM_OCMODE_COMBINED_PWM1 (TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_2) /*!< Combined PWM mode 1 */
|
||||||
#define TIM_OCMODE_COMBINED_PWM2 (TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_0 | TIM_CCMR1_OC1M_2) /*!< Combined PWM mode 2 */
|
#define TIM_OCMODE_COMBINED_PWM2 (TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_0 | TIM_CCMR1_OC1M_2) /*!< Combined PWM mode 2 */
|
||||||
#define TIM_OCMODE_ASSYMETRIC_PWM1 (TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_2) /*!< Asymmetric PWM mode 1 */
|
#define TIM_OCMODE_ASYMMETRIC_PWM1 (TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_2) /*!< Asymmetric PWM mode 1 */
|
||||||
#define TIM_OCMODE_ASSYMETRIC_PWM2 TIM_CCMR1_OC1M /*!< Asymmetric PWM mode 2 */
|
#define TIM_OCMODE_ASYMMETRIC_PWM2 TIM_CCMR1_OC1M /*!< Asymmetric PWM mode 2 */
|
||||||
#endif /* TIM_CCMR1_OC1M_3 */
|
#endif /* TIM_CCMR1_OC1M_3 */
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
@ -1330,7 +1329,7 @@ typedef void (*pTIM_CallbackTypeDef)(TIM_HandleTypeDef *htim); /*!< pointer to
|
|||||||
* @arg TIM_FLAG_CC3: Capture/Compare 3 interrupt flag
|
* @arg TIM_FLAG_CC3: Capture/Compare 3 interrupt flag
|
||||||
* @arg TIM_FLAG_CC4: Capture/Compare 4 interrupt flag
|
* @arg TIM_FLAG_CC4: Capture/Compare 4 interrupt flag
|
||||||
* @arg TIM_FLAG_CC5: Capture/Compare 5 interrupt flag (*)
|
* @arg TIM_FLAG_CC5: Capture/Compare 5 interrupt flag (*)
|
||||||
* @arg TIM_FLAG_CC5: Capture/Compare 6 interrupt flag (*)
|
* @arg TIM_FLAG_CC6: Capture/Compare 6 interrupt flag (*)
|
||||||
* @arg TIM_FLAG_COM: Commutation interrupt flag
|
* @arg TIM_FLAG_COM: Commutation interrupt flag
|
||||||
* @arg TIM_FLAG_TRIGGER: Trigger interrupt flag
|
* @arg TIM_FLAG_TRIGGER: Trigger interrupt flag
|
||||||
* @arg TIM_FLAG_BREAK: Break interrupt flag
|
* @arg TIM_FLAG_BREAK: Break interrupt flag
|
||||||
@ -1354,7 +1353,7 @@ typedef void (*pTIM_CallbackTypeDef)(TIM_HandleTypeDef *htim); /*!< pointer to
|
|||||||
* @arg TIM_FLAG_CC3: Capture/Compare 3 interrupt flag
|
* @arg TIM_FLAG_CC3: Capture/Compare 3 interrupt flag
|
||||||
* @arg TIM_FLAG_CC4: Capture/Compare 4 interrupt flag
|
* @arg TIM_FLAG_CC4: Capture/Compare 4 interrupt flag
|
||||||
* @arg TIM_FLAG_CC5: Capture/Compare 5 interrupt flag (*)
|
* @arg TIM_FLAG_CC5: Capture/Compare 5 interrupt flag (*)
|
||||||
* @arg TIM_FLAG_CC5: Capture/Compare 6 interrupt flag (*)
|
* @arg TIM_FLAG_CC6: Capture/Compare 6 interrupt flag (*)
|
||||||
* @arg TIM_FLAG_COM: Commutation interrupt flag
|
* @arg TIM_FLAG_COM: Commutation interrupt flag
|
||||||
* @arg TIM_FLAG_TRIGGER: Trigger interrupt flag
|
* @arg TIM_FLAG_TRIGGER: Trigger interrupt flag
|
||||||
* @arg TIM_FLAG_BREAK: Break interrupt flag
|
* @arg TIM_FLAG_BREAK: Break interrupt flag
|
||||||
@ -1931,6 +1930,14 @@ mode.
|
|||||||
((__PRESCALER__) == TIM_ICPSC_DIV4) || \
|
((__PRESCALER__) == TIM_ICPSC_DIV4) || \
|
||||||
((__PRESCALER__) == TIM_ICPSC_DIV8))
|
((__PRESCALER__) == TIM_ICPSC_DIV8))
|
||||||
|
|
||||||
|
#if defined(TIM_CCER_CC5E) && defined(TIM_CCER_CC6E)
|
||||||
|
#define IS_TIM_CCX_CHANNEL(__INSTANCE__, __CHANNEL__) (IS_TIM_CCX_INSTANCE(__INSTANCE__, __CHANNEL__) && \
|
||||||
|
((__CHANNEL__) != (TIM_CHANNEL_5)) && \
|
||||||
|
((__CHANNEL__) != (TIM_CHANNEL_6)))
|
||||||
|
#else
|
||||||
|
#define IS_TIM_CCX_CHANNEL(__INSTANCE__, __CHANNEL__) (IS_TIM_CCX_INSTANCE(__INSTANCE__, __CHANNEL__))
|
||||||
|
#endif /* TIM_CCER_CC5E && TIM_CCER_CC6E */
|
||||||
|
|
||||||
#define IS_TIM_OPM_MODE(__MODE__) (((__MODE__) == TIM_OPMODE_SINGLE) || \
|
#define IS_TIM_OPM_MODE(__MODE__) (((__MODE__) == TIM_OPMODE_SINGLE) || \
|
||||||
((__MODE__) == TIM_OPMODE_REPETITIVE))
|
((__MODE__) == TIM_OPMODE_REPETITIVE))
|
||||||
|
|
||||||
@ -1959,8 +1966,9 @@ mode.
|
|||||||
#define IS_TIM_OPM_CHANNELS(__CHANNEL__) (((__CHANNEL__) == TIM_CHANNEL_1) || \
|
#define IS_TIM_OPM_CHANNELS(__CHANNEL__) (((__CHANNEL__) == TIM_CHANNEL_1) || \
|
||||||
((__CHANNEL__) == TIM_CHANNEL_2))
|
((__CHANNEL__) == TIM_CHANNEL_2))
|
||||||
|
|
||||||
#define IS_TIM_PERIOD(__HANDLE__, __PERIOD__) \
|
#define IS_TIM_PERIOD(__HANDLE__, __PERIOD__) ((IS_TIM_32B_COUNTER_INSTANCE(((__HANDLE__)->Instance)) == 0U) ? \
|
||||||
((IS_TIM_32B_COUNTER_INSTANCE(((__HANDLE__)->Instance)) == 0U) ? (((__PERIOD__) > 0U) && ((__PERIOD__) <= 0x0000FFFFU)) : ((__PERIOD__) > 0U))
|
(((__PERIOD__) > 0U) && ((__PERIOD__) <= 0x0000FFFFU)) : \
|
||||||
|
((__PERIOD__) > 0U))
|
||||||
|
|
||||||
#define IS_TIM_COMPLEMENTARY_CHANNELS(__CHANNEL__) (((__CHANNEL__) == TIM_CHANNEL_1) || \
|
#define IS_TIM_COMPLEMENTARY_CHANNELS(__CHANNEL__) (((__CHANNEL__) == TIM_CHANNEL_1) || \
|
||||||
((__CHANNEL__) == TIM_CHANNEL_2) || \
|
((__CHANNEL__) == TIM_CHANNEL_2) || \
|
||||||
@ -2013,7 +2021,6 @@ mode.
|
|||||||
|
|
||||||
#define IS_TIM_BREAK_FILTER(__BRKFILTER__) ((__BRKFILTER__) <= 0xFUL)
|
#define IS_TIM_BREAK_FILTER(__BRKFILTER__) ((__BRKFILTER__) <= 0xFUL)
|
||||||
|
|
||||||
|
|
||||||
#define IS_TIM_BREAK_STATE(__STATE__) (((__STATE__) == TIM_BREAK_ENABLE) || \
|
#define IS_TIM_BREAK_STATE(__STATE__) (((__STATE__) == TIM_BREAK_ENABLE) || \
|
||||||
((__STATE__) == TIM_BREAK_DISABLE))
|
((__STATE__) == TIM_BREAK_DISABLE))
|
||||||
|
|
||||||
@ -2087,8 +2094,8 @@ mode.
|
|||||||
((__MODE__) == TIM_OCMODE_PWM2) || \
|
((__MODE__) == TIM_OCMODE_PWM2) || \
|
||||||
((__MODE__) == TIM_OCMODE_COMBINED_PWM1) || \
|
((__MODE__) == TIM_OCMODE_COMBINED_PWM1) || \
|
||||||
((__MODE__) == TIM_OCMODE_COMBINED_PWM2) || \
|
((__MODE__) == TIM_OCMODE_COMBINED_PWM2) || \
|
||||||
((__MODE__) == TIM_OCMODE_ASSYMETRIC_PWM1) || \
|
((__MODE__) == TIM_OCMODE_ASYMMETRIC_PWM1) || \
|
||||||
((__MODE__) == TIM_OCMODE_ASSYMETRIC_PWM2))
|
((__MODE__) == TIM_OCMODE_ASYMMETRIC_PWM2))
|
||||||
#else
|
#else
|
||||||
#define IS_TIM_PWM_MODE(__MODE__) (((__MODE__) == TIM_OCMODE_PWM1) || \
|
#define IS_TIM_PWM_MODE(__MODE__) (((__MODE__) == TIM_OCMODE_PWM1) || \
|
||||||
((__MODE__) == TIM_OCMODE_PWM2))
|
((__MODE__) == TIM_OCMODE_PWM2))
|
||||||
@ -2450,7 +2457,8 @@ HAL_StatusTypeDef HAL_TIM_ConfigTI1Input(TIM_HandleTypeDef *htim, uint32_t TI1_S
|
|||||||
HAL_StatusTypeDef HAL_TIM_SlaveConfigSynchro(TIM_HandleTypeDef *htim, const TIM_SlaveConfigTypeDef *sSlaveConfig);
|
HAL_StatusTypeDef HAL_TIM_SlaveConfigSynchro(TIM_HandleTypeDef *htim, const TIM_SlaveConfigTypeDef *sSlaveConfig);
|
||||||
HAL_StatusTypeDef HAL_TIM_SlaveConfigSynchro_IT(TIM_HandleTypeDef *htim, const TIM_SlaveConfigTypeDef *sSlaveConfig);
|
HAL_StatusTypeDef HAL_TIM_SlaveConfigSynchro_IT(TIM_HandleTypeDef *htim, const TIM_SlaveConfigTypeDef *sSlaveConfig);
|
||||||
HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStart(TIM_HandleTypeDef *htim, uint32_t BurstBaseAddress,
|
HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStart(TIM_HandleTypeDef *htim, uint32_t BurstBaseAddress,
|
||||||
uint32_t BurstRequestSrc, const uint32_t *BurstBuffer, uint32_t BurstLength);
|
uint32_t BurstRequestSrc, const uint32_t *BurstBuffer,
|
||||||
|
uint32_t BurstLength);
|
||||||
HAL_StatusTypeDef HAL_TIM_DMABurst_MultiWriteStart(TIM_HandleTypeDef *htim, uint32_t BurstBaseAddress,
|
HAL_StatusTypeDef HAL_TIM_DMABurst_MultiWriteStart(TIM_HandleTypeDef *htim, uint32_t BurstBaseAddress,
|
||||||
uint32_t BurstRequestSrc, const uint32_t *BurstBuffer,
|
uint32_t BurstRequestSrc, const uint32_t *BurstBuffer,
|
||||||
uint32_t BurstLength, uint32_t DataLength);
|
uint32_t BurstLength, uint32_t DataLength);
|
||||||
|
@ -139,7 +139,7 @@ HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle(UART_HandleTypeDef *huart, uint8_t *p
|
|||||||
HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size);
|
HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size);
|
||||||
HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle_DMA(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size);
|
HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle_DMA(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size);
|
||||||
|
|
||||||
HAL_UART_RxEventTypeTypeDef HAL_UARTEx_GetRxEventType(UART_HandleTypeDef *huart);
|
HAL_UART_RxEventTypeTypeDef HAL_UARTEx_GetRxEventType(const UART_HandleTypeDef *huart);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -469,7 +469,6 @@ typedef void (*pUSART_CallbackTypeDef)(USART_HandleTypeDef *husart); /*!< poin
|
|||||||
#define __HAL_USART_CLEAR_IDLEFLAG(__HANDLE__) __HAL_USART_CLEAR_FLAG((__HANDLE__), USART_CLEAR_IDLEF)
|
#define __HAL_USART_CLEAR_IDLEFLAG(__HANDLE__) __HAL_USART_CLEAR_FLAG((__HANDLE__), USART_CLEAR_IDLEF)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** @brief Enable the specified USART interrupt.
|
/** @brief Enable the specified USART interrupt.
|
||||||
* @param __HANDLE__ specifies the USART Handle.
|
* @param __HANDLE__ specifies the USART Handle.
|
||||||
* @param __INTERRUPT__ specifies the USART interrupt source to enable.
|
* @param __INTERRUPT__ specifies the USART interrupt source to enable.
|
||||||
|
@ -183,7 +183,7 @@ typedef void (*pWWDG_CallbackTypeDef)(WWDG_HandleTypeDef *hppp); /*!< pointer t
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable the WWDG early wakeup interrupt.
|
* @brief Enable the WWDG early wakeup interrupt.
|
||||||
* @param __HANDLE__ WWDG handle
|
* @param __HANDLE__: WWDG handle
|
||||||
* @param __INTERRUPT__ specifies the interrupt to enable.
|
* @param __INTERRUPT__ specifies the interrupt to enable.
|
||||||
* This parameter can be one of the following values:
|
* This parameter can be one of the following values:
|
||||||
* @arg WWDG_IT_EWI: Early wakeup interrupt
|
* @arg WWDG_IT_EWI: Early wakeup interrupt
|
||||||
@ -296,3 +296,4 @@ void HAL_WWDG_EarlyWakeupCallback(WWDG_HandleTypeDef *hwwdg);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* STM32F3xx_HAL_WWDG_H */
|
#endif /* STM32F3xx_HAL_WWDG_H */
|
||||||
|
|
||||||
|
@ -8073,7 +8073,8 @@ typedef struct
|
|||||||
|
|
||||||
/* Delay required between ADC disable and ADC calibration start. */
|
/* Delay required between ADC disable and ADC calibration start. */
|
||||||
/* Note: On this STM32 series, before starting a calibration, */
|
/* Note: On this STM32 series, before starting a calibration, */
|
||||||
/* ADC must be disabled. */
|
/* ADC must be enabled on STM32F37x and disabled on */
|
||||||
|
/* other STM32F3 devices. */
|
||||||
/* A minimum number of ADC clock cycles are required */
|
/* A minimum number of ADC clock cycles are required */
|
||||||
/* between ADC disable state and calibration start. */
|
/* between ADC disable state and calibration start. */
|
||||||
/* Refer to literal @ref LL_ADC_DELAY_CALIB_ENABLE_ADC_CYCLES. */
|
/* Refer to literal @ref LL_ADC_DELAY_CALIB_ENABLE_ADC_CYCLES. */
|
||||||
|
@ -184,7 +184,7 @@ __STATIC_INLINE void LL_CRC_SetPolynomialSize(CRC_TypeDef *CRCx, uint32_t PolySi
|
|||||||
* @arg @ref LL_CRC_POLYLENGTH_8B
|
* @arg @ref LL_CRC_POLYLENGTH_8B
|
||||||
* @arg @ref LL_CRC_POLYLENGTH_7B
|
* @arg @ref LL_CRC_POLYLENGTH_7B
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_CRC_GetPolynomialSize(CRC_TypeDef *CRCx)
|
__STATIC_INLINE uint32_t LL_CRC_GetPolynomialSize(const CRC_TypeDef *CRCx)
|
||||||
{
|
{
|
||||||
return (uint32_t)(READ_BIT(CRCx->CR, CRC_CR_POLYSIZE));
|
return (uint32_t)(READ_BIT(CRCx->CR, CRC_CR_POLYSIZE));
|
||||||
}
|
}
|
||||||
@ -215,7 +215,7 @@ __STATIC_INLINE void LL_CRC_SetInputDataReverseMode(CRC_TypeDef *CRCx, uint32_t
|
|||||||
* @arg @ref LL_CRC_INDATA_REVERSE_HALFWORD
|
* @arg @ref LL_CRC_INDATA_REVERSE_HALFWORD
|
||||||
* @arg @ref LL_CRC_INDATA_REVERSE_WORD
|
* @arg @ref LL_CRC_INDATA_REVERSE_WORD
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_CRC_GetInputDataReverseMode(CRC_TypeDef *CRCx)
|
__STATIC_INLINE uint32_t LL_CRC_GetInputDataReverseMode(const CRC_TypeDef *CRCx)
|
||||||
{
|
{
|
||||||
return (uint32_t)(READ_BIT(CRCx->CR, CRC_CR_REV_IN));
|
return (uint32_t)(READ_BIT(CRCx->CR, CRC_CR_REV_IN));
|
||||||
}
|
}
|
||||||
@ -242,7 +242,7 @@ __STATIC_INLINE void LL_CRC_SetOutputDataReverseMode(CRC_TypeDef *CRCx, uint32_t
|
|||||||
* @arg @ref LL_CRC_OUTDATA_REVERSE_NONE
|
* @arg @ref LL_CRC_OUTDATA_REVERSE_NONE
|
||||||
* @arg @ref LL_CRC_OUTDATA_REVERSE_BIT
|
* @arg @ref LL_CRC_OUTDATA_REVERSE_BIT
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_CRC_GetOutputDataReverseMode(CRC_TypeDef *CRCx)
|
__STATIC_INLINE uint32_t LL_CRC_GetOutputDataReverseMode(const CRC_TypeDef *CRCx)
|
||||||
{
|
{
|
||||||
return (uint32_t)(READ_BIT(CRCx->CR, CRC_CR_REV_OUT));
|
return (uint32_t)(READ_BIT(CRCx->CR, CRC_CR_REV_OUT));
|
||||||
}
|
}
|
||||||
@ -270,7 +270,7 @@ __STATIC_INLINE void LL_CRC_SetInitialData(CRC_TypeDef *CRCx, uint32_t InitCrc)
|
|||||||
* @param CRCx CRC Instance
|
* @param CRCx CRC Instance
|
||||||
* @retval Value programmed in Programmable initial CRC value register
|
* @retval Value programmed in Programmable initial CRC value register
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_CRC_GetInitialData(CRC_TypeDef *CRCx)
|
__STATIC_INLINE uint32_t LL_CRC_GetInitialData(const CRC_TypeDef *CRCx)
|
||||||
{
|
{
|
||||||
return (uint32_t)(READ_REG(CRCx->INIT));
|
return (uint32_t)(READ_REG(CRCx->INIT));
|
||||||
}
|
}
|
||||||
@ -301,7 +301,7 @@ __STATIC_INLINE void LL_CRC_SetPolynomialCoef(CRC_TypeDef *CRCx, uint32_t Polyno
|
|||||||
* @param CRCx CRC Instance
|
* @param CRCx CRC Instance
|
||||||
* @retval Value programmed in Programmable Polynomial value register
|
* @retval Value programmed in Programmable Polynomial value register
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_CRC_GetPolynomialCoef(CRC_TypeDef *CRCx)
|
__STATIC_INLINE uint32_t LL_CRC_GetPolynomialCoef(const CRC_TypeDef *CRCx)
|
||||||
{
|
{
|
||||||
return (uint32_t)(READ_REG(CRCx->POL));
|
return (uint32_t)(READ_REG(CRCx->POL));
|
||||||
}
|
}
|
||||||
@ -359,7 +359,7 @@ __STATIC_INLINE void LL_CRC_FeedData8(CRC_TypeDef *CRCx, uint8_t InData)
|
|||||||
* @param CRCx CRC Instance
|
* @param CRCx CRC Instance
|
||||||
* @retval Current CRC calculation result as stored in CRC_DR register (32 bits).
|
* @retval Current CRC calculation result as stored in CRC_DR register (32 bits).
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_CRC_ReadData32(CRC_TypeDef *CRCx)
|
__STATIC_INLINE uint32_t LL_CRC_ReadData32(const CRC_TypeDef *CRCx)
|
||||||
{
|
{
|
||||||
return (uint32_t)(READ_REG(CRCx->DR));
|
return (uint32_t)(READ_REG(CRCx->DR));
|
||||||
}
|
}
|
||||||
@ -371,7 +371,7 @@ __STATIC_INLINE uint32_t LL_CRC_ReadData32(CRC_TypeDef *CRCx)
|
|||||||
* @param CRCx CRC Instance
|
* @param CRCx CRC Instance
|
||||||
* @retval Current CRC calculation result as stored in CRC_DR register (16 bits).
|
* @retval Current CRC calculation result as stored in CRC_DR register (16 bits).
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint16_t LL_CRC_ReadData16(CRC_TypeDef *CRCx)
|
__STATIC_INLINE uint16_t LL_CRC_ReadData16(const CRC_TypeDef *CRCx)
|
||||||
{
|
{
|
||||||
return (uint16_t)READ_REG(CRCx->DR);
|
return (uint16_t)READ_REG(CRCx->DR);
|
||||||
}
|
}
|
||||||
@ -383,7 +383,7 @@ __STATIC_INLINE uint16_t LL_CRC_ReadData16(CRC_TypeDef *CRCx)
|
|||||||
* @param CRCx CRC Instance
|
* @param CRCx CRC Instance
|
||||||
* @retval Current CRC calculation result as stored in CRC_DR register (8 bits).
|
* @retval Current CRC calculation result as stored in CRC_DR register (8 bits).
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint8_t LL_CRC_ReadData8(CRC_TypeDef *CRCx)
|
__STATIC_INLINE uint8_t LL_CRC_ReadData8(const CRC_TypeDef *CRCx)
|
||||||
{
|
{
|
||||||
return (uint8_t)READ_REG(CRCx->DR);
|
return (uint8_t)READ_REG(CRCx->DR);
|
||||||
}
|
}
|
||||||
@ -395,7 +395,7 @@ __STATIC_INLINE uint8_t LL_CRC_ReadData8(CRC_TypeDef *CRCx)
|
|||||||
* @param CRCx CRC Instance
|
* @param CRCx CRC Instance
|
||||||
* @retval Current CRC calculation result as stored in CRC_DR register (7 bits).
|
* @retval Current CRC calculation result as stored in CRC_DR register (7 bits).
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint8_t LL_CRC_ReadData7(CRC_TypeDef *CRCx)
|
__STATIC_INLINE uint8_t LL_CRC_ReadData7(const CRC_TypeDef *CRCx)
|
||||||
{
|
{
|
||||||
return (uint8_t)(READ_REG(CRCx->DR) & 0x7FU);
|
return (uint8_t)(READ_REG(CRCx->DR) & 0x7FU);
|
||||||
}
|
}
|
||||||
|
@ -2133,11 +2133,18 @@ __STATIC_INLINE uint32_t LL_I2C_GetSlaveAddr(const I2C_TypeDef *I2Cx)
|
|||||||
__STATIC_INLINE void LL_I2C_HandleTransfer(I2C_TypeDef *I2Cx, uint32_t SlaveAddr, uint32_t SlaveAddrSize,
|
__STATIC_INLINE void LL_I2C_HandleTransfer(I2C_TypeDef *I2Cx, uint32_t SlaveAddr, uint32_t SlaveAddrSize,
|
||||||
uint32_t TransferSize, uint32_t EndMode, uint32_t Request)
|
uint32_t TransferSize, uint32_t EndMode, uint32_t Request)
|
||||||
{
|
{
|
||||||
|
/* Declaration of tmp to prevent undefined behavior of volatile usage */
|
||||||
|
uint32_t tmp = ((uint32_t)(((uint32_t)SlaveAddr & I2C_CR2_SADD) | \
|
||||||
|
((uint32_t)SlaveAddrSize & I2C_CR2_ADD10) | \
|
||||||
|
(((uint32_t)TransferSize << I2C_CR2_NBYTES_Pos) & I2C_CR2_NBYTES) | \
|
||||||
|
(uint32_t)EndMode | (uint32_t)Request) & (~0x80000000U));
|
||||||
|
|
||||||
|
/* update CR2 register */
|
||||||
MODIFY_REG(I2Cx->CR2, I2C_CR2_SADD | I2C_CR2_ADD10 |
|
MODIFY_REG(I2Cx->CR2, I2C_CR2_SADD | I2C_CR2_ADD10 |
|
||||||
(I2C_CR2_RD_WRN & (uint32_t)(Request >> (31U - I2C_CR2_RD_WRN_Pos))) |
|
(I2C_CR2_RD_WRN & (uint32_t)(Request >> (31U - I2C_CR2_RD_WRN_Pos))) |
|
||||||
I2C_CR2_START | I2C_CR2_STOP | I2C_CR2_RELOAD |
|
I2C_CR2_START | I2C_CR2_STOP | I2C_CR2_RELOAD |
|
||||||
I2C_CR2_NBYTES | I2C_CR2_AUTOEND | I2C_CR2_HEAD10R,
|
I2C_CR2_NBYTES | I2C_CR2_AUTOEND | I2C_CR2_HEAD10R,
|
||||||
SlaveAddr | SlaveAddrSize | (TransferSize << I2C_CR2_NBYTES_Pos) | EndMode | Request);
|
tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -208,7 +208,7 @@ __STATIC_INLINE void LL_IWDG_SetPrescaler(IWDG_TypeDef *IWDGx, uint32_t Prescale
|
|||||||
* @arg @ref LL_IWDG_PRESCALER_128
|
* @arg @ref LL_IWDG_PRESCALER_128
|
||||||
* @arg @ref LL_IWDG_PRESCALER_256
|
* @arg @ref LL_IWDG_PRESCALER_256
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_IWDG_GetPrescaler(IWDG_TypeDef *IWDGx)
|
__STATIC_INLINE uint32_t LL_IWDG_GetPrescaler(const IWDG_TypeDef *IWDGx)
|
||||||
{
|
{
|
||||||
return (READ_REG(IWDGx->PR));
|
return (READ_REG(IWDGx->PR));
|
||||||
}
|
}
|
||||||
@ -231,7 +231,7 @@ __STATIC_INLINE void LL_IWDG_SetReloadCounter(IWDG_TypeDef *IWDGx, uint32_t Coun
|
|||||||
* @param IWDGx IWDG Instance
|
* @param IWDGx IWDG Instance
|
||||||
* @retval Value between Min_Data=0 and Max_Data=0x0FFF
|
* @retval Value between Min_Data=0 and Max_Data=0x0FFF
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_IWDG_GetReloadCounter(IWDG_TypeDef *IWDGx)
|
__STATIC_INLINE uint32_t LL_IWDG_GetReloadCounter(const IWDG_TypeDef *IWDGx)
|
||||||
{
|
{
|
||||||
return (READ_REG(IWDGx->RLR));
|
return (READ_REG(IWDGx->RLR));
|
||||||
}
|
}
|
||||||
@ -254,7 +254,7 @@ __STATIC_INLINE void LL_IWDG_SetWindow(IWDG_TypeDef *IWDGx, uint32_t Window)
|
|||||||
* @param IWDGx IWDG Instance
|
* @param IWDGx IWDG Instance
|
||||||
* @retval Value between Min_Data=0 and Max_Data=0x0FFF
|
* @retval Value between Min_Data=0 and Max_Data=0x0FFF
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_IWDG_GetWindow(IWDG_TypeDef *IWDGx)
|
__STATIC_INLINE uint32_t LL_IWDG_GetWindow(const IWDG_TypeDef *IWDGx)
|
||||||
{
|
{
|
||||||
return (READ_REG(IWDGx->WINR));
|
return (READ_REG(IWDGx->WINR));
|
||||||
}
|
}
|
||||||
@ -273,7 +273,7 @@ __STATIC_INLINE uint32_t LL_IWDG_GetWindow(IWDG_TypeDef *IWDGx)
|
|||||||
* @param IWDGx IWDG Instance
|
* @param IWDGx IWDG Instance
|
||||||
* @retval State of bit (1 or 0).
|
* @retval State of bit (1 or 0).
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_IWDG_IsActiveFlag_PVU(IWDG_TypeDef *IWDGx)
|
__STATIC_INLINE uint32_t LL_IWDG_IsActiveFlag_PVU(const IWDG_TypeDef *IWDGx)
|
||||||
{
|
{
|
||||||
return ((READ_BIT(IWDGx->SR, IWDG_SR_PVU) == (IWDG_SR_PVU)) ? 1UL : 0UL);
|
return ((READ_BIT(IWDGx->SR, IWDG_SR_PVU) == (IWDG_SR_PVU)) ? 1UL : 0UL);
|
||||||
}
|
}
|
||||||
@ -284,7 +284,7 @@ __STATIC_INLINE uint32_t LL_IWDG_IsActiveFlag_PVU(IWDG_TypeDef *IWDGx)
|
|||||||
* @param IWDGx IWDG Instance
|
* @param IWDGx IWDG Instance
|
||||||
* @retval State of bit (1 or 0).
|
* @retval State of bit (1 or 0).
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_IWDG_IsActiveFlag_RVU(IWDG_TypeDef *IWDGx)
|
__STATIC_INLINE uint32_t LL_IWDG_IsActiveFlag_RVU(const IWDG_TypeDef *IWDGx)
|
||||||
{
|
{
|
||||||
return ((READ_BIT(IWDGx->SR, IWDG_SR_RVU) == (IWDG_SR_RVU)) ? 1UL : 0UL);
|
return ((READ_BIT(IWDGx->SR, IWDG_SR_RVU) == (IWDG_SR_RVU)) ? 1UL : 0UL);
|
||||||
}
|
}
|
||||||
@ -295,7 +295,7 @@ __STATIC_INLINE uint32_t LL_IWDG_IsActiveFlag_RVU(IWDG_TypeDef *IWDGx)
|
|||||||
* @param IWDGx IWDG Instance
|
* @param IWDGx IWDG Instance
|
||||||
* @retval State of bit (1 or 0).
|
* @retval State of bit (1 or 0).
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_IWDG_IsActiveFlag_WVU(IWDG_TypeDef *IWDGx)
|
__STATIC_INLINE uint32_t LL_IWDG_IsActiveFlag_WVU(const IWDG_TypeDef *IWDGx)
|
||||||
{
|
{
|
||||||
return ((READ_BIT(IWDGx->SR, IWDG_SR_WVU) == (IWDG_SR_WVU)) ? 1UL : 0UL);
|
return ((READ_BIT(IWDGx->SR, IWDG_SR_WVU) == (IWDG_SR_WVU)) ? 1UL : 0UL);
|
||||||
}
|
}
|
||||||
@ -308,7 +308,7 @@ __STATIC_INLINE uint32_t LL_IWDG_IsActiveFlag_WVU(IWDG_TypeDef *IWDGx)
|
|||||||
* @param IWDGx IWDG Instance
|
* @param IWDGx IWDG Instance
|
||||||
* @retval State of bits (1 or 0).
|
* @retval State of bits (1 or 0).
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_IWDG_IsReady(IWDG_TypeDef *IWDGx)
|
__STATIC_INLINE uint32_t LL_IWDG_IsReady(const IWDG_TypeDef *IWDGx)
|
||||||
{
|
{
|
||||||
return ((READ_BIT(IWDGx->SR, IWDG_SR_PVU | IWDG_SR_RVU | IWDG_SR_WVU) == 0U) ? 1UL : 0UL);
|
return ((READ_BIT(IWDGx->SR, IWDG_SR_PVU | IWDG_SR_RVU | IWDG_SR_WVU) == 0U) ? 1UL : 0UL);
|
||||||
}
|
}
|
||||||
|
@ -416,7 +416,7 @@ typedef struct
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#define LL_RTC_TIMESTAMP_EDGE_RISING 0x00000000U /*!< RTC_TS input rising edge generates a time-stamp event */
|
#define LL_RTC_TIMESTAMP_EDGE_RISING 0x00000000U /*!< RTC_TS input rising edge generates a time-stamp event */
|
||||||
#define LL_RTC_TIMESTAMP_EDGE_FALLING RTC_CR_TSEDGE /*!< RTC_TS input falling edge generates a time-stamp even */
|
#define LL_RTC_TIMESTAMP_EDGE_FALLING RTC_CR_TSEDGE /*!< RTC_TS input falling edge generates a time-stamp event */
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
@ -1104,7 +1104,7 @@ __STATIC_INLINE void LL_RTC_TIME_SetFormat(RTC_TypeDef *RTCx, uint32_t TimeForma
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get time format (AM or PM notation)
|
* @brief Get time format (AM or PM notation)
|
||||||
* @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
|
* @note if RTC shadow registers are not bypassed (BYPSHAD=0), need to check if RSF flag is set
|
||||||
* before reading this bit
|
* before reading this bit
|
||||||
* @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
|
* @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
|
||||||
* shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
|
* shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
|
||||||
@ -1138,7 +1138,7 @@ __STATIC_INLINE void LL_RTC_TIME_SetHour(RTC_TypeDef *RTCx, uint32_t Hours)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get Hours in BCD format
|
* @brief Get Hours in BCD format
|
||||||
* @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
|
* @note if RTC shadow registers are not bypassed (BYPSHAD=0), need to check if RSF flag is set
|
||||||
* before reading this bit
|
* before reading this bit
|
||||||
* @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
|
* @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
|
||||||
* shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
|
* shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
|
||||||
@ -1173,7 +1173,7 @@ __STATIC_INLINE void LL_RTC_TIME_SetMinute(RTC_TypeDef *RTCx, uint32_t Minutes)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get Minutes in BCD format
|
* @brief Get Minutes in BCD format
|
||||||
* @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
|
* @note if RTC shadow registers are not bypassed (BYPSHAD=0), need to check if RSF flag is set
|
||||||
* before reading this bit
|
* before reading this bit
|
||||||
* @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
|
* @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
|
||||||
* shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
|
* shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
|
||||||
@ -1208,7 +1208,7 @@ __STATIC_INLINE void LL_RTC_TIME_SetSecond(RTC_TypeDef *RTCx, uint32_t Seconds)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get Seconds in BCD format
|
* @brief Get Seconds in BCD format
|
||||||
* @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
|
* @note if RTC shadow registers are not bypassed (BYPSHAD=0), need to check if RSF flag is set
|
||||||
* before reading this bit
|
* before reading this bit
|
||||||
* @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
|
* @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
|
||||||
* shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
|
* shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
|
||||||
@ -1258,7 +1258,7 @@ __STATIC_INLINE void LL_RTC_TIME_Config(RTC_TypeDef *RTCx, uint32_t Format12_24,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get time (hour, minute and second) in BCD format
|
* @brief Get time (hour, minute and second) in BCD format
|
||||||
* @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
|
* @note if RTC shadow registers are not bypassed (BYPSHAD=0), need to check if RSF flag is set
|
||||||
* before reading this bit
|
* before reading this bit
|
||||||
* @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
|
* @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
|
||||||
* shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
|
* shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
|
||||||
@ -1400,7 +1400,7 @@ __STATIC_INLINE void LL_RTC_DATE_SetYear(RTC_TypeDef *RTCx, uint32_t Year)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get Year in BCD format
|
* @brief Get Year in BCD format
|
||||||
* @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
|
* @note if RTC shadow registers are not bypassed (BYPSHAD=0), need to check if RSF flag is set
|
||||||
* before reading this bit
|
* before reading this bit
|
||||||
* @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Year from BCD to Binary format
|
* @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Year from BCD to Binary format
|
||||||
* @rmtoll DR YT LL_RTC_DATE_GetYear\n
|
* @rmtoll DR YT LL_RTC_DATE_GetYear\n
|
||||||
@ -1434,7 +1434,7 @@ __STATIC_INLINE void LL_RTC_DATE_SetWeekDay(RTC_TypeDef *RTCx, uint32_t WeekDay)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get Week day
|
* @brief Get Week day
|
||||||
* @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
|
* @note if RTC shadow registers are not bypassed (BYPSHAD=0), need to check if RSF flag is set
|
||||||
* before reading this bit
|
* before reading this bit
|
||||||
* @rmtoll DR WDU LL_RTC_DATE_GetWeekDay
|
* @rmtoll DR WDU LL_RTC_DATE_GetWeekDay
|
||||||
* @param RTCx RTC Instance
|
* @param RTCx RTC Instance
|
||||||
@ -1481,7 +1481,7 @@ __STATIC_INLINE void LL_RTC_DATE_SetMonth(RTC_TypeDef *RTCx, uint32_t Month)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get Month in BCD format
|
* @brief Get Month in BCD format
|
||||||
* @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
|
* @note if RTC shadow registers are not bypassed (BYPSHAD=0), need to check if RSF flag is set
|
||||||
* before reading this bit
|
* before reading this bit
|
||||||
* @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Month from BCD to Binary format
|
* @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Month from BCD to Binary format
|
||||||
* @rmtoll DR MT LL_RTC_DATE_GetMonth\n
|
* @rmtoll DR MT LL_RTC_DATE_GetMonth\n
|
||||||
@ -1523,7 +1523,7 @@ __STATIC_INLINE void LL_RTC_DATE_SetDay(RTC_TypeDef *RTCx, uint32_t Day)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get Day in BCD format
|
* @brief Get Day in BCD format
|
||||||
* @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
|
* @note if RTC shadow registers are not bypassed (BYPSHAD=0), need to check if RSF flag is set
|
||||||
* before reading this bit
|
* before reading this bit
|
||||||
* @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
|
* @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
|
||||||
* @rmtoll DR DT LL_RTC_DATE_GetDay\n
|
* @rmtoll DR DT LL_RTC_DATE_GetDay\n
|
||||||
@ -1585,7 +1585,7 @@ __STATIC_INLINE void LL_RTC_DATE_Config(RTC_TypeDef *RTCx, uint32_t WeekDay, uin
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get date (WeekDay, Day, Month and Year) in BCD format
|
* @brief Get date (WeekDay, Day, Month and Year) in BCD format
|
||||||
* @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
|
* @note if RTC shadow registers are not bypassed (BYPSHAD=0), need to check if RSF flag is set
|
||||||
* before reading this bit
|
* before reading this bit
|
||||||
* @note helper macros __LL_RTC_GET_WEEKDAY, __LL_RTC_GET_YEAR, __LL_RTC_GET_MONTH,
|
* @note helper macros __LL_RTC_GET_WEEKDAY, __LL_RTC_GET_YEAR, __LL_RTC_GET_MONTH,
|
||||||
* and __LL_RTC_GET_DAY are available to get independently each parameter.
|
* and __LL_RTC_GET_DAY are available to get independently each parameter.
|
||||||
|
@ -577,7 +577,9 @@ typedef struct
|
|||||||
#define LL_TIM_SR_COMIF TIM_SR_COMIF /*!< COM interrupt flag */
|
#define LL_TIM_SR_COMIF TIM_SR_COMIF /*!< COM interrupt flag */
|
||||||
#define LL_TIM_SR_TIF TIM_SR_TIF /*!< Trigger interrupt flag */
|
#define LL_TIM_SR_TIF TIM_SR_TIF /*!< Trigger interrupt flag */
|
||||||
#define LL_TIM_SR_BIF TIM_SR_BIF /*!< Break interrupt flag */
|
#define LL_TIM_SR_BIF TIM_SR_BIF /*!< Break interrupt flag */
|
||||||
|
#if defined(TIM_SR_B2IF)
|
||||||
#define LL_TIM_SR_B2IF TIM_SR_B2IF /*!< Second break interrupt flag */
|
#define LL_TIM_SR_B2IF TIM_SR_B2IF /*!< Second break interrupt flag */
|
||||||
|
#endif /* TIM_SR_B2IF */
|
||||||
#define LL_TIM_SR_CC1OF TIM_SR_CC1OF /*!< Capture/Compare 1 overcapture flag */
|
#define LL_TIM_SR_CC1OF TIM_SR_CC1OF /*!< Capture/Compare 1 overcapture flag */
|
||||||
#define LL_TIM_SR_CC2OF TIM_SR_CC2OF /*!< Capture/Compare 2 overcapture flag */
|
#define LL_TIM_SR_CC2OF TIM_SR_CC2OF /*!< Capture/Compare 2 overcapture flag */
|
||||||
#define LL_TIM_SR_CC3OF TIM_SR_CC3OF /*!< Capture/Compare 3 overcapture flag */
|
#define LL_TIM_SR_CC3OF TIM_SR_CC3OF /*!< Capture/Compare 3 overcapture flag */
|
||||||
@ -722,8 +724,12 @@ typedef struct
|
|||||||
#define LL_TIM_CHANNEL_CH3 TIM_CCER_CC3E /*!< Timer input/output channel 3 */
|
#define LL_TIM_CHANNEL_CH3 TIM_CCER_CC3E /*!< Timer input/output channel 3 */
|
||||||
#define LL_TIM_CHANNEL_CH3N TIM_CCER_CC3NE /*!< Timer complementary output channel 3 */
|
#define LL_TIM_CHANNEL_CH3N TIM_CCER_CC3NE /*!< Timer complementary output channel 3 */
|
||||||
#define LL_TIM_CHANNEL_CH4 TIM_CCER_CC4E /*!< Timer input/output channel 4 */
|
#define LL_TIM_CHANNEL_CH4 TIM_CCER_CC4E /*!< Timer input/output channel 4 */
|
||||||
|
#if defined(TIM_CCER_CC5E)
|
||||||
#define LL_TIM_CHANNEL_CH5 TIM_CCER_CC5E /*!< Timer output channel 5 */
|
#define LL_TIM_CHANNEL_CH5 TIM_CCER_CC5E /*!< Timer output channel 5 */
|
||||||
|
#endif /* TIM_CCER_CC5E */
|
||||||
|
#if defined(TIM_CCER_CC6E)
|
||||||
#define LL_TIM_CHANNEL_CH6 TIM_CCER_CC6E /*!< Timer output channel 6 */
|
#define LL_TIM_CHANNEL_CH6 TIM_CCER_CC6E /*!< Timer output channel 6 */
|
||||||
|
#endif /* TIM_CCER_CC6E */
|
||||||
#else
|
#else
|
||||||
#define LL_TIM_CHANNEL_CH1 TIM_CCER_CC1E /*!< Timer input/output channel 1 */
|
#define LL_TIM_CHANNEL_CH1 TIM_CCER_CC1E /*!< Timer input/output channel 1 */
|
||||||
#define LL_TIM_CHANNEL_CH1N TIM_CCER_CC1NE /*!< Timer complementary output channel 1 */
|
#define LL_TIM_CHANNEL_CH1N TIM_CCER_CC1NE /*!< Timer complementary output channel 1 */
|
||||||
@ -748,6 +754,15 @@ typedef struct
|
|||||||
*/
|
*/
|
||||||
#endif /* USE_FULL_LL_DRIVER */
|
#endif /* USE_FULL_LL_DRIVER */
|
||||||
|
|
||||||
|
/** Legacy definitions for compatibility purpose
|
||||||
|
@cond 0
|
||||||
|
*/
|
||||||
|
#define LL_TIM_OCMODE_ASSYMETRIC_PWM1 LL_TIM_OCMODE_ASYMMETRIC_PWM1
|
||||||
|
#define LL_TIM_OCMODE_ASSYMETRIC_PWM2 LL_TIM_OCMODE_ASYMMETRIC_PWM2
|
||||||
|
/**
|
||||||
|
@endcond
|
||||||
|
*/
|
||||||
|
|
||||||
/** @defgroup TIM_LL_EC_OCMODE Output Configuration Mode
|
/** @defgroup TIM_LL_EC_OCMODE Output Configuration Mode
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
@ -768,8 +783,8 @@ typedef struct
|
|||||||
#define LL_TIM_OCMODE_COMBINED_PWM2 (TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_0 | TIM_CCMR1_OC1M_2) /*!<Combined PWM mode 2*/
|
#define LL_TIM_OCMODE_COMBINED_PWM2 (TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_0 | TIM_CCMR1_OC1M_2) /*!<Combined PWM mode 2*/
|
||||||
#endif
|
#endif
|
||||||
#if defined(TIM_CCMR1_OC1M_3)
|
#if defined(TIM_CCMR1_OC1M_3)
|
||||||
#define LL_TIM_OCMODE_ASSYMETRIC_PWM1 (TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_2) /*!<Asymmetric PWM mode 1*/
|
#define LL_TIM_OCMODE_ASYMMETRIC_PWM1 (TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_2) /*!<Asymmetric PWM mode 1*/
|
||||||
#define LL_TIM_OCMODE_ASSYMETRIC_PWM2 (TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M) /*!<Asymmetric PWM mode 2*/
|
#define LL_TIM_OCMODE_ASYMMETRIC_PWM2 (TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M) /*!<Asymmetric PWM mode 2*/
|
||||||
#endif
|
#endif
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
@ -980,11 +995,11 @@ typedef struct
|
|||||||
#define LL_TIM_ETR_FILTER_FDIV2_N8 (TIM_SMCR_ETF_2 | TIM_SMCR_ETF_0) /*!< fSAMPLING=fDTS/2, N=8 */
|
#define LL_TIM_ETR_FILTER_FDIV2_N8 (TIM_SMCR_ETF_2 | TIM_SMCR_ETF_0) /*!< fSAMPLING=fDTS/2, N=8 */
|
||||||
#define LL_TIM_ETR_FILTER_FDIV4_N6 (TIM_SMCR_ETF_2 | TIM_SMCR_ETF_1) /*!< fSAMPLING=fDTS/4, N=6 */
|
#define LL_TIM_ETR_FILTER_FDIV4_N6 (TIM_SMCR_ETF_2 | TIM_SMCR_ETF_1) /*!< fSAMPLING=fDTS/4, N=6 */
|
||||||
#define LL_TIM_ETR_FILTER_FDIV4_N8 (TIM_SMCR_ETF_2 | TIM_SMCR_ETF_1 | TIM_SMCR_ETF_0) /*!< fSAMPLING=fDTS/4, N=8 */
|
#define LL_TIM_ETR_FILTER_FDIV4_N8 (TIM_SMCR_ETF_2 | TIM_SMCR_ETF_1 | TIM_SMCR_ETF_0) /*!< fSAMPLING=fDTS/4, N=8 */
|
||||||
#define LL_TIM_ETR_FILTER_FDIV8_N6 TIM_SMCR_ETF_3 /*!< fSAMPLING=fDTS/8, N=8 */
|
#define LL_TIM_ETR_FILTER_FDIV8_N6 TIM_SMCR_ETF_3 /*!< fSAMPLING=fDTS/8, N=6 */
|
||||||
#define LL_TIM_ETR_FILTER_FDIV8_N8 (TIM_SMCR_ETF_3 | TIM_SMCR_ETF_0) /*!< fSAMPLING=fDTS/16, N=5 */
|
#define LL_TIM_ETR_FILTER_FDIV8_N8 (TIM_SMCR_ETF_3 | TIM_SMCR_ETF_0) /*!< fSAMPLING=fDTS/16, N=8 */
|
||||||
#define LL_TIM_ETR_FILTER_FDIV16_N5 (TIM_SMCR_ETF_3 | TIM_SMCR_ETF_1) /*!< fSAMPLING=fDTS/16, N=6 */
|
#define LL_TIM_ETR_FILTER_FDIV16_N5 (TIM_SMCR_ETF_3 | TIM_SMCR_ETF_1) /*!< fSAMPLING=fDTS/16, N=5 */
|
||||||
#define LL_TIM_ETR_FILTER_FDIV16_N6 (TIM_SMCR_ETF_3 | TIM_SMCR_ETF_1 | TIM_SMCR_ETF_0) /*!< fSAMPLING=fDTS/16, N=8 */
|
#define LL_TIM_ETR_FILTER_FDIV16_N6 (TIM_SMCR_ETF_3 | TIM_SMCR_ETF_1 | TIM_SMCR_ETF_0) /*!< fSAMPLING=fDTS/16, N=6 */
|
||||||
#define LL_TIM_ETR_FILTER_FDIV16_N8 (TIM_SMCR_ETF_3 | TIM_SMCR_ETF_2) /*!< fSAMPLING=fDTS/16, N=5 */
|
#define LL_TIM_ETR_FILTER_FDIV16_N8 (TIM_SMCR_ETF_3 | TIM_SMCR_ETF_2) /*!< fSAMPLING=fDTS/16, N=8 */
|
||||||
#define LL_TIM_ETR_FILTER_FDIV32_N5 (TIM_SMCR_ETF_3 | TIM_SMCR_ETF_2 | TIM_SMCR_ETF_0) /*!< fSAMPLING=fDTS/32, N=5 */
|
#define LL_TIM_ETR_FILTER_FDIV32_N5 (TIM_SMCR_ETF_3 | TIM_SMCR_ETF_2 | TIM_SMCR_ETF_0) /*!< fSAMPLING=fDTS/32, N=5 */
|
||||||
#define LL_TIM_ETR_FILTER_FDIV32_N6 (TIM_SMCR_ETF_3 | TIM_SMCR_ETF_2 | TIM_SMCR_ETF_1) /*!< fSAMPLING=fDTS/32, N=6 */
|
#define LL_TIM_ETR_FILTER_FDIV32_N6 (TIM_SMCR_ETF_3 | TIM_SMCR_ETF_2 | TIM_SMCR_ETF_1) /*!< fSAMPLING=fDTS/32, N=6 */
|
||||||
#define LL_TIM_ETR_FILTER_FDIV32_N8 TIM_SMCR_ETF /*!< fSAMPLING=fDTS/32, N=8 */
|
#define LL_TIM_ETR_FILTER_FDIV32_N8 TIM_SMCR_ETF /*!< fSAMPLING=fDTS/32, N=8 */
|
||||||
@ -1844,6 +1859,17 @@ __STATIC_INLINE void LL_TIM_CC_DisablePreload(TIM_TypeDef *TIMx)
|
|||||||
CLEAR_BIT(TIMx->CR2, TIM_CR2_CCPC);
|
CLEAR_BIT(TIMx->CR2, TIM_CR2_CCPC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Indicates whether the capture/compare control bits (CCxE, CCxNE and OCxM) preload is enabled.
|
||||||
|
* @rmtoll CR2 CCPC LL_TIM_CC_IsEnabledPreload
|
||||||
|
* @param TIMx Timer instance
|
||||||
|
* @retval State of bit (1 or 0).
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_TIM_CC_IsEnabledPreload(const TIM_TypeDef *TIMx)
|
||||||
|
{
|
||||||
|
return ((READ_BIT(TIMx->CR2, TIM_CR2_CCPC) == (TIM_CR2_CCPC)) ? 1UL : 0UL);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set the updated source of the capture/compare control bits (CCxE, CCxNE and OCxM).
|
* @brief Set the updated source of the capture/compare control bits (CCxE, CCxNE and OCxM).
|
||||||
* @note Macro IS_TIM_COMMUTATION_EVENT_INSTANCE(TIMx) can be used to check
|
* @note Macro IS_TIM_COMMUTATION_EVENT_INSTANCE(TIMx) can be used to check
|
||||||
@ -2094,15 +2120,15 @@ __STATIC_INLINE void LL_TIM_OC_ConfigOutput(TIM_TypeDef *TIMx, uint32_t Channel,
|
|||||||
* @arg @ref LL_TIM_OCMODE_RETRIG_OPM2
|
* @arg @ref LL_TIM_OCMODE_RETRIG_OPM2
|
||||||
* @arg @ref LL_TIM_OCMODE_COMBINED_PWM1
|
* @arg @ref LL_TIM_OCMODE_COMBINED_PWM1
|
||||||
* @arg @ref LL_TIM_OCMODE_COMBINED_PWM2
|
* @arg @ref LL_TIM_OCMODE_COMBINED_PWM2
|
||||||
* @arg @ref LL_TIM_OCMODE_ASSYMETRIC_PWM1
|
* @arg @ref LL_TIM_OCMODE_ASYMMETRIC_PWM1
|
||||||
* @arg @ref LL_TIM_OCMODE_ASSYMETRIC_PWM2
|
* @arg @ref LL_TIM_OCMODE_ASYMMETRIC_PWM2
|
||||||
* @note The following OC modes are not available on all F3 devices :
|
* @note The following OC modes are not available on all F3 devices :
|
||||||
* - LL_TIM_OCMODE_RETRIG_OPM1
|
* - LL_TIM_OCMODE_RETRIG_OPM1
|
||||||
* - LL_TIM_OCMODE_RETRIG_OPM2
|
* - LL_TIM_OCMODE_RETRIG_OPM2
|
||||||
* - LL_TIM_OCMODE_COMBINED_PWM1
|
* - LL_TIM_OCMODE_COMBINED_PWM1
|
||||||
* - LL_TIM_OCMODE_COMBINED_PWM2
|
* - LL_TIM_OCMODE_COMBINED_PWM2
|
||||||
* - LL_TIM_OCMODE_ASSYMETRIC_PWM1
|
* - LL_TIM_OCMODE_ASYMMETRIC_PWM1
|
||||||
* - LL_TIM_OCMODE_ASSYMETRIC_PWM2
|
* - LL_TIM_OCMODE_ASYMMETRIC_PWM2
|
||||||
* @note CH5 and CH6 channels are not available for all F3 devices
|
* @note CH5 and CH6 channels are not available for all F3 devices
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
@ -2142,8 +2168,8 @@ __STATIC_INLINE void LL_TIM_OC_SetMode(TIM_TypeDef *TIMx, uint32_t Channel, uint
|
|||||||
* - LL_TIM_OCMODE_RETRIG_OPM2
|
* - LL_TIM_OCMODE_RETRIG_OPM2
|
||||||
* - LL_TIM_OCMODE_COMBINED_PWM1
|
* - LL_TIM_OCMODE_COMBINED_PWM1
|
||||||
* - LL_TIM_OCMODE_COMBINED_PWM2
|
* - LL_TIM_OCMODE_COMBINED_PWM2
|
||||||
* - LL_TIM_OCMODE_ASSYMETRIC_PWM1
|
* - LL_TIM_OCMODE_ASYMMETRIC_PWM1
|
||||||
* - LL_TIM_OCMODE_ASSYMETRIC_PWM2
|
* - LL_TIM_OCMODE_ASYMMETRIC_PWM2
|
||||||
* @note CH5 and CH6 channels are not available for all F3 devices
|
* @note CH5 and CH6 channels are not available for all F3 devices
|
||||||
* @retval Returned value can be one of the following values:
|
* @retval Returned value can be one of the following values:
|
||||||
* @arg @ref LL_TIM_OCMODE_FROZEN
|
* @arg @ref LL_TIM_OCMODE_FROZEN
|
||||||
@ -2158,8 +2184,8 @@ __STATIC_INLINE void LL_TIM_OC_SetMode(TIM_TypeDef *TIMx, uint32_t Channel, uint
|
|||||||
* @arg @ref LL_TIM_OCMODE_RETRIG_OPM2
|
* @arg @ref LL_TIM_OCMODE_RETRIG_OPM2
|
||||||
* @arg @ref LL_TIM_OCMODE_COMBINED_PWM1
|
* @arg @ref LL_TIM_OCMODE_COMBINED_PWM1
|
||||||
* @arg @ref LL_TIM_OCMODE_COMBINED_PWM2
|
* @arg @ref LL_TIM_OCMODE_COMBINED_PWM2
|
||||||
* @arg @ref LL_TIM_OCMODE_ASSYMETRIC_PWM1
|
* @arg @ref LL_TIM_OCMODE_ASYMMETRIC_PWM1
|
||||||
* @arg @ref LL_TIM_OCMODE_ASSYMETRIC_PWM2
|
* @arg @ref LL_TIM_OCMODE_ASYMMETRIC_PWM2
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_TIM_OC_GetMode(const TIM_TypeDef *TIMx, uint32_t Channel)
|
__STATIC_INLINE uint32_t LL_TIM_OC_GetMode(const TIM_TypeDef *TIMx, uint32_t Channel)
|
||||||
{
|
{
|
||||||
|
@ -53,26 +53,26 @@ typedef enum
|
|||||||
*/
|
*/
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
uint32_t dev_endpoints; /*!< Device Endpoints number.
|
uint8_t dev_endpoints; /*!< Device Endpoints number.
|
||||||
This parameter depends on the used USB core.
|
This parameter depends on the used USB core.
|
||||||
This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
|
This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
|
||||||
|
|
||||||
uint32_t speed; /*!< USB Core speed.
|
uint8_t speed; /*!< USB Core speed.
|
||||||
This parameter can be any value of @ref PCD_Speed/HCD_Speed
|
This parameter can be any value of @ref PCD_Speed/HCD_Speed
|
||||||
(HCD_SPEED_xxx, HCD_SPEED_xxx) */
|
(HCD_SPEED_xxx, HCD_SPEED_xxx) */
|
||||||
|
|
||||||
uint32_t ep0_mps; /*!< Set the Endpoint 0 Max Packet size. */
|
uint8_t ep0_mps; /*!< Set the Endpoint 0 Max Packet size. */
|
||||||
|
|
||||||
uint32_t phy_itface; /*!< Select the used PHY interface.
|
uint8_t phy_itface; /*!< Select the used PHY interface.
|
||||||
This parameter can be any value of @ref PCD_PHY_Module/HCD_PHY_Module */
|
This parameter can be any value of @ref PCD_PHY_Module/HCD_PHY_Module */
|
||||||
|
|
||||||
uint32_t Sof_enable; /*!< Enable or disable the output of the SOF signal. */
|
uint8_t Sof_enable; /*!< Enable or disable the output of the SOF signal. */
|
||||||
|
|
||||||
uint32_t low_power_enable; /*!< Enable or disable the low Power Mode. */
|
uint8_t low_power_enable; /*!< Enable or disable the low Power Mode. */
|
||||||
|
|
||||||
uint32_t lpm_enable; /*!< Enable or disable Link Power Management. */
|
uint8_t lpm_enable; /*!< Enable or disable Link Power Management. */
|
||||||
|
|
||||||
uint32_t battery_charging_enable; /*!< Enable or disable Battery charging. */
|
uint8_t battery_charging_enable; /*!< Enable or disable Battery charging. */
|
||||||
} USB_CfgTypeDef;
|
} USB_CfgTypeDef;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
@ -203,6 +203,9 @@ HAL_StatusTypeDef USB_EnableGlobalInt(USB_TypeDef *USBx);
|
|||||||
HAL_StatusTypeDef USB_DisableGlobalInt(USB_TypeDef *USBx);
|
HAL_StatusTypeDef USB_DisableGlobalInt(USB_TypeDef *USBx);
|
||||||
HAL_StatusTypeDef USB_SetCurrentMode(USB_TypeDef *USBx, USB_ModeTypeDef mode);
|
HAL_StatusTypeDef USB_SetCurrentMode(USB_TypeDef *USBx, USB_ModeTypeDef mode);
|
||||||
|
|
||||||
|
HAL_StatusTypeDef USB_FlushRxFifo(USB_TypeDef const *USBx);
|
||||||
|
HAL_StatusTypeDef USB_FlushTxFifo(USB_TypeDef const *USBx, uint32_t num);
|
||||||
|
|
||||||
#if defined (HAL_PCD_MODULE_ENABLED)
|
#if defined (HAL_PCD_MODULE_ENABLED)
|
||||||
HAL_StatusTypeDef USB_ActivateEndpoint(USB_TypeDef *USBx, USB_EPTypeDef *ep);
|
HAL_StatusTypeDef USB_ActivateEndpoint(USB_TypeDef *USBx, USB_EPTypeDef *ep);
|
||||||
HAL_StatusTypeDef USB_DeactivateEndpoint(USB_TypeDef *USBx, USB_EPTypeDef *ep);
|
HAL_StatusTypeDef USB_DeactivateEndpoint(USB_TypeDef *USBx, USB_EPTypeDef *ep);
|
||||||
@ -216,14 +219,14 @@ HAL_StatusTypeDef USB_SetDevAddress(USB_TypeDef *USBx, uint8_t address);
|
|||||||
HAL_StatusTypeDef USB_DevConnect(USB_TypeDef *USBx);
|
HAL_StatusTypeDef USB_DevConnect(USB_TypeDef *USBx);
|
||||||
HAL_StatusTypeDef USB_DevDisconnect(USB_TypeDef *USBx);
|
HAL_StatusTypeDef USB_DevDisconnect(USB_TypeDef *USBx);
|
||||||
HAL_StatusTypeDef USB_StopDevice(USB_TypeDef *USBx);
|
HAL_StatusTypeDef USB_StopDevice(USB_TypeDef *USBx);
|
||||||
uint32_t USB_ReadInterrupts(USB_TypeDef *USBx);
|
uint32_t USB_ReadInterrupts(USB_TypeDef const *USBx);
|
||||||
HAL_StatusTypeDef USB_ActivateRemoteWakeup(USB_TypeDef *USBx);
|
HAL_StatusTypeDef USB_ActivateRemoteWakeup(USB_TypeDef *USBx);
|
||||||
HAL_StatusTypeDef USB_DeActivateRemoteWakeup(USB_TypeDef *USBx);
|
HAL_StatusTypeDef USB_DeActivateRemoteWakeup(USB_TypeDef *USBx);
|
||||||
|
|
||||||
void USB_WritePMA(USB_TypeDef *USBx, uint8_t *pbUsrBuf,
|
void USB_WritePMA(USB_TypeDef const *USBx, uint8_t *pbUsrBuf,
|
||||||
uint16_t wPMABufAddr, uint16_t wNBytes);
|
uint16_t wPMABufAddr, uint16_t wNBytes);
|
||||||
|
|
||||||
void USB_ReadPMA(USB_TypeDef *USBx, uint8_t *pbUsrBuf,
|
void USB_ReadPMA(USB_TypeDef const *USBx, uint8_t *pbUsrBuf,
|
||||||
uint16_t wPMABufAddr, uint16_t wNBytes);
|
uint16_t wPMABufAddr, uint16_t wNBytes);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -225,7 +225,7 @@ __STATIC_INLINE uint32_t LL_GetFlashSize(void)
|
|||||||
* @param HCLKFrequency HCLK frequency in Hz (can be calculated thanks to RCC helper macro)
|
* @param HCLKFrequency HCLK frequency in Hz (can be calculated thanks to RCC helper macro)
|
||||||
* @note When a RTOS is used, it is recommended to avoid changing the SysTick
|
* @note When a RTOS is used, it is recommended to avoid changing the SysTick
|
||||||
* configuration by calling this function, for a delay use rather osDelay RTOS service.
|
* configuration by calling this function, for a delay use rather osDelay RTOS service.
|
||||||
* @param Ticks Number of ticks
|
* @param Ticks Frequency of Ticks (Hz)
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE void LL_InitTick(uint32_t HCLKFrequency, uint32_t Ticks)
|
__STATIC_INLINE void LL_InitTick(uint32_t HCLKFrequency, uint32_t Ticks)
|
||||||
|
@ -131,7 +131,7 @@ __STATIC_INLINE void LL_WWDG_Enable(WWDG_TypeDef *WWDGx)
|
|||||||
* @param WWDGx WWDG Instance
|
* @param WWDGx WWDG Instance
|
||||||
* @retval State of bit (1 or 0).
|
* @retval State of bit (1 or 0).
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_WWDG_IsEnabled(WWDG_TypeDef *WWDGx)
|
__STATIC_INLINE uint32_t LL_WWDG_IsEnabled(const WWDG_TypeDef *WWDGx)
|
||||||
{
|
{
|
||||||
return ((READ_BIT(WWDGx->CR, WWDG_CR_WDGA) == (WWDG_CR_WDGA)) ? 1UL : 0UL);
|
return ((READ_BIT(WWDGx->CR, WWDG_CR_WDGA) == (WWDG_CR_WDGA)) ? 1UL : 0UL);
|
||||||
}
|
}
|
||||||
@ -158,7 +158,7 @@ __STATIC_INLINE void LL_WWDG_SetCounter(WWDG_TypeDef *WWDGx, uint32_t Counter)
|
|||||||
* @param WWDGx WWDG Instance
|
* @param WWDGx WWDG Instance
|
||||||
* @retval 7 bit Watchdog Counter value
|
* @retval 7 bit Watchdog Counter value
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_WWDG_GetCounter(WWDG_TypeDef *WWDGx)
|
__STATIC_INLINE uint32_t LL_WWDG_GetCounter(const WWDG_TypeDef *WWDGx)
|
||||||
{
|
{
|
||||||
return (READ_BIT(WWDGx->CR, WWDG_CR_T));
|
return (READ_BIT(WWDGx->CR, WWDG_CR_T));
|
||||||
}
|
}
|
||||||
@ -191,7 +191,7 @@ __STATIC_INLINE void LL_WWDG_SetPrescaler(WWDG_TypeDef *WWDGx, uint32_t Prescale
|
|||||||
* @arg @ref LL_WWDG_PRESCALER_4
|
* @arg @ref LL_WWDG_PRESCALER_4
|
||||||
* @arg @ref LL_WWDG_PRESCALER_8
|
* @arg @ref LL_WWDG_PRESCALER_8
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_WWDG_GetPrescaler(WWDG_TypeDef *WWDGx)
|
__STATIC_INLINE uint32_t LL_WWDG_GetPrescaler(const WWDG_TypeDef *WWDGx)
|
||||||
{
|
{
|
||||||
return (READ_BIT(WWDGx->CFR, WWDG_CFR_WDGTB));
|
return (READ_BIT(WWDGx->CFR, WWDG_CFR_WDGTB));
|
||||||
}
|
}
|
||||||
@ -223,7 +223,7 @@ __STATIC_INLINE void LL_WWDG_SetWindow(WWDG_TypeDef *WWDGx, uint32_t Window)
|
|||||||
* @param WWDGx WWDG Instance
|
* @param WWDGx WWDG Instance
|
||||||
* @retval 7 bit Watchdog Window value
|
* @retval 7 bit Watchdog Window value
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_WWDG_GetWindow(WWDG_TypeDef *WWDGx)
|
__STATIC_INLINE uint32_t LL_WWDG_GetWindow(const WWDG_TypeDef *WWDGx)
|
||||||
{
|
{
|
||||||
return (READ_BIT(WWDGx->CFR, WWDG_CFR_W));
|
return (READ_BIT(WWDGx->CFR, WWDG_CFR_W));
|
||||||
}
|
}
|
||||||
@ -244,7 +244,7 @@ __STATIC_INLINE uint32_t LL_WWDG_GetWindow(WWDG_TypeDef *WWDGx)
|
|||||||
* @param WWDGx WWDG Instance
|
* @param WWDGx WWDG Instance
|
||||||
* @retval State of bit (1 or 0).
|
* @retval State of bit (1 or 0).
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_WWDG_IsActiveFlag_EWKUP(WWDG_TypeDef *WWDGx)
|
__STATIC_INLINE uint32_t LL_WWDG_IsActiveFlag_EWKUP(const WWDG_TypeDef *WWDGx)
|
||||||
{
|
{
|
||||||
return ((READ_BIT(WWDGx->SR, WWDG_SR_EWIF) == (WWDG_SR_EWIF)) ? 1UL : 0UL);
|
return ((READ_BIT(WWDGx->SR, WWDG_SR_EWIF) == (WWDG_SR_EWIF)) ? 1UL : 0UL);
|
||||||
}
|
}
|
||||||
@ -286,7 +286,7 @@ __STATIC_INLINE void LL_WWDG_EnableIT_EWKUP(WWDG_TypeDef *WWDGx)
|
|||||||
* @param WWDGx WWDG Instance
|
* @param WWDGx WWDG Instance
|
||||||
* @retval State of bit (1 or 0).
|
* @retval State of bit (1 or 0).
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_WWDG_IsEnabledIT_EWKUP(WWDG_TypeDef *WWDGx)
|
__STATIC_INLINE uint32_t LL_WWDG_IsEnabledIT_EWKUP(const WWDG_TypeDef *WWDGx)
|
||||||
{
|
{
|
||||||
return ((READ_BIT(WWDGx->CFR, WWDG_CFR_EWI) == (WWDG_CFR_EWI)) ? 1UL : 0UL);
|
return ((READ_BIT(WWDGx->CFR, WWDG_CFR_EWI) == (WWDG_CFR_EWI)) ? 1UL : 0UL);
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
*/
|
*/
|
||||||
#define __STM32F3xx_HAL_VERSION_MAIN (0x01U) /*!< [31:24] main version */
|
#define __STM32F3xx_HAL_VERSION_MAIN (0x01U) /*!< [31:24] main version */
|
||||||
#define __STM32F3xx_HAL_VERSION_SUB1 (0x05U) /*!< [23:16] sub1 version */
|
#define __STM32F3xx_HAL_VERSION_SUB1 (0x05U) /*!< [23:16] sub1 version */
|
||||||
#define __STM32F3xx_HAL_VERSION_SUB2 (0x07U) /*!< [15:8] sub2 version */
|
#define __STM32F3xx_HAL_VERSION_SUB2 (0x08U) /*!< [15:8] sub2 version */
|
||||||
#define __STM32F3xx_HAL_VERSION_RC (0x00U) /*!< [7:0] release candidate */
|
#define __STM32F3xx_HAL_VERSION_RC (0x00U) /*!< [7:0] release candidate */
|
||||||
#define __STM32F3xx_HAL_VERSION ((__STM32F3xx_HAL_VERSION_MAIN << 24U)\
|
#define __STM32F3xx_HAL_VERSION ((__STM32F3xx_HAL_VERSION_MAIN << 24U)\
|
||||||
|(__STM32F3xx_HAL_VERSION_SUB1 << 16U)\
|
|(__STM32F3xx_HAL_VERSION_SUB1 << 16U)\
|
||||||
|
@ -4854,6 +4854,9 @@ uint32_t HAL_ADCEx_MultiModeGetValue(ADC_HandleTypeDef* hadc)
|
|||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
assert_param(IS_ADC_MULTIMODE_MASTER_INSTANCE(hadc->Instance));
|
assert_param(IS_ADC_MULTIMODE_MASTER_INSTANCE(hadc->Instance));
|
||||||
|
|
||||||
|
/* Prevent unused argument(s) compilation warning */
|
||||||
|
UNUSED(hadc);
|
||||||
|
|
||||||
/* Pointer to the common control register to which is belonging hadc */
|
/* Pointer to the common control register to which is belonging hadc */
|
||||||
/* (Depending on STM32F3 product, there may be up to 4 ADC and 2 common */
|
/* (Depending on STM32F3 product, there may be up to 4 ADC and 2 common */
|
||||||
/* control registers) */
|
/* control registers) */
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
(++) Enable the CAN interface clock using __HAL_RCC_CANx_CLK_ENABLE()
|
(++) Enable the CAN interface clock using __HAL_RCC_CANx_CLK_ENABLE()
|
||||||
(++) Configure CAN pins
|
(++) Configure CAN pins
|
||||||
(+++) Enable the clock for the CAN GPIOs
|
(+++) Enable the clock for the CAN GPIOs
|
||||||
(+++) Configure CAN pins as alternate function open-drain
|
(+++) Configure CAN pins as alternate function
|
||||||
(++) In case of using interrupts (e.g. HAL_CAN_ActivateNotification())
|
(++) In case of using interrupts (e.g. HAL_CAN_ActivateNotification())
|
||||||
(+++) Configure the CAN interrupt priority using
|
(+++) Configure the CAN interrupt priority using
|
||||||
HAL_NVIC_SetPriority()
|
HAL_NVIC_SetPriority()
|
||||||
@ -235,6 +235,7 @@
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#define CAN_TIMEOUT_VALUE 10U
|
#define CAN_TIMEOUT_VALUE 10U
|
||||||
|
#define CAN_WAKEUP_TIMEOUT_COUNTER 1000000U
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
@ -328,7 +329,7 @@ HAL_StatusTypeDef HAL_CAN_Init(CAN_HandleTypeDef *hcan)
|
|||||||
/* Init the low level hardware: CLOCK, NVIC */
|
/* Init the low level hardware: CLOCK, NVIC */
|
||||||
HAL_CAN_MspInit(hcan);
|
HAL_CAN_MspInit(hcan);
|
||||||
}
|
}
|
||||||
#endif /* (USE_HAL_CAN_REGISTER_CALLBACKS) */
|
#endif /* USE_HAL_CAN_REGISTER_CALLBACKS */
|
||||||
|
|
||||||
/* Request initialisation */
|
/* Request initialisation */
|
||||||
SET_BIT(hcan->Instance->MCR, CAN_MCR_INRQ);
|
SET_BIT(hcan->Instance->MCR, CAN_MCR_INRQ);
|
||||||
@ -482,7 +483,7 @@ HAL_StatusTypeDef HAL_CAN_DeInit(CAN_HandleTypeDef *hcan)
|
|||||||
#else
|
#else
|
||||||
/* DeInit the low level hardware: CLOCK, NVIC */
|
/* DeInit the low level hardware: CLOCK, NVIC */
|
||||||
HAL_CAN_MspDeInit(hcan);
|
HAL_CAN_MspDeInit(hcan);
|
||||||
#endif /* (USE_HAL_CAN_REGISTER_CALLBACKS) */
|
#endif /* USE_HAL_CAN_REGISTER_CALLBACKS */
|
||||||
|
|
||||||
/* Reset the CAN peripheral */
|
/* Reset the CAN peripheral */
|
||||||
SET_BIT(hcan->Instance->MCR, CAN_MCR_RESET);
|
SET_BIT(hcan->Instance->MCR, CAN_MCR_RESET);
|
||||||
@ -1127,7 +1128,6 @@ HAL_StatusTypeDef HAL_CAN_RequestSleep(CAN_HandleTypeDef *hcan)
|
|||||||
HAL_StatusTypeDef HAL_CAN_WakeUp(CAN_HandleTypeDef *hcan)
|
HAL_StatusTypeDef HAL_CAN_WakeUp(CAN_HandleTypeDef *hcan)
|
||||||
{
|
{
|
||||||
__IO uint32_t count = 0;
|
__IO uint32_t count = 0;
|
||||||
uint32_t timeout = 1000000U;
|
|
||||||
HAL_CAN_StateTypeDef state = hcan->State;
|
HAL_CAN_StateTypeDef state = hcan->State;
|
||||||
|
|
||||||
if ((state == HAL_CAN_STATE_READY) ||
|
if ((state == HAL_CAN_STATE_READY) ||
|
||||||
@ -1143,15 +1143,14 @@ HAL_StatusTypeDef HAL_CAN_WakeUp(CAN_HandleTypeDef *hcan)
|
|||||||
count++;
|
count++;
|
||||||
|
|
||||||
/* Check if timeout is reached */
|
/* Check if timeout is reached */
|
||||||
if (count > timeout)
|
if (count > CAN_WAKEUP_TIMEOUT_COUNTER)
|
||||||
{
|
{
|
||||||
/* Update error code */
|
/* Update error code */
|
||||||
hcan->ErrorCode |= HAL_CAN_ERROR_TIMEOUT;
|
hcan->ErrorCode |= HAL_CAN_ERROR_TIMEOUT;
|
||||||
|
|
||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
}
|
} while ((hcan->Instance->MSR & CAN_MSR_SLAK) != 0U);
|
||||||
while ((hcan->Instance->MSR & CAN_MSR_SLAK) != 0U);
|
|
||||||
|
|
||||||
/* Return function status */
|
/* Return function status */
|
||||||
return HAL_OK;
|
return HAL_OK;
|
||||||
|
@ -301,6 +301,20 @@
|
|||||||
*/
|
*/
|
||||||
#define COMP_LOCK_DISABLE (0x00000000U)
|
#define COMP_LOCK_DISABLE (0x00000000U)
|
||||||
#define COMP_LOCK_ENABLE COMP_CSR_COMPxLOCK
|
#define COMP_LOCK_ENABLE COMP_CSR_COMPxLOCK
|
||||||
|
|
||||||
|
/* Delay for COMP startup time. */
|
||||||
|
/* Note: Delay required to reach propagation delay specification. */
|
||||||
|
/* Literal set to maximum value (refer to device datasheet, */
|
||||||
|
/* parameter "tSTART"). */
|
||||||
|
/* Unit: us */
|
||||||
|
#define COMP_DELAY_STARTUP_US (80UL) /*!< Delay for COMP startup time */
|
||||||
|
|
||||||
|
/* Delay for COMP voltage scaler stabilization time. */
|
||||||
|
/* Literal set to maximum value (refer to device datasheet, */
|
||||||
|
/* parameter "tSTART_SCALER"). */
|
||||||
|
/* Unit: us */
|
||||||
|
#define COMP_DELAY_VOLTAGE_SCALER_STAB_US (200UL) /*!< Delay for COMP voltage scaler stabilization time */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
@ -337,6 +351,8 @@
|
|||||||
*/
|
*/
|
||||||
HAL_StatusTypeDef HAL_COMP_Init(COMP_HandleTypeDef *hcomp)
|
HAL_StatusTypeDef HAL_COMP_Init(COMP_HandleTypeDef *hcomp)
|
||||||
{
|
{
|
||||||
|
uint32_t comp_voltage_scaler_initialized; /* Value "0" if comparator voltage scaler is not initialized */
|
||||||
|
__IO uint32_t wait_loop_index = 0UL;
|
||||||
HAL_StatusTypeDef status = HAL_OK;
|
HAL_StatusTypeDef status = HAL_OK;
|
||||||
|
|
||||||
/* Check the COMP handle allocation and lock status */
|
/* Check the COMP handle allocation and lock status */
|
||||||
@ -385,6 +401,9 @@ HAL_StatusTypeDef HAL_COMP_Init(COMP_HandleTypeDef *hcomp)
|
|||||||
HAL_COMP_MspInit(hcomp);
|
HAL_COMP_MspInit(hcomp);
|
||||||
#endif /* USE_HAL_COMP_REGISTER_CALLBACKS */
|
#endif /* USE_HAL_COMP_REGISTER_CALLBACKS */
|
||||||
|
|
||||||
|
/* Memorize voltage scaler state before initialization */
|
||||||
|
comp_voltage_scaler_initialized = READ_BIT(hcomp->Instance->CSR, (COMP_CSR_COMPxINSEL_1 | COMP_CSR_COMPxINSEL_0));
|
||||||
|
|
||||||
if (hcomp->State == HAL_COMP_STATE_RESET)
|
if (hcomp->State == HAL_COMP_STATE_RESET)
|
||||||
{
|
{
|
||||||
/* Allocate lock resource and initialize it */
|
/* Allocate lock resource and initialize it */
|
||||||
@ -405,6 +424,22 @@ HAL_StatusTypeDef HAL_COMP_Init(COMP_HandleTypeDef *hcomp)
|
|||||||
/* Set COMPxMODE bits according to hcomp->Init.Mode value */
|
/* Set COMPxMODE bits according to hcomp->Init.Mode value */
|
||||||
COMP_INIT(hcomp);
|
COMP_INIT(hcomp);
|
||||||
|
|
||||||
|
/* Delay for COMP scaler bridge voltage stabilization */
|
||||||
|
/* Apply the delay if voltage scaler bridge is required and not already enabled */
|
||||||
|
if ((READ_BIT(hcomp->Instance->CSR, (COMP_CSR_COMPxINSEL_1 | COMP_CSR_COMPxINSEL_0)) != 0UL) &&
|
||||||
|
(comp_voltage_scaler_initialized == 0UL))
|
||||||
|
{
|
||||||
|
/* Wait loop initialization and execution */
|
||||||
|
/* Note: Variable divided by 2 to compensate partially */
|
||||||
|
/* CPU processing cycles, scaling in us split to not */
|
||||||
|
/* exceed 32 bits register capacity and handle low frequency. */
|
||||||
|
wait_loop_index = ((COMP_DELAY_VOLTAGE_SCALER_STAB_US / 10UL) * ((SystemCoreClock / (100000UL * 2UL)) + 1UL));
|
||||||
|
while (wait_loop_index != 0UL)
|
||||||
|
{
|
||||||
|
wait_loop_index--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Initialize the COMP state*/
|
/* Initialize the COMP state*/
|
||||||
hcomp->State = HAL_COMP_STATE_READY;
|
hcomp->State = HAL_COMP_STATE_READY;
|
||||||
}
|
}
|
||||||
@ -677,6 +712,7 @@ HAL_StatusTypeDef HAL_COMP_UnRegisterCallback(COMP_HandleTypeDef *hcomp, HAL_COM
|
|||||||
*/
|
*/
|
||||||
HAL_StatusTypeDef HAL_COMP_Start(COMP_HandleTypeDef *hcomp)
|
HAL_StatusTypeDef HAL_COMP_Start(COMP_HandleTypeDef *hcomp)
|
||||||
{
|
{
|
||||||
|
__IO uint32_t wait_loop_index = 0UL;
|
||||||
HAL_StatusTypeDef status = HAL_OK;
|
HAL_StatusTypeDef status = HAL_OK;
|
||||||
uint32_t extiline = 0U;
|
uint32_t extiline = 0U;
|
||||||
|
|
||||||
@ -729,6 +765,17 @@ HAL_StatusTypeDef HAL_COMP_Start(COMP_HandleTypeDef *hcomp)
|
|||||||
__HAL_COMP_ENABLE(hcomp);
|
__HAL_COMP_ENABLE(hcomp);
|
||||||
|
|
||||||
hcomp->State = HAL_COMP_STATE_BUSY;
|
hcomp->State = HAL_COMP_STATE_BUSY;
|
||||||
|
|
||||||
|
/* Delay for COMP startup time */
|
||||||
|
/* Wait loop initialization and execution */
|
||||||
|
/* Note: Variable divided by 2 to compensate partially */
|
||||||
|
/* CPU processing cycles, scaling in us split to not */
|
||||||
|
/* exceed 32 bits register capacity and handle low frequency. */
|
||||||
|
wait_loop_index = ((COMP_DELAY_STARTUP_US / 10UL) * ((SystemCoreClock / (100000UL * 2UL)) + 1UL));
|
||||||
|
while (wait_loop_index != 0UL)
|
||||||
|
{
|
||||||
|
wait_loop_index--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -310,6 +310,38 @@ void HAL_MPU_Enable(uint32_t MPU_Control)
|
|||||||
SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk;
|
SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enables the MPU Region.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void HAL_MPU_EnableRegion(uint32_t RegionNumber)
|
||||||
|
{
|
||||||
|
/* Check the parameters */
|
||||||
|
assert_param(IS_MPU_REGION_NUMBER(RegionNumber));
|
||||||
|
|
||||||
|
/* Set the Region number */
|
||||||
|
MPU->RNR = RegionNumber;
|
||||||
|
|
||||||
|
/* Enable the Region */
|
||||||
|
SET_BIT(MPU->RASR, MPU_RASR_ENABLE_Msk);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Disables the MPU Region.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void HAL_MPU_DisableRegion(uint32_t RegionNumber)
|
||||||
|
{
|
||||||
|
/* Check the parameters */
|
||||||
|
assert_param(IS_MPU_REGION_NUMBER(RegionNumber));
|
||||||
|
|
||||||
|
/* Set the Region number */
|
||||||
|
MPU->RNR = RegionNumber;
|
||||||
|
|
||||||
|
/* Disable the Region */
|
||||||
|
CLEAR_BIT(MPU->RASR, MPU_RASR_ENABLE_Msk);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initializes and configures the Region and the memory to be protected.
|
* @brief Initializes and configures the Region and the memory to be protected.
|
||||||
* @param MPU_Init Pointer to a MPU_Region_InitTypeDef structure that contains
|
* @param MPU_Init Pointer to a MPU_Region_InitTypeDef structure that contains
|
||||||
@ -321,13 +353,6 @@ void HAL_MPU_ConfigRegion(MPU_Region_InitTypeDef *MPU_Init)
|
|||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
assert_param(IS_MPU_REGION_NUMBER(MPU_Init->Number));
|
assert_param(IS_MPU_REGION_NUMBER(MPU_Init->Number));
|
||||||
assert_param(IS_MPU_REGION_ENABLE(MPU_Init->Enable));
|
assert_param(IS_MPU_REGION_ENABLE(MPU_Init->Enable));
|
||||||
|
|
||||||
/* Set the Region number */
|
|
||||||
MPU->RNR = MPU_Init->Number;
|
|
||||||
|
|
||||||
if ((MPU_Init->Enable) != RESET)
|
|
||||||
{
|
|
||||||
/* Check the parameters */
|
|
||||||
assert_param(IS_MPU_INSTRUCTION_ACCESS(MPU_Init->DisableExec));
|
assert_param(IS_MPU_INSTRUCTION_ACCESS(MPU_Init->DisableExec));
|
||||||
assert_param(IS_MPU_REGION_PERMISSION_ATTRIBUTE(MPU_Init->AccessPermission));
|
assert_param(IS_MPU_REGION_PERMISSION_ATTRIBUTE(MPU_Init->AccessPermission));
|
||||||
assert_param(IS_MPU_TEX_LEVEL(MPU_Init->TypeExtField));
|
assert_param(IS_MPU_TEX_LEVEL(MPU_Init->TypeExtField));
|
||||||
@ -337,6 +362,13 @@ void HAL_MPU_ConfigRegion(MPU_Region_InitTypeDef *MPU_Init)
|
|||||||
assert_param(IS_MPU_SUB_REGION_DISABLE(MPU_Init->SubRegionDisable));
|
assert_param(IS_MPU_SUB_REGION_DISABLE(MPU_Init->SubRegionDisable));
|
||||||
assert_param(IS_MPU_REGION_SIZE(MPU_Init->Size));
|
assert_param(IS_MPU_REGION_SIZE(MPU_Init->Size));
|
||||||
|
|
||||||
|
/* Set the Region number */
|
||||||
|
MPU->RNR = MPU_Init->Number;
|
||||||
|
|
||||||
|
/* Disable the Region */
|
||||||
|
CLEAR_BIT(MPU->RASR, MPU_RASR_ENABLE_Msk);
|
||||||
|
|
||||||
|
/* Apply configuration */
|
||||||
MPU->RBAR = MPU_Init->BaseAddress;
|
MPU->RBAR = MPU_Init->BaseAddress;
|
||||||
MPU->RASR = ((uint32_t)MPU_Init->DisableExec << MPU_RASR_XN_Pos) |
|
MPU->RASR = ((uint32_t)MPU_Init->DisableExec << MPU_RASR_XN_Pos) |
|
||||||
((uint32_t)MPU_Init->AccessPermission << MPU_RASR_AP_Pos) |
|
((uint32_t)MPU_Init->AccessPermission << MPU_RASR_AP_Pos) |
|
||||||
@ -348,12 +380,6 @@ void HAL_MPU_ConfigRegion(MPU_Region_InitTypeDef *MPU_Init)
|
|||||||
((uint32_t)MPU_Init->Size << MPU_RASR_SIZE_Pos) |
|
((uint32_t)MPU_Init->Size << MPU_RASR_SIZE_Pos) |
|
||||||
((uint32_t)MPU_Init->Enable << MPU_RASR_ENABLE_Pos);
|
((uint32_t)MPU_Init->Enable << MPU_RASR_ENABLE_Pos);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
MPU->RBAR = 0x00U;
|
|
||||||
MPU->RASR = 0x00U;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif /* __MPU_PRESENT */
|
#endif /* __MPU_PRESENT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -403,7 +403,7 @@ uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t
|
|||||||
* @param hcrc CRC handle
|
* @param hcrc CRC handle
|
||||||
* @retval HAL state
|
* @retval HAL state
|
||||||
*/
|
*/
|
||||||
HAL_CRC_StateTypeDef HAL_CRC_GetState(CRC_HandleTypeDef *hcrc)
|
HAL_CRC_StateTypeDef HAL_CRC_GetState(const CRC_HandleTypeDef *hcrc)
|
||||||
{
|
{
|
||||||
/* Return CRC handle state */
|
/* Return CRC handle state */
|
||||||
return hcrc->State;
|
return hcrc->State;
|
||||||
|
@ -210,8 +210,6 @@ HAL_StatusTypeDef HAL_CRCEx_Output_Data_Reverse(CRC_HandleTypeDef *hcrc, uint32_
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
@ -382,6 +382,12 @@ HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress,
|
|||||||
*/
|
*/
|
||||||
HAL_StatusTypeDef HAL_DMA_Abort(DMA_HandleTypeDef *hdma)
|
HAL_StatusTypeDef HAL_DMA_Abort(DMA_HandleTypeDef *hdma)
|
||||||
{
|
{
|
||||||
|
/* Check the DMA handle allocation */
|
||||||
|
if(NULL == hdma)
|
||||||
|
{
|
||||||
|
return HAL_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
if(hdma->State != HAL_DMA_STATE_BUSY)
|
if(hdma->State != HAL_DMA_STATE_BUSY)
|
||||||
{
|
{
|
||||||
/* no transfer ongoing */
|
/* no transfer ongoing */
|
||||||
@ -431,7 +437,6 @@ HAL_StatusTypeDef HAL_DMA_Abort_IT(DMA_HandleTypeDef *hdma)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Disable DMA IT */
|
/* Disable DMA IT */
|
||||||
hdma->Instance->CCR &= ~(DMA_IT_TC | DMA_IT_HT | DMA_IT_TE);
|
hdma->Instance->CCR &= ~(DMA_IT_TC | DMA_IT_HT | DMA_IT_TE);
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@
|
|||||||
(++) Provide exiting handle as parameter.
|
(++) Provide exiting handle as parameter.
|
||||||
(++) Provide pointer on EXTI_ConfigTypeDef structure as second parameter.
|
(++) Provide pointer on EXTI_ConfigTypeDef structure as second parameter.
|
||||||
|
|
||||||
(#) Clear Exti configuration of a dedicated line using HAL_EXTI_GetConfigLine().
|
(#) Clear Exti configuration of a dedicated line using HAL_EXTI_ClearConfigLine().
|
||||||
(++) Provide exiting handle as parameter.
|
(++) Provide exiting handle as parameter.
|
||||||
|
|
||||||
(#) Register callback to treat Exti interrupts using HAL_EXTI_RegisterCallback().
|
(#) Register callback to treat Exti interrupts using HAL_EXTI_RegisterCallback().
|
||||||
@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
(#) Get interrupt pending bit using HAL_EXTI_GetPending().
|
(#) Get interrupt pending bit using HAL_EXTI_GetPending().
|
||||||
|
|
||||||
(#) Clear interrupt pending bit using HAL_EXTI_GetPending().
|
(#) Clear interrupt pending bit using HAL_EXTI_ClearPending().
|
||||||
|
|
||||||
(#) Generate software interrupt using HAL_EXTI_GenerateSWI().
|
(#) Generate software interrupt using HAL_EXTI_GenerateSWI().
|
||||||
|
|
||||||
|
@ -684,7 +684,7 @@ static HAL_StatusTypeDef FLASH_OB_DisableWRP(uint32_t WriteProtectPage)
|
|||||||
#if defined(OB_WRP0_WRP0)
|
#if defined(OB_WRP0_WRP0)
|
||||||
if(WRP0_Data != 0xFFU)
|
if(WRP0_Data != 0xFFU)
|
||||||
{
|
{
|
||||||
OB->WRP0 |= WRP0_Data;
|
OB->WRP0 = WRP0_Data;
|
||||||
|
|
||||||
/* Wait for last operation to be completed */
|
/* Wait for last operation to be completed */
|
||||||
status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE);
|
status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE);
|
||||||
@ -694,7 +694,7 @@ static HAL_StatusTypeDef FLASH_OB_DisableWRP(uint32_t WriteProtectPage)
|
|||||||
#if defined(OB_WRP1_WRP1)
|
#if defined(OB_WRP1_WRP1)
|
||||||
if((status == HAL_OK) && (WRP1_Data != 0xFFU))
|
if((status == HAL_OK) && (WRP1_Data != 0xFFU))
|
||||||
{
|
{
|
||||||
OB->WRP1 |= WRP1_Data;
|
OB->WRP1 = WRP1_Data;
|
||||||
|
|
||||||
/* Wait for last operation to be completed */
|
/* Wait for last operation to be completed */
|
||||||
status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE);
|
status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE);
|
||||||
@ -704,7 +704,7 @@ static HAL_StatusTypeDef FLASH_OB_DisableWRP(uint32_t WriteProtectPage)
|
|||||||
#if defined(OB_WRP2_WRP2)
|
#if defined(OB_WRP2_WRP2)
|
||||||
if((status == HAL_OK) && (WRP2_Data != 0xFFU))
|
if((status == HAL_OK) && (WRP2_Data != 0xFFU))
|
||||||
{
|
{
|
||||||
OB->WRP2 |= WRP2_Data;
|
OB->WRP2 = WRP2_Data;
|
||||||
|
|
||||||
/* Wait for last operation to be completed */
|
/* Wait for last operation to be completed */
|
||||||
status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE);
|
status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE);
|
||||||
@ -714,7 +714,7 @@ static HAL_StatusTypeDef FLASH_OB_DisableWRP(uint32_t WriteProtectPage)
|
|||||||
#if defined(OB_WRP3_WRP3)
|
#if defined(OB_WRP3_WRP3)
|
||||||
if((status == HAL_OK) && (WRP3_Data != 0xFFU))
|
if((status == HAL_OK) && (WRP3_Data != 0xFFU))
|
||||||
{
|
{
|
||||||
OB->WRP3 |= WRP3_Data;
|
OB->WRP3 = WRP3_Data;
|
||||||
|
|
||||||
/* Wait for last operation to be completed */
|
/* Wait for last operation to be completed */
|
||||||
status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE);
|
status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE);
|
||||||
|
@ -458,7 +458,7 @@ void HAL_GPIO_TogglePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
|
|||||||
* until the next reset.
|
* until the next reset.
|
||||||
* @param GPIOx where x can be (A..F) to select the GPIO peripheral for STM32F3 family
|
* @param GPIOx where x can be (A..F) to select the GPIO peripheral for STM32F3 family
|
||||||
* @param GPIO_Pin specifies the port bits to be locked.
|
* @param GPIO_Pin specifies the port bits to be locked.
|
||||||
* This parameter can be any combination of GPIO_Pin_x where x can be (0..15).
|
* This parameter can be any combination of GPIO_PIN_x where x can be (0..15).
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
HAL_StatusTypeDef HAL_GPIO_LockPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
|
HAL_StatusTypeDef HAL_GPIO_LockPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
|
||||||
|
@ -84,7 +84,6 @@
|
|||||||
any restriction. HRTIM waveform modes are managed through the set of
|
any restriction. HRTIM waveform modes are managed through the set of
|
||||||
functions named HAL_HRTIM_Waveform<Function>
|
functions named HAL_HRTIM_Waveform<Function>
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
##### How to use this driver #####
|
##### How to use this driver #####
|
||||||
==============================================================================
|
==============================================================================
|
||||||
[..]
|
[..]
|
||||||
@ -8384,7 +8383,7 @@ static uint32_t HRTIM_GetITFromOCMode(const HRTIM_HandleTypeDef * hhrtim,
|
|||||||
case HRTIM_OUTPUT_TD1:
|
case HRTIM_OUTPUT_TD1:
|
||||||
case HRTIM_OUTPUT_TE1:
|
case HRTIM_OUTPUT_TE1:
|
||||||
{
|
{
|
||||||
/* Retrieves actual OC mode and set interrupt accordingly */
|
/* Retreives actual OC mode and set interrupt accordingly */
|
||||||
hrtim_set = hhrtim->Instance->sTimerxRegs[TimerIdx].SETx1R;
|
hrtim_set = hhrtim->Instance->sTimerxRegs[TimerIdx].SETx1R;
|
||||||
hrtim_reset = hhrtim->Instance->sTimerxRegs[TimerIdx].RSTx1R;
|
hrtim_reset = hhrtim->Instance->sTimerxRegs[TimerIdx].RSTx1R;
|
||||||
|
|
||||||
@ -8419,7 +8418,7 @@ static uint32_t HRTIM_GetITFromOCMode(const HRTIM_HandleTypeDef * hhrtim,
|
|||||||
case HRTIM_OUTPUT_TD2:
|
case HRTIM_OUTPUT_TD2:
|
||||||
case HRTIM_OUTPUT_TE2:
|
case HRTIM_OUTPUT_TE2:
|
||||||
{
|
{
|
||||||
/* Retrieves actual OC mode and set interrupt accordingly */
|
/* Retreives actual OC mode and set interrupt accordingly */
|
||||||
hrtim_set = hhrtim->Instance->sTimerxRegs[TimerIdx].SETx2R;
|
hrtim_set = hhrtim->Instance->sTimerxRegs[TimerIdx].SETx2R;
|
||||||
hrtim_reset = hhrtim->Instance->sTimerxRegs[TimerIdx].RSTx2R;
|
hrtim_reset = hhrtim->Instance->sTimerxRegs[TimerIdx].RSTx2R;
|
||||||
|
|
||||||
@ -8490,7 +8489,7 @@ static uint32_t HRTIM_GetDMAFromOCMode(const HRTIM_HandleTypeDef * hhrtim,
|
|||||||
case HRTIM_OUTPUT_TD1:
|
case HRTIM_OUTPUT_TD1:
|
||||||
case HRTIM_OUTPUT_TE1:
|
case HRTIM_OUTPUT_TE1:
|
||||||
{
|
{
|
||||||
/* Retrieves actual OC mode and set dma_request accordingly */
|
/* Retreives actual OC mode and set dma_request accordingly */
|
||||||
hrtim_set = hhrtim->Instance->sTimerxRegs[TimerIdx].SETx1R;
|
hrtim_set = hhrtim->Instance->sTimerxRegs[TimerIdx].SETx1R;
|
||||||
hrtim_reset = hhrtim->Instance->sTimerxRegs[TimerIdx].RSTx1R;
|
hrtim_reset = hhrtim->Instance->sTimerxRegs[TimerIdx].RSTx1R;
|
||||||
|
|
||||||
@ -8525,7 +8524,7 @@ static uint32_t HRTIM_GetDMAFromOCMode(const HRTIM_HandleTypeDef * hhrtim,
|
|||||||
case HRTIM_OUTPUT_TD2:
|
case HRTIM_OUTPUT_TD2:
|
||||||
case HRTIM_OUTPUT_TE2:
|
case HRTIM_OUTPUT_TE2:
|
||||||
{
|
{
|
||||||
/* Retrieves actual OC mode and set dma_request accordingly */
|
/* Retreives actual OC mode and set dma_request accordingly */
|
||||||
hrtim_set = hhrtim->Instance->sTimerxRegs[TimerIdx].SETx2R;
|
hrtim_set = hhrtim->Instance->sTimerxRegs[TimerIdx].SETx2R;
|
||||||
hrtim_reset = hhrtim->Instance->sTimerxRegs[TimerIdx].RSTx2R;
|
hrtim_reset = hhrtim->Instance->sTimerxRegs[TimerIdx].RSTx2R;
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@
|
|||||||
add their own code by customization of function pointer HAL_I2C_SlaveRxCpltCallback()
|
add their own code by customization of function pointer HAL_I2C_SlaveRxCpltCallback()
|
||||||
(+) In case of transfer Error, HAL_I2C_ErrorCallback() function is executed and users can
|
(+) In case of transfer Error, HAL_I2C_ErrorCallback() function is executed and users can
|
||||||
add their own code by customization of function pointer HAL_I2C_ErrorCallback()
|
add their own code by customization of function pointer HAL_I2C_ErrorCallback()
|
||||||
(+) Abort a master I2C process communication with Interrupt using HAL_I2C_Master_Abort_IT()
|
(+) Abort a master or memory I2C process communication with Interrupt using HAL_I2C_Master_Abort_IT()
|
||||||
(+) End of abort process, HAL_I2C_AbortCpltCallback() is executed and users can
|
(+) End of abort process, HAL_I2C_AbortCpltCallback() is executed and users can
|
||||||
add their own code by customization of function pointer HAL_I2C_AbortCpltCallback()
|
add their own code by customization of function pointer HAL_I2C_AbortCpltCallback()
|
||||||
(+) Discard a slave I2C process communication using __HAL_I2C_GENERATE_NACK() macro.
|
(+) Discard a slave I2C process communication using __HAL_I2C_GENERATE_NACK() macro.
|
||||||
@ -156,7 +156,7 @@
|
|||||||
HAL_I2C_Master_Seq_Receive_IT() or using HAL_I2C_Master_Seq_Receive_DMA()
|
HAL_I2C_Master_Seq_Receive_IT() or using HAL_I2C_Master_Seq_Receive_DMA()
|
||||||
(+++) At reception end of current frame transfer, HAL_I2C_MasterRxCpltCallback() is executed and users can
|
(+++) At reception end of current frame transfer, HAL_I2C_MasterRxCpltCallback() is executed and users can
|
||||||
add their own code by customization of function pointer HAL_I2C_MasterRxCpltCallback()
|
add their own code by customization of function pointer HAL_I2C_MasterRxCpltCallback()
|
||||||
(++) Abort a master IT or DMA I2C process communication with Interrupt using HAL_I2C_Master_Abort_IT()
|
(++) Abort a master or memory IT or DMA I2C process communication with Interrupt using HAL_I2C_Master_Abort_IT()
|
||||||
(+++) End of abort process, HAL_I2C_AbortCpltCallback() is executed and users can
|
(+++) End of abort process, HAL_I2C_AbortCpltCallback() is executed and users can
|
||||||
add their own code by customization of function pointer HAL_I2C_AbortCpltCallback()
|
add their own code by customization of function pointer HAL_I2C_AbortCpltCallback()
|
||||||
(++) Enable/disable the Address listen mode in slave I2C mode using HAL_I2C_EnableListen_IT()
|
(++) Enable/disable the Address listen mode in slave I2C mode using HAL_I2C_EnableListen_IT()
|
||||||
@ -214,7 +214,7 @@
|
|||||||
add their own code by customization of function pointer HAL_I2C_SlaveRxCpltCallback()
|
add their own code by customization of function pointer HAL_I2C_SlaveRxCpltCallback()
|
||||||
(+) In case of transfer Error, HAL_I2C_ErrorCallback() function is executed and users can
|
(+) In case of transfer Error, HAL_I2C_ErrorCallback() function is executed and users can
|
||||||
add their own code by customization of function pointer HAL_I2C_ErrorCallback()
|
add their own code by customization of function pointer HAL_I2C_ErrorCallback()
|
||||||
(+) Abort a master I2C process communication with Interrupt using HAL_I2C_Master_Abort_IT()
|
(+) Abort a master or memory I2C process communication with Interrupt using HAL_I2C_Master_Abort_IT()
|
||||||
(+) End of abort process, HAL_I2C_AbortCpltCallback() is executed and users can
|
(+) End of abort process, HAL_I2C_AbortCpltCallback() is executed and users can
|
||||||
add their own code by customization of function pointer HAL_I2C_AbortCpltCallback()
|
add their own code by customization of function pointer HAL_I2C_AbortCpltCallback()
|
||||||
(+) Discard a slave I2C process communication using __HAL_I2C_GENERATE_NACK() macro.
|
(+) Discard a slave I2C process communication using __HAL_I2C_GENERATE_NACK() macro.
|
||||||
@ -608,7 +608,12 @@ HAL_StatusTypeDef HAL_I2C_Init(I2C_HandleTypeDef *hi2c)
|
|||||||
/* Configure I2Cx: Addressing Master mode */
|
/* Configure I2Cx: Addressing Master mode */
|
||||||
if (hi2c->Init.AddressingMode == I2C_ADDRESSINGMODE_10BIT)
|
if (hi2c->Init.AddressingMode == I2C_ADDRESSINGMODE_10BIT)
|
||||||
{
|
{
|
||||||
hi2c->Instance->CR2 = (I2C_CR2_ADD10);
|
SET_BIT(hi2c->Instance->CR2, I2C_CR2_ADD10);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Clear the I2C ADD10 bit */
|
||||||
|
CLEAR_BIT(hi2c->Instance->CR2, I2C_CR2_ADD10);
|
||||||
}
|
}
|
||||||
/* Enable the AUTOEND by default, and enable NACK (should be disable only during Slave process */
|
/* Enable the AUTOEND by default, and enable NACK (should be disable only during Slave process */
|
||||||
hi2c->Instance->CR2 |= (I2C_CR2_AUTOEND | I2C_CR2_NACK);
|
hi2c->Instance->CR2 |= (I2C_CR2_AUTOEND | I2C_CR2_NACK);
|
||||||
@ -1115,6 +1120,7 @@ HAL_StatusTypeDef HAL_I2C_Master_Transmit(I2C_HandleTypeDef *hi2c, uint16_t DevA
|
|||||||
uint16_t Size, uint32_t Timeout)
|
uint16_t Size, uint32_t Timeout)
|
||||||
{
|
{
|
||||||
uint32_t tickstart;
|
uint32_t tickstart;
|
||||||
|
uint32_t xfermode;
|
||||||
|
|
||||||
if (hi2c->State == HAL_I2C_STATE_READY)
|
if (hi2c->State == HAL_I2C_STATE_READY)
|
||||||
{
|
{
|
||||||
@ -1138,18 +1144,39 @@ HAL_StatusTypeDef HAL_I2C_Master_Transmit(I2C_HandleTypeDef *hi2c, uint16_t DevA
|
|||||||
hi2c->XferCount = Size;
|
hi2c->XferCount = Size;
|
||||||
hi2c->XferISR = NULL;
|
hi2c->XferISR = NULL;
|
||||||
|
|
||||||
/* Send Slave Address */
|
|
||||||
/* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE and generate RESTART */
|
|
||||||
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
||||||
{
|
{
|
||||||
hi2c->XferSize = MAX_NBYTE_SIZE;
|
hi2c->XferSize = MAX_NBYTE_SIZE;
|
||||||
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_RELOAD_MODE,
|
xfermode = I2C_RELOAD_MODE;
|
||||||
I2C_GENERATE_START_WRITE);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
hi2c->XferSize = hi2c->XferCount;
|
hi2c->XferSize = hi2c->XferCount;
|
||||||
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_AUTOEND_MODE,
|
xfermode = I2C_AUTOEND_MODE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hi2c->XferSize > 0U)
|
||||||
|
{
|
||||||
|
/* Preload TX register */
|
||||||
|
/* Write data to TXDR */
|
||||||
|
hi2c->Instance->TXDR = *hi2c->pBuffPtr;
|
||||||
|
|
||||||
|
/* Increment Buffer pointer */
|
||||||
|
hi2c->pBuffPtr++;
|
||||||
|
|
||||||
|
hi2c->XferCount--;
|
||||||
|
hi2c->XferSize--;
|
||||||
|
|
||||||
|
/* Send Slave Address */
|
||||||
|
/* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE and generate RESTART */
|
||||||
|
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)(hi2c->XferSize + 1U), xfermode,
|
||||||
|
I2C_GENERATE_START_WRITE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Send Slave Address */
|
||||||
|
/* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE and generate RESTART */
|
||||||
|
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, xfermode,
|
||||||
I2C_GENERATE_START_WRITE);
|
I2C_GENERATE_START_WRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1261,7 +1288,7 @@ HAL_StatusTypeDef HAL_I2C_Master_Receive(I2C_HandleTypeDef *hi2c, uint16_t DevAd
|
|||||||
/* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE and generate RESTART */
|
/* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE and generate RESTART */
|
||||||
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
||||||
{
|
{
|
||||||
hi2c->XferSize = MAX_NBYTE_SIZE;
|
hi2c->XferSize = 1U;
|
||||||
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_RELOAD_MODE,
|
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_RELOAD_MODE,
|
||||||
I2C_GENERATE_START_READ);
|
I2C_GENERATE_START_READ);
|
||||||
}
|
}
|
||||||
@ -1352,6 +1379,8 @@ HAL_StatusTypeDef HAL_I2C_Slave_Transmit(I2C_HandleTypeDef *hi2c, uint8_t *pData
|
|||||||
uint32_t Timeout)
|
uint32_t Timeout)
|
||||||
{
|
{
|
||||||
uint32_t tickstart;
|
uint32_t tickstart;
|
||||||
|
uint16_t tmpXferCount;
|
||||||
|
HAL_StatusTypeDef error;
|
||||||
|
|
||||||
if (hi2c->State == HAL_I2C_STATE_READY)
|
if (hi2c->State == HAL_I2C_STATE_READY)
|
||||||
{
|
{
|
||||||
@ -1378,14 +1407,6 @@ HAL_StatusTypeDef HAL_I2C_Slave_Transmit(I2C_HandleTypeDef *hi2c, uint8_t *pData
|
|||||||
/* Enable Address Acknowledge */
|
/* Enable Address Acknowledge */
|
||||||
hi2c->Instance->CR2 &= ~I2C_CR2_NACK;
|
hi2c->Instance->CR2 &= ~I2C_CR2_NACK;
|
||||||
|
|
||||||
/* Wait until ADDR flag is set */
|
|
||||||
if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_ADDR, RESET, Timeout, tickstart) != HAL_OK)
|
|
||||||
{
|
|
||||||
/* Disable Address Acknowledge */
|
|
||||||
hi2c->Instance->CR2 |= I2C_CR2_NACK;
|
|
||||||
return HAL_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Preload TX data if no stretch enable */
|
/* Preload TX data if no stretch enable */
|
||||||
if (hi2c->Init.NoStretchMode == I2C_NOSTRETCH_ENABLE)
|
if (hi2c->Init.NoStretchMode == I2C_NOSTRETCH_ENABLE)
|
||||||
{
|
{
|
||||||
@ -1399,6 +1420,18 @@ HAL_StatusTypeDef HAL_I2C_Slave_Transmit(I2C_HandleTypeDef *hi2c, uint8_t *pData
|
|||||||
hi2c->XferCount--;
|
hi2c->XferCount--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Wait until ADDR flag is set */
|
||||||
|
if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_ADDR, RESET, Timeout, tickstart) != HAL_OK)
|
||||||
|
{
|
||||||
|
/* Disable Address Acknowledge */
|
||||||
|
hi2c->Instance->CR2 |= I2C_CR2_NACK;
|
||||||
|
|
||||||
|
/* Flush TX register */
|
||||||
|
I2C_Flush_TXDR(hi2c);
|
||||||
|
|
||||||
|
return HAL_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
/* Clear ADDR flag */
|
/* Clear ADDR flag */
|
||||||
__HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_ADDR);
|
__HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_ADDR);
|
||||||
|
|
||||||
@ -1410,6 +1443,10 @@ HAL_StatusTypeDef HAL_I2C_Slave_Transmit(I2C_HandleTypeDef *hi2c, uint8_t *pData
|
|||||||
{
|
{
|
||||||
/* Disable Address Acknowledge */
|
/* Disable Address Acknowledge */
|
||||||
hi2c->Instance->CR2 |= I2C_CR2_NACK;
|
hi2c->Instance->CR2 |= I2C_CR2_NACK;
|
||||||
|
|
||||||
|
/* Flush TX register */
|
||||||
|
I2C_Flush_TXDR(hi2c);
|
||||||
|
|
||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1422,6 +1459,10 @@ HAL_StatusTypeDef HAL_I2C_Slave_Transmit(I2C_HandleTypeDef *hi2c, uint8_t *pData
|
|||||||
{
|
{
|
||||||
/* Disable Address Acknowledge */
|
/* Disable Address Acknowledge */
|
||||||
hi2c->Instance->CR2 |= I2C_CR2_NACK;
|
hi2c->Instance->CR2 |= I2C_CR2_NACK;
|
||||||
|
|
||||||
|
/* Flush TX register */
|
||||||
|
I2C_Flush_TXDR(hi2c);
|
||||||
|
|
||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1445,13 +1486,29 @@ HAL_StatusTypeDef HAL_I2C_Slave_Transmit(I2C_HandleTypeDef *hi2c, uint8_t *pData
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Wait until AF flag is set */
|
/* Wait until AF flag is set */
|
||||||
if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_AF, RESET, Timeout, tickstart) != HAL_OK)
|
error = I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_AF, RESET, Timeout, tickstart);
|
||||||
|
|
||||||
|
if (error != HAL_OK)
|
||||||
|
{
|
||||||
|
/* Check that I2C transfer finished */
|
||||||
|
/* if yes, normal use case, a NACK is sent by the MASTER when Transfer is finished */
|
||||||
|
/* Mean XferCount == 0 */
|
||||||
|
|
||||||
|
tmpXferCount = hi2c->XferCount;
|
||||||
|
if ((hi2c->ErrorCode == HAL_I2C_ERROR_AF) && (tmpXferCount == 0U))
|
||||||
|
{
|
||||||
|
/* Reset ErrorCode to NONE */
|
||||||
|
hi2c->ErrorCode = HAL_I2C_ERROR_NONE;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
/* Disable Address Acknowledge */
|
/* Disable Address Acknowledge */
|
||||||
hi2c->Instance->CR2 |= I2C_CR2_NACK;
|
hi2c->Instance->CR2 |= I2C_CR2_NACK;
|
||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
/* Flush TX register */
|
/* Flush TX register */
|
||||||
I2C_Flush_TXDR(hi2c);
|
I2C_Flush_TXDR(hi2c);
|
||||||
|
|
||||||
@ -1469,6 +1526,7 @@ HAL_StatusTypeDef HAL_I2C_Slave_Transmit(I2C_HandleTypeDef *hi2c, uint8_t *pData
|
|||||||
|
|
||||||
/* Clear STOP flag */
|
/* Clear STOP flag */
|
||||||
__HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF);
|
__HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF);
|
||||||
|
}
|
||||||
|
|
||||||
/* Wait until BUSY flag is reset */
|
/* Wait until BUSY flag is reset */
|
||||||
if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_BUSY, SET, Timeout, tickstart) != HAL_OK)
|
if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_BUSY, SET, Timeout, tickstart) != HAL_OK)
|
||||||
@ -1672,7 +1730,26 @@ HAL_StatusTypeDef HAL_I2C_Master_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16_t D
|
|||||||
|
|
||||||
/* Send Slave Address */
|
/* Send Slave Address */
|
||||||
/* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE */
|
/* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE */
|
||||||
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, xfermode, I2C_GENERATE_START_WRITE);
|
if (hi2c->XferSize > 0U)
|
||||||
|
{
|
||||||
|
/* Preload TX register */
|
||||||
|
/* Write data to TXDR */
|
||||||
|
hi2c->Instance->TXDR = *hi2c->pBuffPtr;
|
||||||
|
|
||||||
|
/* Increment Buffer pointer */
|
||||||
|
hi2c->pBuffPtr++;
|
||||||
|
|
||||||
|
hi2c->XferCount--;
|
||||||
|
hi2c->XferSize--;
|
||||||
|
|
||||||
|
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)(hi2c->XferSize + 1U), xfermode,
|
||||||
|
I2C_GENERATE_START_WRITE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, xfermode,
|
||||||
|
I2C_GENERATE_START_WRITE);
|
||||||
|
}
|
||||||
|
|
||||||
/* Process Unlocked */
|
/* Process Unlocked */
|
||||||
__HAL_UNLOCK(hi2c);
|
__HAL_UNLOCK(hi2c);
|
||||||
@ -1732,7 +1809,7 @@ HAL_StatusTypeDef HAL_I2C_Master_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_t De
|
|||||||
|
|
||||||
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
||||||
{
|
{
|
||||||
hi2c->XferSize = MAX_NBYTE_SIZE;
|
hi2c->XferSize = 1U;
|
||||||
xfermode = I2C_RELOAD_MODE;
|
xfermode = I2C_RELOAD_MODE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1895,6 +1972,7 @@ HAL_StatusTypeDef HAL_I2C_Master_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint16_t
|
|||||||
{
|
{
|
||||||
uint32_t xfermode;
|
uint32_t xfermode;
|
||||||
HAL_StatusTypeDef dmaxferstatus;
|
HAL_StatusTypeDef dmaxferstatus;
|
||||||
|
uint32_t sizetoxfer = 0U;
|
||||||
|
|
||||||
if (hi2c->State == HAL_I2C_STATE_READY)
|
if (hi2c->State == HAL_I2C_STATE_READY)
|
||||||
{
|
{
|
||||||
@ -1927,6 +2005,20 @@ HAL_StatusTypeDef HAL_I2C_Master_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint16_t
|
|||||||
xfermode = I2C_AUTOEND_MODE;
|
xfermode = I2C_AUTOEND_MODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hi2c->XferSize > 0U)
|
||||||
|
{
|
||||||
|
/* Preload TX register */
|
||||||
|
/* Write data to TXDR */
|
||||||
|
hi2c->Instance->TXDR = *hi2c->pBuffPtr;
|
||||||
|
|
||||||
|
/* Increment Buffer pointer */
|
||||||
|
hi2c->pBuffPtr++;
|
||||||
|
|
||||||
|
sizetoxfer = hi2c->XferSize;
|
||||||
|
hi2c->XferCount--;
|
||||||
|
hi2c->XferSize--;
|
||||||
|
}
|
||||||
|
|
||||||
if (hi2c->XferSize > 0U)
|
if (hi2c->XferSize > 0U)
|
||||||
{
|
{
|
||||||
if (hi2c->hdmatx != NULL)
|
if (hi2c->hdmatx != NULL)
|
||||||
@ -1942,8 +2034,8 @@ HAL_StatusTypeDef HAL_I2C_Master_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint16_t
|
|||||||
hi2c->hdmatx->XferAbortCallback = NULL;
|
hi2c->hdmatx->XferAbortCallback = NULL;
|
||||||
|
|
||||||
/* Enable the DMA channel */
|
/* Enable the DMA channel */
|
||||||
dmaxferstatus = HAL_DMA_Start_IT(hi2c->hdmatx, (uint32_t)pData, (uint32_t)&hi2c->Instance->TXDR,
|
dmaxferstatus = HAL_DMA_Start_IT(hi2c->hdmatx, (uint32_t)hi2c->pBuffPtr,
|
||||||
hi2c->XferSize);
|
(uint32_t)&hi2c->Instance->TXDR, hi2c->XferSize);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1964,7 +2056,8 @@ HAL_StatusTypeDef HAL_I2C_Master_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint16_t
|
|||||||
{
|
{
|
||||||
/* Send Slave Address */
|
/* Send Slave Address */
|
||||||
/* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE and generate RESTART */
|
/* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE and generate RESTART */
|
||||||
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, xfermode, I2C_GENERATE_START_WRITE);
|
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)(hi2c->XferSize + 1U),
|
||||||
|
xfermode, I2C_GENERATE_START_WRITE);
|
||||||
|
|
||||||
/* Update XferCount value */
|
/* Update XferCount value */
|
||||||
hi2c->XferCount -= hi2c->XferSize;
|
hi2c->XferCount -= hi2c->XferSize;
|
||||||
@ -2003,7 +2096,7 @@ HAL_StatusTypeDef HAL_I2C_Master_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint16_t
|
|||||||
|
|
||||||
/* Send Slave Address */
|
/* Send Slave Address */
|
||||||
/* Set NBYTES to write and generate START condition */
|
/* Set NBYTES to write and generate START condition */
|
||||||
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_AUTOEND_MODE,
|
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)sizetoxfer, I2C_AUTOEND_MODE,
|
||||||
I2C_GENERATE_START_WRITE);
|
I2C_GENERATE_START_WRITE);
|
||||||
|
|
||||||
/* Process Unlocked */
|
/* Process Unlocked */
|
||||||
@ -2065,7 +2158,7 @@ HAL_StatusTypeDef HAL_I2C_Master_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16_t D
|
|||||||
|
|
||||||
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
||||||
{
|
{
|
||||||
hi2c->XferSize = MAX_NBYTE_SIZE;
|
hi2c->XferSize = 1U;
|
||||||
xfermode = I2C_RELOAD_MODE;
|
xfermode = I2C_RELOAD_MODE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2159,11 +2252,11 @@ HAL_StatusTypeDef HAL_I2C_Master_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16_t D
|
|||||||
/* Note : The I2C interrupts must be enabled after unlocking current process
|
/* Note : The I2C interrupts must be enabled after unlocking current process
|
||||||
to avoid the risk of I2C interrupt handle execution before current
|
to avoid the risk of I2C interrupt handle execution before current
|
||||||
process unlock */
|
process unlock */
|
||||||
/* Enable ERR, TC, STOP, NACK, TXI interrupt */
|
/* Enable ERR, TC, STOP, NACK, RXI interrupt */
|
||||||
/* possible to enable all of these */
|
/* possible to enable all of these */
|
||||||
/* I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI |
|
/* I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI |
|
||||||
I2C_IT_ADDRI | I2C_IT_RXI | I2C_IT_TXI */
|
I2C_IT_ADDRI | I2C_IT_RXI | I2C_IT_TXI */
|
||||||
I2C_Enable_IRQ(hi2c, I2C_XFER_TX_IT);
|
I2C_Enable_IRQ(hi2c, I2C_XFER_RX_IT);
|
||||||
}
|
}
|
||||||
|
|
||||||
return HAL_OK;
|
return HAL_OK;
|
||||||
@ -2612,7 +2705,7 @@ HAL_StatusTypeDef HAL_I2C_Mem_Read(I2C_HandleTypeDef *hi2c, uint16_t DevAddress,
|
|||||||
/* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE and generate RESTART */
|
/* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE and generate RESTART */
|
||||||
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
||||||
{
|
{
|
||||||
hi2c->XferSize = MAX_NBYTE_SIZE;
|
hi2c->XferSize = 1U;
|
||||||
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_RELOAD_MODE,
|
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_RELOAD_MODE,
|
||||||
I2C_GENERATE_START_READ);
|
I2C_GENERATE_START_READ);
|
||||||
}
|
}
|
||||||
@ -2650,7 +2743,7 @@ HAL_StatusTypeDef HAL_I2C_Mem_Read(I2C_HandleTypeDef *hi2c, uint16_t DevAddress,
|
|||||||
|
|
||||||
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
||||||
{
|
{
|
||||||
hi2c->XferSize = MAX_NBYTE_SIZE;
|
hi2c->XferSize = 1U;
|
||||||
I2C_TransferConfig(hi2c, DevAddress, (uint8_t) hi2c->XferSize, I2C_RELOAD_MODE,
|
I2C_TransferConfig(hi2c, DevAddress, (uint8_t) hi2c->XferSize, I2C_RELOAD_MODE,
|
||||||
I2C_NO_STARTSTOP);
|
I2C_NO_STARTSTOP);
|
||||||
}
|
}
|
||||||
@ -2728,6 +2821,7 @@ HAL_StatusTypeDef HAL_I2C_Mem_Write_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddr
|
|||||||
hi2c->ErrorCode = HAL_I2C_ERROR_NONE;
|
hi2c->ErrorCode = HAL_I2C_ERROR_NONE;
|
||||||
|
|
||||||
/* Prepare transfer parameters */
|
/* Prepare transfer parameters */
|
||||||
|
hi2c->XferSize = 0U;
|
||||||
hi2c->pBuffPtr = pData;
|
hi2c->pBuffPtr = pData;
|
||||||
hi2c->XferCount = Size;
|
hi2c->XferCount = Size;
|
||||||
hi2c->XferOptions = I2C_NO_OPTION_FRAME;
|
hi2c->XferOptions = I2C_NO_OPTION_FRAME;
|
||||||
@ -2849,11 +2943,11 @@ HAL_StatusTypeDef HAL_I2C_Mem_Read_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddre
|
|||||||
to avoid the risk of I2C interrupt handle execution before current
|
to avoid the risk of I2C interrupt handle execution before current
|
||||||
process unlock */
|
process unlock */
|
||||||
|
|
||||||
/* Enable ERR, TC, STOP, NACK, RXI interrupt */
|
/* Enable ERR, TC, STOP, NACK, TXI interrupt */
|
||||||
/* possible to enable all of these */
|
/* possible to enable all of these */
|
||||||
/* I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI |
|
/* I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI |
|
||||||
I2C_IT_ADDRI | I2C_IT_RXI | I2C_IT_TXI */
|
I2C_IT_ADDRI | I2C_IT_RXI | I2C_IT_TXI */
|
||||||
I2C_Enable_IRQ(hi2c, (I2C_XFER_TX_IT | I2C_XFER_RX_IT));
|
I2C_Enable_IRQ(hi2c, I2C_XFER_TX_IT);
|
||||||
|
|
||||||
return HAL_OK;
|
return HAL_OK;
|
||||||
}
|
}
|
||||||
@ -3259,22 +3353,6 @@ HAL_StatusTypeDef HAL_I2C_IsDeviceReady(I2C_HandleTypeDef *hi2c, uint16_t DevAdd
|
|||||||
__HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF);
|
__HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if the maximum allowed number of trials has been reached */
|
|
||||||
if (I2C_Trials == Trials)
|
|
||||||
{
|
|
||||||
/* Generate Stop */
|
|
||||||
hi2c->Instance->CR2 |= I2C_CR2_STOP;
|
|
||||||
|
|
||||||
/* Wait until STOPF flag is reset */
|
|
||||||
if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_STOPF, RESET, Timeout, tickstart) != HAL_OK)
|
|
||||||
{
|
|
||||||
return HAL_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Clear STOP Flag */
|
|
||||||
__HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Increment Trials */
|
/* Increment Trials */
|
||||||
I2C_Trials++;
|
I2C_Trials++;
|
||||||
} while (I2C_Trials < Trials);
|
} while (I2C_Trials < Trials);
|
||||||
@ -3313,6 +3391,7 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16
|
|||||||
{
|
{
|
||||||
uint32_t xfermode;
|
uint32_t xfermode;
|
||||||
uint32_t xferrequest = I2C_GENERATE_START_WRITE;
|
uint32_t xferrequest = I2C_GENERATE_START_WRITE;
|
||||||
|
uint32_t sizetoxfer = 0U;
|
||||||
|
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
assert_param(IS_I2C_TRANSFER_OPTIONS_REQUEST(XferOptions));
|
assert_param(IS_I2C_TRANSFER_OPTIONS_REQUEST(XferOptions));
|
||||||
@ -3344,6 +3423,21 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16
|
|||||||
xfermode = hi2c->XferOptions;
|
xfermode = hi2c->XferOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((hi2c->XferSize > 0U) && ((XferOptions == I2C_FIRST_FRAME) || \
|
||||||
|
(XferOptions == I2C_FIRST_AND_LAST_FRAME)))
|
||||||
|
{
|
||||||
|
/* Preload TX register */
|
||||||
|
/* Write data to TXDR */
|
||||||
|
hi2c->Instance->TXDR = *hi2c->pBuffPtr;
|
||||||
|
|
||||||
|
/* Increment Buffer pointer */
|
||||||
|
hi2c->pBuffPtr++;
|
||||||
|
|
||||||
|
sizetoxfer = hi2c->XferSize;
|
||||||
|
hi2c->XferCount--;
|
||||||
|
hi2c->XferSize--;
|
||||||
|
}
|
||||||
|
|
||||||
/* If transfer direction not change and there is no request to start another frame,
|
/* If transfer direction not change and there is no request to start another frame,
|
||||||
do not generate Restart Condition */
|
do not generate Restart Condition */
|
||||||
/* Mean Previous state is same as current state */
|
/* Mean Previous state is same as current state */
|
||||||
@ -3365,7 +3459,14 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Send Slave Address and set NBYTES to write */
|
/* Send Slave Address and set NBYTES to write */
|
||||||
|
if ((XferOptions == I2C_FIRST_FRAME) || (XferOptions == I2C_FIRST_AND_LAST_FRAME))
|
||||||
|
{
|
||||||
|
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)sizetoxfer, xfermode, xferrequest);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, xfermode, xferrequest);
|
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, xfermode, xferrequest);
|
||||||
|
}
|
||||||
|
|
||||||
/* Process Unlocked */
|
/* Process Unlocked */
|
||||||
__HAL_UNLOCK(hi2c);
|
__HAL_UNLOCK(hi2c);
|
||||||
@ -3405,6 +3506,7 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint1
|
|||||||
uint32_t xfermode;
|
uint32_t xfermode;
|
||||||
uint32_t xferrequest = I2C_GENERATE_START_WRITE;
|
uint32_t xferrequest = I2C_GENERATE_START_WRITE;
|
||||||
HAL_StatusTypeDef dmaxferstatus;
|
HAL_StatusTypeDef dmaxferstatus;
|
||||||
|
uint32_t sizetoxfer = 0U;
|
||||||
|
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
assert_param(IS_I2C_TRANSFER_OPTIONS_REQUEST(XferOptions));
|
assert_param(IS_I2C_TRANSFER_OPTIONS_REQUEST(XferOptions));
|
||||||
@ -3436,6 +3538,21 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint1
|
|||||||
xfermode = hi2c->XferOptions;
|
xfermode = hi2c->XferOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((hi2c->XferSize > 0U) && ((XferOptions == I2C_FIRST_FRAME) || \
|
||||||
|
(XferOptions == I2C_FIRST_AND_LAST_FRAME)))
|
||||||
|
{
|
||||||
|
/* Preload TX register */
|
||||||
|
/* Write data to TXDR */
|
||||||
|
hi2c->Instance->TXDR = *hi2c->pBuffPtr;
|
||||||
|
|
||||||
|
/* Increment Buffer pointer */
|
||||||
|
hi2c->pBuffPtr++;
|
||||||
|
|
||||||
|
sizetoxfer = hi2c->XferSize;
|
||||||
|
hi2c->XferCount--;
|
||||||
|
hi2c->XferSize--;
|
||||||
|
}
|
||||||
|
|
||||||
/* If transfer direction not change and there is no request to start another frame,
|
/* If transfer direction not change and there is no request to start another frame,
|
||||||
do not generate Restart Condition */
|
do not generate Restart Condition */
|
||||||
/* Mean Previous state is same as current state */
|
/* Mean Previous state is same as current state */
|
||||||
@ -3471,8 +3588,8 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint1
|
|||||||
hi2c->hdmatx->XferAbortCallback = NULL;
|
hi2c->hdmatx->XferAbortCallback = NULL;
|
||||||
|
|
||||||
/* Enable the DMA channel */
|
/* Enable the DMA channel */
|
||||||
dmaxferstatus = HAL_DMA_Start_IT(hi2c->hdmatx, (uint32_t)pData, (uint32_t)&hi2c->Instance->TXDR,
|
dmaxferstatus = HAL_DMA_Start_IT(hi2c->hdmatx, (uint32_t)hi2c->pBuffPtr,
|
||||||
hi2c->XferSize);
|
(uint32_t)&hi2c->Instance->TXDR, hi2c->XferSize);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -3492,7 +3609,14 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint1
|
|||||||
if (dmaxferstatus == HAL_OK)
|
if (dmaxferstatus == HAL_OK)
|
||||||
{
|
{
|
||||||
/* Send Slave Address and set NBYTES to write */
|
/* Send Slave Address and set NBYTES to write */
|
||||||
|
if ((XferOptions == I2C_FIRST_FRAME) || (XferOptions == I2C_FIRST_AND_LAST_FRAME))
|
||||||
|
{
|
||||||
|
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)sizetoxfer, xfermode, xferrequest);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, xfermode, xferrequest);
|
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, xfermode, xferrequest);
|
||||||
|
}
|
||||||
|
|
||||||
/* Update XferCount value */
|
/* Update XferCount value */
|
||||||
hi2c->XferCount -= hi2c->XferSize;
|
hi2c->XferCount -= hi2c->XferSize;
|
||||||
@ -3531,8 +3655,14 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint1
|
|||||||
|
|
||||||
/* Send Slave Address */
|
/* Send Slave Address */
|
||||||
/* Set NBYTES to write and generate START condition */
|
/* Set NBYTES to write and generate START condition */
|
||||||
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_AUTOEND_MODE,
|
if ((XferOptions == I2C_FIRST_FRAME) || (XferOptions == I2C_FIRST_AND_LAST_FRAME))
|
||||||
I2C_GENERATE_START_WRITE);
|
{
|
||||||
|
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)sizetoxfer, xfermode, xferrequest);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, xfermode, xferrequest);
|
||||||
|
}
|
||||||
|
|
||||||
/* Process Unlocked */
|
/* Process Unlocked */
|
||||||
__HAL_UNLOCK(hi2c);
|
__HAL_UNLOCK(hi2c);
|
||||||
@ -3795,11 +3925,11 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16
|
|||||||
/* Note : The I2C interrupts must be enabled after unlocking current process
|
/* Note : The I2C interrupts must be enabled after unlocking current process
|
||||||
to avoid the risk of I2C interrupt handle execution before current
|
to avoid the risk of I2C interrupt handle execution before current
|
||||||
process unlock */
|
process unlock */
|
||||||
/* Enable ERR, TC, STOP, NACK, TXI interrupt */
|
/* Enable ERR, TC, STOP, NACK, RXI interrupt */
|
||||||
/* possible to enable all of these */
|
/* possible to enable all of these */
|
||||||
/* I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI |
|
/* I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI |
|
||||||
I2C_IT_ADDRI | I2C_IT_RXI | I2C_IT_TXI */
|
I2C_IT_ADDRI | I2C_IT_RXI | I2C_IT_TXI */
|
||||||
I2C_Enable_IRQ(hi2c, I2C_XFER_TX_IT);
|
I2C_Enable_IRQ(hi2c, I2C_XFER_RX_IT);
|
||||||
}
|
}
|
||||||
|
|
||||||
return HAL_OK;
|
return HAL_OK;
|
||||||
@ -4434,7 +4564,7 @@ HAL_StatusTypeDef HAL_I2C_DisableListen_IT(I2C_HandleTypeDef *hi2c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Abort a master I2C IT or DMA process communication with Interrupt.
|
* @brief Abort a master or memory I2C IT or DMA process communication with Interrupt.
|
||||||
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
||||||
* the configuration information for the specified I2C.
|
* the configuration information for the specified I2C.
|
||||||
* @param DevAddress Target device address: The device 7 bits address value
|
* @param DevAddress Target device address: The device 7 bits address value
|
||||||
@ -4443,7 +4573,9 @@ HAL_StatusTypeDef HAL_I2C_DisableListen_IT(I2C_HandleTypeDef *hi2c)
|
|||||||
*/
|
*/
|
||||||
HAL_StatusTypeDef HAL_I2C_Master_Abort_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress)
|
HAL_StatusTypeDef HAL_I2C_Master_Abort_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress)
|
||||||
{
|
{
|
||||||
if (hi2c->Mode == HAL_I2C_MODE_MASTER)
|
HAL_I2C_ModeTypeDef tmp_mode = hi2c->Mode;
|
||||||
|
|
||||||
|
if ((tmp_mode == HAL_I2C_MODE_MASTER) || (tmp_mode == HAL_I2C_MODE_MEM))
|
||||||
{
|
{
|
||||||
/* Process Locked */
|
/* Process Locked */
|
||||||
__HAL_LOCK(hi2c);
|
__HAL_LOCK(hi2c);
|
||||||
@ -4842,8 +4974,12 @@ static HAL_StatusTypeDef I2C_Master_ISR_IT(struct __I2C_HandleTypeDef *hi2c, uin
|
|||||||
hi2c->XferSize--;
|
hi2c->XferSize--;
|
||||||
hi2c->XferCount--;
|
hi2c->XferCount--;
|
||||||
}
|
}
|
||||||
else if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_TXIS) != RESET) && \
|
else if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_TC) == RESET) && \
|
||||||
(I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_TXI) != RESET))
|
((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_TXIS) != RESET) && \
|
||||||
|
(I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_TXI) != RESET)))
|
||||||
|
{
|
||||||
|
/* Write data to TXDR */
|
||||||
|
if (hi2c->XferCount != 0U)
|
||||||
{
|
{
|
||||||
/* Write data to TXDR */
|
/* Write data to TXDR */
|
||||||
hi2c->Instance->TXDR = *hi2c->pBuffPtr;
|
hi2c->Instance->TXDR = *hi2c->pBuffPtr;
|
||||||
@ -4854,6 +4990,7 @@ static HAL_StatusTypeDef I2C_Master_ISR_IT(struct __I2C_HandleTypeDef *hi2c, uin
|
|||||||
hi2c->XferSize--;
|
hi2c->XferSize--;
|
||||||
hi2c->XferCount--;
|
hi2c->XferCount--;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_TCR) != RESET) && \
|
else if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_TCR) != RESET) && \
|
||||||
(I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_TCI) != RESET))
|
(I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_TCI) != RESET))
|
||||||
{
|
{
|
||||||
@ -4862,8 +4999,16 @@ static HAL_StatusTypeDef I2C_Master_ISR_IT(struct __I2C_HandleTypeDef *hi2c, uin
|
|||||||
devaddress = (uint16_t)(hi2c->Instance->CR2 & I2C_CR2_SADD);
|
devaddress = (uint16_t)(hi2c->Instance->CR2 & I2C_CR2_SADD);
|
||||||
|
|
||||||
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
||||||
|
{
|
||||||
|
/* Errata workaround 170323 */
|
||||||
|
if (I2C_GET_DIR(hi2c) == I2C_DIRECTION_RECEIVE)
|
||||||
|
{
|
||||||
|
hi2c->XferSize = 1U;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
hi2c->XferSize = MAX_NBYTE_SIZE;
|
hi2c->XferSize = MAX_NBYTE_SIZE;
|
||||||
|
}
|
||||||
I2C_TransferConfig(hi2c, devaddress, (uint8_t)hi2c->XferSize, I2C_RELOAD_MODE, I2C_NO_STARTSTOP);
|
I2C_TransferConfig(hi2c, devaddress, (uint8_t)hi2c->XferSize, I2C_RELOAD_MODE, I2C_NO_STARTSTOP);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -5017,8 +5162,16 @@ static HAL_StatusTypeDef I2C_Mem_ISR_IT(struct __I2C_HandleTypeDef *hi2c, uint32
|
|||||||
if ((hi2c->XferCount != 0U) && (hi2c->XferSize == 0U))
|
if ((hi2c->XferCount != 0U) && (hi2c->XferSize == 0U))
|
||||||
{
|
{
|
||||||
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
||||||
|
{
|
||||||
|
/* Errata workaround 170323 */
|
||||||
|
if (I2C_GET_DIR(hi2c) == I2C_DIRECTION_RECEIVE)
|
||||||
|
{
|
||||||
|
hi2c->XferSize = 1U;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
hi2c->XferSize = MAX_NBYTE_SIZE;
|
hi2c->XferSize = MAX_NBYTE_SIZE;
|
||||||
|
}
|
||||||
I2C_TransferConfig(hi2c, (uint16_t)hi2c->Devaddress, (uint8_t)hi2c->XferSize,
|
I2C_TransferConfig(hi2c, (uint16_t)hi2c->Devaddress, (uint8_t)hi2c->XferSize,
|
||||||
I2C_RELOAD_MODE, I2C_NO_STARTSTOP);
|
I2C_RELOAD_MODE, I2C_NO_STARTSTOP);
|
||||||
}
|
}
|
||||||
@ -5039,14 +5192,28 @@ static HAL_StatusTypeDef I2C_Mem_ISR_IT(struct __I2C_HandleTypeDef *hi2c, uint32
|
|||||||
else if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_TC) != RESET) && \
|
else if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_TC) != RESET) && \
|
||||||
(I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_TCI) != RESET))
|
(I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_TCI) != RESET))
|
||||||
{
|
{
|
||||||
|
/* Disable Interrupt related to address step */
|
||||||
|
I2C_Disable_IRQ(hi2c, I2C_XFER_TX_IT);
|
||||||
|
|
||||||
|
/* Enable ERR, TC, STOP, NACK and RXI interrupts */
|
||||||
|
I2C_Enable_IRQ(hi2c, I2C_XFER_RX_IT);
|
||||||
|
|
||||||
if (hi2c->State == HAL_I2C_STATE_BUSY_RX)
|
if (hi2c->State == HAL_I2C_STATE_BUSY_RX)
|
||||||
{
|
{
|
||||||
direction = I2C_GENERATE_START_READ;
|
direction = I2C_GENERATE_START_READ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
||||||
|
{
|
||||||
|
/* Errata workaround 170323 */
|
||||||
|
if (I2C_GET_DIR(hi2c) == I2C_DIRECTION_RECEIVE)
|
||||||
|
{
|
||||||
|
hi2c->XferSize = 1U;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
hi2c->XferSize = MAX_NBYTE_SIZE;
|
hi2c->XferSize = MAX_NBYTE_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE and generate RESTART */
|
/* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE and generate RESTART */
|
||||||
I2C_TransferConfig(hi2c, (uint16_t)hi2c->Devaddress, (uint8_t)hi2c->XferSize,
|
I2C_TransferConfig(hi2c, (uint16_t)hi2c->Devaddress, (uint8_t)hi2c->XferSize,
|
||||||
@ -5103,8 +5270,7 @@ static HAL_StatusTypeDef I2C_Slave_ISR_IT(struct __I2C_HandleTypeDef *hi2c, uint
|
|||||||
/* Call I2C Slave complete process */
|
/* Call I2C Slave complete process */
|
||||||
I2C_ITSlaveCplt(hi2c, tmpITFlags);
|
I2C_ITSlaveCplt(hi2c, tmpITFlags);
|
||||||
}
|
}
|
||||||
|
else if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_AF) != RESET) && \
|
||||||
if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_AF) != RESET) && \
|
|
||||||
(I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_NACKI) != RESET))
|
(I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_NACKI) != RESET))
|
||||||
{
|
{
|
||||||
/* Check that I2C transfer finished */
|
/* Check that I2C transfer finished */
|
||||||
@ -5267,8 +5433,16 @@ static HAL_StatusTypeDef I2C_Master_ISR_DMA(struct __I2C_HandleTypeDef *hi2c, ui
|
|||||||
|
|
||||||
/* Prepare the new XferSize to transfer */
|
/* Prepare the new XferSize to transfer */
|
||||||
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
||||||
|
{
|
||||||
|
/* Errata workaround 170323 */
|
||||||
|
if (I2C_GET_DIR(hi2c) == I2C_DIRECTION_RECEIVE)
|
||||||
|
{
|
||||||
|
hi2c->XferSize = 1U;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
hi2c->XferSize = MAX_NBYTE_SIZE;
|
hi2c->XferSize = MAX_NBYTE_SIZE;
|
||||||
|
}
|
||||||
xfermode = I2C_RELOAD_MODE;
|
xfermode = I2C_RELOAD_MODE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -5405,6 +5579,9 @@ static HAL_StatusTypeDef I2C_Mem_ISR_DMA(struct __I2C_HandleTypeDef *hi2c, uint3
|
|||||||
else if ((I2C_CHECK_FLAG(ITFlags, I2C_FLAG_TCR) != RESET) && \
|
else if ((I2C_CHECK_FLAG(ITFlags, I2C_FLAG_TCR) != RESET) && \
|
||||||
(I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_TCI) != RESET))
|
(I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_TCI) != RESET))
|
||||||
{
|
{
|
||||||
|
/* Disable Interrupt related to address step */
|
||||||
|
I2C_Disable_IRQ(hi2c, I2C_XFER_TX_IT);
|
||||||
|
|
||||||
/* Enable only Error interrupt */
|
/* Enable only Error interrupt */
|
||||||
I2C_Enable_IRQ(hi2c, I2C_XFER_ERROR_IT);
|
I2C_Enable_IRQ(hi2c, I2C_XFER_ERROR_IT);
|
||||||
|
|
||||||
@ -5412,8 +5589,16 @@ static HAL_StatusTypeDef I2C_Mem_ISR_DMA(struct __I2C_HandleTypeDef *hi2c, uint3
|
|||||||
{
|
{
|
||||||
/* Prepare the new XferSize to transfer */
|
/* Prepare the new XferSize to transfer */
|
||||||
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
||||||
|
{
|
||||||
|
/* Errata workaround 170323 */
|
||||||
|
if (I2C_GET_DIR(hi2c) == I2C_DIRECTION_RECEIVE)
|
||||||
|
{
|
||||||
|
hi2c->XferSize = 1U;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
hi2c->XferSize = MAX_NBYTE_SIZE;
|
hi2c->XferSize = MAX_NBYTE_SIZE;
|
||||||
|
}
|
||||||
I2C_TransferConfig(hi2c, (uint16_t)hi2c->Devaddress, (uint8_t)hi2c->XferSize,
|
I2C_TransferConfig(hi2c, (uint16_t)hi2c->Devaddress, (uint8_t)hi2c->XferSize,
|
||||||
I2C_RELOAD_MODE, I2C_NO_STARTSTOP);
|
I2C_RELOAD_MODE, I2C_NO_STARTSTOP);
|
||||||
}
|
}
|
||||||
@ -5447,14 +5632,28 @@ static HAL_StatusTypeDef I2C_Mem_ISR_DMA(struct __I2C_HandleTypeDef *hi2c, uint3
|
|||||||
else if ((I2C_CHECK_FLAG(ITFlags, I2C_FLAG_TC) != RESET) && \
|
else if ((I2C_CHECK_FLAG(ITFlags, I2C_FLAG_TC) != RESET) && \
|
||||||
(I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_TCI) != RESET))
|
(I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_TCI) != RESET))
|
||||||
{
|
{
|
||||||
|
/* Disable Interrupt related to address step */
|
||||||
|
I2C_Disable_IRQ(hi2c, I2C_XFER_TX_IT);
|
||||||
|
|
||||||
|
/* Enable only Error and NACK interrupt for data transfer */
|
||||||
|
I2C_Enable_IRQ(hi2c, I2C_XFER_ERROR_IT);
|
||||||
|
|
||||||
if (hi2c->State == HAL_I2C_STATE_BUSY_RX)
|
if (hi2c->State == HAL_I2C_STATE_BUSY_RX)
|
||||||
{
|
{
|
||||||
direction = I2C_GENERATE_START_READ;
|
direction = I2C_GENERATE_START_READ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
||||||
|
{
|
||||||
|
/* Errata workaround 170323 */
|
||||||
|
if (I2C_GET_DIR(hi2c) == I2C_DIRECTION_RECEIVE)
|
||||||
|
{
|
||||||
|
hi2c->XferSize = 1U;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
hi2c->XferSize = MAX_NBYTE_SIZE;
|
hi2c->XferSize = MAX_NBYTE_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE and generate RESTART */
|
/* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE and generate RESTART */
|
||||||
I2C_TransferConfig(hi2c, (uint16_t)hi2c->Devaddress, (uint8_t)hi2c->XferSize,
|
I2C_TransferConfig(hi2c, (uint16_t)hi2c->Devaddress, (uint8_t)hi2c->XferSize,
|
||||||
@ -5524,8 +5723,7 @@ static HAL_StatusTypeDef I2C_Slave_ISR_DMA(struct __I2C_HandleTypeDef *hi2c, uin
|
|||||||
/* Call I2C Slave complete process */
|
/* Call I2C Slave complete process */
|
||||||
I2C_ITSlaveCplt(hi2c, ITFlags);
|
I2C_ITSlaveCplt(hi2c, ITFlags);
|
||||||
}
|
}
|
||||||
|
else if ((I2C_CHECK_FLAG(ITFlags, I2C_FLAG_AF) != RESET) && \
|
||||||
if ((I2C_CHECK_FLAG(ITFlags, I2C_FLAG_AF) != RESET) && \
|
|
||||||
(I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_NACKI) != RESET))
|
(I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_NACKI) != RESET))
|
||||||
{
|
{
|
||||||
/* Check that I2C transfer finished */
|
/* Check that I2C transfer finished */
|
||||||
@ -6125,6 +6323,7 @@ static void I2C_ITSlaveCplt(I2C_HandleTypeDef *hi2c, uint32_t ITFlags)
|
|||||||
{
|
{
|
||||||
uint32_t tmpcr1value = READ_REG(hi2c->Instance->CR1);
|
uint32_t tmpcr1value = READ_REG(hi2c->Instance->CR1);
|
||||||
uint32_t tmpITFlags = ITFlags;
|
uint32_t tmpITFlags = ITFlags;
|
||||||
|
uint32_t tmpoptions = hi2c->XferOptions;
|
||||||
HAL_I2C_StateTypeDef tmpstate = hi2c->State;
|
HAL_I2C_StateTypeDef tmpstate = hi2c->State;
|
||||||
|
|
||||||
/* Clear STOP Flag */
|
/* Clear STOP Flag */
|
||||||
@ -6141,6 +6340,11 @@ static void I2C_ITSlaveCplt(I2C_HandleTypeDef *hi2c, uint32_t ITFlags)
|
|||||||
I2C_Disable_IRQ(hi2c, I2C_XFER_LISTEN_IT | I2C_XFER_RX_IT);
|
I2C_Disable_IRQ(hi2c, I2C_XFER_LISTEN_IT | I2C_XFER_RX_IT);
|
||||||
hi2c->PreviousState = I2C_STATE_SLAVE_BUSY_RX;
|
hi2c->PreviousState = I2C_STATE_SLAVE_BUSY_RX;
|
||||||
}
|
}
|
||||||
|
else if (tmpstate == HAL_I2C_STATE_LISTEN)
|
||||||
|
{
|
||||||
|
I2C_Disable_IRQ(hi2c, I2C_XFER_LISTEN_IT | I2C_XFER_TX_IT | I2C_XFER_RX_IT);
|
||||||
|
hi2c->PreviousState = I2C_STATE_NONE;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Do nothing */
|
/* Do nothing */
|
||||||
@ -6207,6 +6411,57 @@ static void I2C_ITSlaveCplt(I2C_HandleTypeDef *hi2c, uint32_t ITFlags)
|
|||||||
hi2c->ErrorCode |= HAL_I2C_ERROR_AF;
|
hi2c->ErrorCode |= HAL_I2C_ERROR_AF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_AF) != RESET) && \
|
||||||
|
(I2C_CHECK_IT_SOURCE(tmpcr1value, I2C_IT_NACKI) != RESET))
|
||||||
|
{
|
||||||
|
/* Check that I2C transfer finished */
|
||||||
|
/* if yes, normal use case, a NACK is sent by the MASTER when Transfer is finished */
|
||||||
|
/* Mean XferCount == 0*/
|
||||||
|
/* So clear Flag NACKF only */
|
||||||
|
if (hi2c->XferCount == 0U)
|
||||||
|
{
|
||||||
|
if ((hi2c->State == HAL_I2C_STATE_LISTEN) && (tmpoptions == I2C_FIRST_AND_LAST_FRAME))
|
||||||
|
/* Same action must be done for (tmpoptions == I2C_LAST_FRAME) which removed for
|
||||||
|
Warning[Pa134]: left and right operands are identical */
|
||||||
|
{
|
||||||
|
/* Call I2C Listen complete process */
|
||||||
|
I2C_ITListenCplt(hi2c, tmpITFlags);
|
||||||
|
}
|
||||||
|
else if ((hi2c->State == HAL_I2C_STATE_BUSY_TX_LISTEN) && (tmpoptions != I2C_NO_OPTION_FRAME))
|
||||||
|
{
|
||||||
|
/* Clear NACK Flag */
|
||||||
|
__HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF);
|
||||||
|
|
||||||
|
/* Flush TX register */
|
||||||
|
I2C_Flush_TXDR(hi2c);
|
||||||
|
|
||||||
|
/* Last Byte is Transmitted */
|
||||||
|
/* Call I2C Slave Sequential complete process */
|
||||||
|
I2C_ITSlaveSeqCplt(hi2c);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Clear NACK Flag */
|
||||||
|
__HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* if no, error use case, a Non-Acknowledge of last Data is generated by the MASTER*/
|
||||||
|
/* Clear NACK Flag */
|
||||||
|
__HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF);
|
||||||
|
|
||||||
|
/* Set ErrorCode corresponding to a Non-Acknowledge */
|
||||||
|
hi2c->ErrorCode |= HAL_I2C_ERROR_AF;
|
||||||
|
|
||||||
|
if ((tmpoptions == I2C_FIRST_FRAME) || (tmpoptions == I2C_NEXT_FRAME))
|
||||||
|
{
|
||||||
|
/* Call the corresponding callback to inform upper layer of End of Transfer */
|
||||||
|
I2C_ITError(hi2c, hi2c->ErrorCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
hi2c->Mode = HAL_I2C_MODE_NONE;
|
hi2c->Mode = HAL_I2C_MODE_NONE;
|
||||||
hi2c->XferISR = NULL;
|
hi2c->XferISR = NULL;
|
||||||
|
|
||||||
@ -6623,9 +6878,17 @@ static void I2C_DMAMasterReceiveCplt(DMA_HandleTypeDef *hdma)
|
|||||||
|
|
||||||
/* Set the XferSize to transfer */
|
/* Set the XferSize to transfer */
|
||||||
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
if (hi2c->XferCount > MAX_NBYTE_SIZE)
|
||||||
|
{
|
||||||
|
/* Errata workaround 170323 */
|
||||||
|
if (I2C_GET_DIR(hi2c) == I2C_DIRECTION_RECEIVE)
|
||||||
|
{
|
||||||
|
hi2c->XferSize = 1U;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
hi2c->XferSize = MAX_NBYTE_SIZE;
|
hi2c->XferSize = MAX_NBYTE_SIZE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
hi2c->XferSize = hi2c->XferCount;
|
hi2c->XferSize = hi2c->XferCount;
|
||||||
@ -6735,6 +6998,12 @@ static HAL_StatusTypeDef I2C_WaitOnFlagUntilTimeout(I2C_HandleTypeDef *hi2c, uin
|
|||||||
{
|
{
|
||||||
while (__HAL_I2C_GET_FLAG(hi2c, Flag) == Status)
|
while (__HAL_I2C_GET_FLAG(hi2c, Flag) == Status)
|
||||||
{
|
{
|
||||||
|
/* Check if an error is detected */
|
||||||
|
if (I2C_IsErrorOccurred(hi2c, Timeout, Tickstart) != HAL_OK)
|
||||||
|
{
|
||||||
|
return HAL_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check for the Timeout */
|
/* Check for the Timeout */
|
||||||
if (Timeout != HAL_MAX_DELAY)
|
if (Timeout != HAL_MAX_DELAY)
|
||||||
{
|
{
|
||||||
@ -6846,16 +7115,18 @@ static HAL_StatusTypeDef I2C_WaitOnSTOPFlagUntilTimeout(I2C_HandleTypeDef *hi2c,
|
|||||||
static HAL_StatusTypeDef I2C_WaitOnRXNEFlagUntilTimeout(I2C_HandleTypeDef *hi2c, uint32_t Timeout,
|
static HAL_StatusTypeDef I2C_WaitOnRXNEFlagUntilTimeout(I2C_HandleTypeDef *hi2c, uint32_t Timeout,
|
||||||
uint32_t Tickstart)
|
uint32_t Tickstart)
|
||||||
{
|
{
|
||||||
while (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_RXNE) == RESET)
|
HAL_StatusTypeDef status = HAL_OK;
|
||||||
|
|
||||||
|
while ((__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_RXNE) == RESET) && (status == HAL_OK))
|
||||||
{
|
{
|
||||||
/* Check if an error is detected */
|
/* Check if an error is detected */
|
||||||
if (I2C_IsErrorOccurred(hi2c, Timeout, Tickstart) != HAL_OK)
|
if (I2C_IsErrorOccurred(hi2c, Timeout, Tickstart) != HAL_OK)
|
||||||
{
|
{
|
||||||
return HAL_ERROR;
|
status = HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if a STOPF is detected */
|
/* Check if a STOPF is detected */
|
||||||
if (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_STOPF) == SET)
|
if ((__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_STOPF) == SET) && (status == HAL_OK))
|
||||||
{
|
{
|
||||||
/* Check if an RXNE is pending */
|
/* Check if an RXNE is pending */
|
||||||
/* Store Last receive data if any */
|
/* Store Last receive data if any */
|
||||||
@ -6863,19 +7134,14 @@ static HAL_StatusTypeDef I2C_WaitOnRXNEFlagUntilTimeout(I2C_HandleTypeDef *hi2c,
|
|||||||
{
|
{
|
||||||
/* Return HAL_OK */
|
/* Return HAL_OK */
|
||||||
/* The Reading of data from RXDR will be done in caller function */
|
/* The Reading of data from RXDR will be done in caller function */
|
||||||
return HAL_OK;
|
status = HAL_OK;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
/* Check a no-acknowledge have been detected */
|
||||||
if (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_AF) == SET)
|
if (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_AF) == SET)
|
||||||
{
|
{
|
||||||
__HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF);
|
__HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF);
|
||||||
hi2c->ErrorCode = HAL_I2C_ERROR_AF;
|
hi2c->ErrorCode = HAL_I2C_ERROR_AF;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
hi2c->ErrorCode = HAL_I2C_ERROR_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Clear STOP Flag */
|
/* Clear STOP Flag */
|
||||||
__HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF);
|
__HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF);
|
||||||
@ -6889,12 +7155,16 @@ static HAL_StatusTypeDef I2C_WaitOnRXNEFlagUntilTimeout(I2C_HandleTypeDef *hi2c,
|
|||||||
/* Process Unlocked */
|
/* Process Unlocked */
|
||||||
__HAL_UNLOCK(hi2c);
|
__HAL_UNLOCK(hi2c);
|
||||||
|
|
||||||
return HAL_ERROR;
|
status = HAL_ERROR;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hi2c->ErrorCode = HAL_I2C_ERROR_NONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for the Timeout */
|
/* Check for the Timeout */
|
||||||
if (((HAL_GetTick() - Tickstart) > Timeout) || (Timeout == 0U))
|
if ((((HAL_GetTick() - Tickstart) > Timeout) || (Timeout == 0U)) && (status == HAL_OK))
|
||||||
{
|
{
|
||||||
if ((__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_RXNE) == RESET))
|
if ((__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_RXNE) == RESET))
|
||||||
{
|
{
|
||||||
@ -6904,11 +7174,11 @@ static HAL_StatusTypeDef I2C_WaitOnRXNEFlagUntilTimeout(I2C_HandleTypeDef *hi2c,
|
|||||||
/* Process Unlocked */
|
/* Process Unlocked */
|
||||||
__HAL_UNLOCK(hi2c);
|
__HAL_UNLOCK(hi2c);
|
||||||
|
|
||||||
return HAL_ERROR;
|
status = HAL_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return HAL_OK;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -7103,13 +7373,13 @@ static void I2C_Enable_IRQ(I2C_HandleTypeDef *hi2c, uint16_t InterruptRequest)
|
|||||||
|
|
||||||
if ((InterruptRequest & I2C_XFER_TX_IT) == I2C_XFER_TX_IT)
|
if ((InterruptRequest & I2C_XFER_TX_IT) == I2C_XFER_TX_IT)
|
||||||
{
|
{
|
||||||
/* Enable ERR, TC, STOP, NACK and RXI interrupts */
|
/* Enable ERR, TC, STOP, NACK and TXI interrupts */
|
||||||
tmpisr |= I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | I2C_IT_TXI;
|
tmpisr |= I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | I2C_IT_TXI;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((InterruptRequest & I2C_XFER_RX_IT) == I2C_XFER_RX_IT)
|
if ((InterruptRequest & I2C_XFER_RX_IT) == I2C_XFER_RX_IT)
|
||||||
{
|
{
|
||||||
/* Enable ERR, TC, STOP, NACK and TXI interrupts */
|
/* Enable ERR, TC, STOP, NACK and RXI interrupts */
|
||||||
tmpisr |= I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | I2C_IT_RXI;
|
tmpisr |= I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | I2C_IT_RXI;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7136,13 +7406,13 @@ static void I2C_Enable_IRQ(I2C_HandleTypeDef *hi2c, uint16_t InterruptRequest)
|
|||||||
|
|
||||||
if ((InterruptRequest & I2C_XFER_TX_IT) == I2C_XFER_TX_IT)
|
if ((InterruptRequest & I2C_XFER_TX_IT) == I2C_XFER_TX_IT)
|
||||||
{
|
{
|
||||||
/* Enable ERR, TC, STOP, NACK and RXI interrupts */
|
/* Enable ERR, TC, STOP, NACK and TXI interrupts */
|
||||||
tmpisr |= I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | I2C_IT_TXI;
|
tmpisr |= I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | I2C_IT_TXI;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((InterruptRequest & I2C_XFER_RX_IT) == I2C_XFER_RX_IT)
|
if ((InterruptRequest & I2C_XFER_RX_IT) == I2C_XFER_RX_IT)
|
||||||
{
|
{
|
||||||
/* Enable ERR, TC, STOP, NACK and TXI interrupts */
|
/* Enable ERR, TC, STOP, NACK and RXI interrupts */
|
||||||
tmpisr |= I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | I2C_IT_RXI;
|
tmpisr |= I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | I2C_IT_RXI;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7158,7 +7428,7 @@ static void I2C_Enable_IRQ(I2C_HandleTypeDef *hi2c, uint16_t InterruptRequest)
|
|||||||
tmpisr |= (I2C_IT_STOPI | I2C_IT_TCI);
|
tmpisr |= (I2C_IT_STOPI | I2C_IT_TCI);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((hi2c->XferISR != I2C_Mem_ISR_DMA) && (InterruptRequest == I2C_XFER_RELOAD_IT))
|
if (InterruptRequest == I2C_XFER_RELOAD_IT)
|
||||||
{
|
{
|
||||||
/* Enable TC interrupts */
|
/* Enable TC interrupts */
|
||||||
tmpisr |= I2C_IT_TCI;
|
tmpisr |= I2C_IT_TCI;
|
||||||
|
@ -874,15 +874,14 @@ HAL_StatusTypeDef HAL_I2S_Transmit(I2S_HandleTypeDef *hi2s, uint16_t *pData, uin
|
|||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Process Locked */
|
|
||||||
__HAL_LOCK(hi2s);
|
|
||||||
|
|
||||||
if (hi2s->State != HAL_I2S_STATE_READY)
|
if (hi2s->State != HAL_I2S_STATE_READY)
|
||||||
{
|
{
|
||||||
__HAL_UNLOCK(hi2s);
|
|
||||||
return HAL_BUSY;
|
return HAL_BUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Process Locked */
|
||||||
|
__HAL_LOCK(hi2s);
|
||||||
|
|
||||||
/* Set state and reset error code */
|
/* Set state and reset error code */
|
||||||
hi2s->State = HAL_I2S_STATE_BUSY_TX;
|
hi2s->State = HAL_I2S_STATE_BUSY_TX;
|
||||||
hi2s->ErrorCode = HAL_I2S_ERROR_NONE;
|
hi2s->ErrorCode = HAL_I2S_ERROR_NONE;
|
||||||
@ -993,15 +992,14 @@ HAL_StatusTypeDef HAL_I2S_Receive(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint
|
|||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Process Locked */
|
|
||||||
__HAL_LOCK(hi2s);
|
|
||||||
|
|
||||||
if (hi2s->State != HAL_I2S_STATE_READY)
|
if (hi2s->State != HAL_I2S_STATE_READY)
|
||||||
{
|
{
|
||||||
__HAL_UNLOCK(hi2s);
|
|
||||||
return HAL_BUSY;
|
return HAL_BUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Process Locked */
|
||||||
|
__HAL_LOCK(hi2s);
|
||||||
|
|
||||||
/* Set state and reset error code */
|
/* Set state and reset error code */
|
||||||
hi2s->State = HAL_I2S_STATE_BUSY_RX;
|
hi2s->State = HAL_I2S_STATE_BUSY_RX;
|
||||||
hi2s->ErrorCode = HAL_I2S_ERROR_NONE;
|
hi2s->ErrorCode = HAL_I2S_ERROR_NONE;
|
||||||
@ -1091,15 +1089,14 @@ HAL_StatusTypeDef HAL_I2S_Transmit_IT(I2S_HandleTypeDef *hi2s, uint16_t *pData,
|
|||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Process Locked */
|
|
||||||
__HAL_LOCK(hi2s);
|
|
||||||
|
|
||||||
if (hi2s->State != HAL_I2S_STATE_READY)
|
if (hi2s->State != HAL_I2S_STATE_READY)
|
||||||
{
|
{
|
||||||
__HAL_UNLOCK(hi2s);
|
|
||||||
return HAL_BUSY;
|
return HAL_BUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Process Locked */
|
||||||
|
__HAL_LOCK(hi2s);
|
||||||
|
|
||||||
/* Set state and reset error code */
|
/* Set state and reset error code */
|
||||||
hi2s->State = HAL_I2S_STATE_BUSY_TX;
|
hi2s->State = HAL_I2S_STATE_BUSY_TX;
|
||||||
hi2s->ErrorCode = HAL_I2S_ERROR_NONE;
|
hi2s->ErrorCode = HAL_I2S_ERROR_NONE;
|
||||||
@ -1118,6 +1115,8 @@ HAL_StatusTypeDef HAL_I2S_Transmit_IT(I2S_HandleTypeDef *hi2s, uint16_t *pData,
|
|||||||
hi2s->TxXferCount = Size;
|
hi2s->TxXferCount = Size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__HAL_UNLOCK(hi2s);
|
||||||
|
|
||||||
/* Enable TXE and ERR interrupt */
|
/* Enable TXE and ERR interrupt */
|
||||||
__HAL_I2S_ENABLE_IT(hi2s, (I2S_IT_TXE | I2S_IT_ERR));
|
__HAL_I2S_ENABLE_IT(hi2s, (I2S_IT_TXE | I2S_IT_ERR));
|
||||||
|
|
||||||
@ -1128,7 +1127,6 @@ HAL_StatusTypeDef HAL_I2S_Transmit_IT(I2S_HandleTypeDef *hi2s, uint16_t *pData,
|
|||||||
__HAL_I2S_ENABLE(hi2s);
|
__HAL_I2S_ENABLE(hi2s);
|
||||||
}
|
}
|
||||||
|
|
||||||
__HAL_UNLOCK(hi2s);
|
|
||||||
return HAL_OK;
|
return HAL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1157,15 +1155,14 @@ HAL_StatusTypeDef HAL_I2S_Receive_IT(I2S_HandleTypeDef *hi2s, uint16_t *pData, u
|
|||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Process Locked */
|
|
||||||
__HAL_LOCK(hi2s);
|
|
||||||
|
|
||||||
if (hi2s->State != HAL_I2S_STATE_READY)
|
if (hi2s->State != HAL_I2S_STATE_READY)
|
||||||
{
|
{
|
||||||
__HAL_UNLOCK(hi2s);
|
|
||||||
return HAL_BUSY;
|
return HAL_BUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Process Locked */
|
||||||
|
__HAL_LOCK(hi2s);
|
||||||
|
|
||||||
/* Set state and reset error code */
|
/* Set state and reset error code */
|
||||||
hi2s->State = HAL_I2S_STATE_BUSY_RX;
|
hi2s->State = HAL_I2S_STATE_BUSY_RX;
|
||||||
hi2s->ErrorCode = HAL_I2S_ERROR_NONE;
|
hi2s->ErrorCode = HAL_I2S_ERROR_NONE;
|
||||||
@ -1184,6 +1181,8 @@ HAL_StatusTypeDef HAL_I2S_Receive_IT(I2S_HandleTypeDef *hi2s, uint16_t *pData, u
|
|||||||
hi2s->RxXferCount = Size;
|
hi2s->RxXferCount = Size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__HAL_UNLOCK(hi2s);
|
||||||
|
|
||||||
/* Enable RXNE and ERR interrupt */
|
/* Enable RXNE and ERR interrupt */
|
||||||
__HAL_I2S_ENABLE_IT(hi2s, (I2S_IT_RXNE | I2S_IT_ERR));
|
__HAL_I2S_ENABLE_IT(hi2s, (I2S_IT_RXNE | I2S_IT_ERR));
|
||||||
|
|
||||||
@ -1194,7 +1193,6 @@ HAL_StatusTypeDef HAL_I2S_Receive_IT(I2S_HandleTypeDef *hi2s, uint16_t *pData, u
|
|||||||
__HAL_I2S_ENABLE(hi2s);
|
__HAL_I2S_ENABLE(hi2s);
|
||||||
}
|
}
|
||||||
|
|
||||||
__HAL_UNLOCK(hi2s);
|
|
||||||
return HAL_OK;
|
return HAL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1221,15 +1219,14 @@ HAL_StatusTypeDef HAL_I2S_Transmit_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData,
|
|||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Process Locked */
|
|
||||||
__HAL_LOCK(hi2s);
|
|
||||||
|
|
||||||
if (hi2s->State != HAL_I2S_STATE_READY)
|
if (hi2s->State != HAL_I2S_STATE_READY)
|
||||||
{
|
{
|
||||||
__HAL_UNLOCK(hi2s);
|
|
||||||
return HAL_BUSY;
|
return HAL_BUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Process Locked */
|
||||||
|
__HAL_LOCK(hi2s);
|
||||||
|
|
||||||
/* Set state and reset error code */
|
/* Set state and reset error code */
|
||||||
hi2s->State = HAL_I2S_STATE_BUSY_TX;
|
hi2s->State = HAL_I2S_STATE_BUSY_TX;
|
||||||
hi2s->ErrorCode = HAL_I2S_ERROR_NONE;
|
hi2s->ErrorCode = HAL_I2S_ERROR_NONE;
|
||||||
@ -1271,12 +1268,7 @@ HAL_StatusTypeDef HAL_I2S_Transmit_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData,
|
|||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if the I2S is already enabled */
|
__HAL_UNLOCK(hi2s);
|
||||||
if (HAL_IS_BIT_CLR(hi2s->Instance->I2SCFGR, SPI_I2SCFGR_I2SE))
|
|
||||||
{
|
|
||||||
/* Enable I2S peripheral */
|
|
||||||
__HAL_I2S_ENABLE(hi2s);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check if the I2S Tx request is already enabled */
|
/* Check if the I2S Tx request is already enabled */
|
||||||
if (HAL_IS_BIT_CLR(hi2s->Instance->CR2, SPI_CR2_TXDMAEN))
|
if (HAL_IS_BIT_CLR(hi2s->Instance->CR2, SPI_CR2_TXDMAEN))
|
||||||
@ -1285,7 +1277,13 @@ HAL_StatusTypeDef HAL_I2S_Transmit_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData,
|
|||||||
SET_BIT(hi2s->Instance->CR2, SPI_CR2_TXDMAEN);
|
SET_BIT(hi2s->Instance->CR2, SPI_CR2_TXDMAEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
__HAL_UNLOCK(hi2s);
|
/* Check if the I2S is already enabled */
|
||||||
|
if (HAL_IS_BIT_CLR(hi2s->Instance->I2SCFGR, SPI_I2SCFGR_I2SE))
|
||||||
|
{
|
||||||
|
/* Enable I2S peripheral */
|
||||||
|
__HAL_I2S_ENABLE(hi2s);
|
||||||
|
}
|
||||||
|
|
||||||
return HAL_OK;
|
return HAL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1312,15 +1310,14 @@ HAL_StatusTypeDef HAL_I2S_Receive_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData,
|
|||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Process Locked */
|
|
||||||
__HAL_LOCK(hi2s);
|
|
||||||
|
|
||||||
if (hi2s->State != HAL_I2S_STATE_READY)
|
if (hi2s->State != HAL_I2S_STATE_READY)
|
||||||
{
|
{
|
||||||
__HAL_UNLOCK(hi2s);
|
|
||||||
return HAL_BUSY;
|
return HAL_BUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Process Locked */
|
||||||
|
__HAL_LOCK(hi2s);
|
||||||
|
|
||||||
/* Set state and reset error code */
|
/* Set state and reset error code */
|
||||||
hi2s->State = HAL_I2S_STATE_BUSY_RX;
|
hi2s->State = HAL_I2S_STATE_BUSY_RX;
|
||||||
hi2s->ErrorCode = HAL_I2S_ERROR_NONE;
|
hi2s->ErrorCode = HAL_I2S_ERROR_NONE;
|
||||||
@ -1368,12 +1365,7 @@ HAL_StatusTypeDef HAL_I2S_Receive_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData,
|
|||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if the I2S is already enabled */
|
__HAL_UNLOCK(hi2s);
|
||||||
if (HAL_IS_BIT_CLR(hi2s->Instance->I2SCFGR, SPI_I2SCFGR_I2SE))
|
|
||||||
{
|
|
||||||
/* Enable I2S peripheral */
|
|
||||||
__HAL_I2S_ENABLE(hi2s);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check if the I2S Rx request is already enabled */
|
/* Check if the I2S Rx request is already enabled */
|
||||||
if (HAL_IS_BIT_CLR(hi2s->Instance->CR2, SPI_CR2_RXDMAEN))
|
if (HAL_IS_BIT_CLR(hi2s->Instance->CR2, SPI_CR2_RXDMAEN))
|
||||||
@ -1382,7 +1374,13 @@ HAL_StatusTypeDef HAL_I2S_Receive_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData,
|
|||||||
SET_BIT(hi2s->Instance->CR2, SPI_CR2_RXDMAEN);
|
SET_BIT(hi2s->Instance->CR2, SPI_CR2_RXDMAEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
__HAL_UNLOCK(hi2s);
|
/* Check if the I2S is already enabled */
|
||||||
|
if (HAL_IS_BIT_CLR(hi2s->Instance->I2SCFGR, SPI_I2SCFGR_I2SE))
|
||||||
|
{
|
||||||
|
/* Enable I2S peripheral */
|
||||||
|
__HAL_I2S_ENABLE(hi2s);
|
||||||
|
}
|
||||||
|
|
||||||
return HAL_OK;
|
return HAL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,12 +210,10 @@ HAL_StatusTypeDef HAL_I2SEx_TransmitReceive(I2S_HandleTypeDef *hi2s,
|
|||||||
uint32_t Timeout)
|
uint32_t Timeout)
|
||||||
{
|
{
|
||||||
uint32_t tmp1 = 0U;
|
uint32_t tmp1 = 0U;
|
||||||
HAL_StatusTypeDef errorcode = HAL_OK;
|
|
||||||
|
|
||||||
if (hi2s->State != HAL_I2S_STATE_READY)
|
if (hi2s->State != HAL_I2S_STATE_READY)
|
||||||
{
|
{
|
||||||
errorcode = HAL_BUSY;
|
return HAL_BUSY;
|
||||||
goto error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((pTxData == NULL) || (pRxData == NULL) || (Size == 0U))
|
if ((pTxData == NULL) || (pRxData == NULL) || (Size == 0U))
|
||||||
@ -281,8 +279,11 @@ HAL_StatusTypeDef HAL_I2SEx_TransmitReceive(I2S_HandleTypeDef *hi2s,
|
|||||||
{
|
{
|
||||||
/* Set the error code */
|
/* Set the error code */
|
||||||
SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT);
|
SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT);
|
||||||
errorcode = HAL_ERROR;
|
hi2s->State = HAL_I2S_STATE_READY;
|
||||||
goto error;
|
|
||||||
|
/* Process UnLock */
|
||||||
|
__HAL_UNLOCK(hi2s);
|
||||||
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
/* Write Data on DR register */
|
/* Write Data on DR register */
|
||||||
hi2s->Instance->DR = (*pTxData++);
|
hi2s->Instance->DR = (*pTxData++);
|
||||||
@ -305,8 +306,11 @@ HAL_StatusTypeDef HAL_I2SEx_TransmitReceive(I2S_HandleTypeDef *hi2s,
|
|||||||
{
|
{
|
||||||
/* Set the error code */
|
/* Set the error code */
|
||||||
SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT);
|
SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT);
|
||||||
errorcode = HAL_ERROR;
|
hi2s->State = HAL_I2S_STATE_READY;
|
||||||
goto error;
|
|
||||||
|
/* Process UnLock */
|
||||||
|
__HAL_UNLOCK(hi2s);
|
||||||
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
/* Read Data from DR register */
|
/* Read Data from DR register */
|
||||||
(*pRxData++) = I2SxEXT(hi2s->Instance)->DR;
|
(*pRxData++) = I2SxEXT(hi2s->Instance)->DR;
|
||||||
@ -354,8 +358,11 @@ HAL_StatusTypeDef HAL_I2SEx_TransmitReceive(I2S_HandleTypeDef *hi2s,
|
|||||||
{
|
{
|
||||||
/* Set the error code */
|
/* Set the error code */
|
||||||
SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT);
|
SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT);
|
||||||
errorcode = HAL_ERROR;
|
hi2s->State = HAL_I2S_STATE_READY;
|
||||||
goto error;
|
|
||||||
|
/* Process UnLock */
|
||||||
|
__HAL_UNLOCK(hi2s);
|
||||||
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
/* Write Data on DR register */
|
/* Write Data on DR register */
|
||||||
I2SxEXT(hi2s->Instance)->DR = (*pTxData++);
|
I2SxEXT(hi2s->Instance)->DR = (*pTxData++);
|
||||||
@ -378,8 +385,11 @@ HAL_StatusTypeDef HAL_I2SEx_TransmitReceive(I2S_HandleTypeDef *hi2s,
|
|||||||
{
|
{
|
||||||
/* Set the error code */
|
/* Set the error code */
|
||||||
SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT);
|
SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT);
|
||||||
errorcode = HAL_ERROR;
|
hi2s->State = HAL_I2S_STATE_READY;
|
||||||
goto error;
|
|
||||||
|
/* Process UnLock */
|
||||||
|
__HAL_UNLOCK(hi2s);
|
||||||
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
/* Read Data from DR register */
|
/* Read Data from DR register */
|
||||||
(*pRxData++) = hi2s->Instance->DR;
|
(*pRxData++) = hi2s->Instance->DR;
|
||||||
@ -398,15 +408,17 @@ HAL_StatusTypeDef HAL_I2SEx_TransmitReceive(I2S_HandleTypeDef *hi2s,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hi2s->ErrorCode != HAL_I2S_ERROR_NONE)
|
|
||||||
{
|
|
||||||
errorcode = HAL_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
error :
|
|
||||||
hi2s->State = HAL_I2S_STATE_READY;
|
hi2s->State = HAL_I2S_STATE_READY;
|
||||||
__HAL_UNLOCK(hi2s);
|
__HAL_UNLOCK(hi2s);
|
||||||
return errorcode;
|
|
||||||
|
if (hi2s->ErrorCode != HAL_I2S_ERROR_NONE)
|
||||||
|
{
|
||||||
|
return HAL_ERROR;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return HAL_OK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -430,12 +442,10 @@ HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_IT(I2S_HandleTypeDef *hi2s,
|
|||||||
uint16_t Size)
|
uint16_t Size)
|
||||||
{
|
{
|
||||||
uint32_t tmp1 = 0U;
|
uint32_t tmp1 = 0U;
|
||||||
HAL_StatusTypeDef errorcode = HAL_OK;
|
|
||||||
|
|
||||||
if (hi2s->State != HAL_I2S_STATE_READY)
|
if (hi2s->State != HAL_I2S_STATE_READY)
|
||||||
{
|
{
|
||||||
errorcode = HAL_BUSY;
|
return HAL_BUSY;
|
||||||
goto error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((pTxData == NULL) || (pRxData == NULL) || (Size == 0U))
|
if ((pTxData == NULL) || (pRxData == NULL) || (Size == 0U))
|
||||||
@ -510,15 +520,14 @@ HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_IT(I2S_HandleTypeDef *hi2s,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__HAL_UNLOCK(hi2s);
|
||||||
/* Enable I2Sext peripheral */
|
/* Enable I2Sext peripheral */
|
||||||
__HAL_I2SEXT_ENABLE(hi2s);
|
__HAL_I2SEXT_ENABLE(hi2s);
|
||||||
|
|
||||||
/* Enable I2S peripheral */
|
/* Enable I2S peripheral */
|
||||||
__HAL_I2S_ENABLE(hi2s);
|
__HAL_I2S_ENABLE(hi2s);
|
||||||
|
|
||||||
error :
|
return HAL_OK;
|
||||||
__HAL_UNLOCK(hi2s);
|
|
||||||
return errorcode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -543,12 +552,10 @@ HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_DMA(I2S_HandleTypeDef *hi2s,
|
|||||||
{
|
{
|
||||||
uint32_t *tmp = NULL;
|
uint32_t *tmp = NULL;
|
||||||
uint32_t tmp1 = 0U;
|
uint32_t tmp1 = 0U;
|
||||||
HAL_StatusTypeDef errorcode = HAL_OK;
|
|
||||||
|
|
||||||
if (hi2s->State != HAL_I2S_STATE_READY)
|
if (hi2s->State != HAL_I2S_STATE_READY)
|
||||||
{
|
{
|
||||||
errorcode = HAL_BUSY;
|
return HAL_BUSY;
|
||||||
goto error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((pTxData == NULL) || (pRxData == NULL) || (Size == 0U))
|
if ((pTxData == NULL) || (pRxData == NULL) || (Size == 0U))
|
||||||
@ -620,16 +627,6 @@ HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_DMA(I2S_HandleTypeDef *hi2s,
|
|||||||
|
|
||||||
/* Enable Tx DMA Request */
|
/* Enable Tx DMA Request */
|
||||||
SET_BIT(hi2s->Instance->CR2, SPI_CR2_TXDMAEN);
|
SET_BIT(hi2s->Instance->CR2, SPI_CR2_TXDMAEN);
|
||||||
|
|
||||||
/* Check if the I2S is already enabled */
|
|
||||||
if ((hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SE) != SPI_I2SCFGR_I2SE)
|
|
||||||
{
|
|
||||||
/* Enable I2Sext(receiver) before enabling I2Sx peripheral */
|
|
||||||
__HAL_I2SEXT_ENABLE(hi2s);
|
|
||||||
|
|
||||||
/* Enable I2S peripheral after the I2Sext */
|
|
||||||
__HAL_I2S_ENABLE(hi2s);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -653,7 +650,9 @@ HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_DMA(I2S_HandleTypeDef *hi2s,
|
|||||||
|
|
||||||
/* Enable Rx DMA Request */
|
/* Enable Rx DMA Request */
|
||||||
SET_BIT(hi2s->Instance->CR2, SPI_CR2_RXDMAEN);
|
SET_BIT(hi2s->Instance->CR2, SPI_CR2_RXDMAEN);
|
||||||
|
}
|
||||||
|
|
||||||
|
__HAL_UNLOCK(hi2s);
|
||||||
/* Check if the I2S is already enabled */
|
/* Check if the I2S is already enabled */
|
||||||
if ((hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SE) != SPI_I2SCFGR_I2SE)
|
if ((hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SE) != SPI_I2SCFGR_I2SE)
|
||||||
{
|
{
|
||||||
@ -662,11 +661,8 @@ HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_DMA(I2S_HandleTypeDef *hi2s,
|
|||||||
/* Enable I2S peripheral before the I2Sext */
|
/* Enable I2S peripheral before the I2Sext */
|
||||||
__HAL_I2S_ENABLE(hi2s);
|
__HAL_I2S_ENABLE(hi2s);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
error :
|
return HAL_OK;
|
||||||
__HAL_UNLOCK(hi2s);
|
|
||||||
return errorcode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -142,7 +142,7 @@
|
|||||||
|
|
||||||
[..]
|
[..]
|
||||||
Use function HAL_IRDA_UnRegisterCallback() to reset a callback to the default
|
Use function HAL_IRDA_UnRegisterCallback() to reset a callback to the default
|
||||||
weak (surcharged) function.
|
weak function.
|
||||||
HAL_IRDA_UnRegisterCallback() takes as parameters the HAL peripheral handle,
|
HAL_IRDA_UnRegisterCallback() takes as parameters the HAL peripheral handle,
|
||||||
and the Callback ID.
|
and the Callback ID.
|
||||||
This function allows to reset following callbacks:
|
This function allows to reset following callbacks:
|
||||||
@ -159,10 +159,10 @@
|
|||||||
|
|
||||||
[..]
|
[..]
|
||||||
By default, after the HAL_IRDA_Init() and when the state is HAL_IRDA_STATE_RESET
|
By default, after the HAL_IRDA_Init() and when the state is HAL_IRDA_STATE_RESET
|
||||||
all callbacks are set to the corresponding weak (surcharged) functions:
|
all callbacks are set to the corresponding weak functions:
|
||||||
examples HAL_IRDA_TxCpltCallback(), HAL_IRDA_RxHalfCpltCallback().
|
examples HAL_IRDA_TxCpltCallback(), HAL_IRDA_RxHalfCpltCallback().
|
||||||
Exception done for MspInit and MspDeInit functions that are respectively
|
Exception done for MspInit and MspDeInit functions that are respectively
|
||||||
reset to the legacy weak (surcharged) functions in the HAL_IRDA_Init()
|
reset to the legacy weak functions in the HAL_IRDA_Init()
|
||||||
and HAL_IRDA_DeInit() only when these callbacks are null (not registered beforehand).
|
and HAL_IRDA_DeInit() only when these callbacks are null (not registered beforehand).
|
||||||
If not, MspInit or MspDeInit are not null, the HAL_IRDA_Init() and HAL_IRDA_DeInit()
|
If not, MspInit or MspDeInit are not null, the HAL_IRDA_Init() and HAL_IRDA_DeInit()
|
||||||
keep and use the user MspInit/MspDeInit callbacks (registered beforehand).
|
keep and use the user MspInit/MspDeInit callbacks (registered beforehand).
|
||||||
@ -179,7 +179,7 @@
|
|||||||
[..]
|
[..]
|
||||||
When The compilation define USE_HAL_IRDA_REGISTER_CALLBACKS is set to 0 or
|
When The compilation define USE_HAL_IRDA_REGISTER_CALLBACKS is set to 0 or
|
||||||
not defined, the callback registration feature is not available
|
not defined, the callback registration feature is not available
|
||||||
and weak (surcharged) callbacks are used.
|
and weak callbacks are used.
|
||||||
|
|
||||||
@endverbatim
|
@endverbatim
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
@ -470,7 +470,7 @@ __weak void HAL_IRDA_MspDeInit(IRDA_HandleTypeDef *hirda)
|
|||||||
#if (USE_HAL_IRDA_REGISTER_CALLBACKS == 1)
|
#if (USE_HAL_IRDA_REGISTER_CALLBACKS == 1)
|
||||||
/**
|
/**
|
||||||
* @brief Register a User IRDA Callback
|
* @brief Register a User IRDA Callback
|
||||||
* To be used instead of the weak predefined callback
|
* To be used to override the weak predefined callback
|
||||||
* @note The HAL_IRDA_RegisterCallback() may be called before HAL_IRDA_Init() in HAL_IRDA_STATE_RESET
|
* @note The HAL_IRDA_RegisterCallback() may be called before HAL_IRDA_Init() in HAL_IRDA_STATE_RESET
|
||||||
* to register callbacks for HAL_IRDA_MSPINIT_CB_ID and HAL_IRDA_MSPDEINIT_CB_ID
|
* to register callbacks for HAL_IRDA_MSPINIT_CB_ID and HAL_IRDA_MSPDEINIT_CB_ID
|
||||||
* @param hirda irda handle
|
* @param hirda irda handle
|
||||||
|
@ -77,15 +77,15 @@
|
|||||||
and a pointer to the user callback function.
|
and a pointer to the user callback function.
|
||||||
|
|
||||||
Use function HAL_NAND_UnRegisterCallback() to reset a callback to the default
|
Use function HAL_NAND_UnRegisterCallback() to reset a callback to the default
|
||||||
weak (surcharged) function. It allows to reset following callbacks:
|
weak (overridden) function. It allows to reset following callbacks:
|
||||||
(+) MspInitCallback : NAND MspInit.
|
(+) MspInitCallback : NAND MspInit.
|
||||||
(+) MspDeInitCallback : NAND MspDeInit.
|
(+) MspDeInitCallback : NAND MspDeInit.
|
||||||
This function) takes as parameters the HAL peripheral handle and the Callback ID.
|
This function) takes as parameters the HAL peripheral handle and the Callback ID.
|
||||||
|
|
||||||
By default, after the HAL_NAND_Init and if the state is HAL_NAND_STATE_RESET
|
By default, after the HAL_NAND_Init and if the state is HAL_NAND_STATE_RESET
|
||||||
all callbacks are reset to the corresponding legacy weak (surcharged) functions.
|
all callbacks are reset to the corresponding legacy weak (overridden) functions.
|
||||||
Exception done for MspInit and MspDeInit callbacks that are respectively
|
Exception done for MspInit and MspDeInit callbacks that are respectively
|
||||||
reset to the legacy weak (surcharged) functions in the HAL_NAND_Init
|
reset to the legacy weak (overridden) functions in the HAL_NAND_Init
|
||||||
and HAL_NAND_DeInit only when these callbacks are null (not registered beforehand).
|
and HAL_NAND_DeInit only when these callbacks are null (not registered beforehand).
|
||||||
If not, MspInit or MspDeInit are not null, the HAL_NAND_Init and HAL_NAND_DeInit
|
If not, MspInit or MspDeInit are not null, the HAL_NAND_Init and HAL_NAND_DeInit
|
||||||
keep and use the user MspInit/MspDeInit callbacks (registered beforehand)
|
keep and use the user MspInit/MspDeInit callbacks (registered beforehand)
|
||||||
@ -100,7 +100,7 @@
|
|||||||
|
|
||||||
When The compilation define USE_HAL_NAND_REGISTER_CALLBACKS is set to 0 or
|
When The compilation define USE_HAL_NAND_REGISTER_CALLBACKS is set to 0 or
|
||||||
not defined, the callback registering feature is not available
|
not defined, the callback registering feature is not available
|
||||||
and weak (surcharged) callbacks are used.
|
and weak (overridden) callbacks are used.
|
||||||
|
|
||||||
@endverbatim
|
@endverbatim
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
@ -1976,7 +1976,7 @@ uint32_t HAL_NAND_Address_Inc(const NAND_HandleTypeDef *hnand, NAND_AddressTypeD
|
|||||||
#if (USE_HAL_NAND_REGISTER_CALLBACKS == 1)
|
#if (USE_HAL_NAND_REGISTER_CALLBACKS == 1)
|
||||||
/**
|
/**
|
||||||
* @brief Register a User NAND Callback
|
* @brief Register a User NAND Callback
|
||||||
* To be used instead of the weak (surcharged) predefined callback
|
* To be used to override the weak predefined callback
|
||||||
* @param hnand : NAND handle
|
* @param hnand : NAND handle
|
||||||
* @param CallbackId : ID of the callback to be registered
|
* @param CallbackId : ID of the callback to be registered
|
||||||
* This parameter can be one of the following values:
|
* This parameter can be one of the following values:
|
||||||
@ -1996,9 +1996,6 @@ HAL_StatusTypeDef HAL_NAND_RegisterCallback(NAND_HandleTypeDef *hnand, HAL_NAND_
|
|||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Process locked */
|
|
||||||
__HAL_LOCK(hnand);
|
|
||||||
|
|
||||||
if (hnand->State == HAL_NAND_STATE_READY)
|
if (hnand->State == HAL_NAND_STATE_READY)
|
||||||
{
|
{
|
||||||
switch (CallbackId)
|
switch (CallbackId)
|
||||||
@ -2040,14 +2037,12 @@ HAL_StatusTypeDef HAL_NAND_RegisterCallback(NAND_HandleTypeDef *hnand, HAL_NAND_
|
|||||||
status = HAL_ERROR;
|
status = HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Release Lock */
|
|
||||||
__HAL_UNLOCK(hnand);
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Unregister a User NAND Callback
|
* @brief Unregister a User NAND Callback
|
||||||
* NAND Callback is redirected to the weak (surcharged) predefined callback
|
* NAND Callback is redirected to the weak predefined callback
|
||||||
* @param hnand : NAND handle
|
* @param hnand : NAND handle
|
||||||
* @param CallbackId : ID of the callback to be unregistered
|
* @param CallbackId : ID of the callback to be unregistered
|
||||||
* This parameter can be one of the following values:
|
* This parameter can be one of the following values:
|
||||||
@ -2060,9 +2055,6 @@ HAL_StatusTypeDef HAL_NAND_UnRegisterCallback(NAND_HandleTypeDef *hnand, HAL_NAN
|
|||||||
{
|
{
|
||||||
HAL_StatusTypeDef status = HAL_OK;
|
HAL_StatusTypeDef status = HAL_OK;
|
||||||
|
|
||||||
/* Process locked */
|
|
||||||
__HAL_LOCK(hnand);
|
|
||||||
|
|
||||||
if (hnand->State == HAL_NAND_STATE_READY)
|
if (hnand->State == HAL_NAND_STATE_READY)
|
||||||
{
|
{
|
||||||
switch (CallbackId)
|
switch (CallbackId)
|
||||||
@ -2104,8 +2096,6 @@ HAL_StatusTypeDef HAL_NAND_UnRegisterCallback(NAND_HandleTypeDef *hnand, HAL_NAN
|
|||||||
status = HAL_ERROR;
|
status = HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Release Lock */
|
|
||||||
__HAL_UNLOCK(hnand);
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
#endif /* USE_HAL_NAND_REGISTER_CALLBACKS */
|
#endif /* USE_HAL_NAND_REGISTER_CALLBACKS */
|
||||||
|
@ -74,15 +74,15 @@
|
|||||||
and a pointer to the user callback function.
|
and a pointer to the user callback function.
|
||||||
|
|
||||||
Use function HAL_NOR_UnRegisterCallback() to reset a callback to the default
|
Use function HAL_NOR_UnRegisterCallback() to reset a callback to the default
|
||||||
weak (surcharged) function. It allows to reset following callbacks:
|
weak (overridden) function. It allows to reset following callbacks:
|
||||||
(+) MspInitCallback : NOR MspInit.
|
(+) MspInitCallback : NOR MspInit.
|
||||||
(+) MspDeInitCallback : NOR MspDeInit.
|
(+) MspDeInitCallback : NOR MspDeInit.
|
||||||
This function) takes as parameters the HAL peripheral handle and the Callback ID.
|
This function) takes as parameters the HAL peripheral handle and the Callback ID.
|
||||||
|
|
||||||
By default, after the HAL_NOR_Init and if the state is HAL_NOR_STATE_RESET
|
By default, after the HAL_NOR_Init and if the state is HAL_NOR_STATE_RESET
|
||||||
all callbacks are reset to the corresponding legacy weak (surcharged) functions.
|
all callbacks are reset to the corresponding legacy weak (overridden) functions.
|
||||||
Exception done for MspInit and MspDeInit callbacks that are respectively
|
Exception done for MspInit and MspDeInit callbacks that are respectively
|
||||||
reset to the legacy weak (surcharged) functions in the HAL_NOR_Init
|
reset to the legacy weak (overridden) functions in the HAL_NOR_Init
|
||||||
and HAL_NOR_DeInit only when these callbacks are null (not registered beforehand).
|
and HAL_NOR_DeInit only when these callbacks are null (not registered beforehand).
|
||||||
If not, MspInit or MspDeInit are not null, the HAL_NOR_Init and HAL_NOR_DeInit
|
If not, MspInit or MspDeInit are not null, the HAL_NOR_Init and HAL_NOR_DeInit
|
||||||
keep and use the user MspInit/MspDeInit callbacks (registered beforehand)
|
keep and use the user MspInit/MspDeInit callbacks (registered beforehand)
|
||||||
@ -97,7 +97,7 @@
|
|||||||
|
|
||||||
When The compilation define USE_HAL_NOR_REGISTER_CALLBACKS is set to 0 or
|
When The compilation define USE_HAL_NOR_REGISTER_CALLBACKS is set to 0 or
|
||||||
not defined, the callback registering feature is not available
|
not defined, the callback registering feature is not available
|
||||||
and weak (surcharged) callbacks are used.
|
and weak (overridden) callbacks are used.
|
||||||
|
|
||||||
@endverbatim
|
@endverbatim
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
@ -406,7 +406,7 @@ __weak void HAL_NOR_MspDeInit(NOR_HandleTypeDef *hnor)
|
|||||||
* @param Timeout Maximum timeout value
|
* @param Timeout Maximum timeout value
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
__weak void HAL_NOR_MspWait(const NOR_HandleTypeDef *hnor, uint32_t Timeout)
|
__weak void HAL_NOR_MspWait(NOR_HandleTypeDef *hnor, uint32_t Timeout)
|
||||||
{
|
{
|
||||||
/* Prevent unused argument(s) compilation warning */
|
/* Prevent unused argument(s) compilation warning */
|
||||||
UNUSED(hnor);
|
UNUSED(hnor);
|
||||||
@ -1309,7 +1309,7 @@ HAL_StatusTypeDef HAL_NOR_Read_CFI(NOR_HandleTypeDef *hnor, NOR_CFITypeDef *pNOR
|
|||||||
#if (USE_HAL_NOR_REGISTER_CALLBACKS == 1)
|
#if (USE_HAL_NOR_REGISTER_CALLBACKS == 1)
|
||||||
/**
|
/**
|
||||||
* @brief Register a User NOR Callback
|
* @brief Register a User NOR Callback
|
||||||
* To be used instead of the weak (surcharged) predefined callback
|
* To be used to override the weak predefined callback
|
||||||
* @param hnor : NOR handle
|
* @param hnor : NOR handle
|
||||||
* @param CallbackId : ID of the callback to be registered
|
* @param CallbackId : ID of the callback to be registered
|
||||||
* This parameter can be one of the following values:
|
* This parameter can be one of the following values:
|
||||||
@ -1329,9 +1329,6 @@ HAL_StatusTypeDef HAL_NOR_RegisterCallback(NOR_HandleTypeDef *hnor, HAL_NOR_Call
|
|||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Process locked */
|
|
||||||
__HAL_LOCK(hnor);
|
|
||||||
|
|
||||||
state = hnor->State;
|
state = hnor->State;
|
||||||
if ((state == HAL_NOR_STATE_READY) || (state == HAL_NOR_STATE_RESET) || (state == HAL_NOR_STATE_PROTECTED))
|
if ((state == HAL_NOR_STATE_READY) || (state == HAL_NOR_STATE_RESET) || (state == HAL_NOR_STATE_PROTECTED))
|
||||||
{
|
{
|
||||||
@ -1355,14 +1352,12 @@ HAL_StatusTypeDef HAL_NOR_RegisterCallback(NOR_HandleTypeDef *hnor, HAL_NOR_Call
|
|||||||
status = HAL_ERROR;
|
status = HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Release Lock */
|
|
||||||
__HAL_UNLOCK(hnor);
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Unregister a User NOR Callback
|
* @brief Unregister a User NOR Callback
|
||||||
* NOR Callback is redirected to the weak (surcharged) predefined callback
|
* NOR Callback is redirected to the weak predefined callback
|
||||||
* @param hnor : NOR handle
|
* @param hnor : NOR handle
|
||||||
* @param CallbackId : ID of the callback to be unregistered
|
* @param CallbackId : ID of the callback to be unregistered
|
||||||
* This parameter can be one of the following values:
|
* This parameter can be one of the following values:
|
||||||
@ -1375,9 +1370,6 @@ HAL_StatusTypeDef HAL_NOR_UnRegisterCallback(NOR_HandleTypeDef *hnor, HAL_NOR_Ca
|
|||||||
HAL_StatusTypeDef status = HAL_OK;
|
HAL_StatusTypeDef status = HAL_OK;
|
||||||
HAL_NOR_StateTypeDef state;
|
HAL_NOR_StateTypeDef state;
|
||||||
|
|
||||||
/* Process locked */
|
|
||||||
__HAL_LOCK(hnor);
|
|
||||||
|
|
||||||
state = hnor->State;
|
state = hnor->State;
|
||||||
if ((state == HAL_NOR_STATE_READY) || (state == HAL_NOR_STATE_RESET) || (state == HAL_NOR_STATE_PROTECTED))
|
if ((state == HAL_NOR_STATE_READY) || (state == HAL_NOR_STATE_RESET) || (state == HAL_NOR_STATE_PROTECTED))
|
||||||
{
|
{
|
||||||
@ -1401,8 +1393,6 @@ HAL_StatusTypeDef HAL_NOR_UnRegisterCallback(NOR_HandleTypeDef *hnor, HAL_NOR_Ca
|
|||||||
status = HAL_ERROR;
|
status = HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Release Lock */
|
|
||||||
__HAL_UNLOCK(hnor);
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
#endif /* (USE_HAL_NOR_REGISTER_CALLBACKS) */
|
#endif /* (USE_HAL_NOR_REGISTER_CALLBACKS) */
|
||||||
@ -1533,7 +1523,7 @@ HAL_NOR_StateTypeDef HAL_NOR_GetState(const NOR_HandleTypeDef *hnor)
|
|||||||
* @retval NOR_Status The returned value can be: HAL_NOR_STATUS_SUCCESS, HAL_NOR_STATUS_ERROR
|
* @retval NOR_Status The returned value can be: HAL_NOR_STATUS_SUCCESS, HAL_NOR_STATUS_ERROR
|
||||||
* or HAL_NOR_STATUS_TIMEOUT
|
* or HAL_NOR_STATUS_TIMEOUT
|
||||||
*/
|
*/
|
||||||
HAL_NOR_StatusTypeDef HAL_NOR_GetStatus(const NOR_HandleTypeDef *hnor, uint32_t Address, uint32_t Timeout)
|
HAL_NOR_StatusTypeDef HAL_NOR_GetStatus(NOR_HandleTypeDef *hnor, uint32_t Address, uint32_t Timeout)
|
||||||
{
|
{
|
||||||
HAL_NOR_StatusTypeDef status = HAL_NOR_STATUS_ONGOING;
|
HAL_NOR_StatusTypeDef status = HAL_NOR_STATUS_ONGOING;
|
||||||
uint16_t tmpsr1;
|
uint16_t tmpsr1;
|
||||||
|
@ -1311,7 +1311,7 @@ HAL_StatusTypeDef HAL_PCD_EP_Receive(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, u
|
|||||||
* @param ep_addr endpoint address
|
* @param ep_addr endpoint address
|
||||||
* @retval Data Size
|
* @retval Data Size
|
||||||
*/
|
*/
|
||||||
uint32_t HAL_PCD_EP_GetRxCount(PCD_HandleTypeDef *hpcd, uint8_t ep_addr)
|
uint32_t HAL_PCD_EP_GetRxCount(PCD_HandleTypeDef const *hpcd, uint8_t ep_addr)
|
||||||
{
|
{
|
||||||
return hpcd->OUT_ep[ep_addr & EP_ADDR_MSK].xfer_count;
|
return hpcd->OUT_ep[ep_addr & EP_ADDR_MSK].xfer_count;
|
||||||
}
|
}
|
||||||
@ -1451,9 +1451,18 @@ HAL_StatusTypeDef HAL_PCD_EP_Abort(PCD_HandleTypeDef *hpcd, uint8_t ep_addr)
|
|||||||
*/
|
*/
|
||||||
HAL_StatusTypeDef HAL_PCD_EP_Flush(PCD_HandleTypeDef *hpcd, uint8_t ep_addr)
|
HAL_StatusTypeDef HAL_PCD_EP_Flush(PCD_HandleTypeDef *hpcd, uint8_t ep_addr)
|
||||||
{
|
{
|
||||||
/* Prevent unused argument(s) compilation warning */
|
__HAL_LOCK(hpcd);
|
||||||
UNUSED(hpcd);
|
|
||||||
UNUSED(ep_addr);
|
if ((ep_addr & 0x80U) == 0x80U)
|
||||||
|
{
|
||||||
|
(void)USB_FlushTxFifo(hpcd->Instance, (uint32_t)ep_addr & EP_ADDR_MSK);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
(void)USB_FlushRxFifo(hpcd->Instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
__HAL_UNLOCK(hpcd);
|
||||||
|
|
||||||
return HAL_OK;
|
return HAL_OK;
|
||||||
}
|
}
|
||||||
@ -1502,7 +1511,7 @@ HAL_StatusTypeDef HAL_PCD_DeActivateRemoteWakeup(PCD_HandleTypeDef *hpcd)
|
|||||||
* @param hpcd PCD handle
|
* @param hpcd PCD handle
|
||||||
* @retval HAL state
|
* @retval HAL state
|
||||||
*/
|
*/
|
||||||
PCD_StateTypeDef HAL_PCD_GetState(PCD_HandleTypeDef *hpcd)
|
PCD_StateTypeDef HAL_PCD_GetState(PCD_HandleTypeDef const *hpcd)
|
||||||
{
|
{
|
||||||
return hpcd->State;
|
return hpcd->State;
|
||||||
}
|
}
|
||||||
|
@ -283,6 +283,9 @@ void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry)
|
|||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
assert_param(IS_PWR_SLEEP_ENTRY(SLEEPEntry));
|
assert_param(IS_PWR_SLEEP_ENTRY(SLEEPEntry));
|
||||||
|
|
||||||
|
/* Prevent unused argument(s) compilation warning */
|
||||||
|
UNUSED(Regulator);
|
||||||
|
|
||||||
/* Clear SLEEPDEEP bit of Cortex System Control Register */
|
/* Clear SLEEPDEEP bit of Cortex System Control Register */
|
||||||
SCB->SCR &= (uint32_t)~((uint32_t)SCB_SCR_SLEEPDEEP_Msk);
|
SCB->SCR &= (uint32_t)~((uint32_t)SCB_SCR_SLEEPDEEP_Msk);
|
||||||
|
|
||||||
|
@ -892,6 +892,9 @@ void HAL_RCC_MCOConfig(uint32_t RCC_MCOx, uint32_t RCC_MCOSource, uint32_t RCC_M
|
|||||||
assert_param(IS_RCC_MCODIV(RCC_MCODiv));
|
assert_param(IS_RCC_MCODIV(RCC_MCODiv));
|
||||||
assert_param(IS_RCC_MCO1SOURCE(RCC_MCOSource));
|
assert_param(IS_RCC_MCO1SOURCE(RCC_MCOSource));
|
||||||
|
|
||||||
|
/* Prevent unused argument(s) compilation warning */
|
||||||
|
UNUSED(RCC_MCOx);
|
||||||
|
|
||||||
/* Configure the MCO1 pin in alternate function mode */
|
/* Configure the MCO1 pin in alternate function mode */
|
||||||
gpio.Mode = GPIO_MODE_AF_PP;
|
gpio.Mode = GPIO_MODE_AF_PP;
|
||||||
gpio.Speed = GPIO_SPEED_FREQ_HIGH;
|
gpio.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||||
@ -977,8 +980,8 @@ uint32_t HAL_RCC_GetSysClockFreq(void)
|
|||||||
}
|
}
|
||||||
case RCC_SYSCLKSOURCE_STATUS_PLLCLK: /* PLL used as system clock */
|
case RCC_SYSCLKSOURCE_STATUS_PLLCLK: /* PLL used as system clock */
|
||||||
{
|
{
|
||||||
pllmul = aPLLMULFactorTable[(uint32_t)(tmpreg & RCC_CFGR_PLLMUL) >> POSITION_VAL(RCC_CFGR_PLLMUL)];
|
pllmul = aPLLMULFactorTable[(uint32_t)(tmpreg & RCC_CFGR_PLLMUL) >> RCC_CFGR_PLLMUL_Pos];
|
||||||
prediv = aPredivFactorTable[(uint32_t)(RCC->CFGR2 & RCC_CFGR2_PREDIV) >> POSITION_VAL(RCC_CFGR2_PREDIV)];
|
prediv = aPredivFactorTable[(uint32_t)(RCC->CFGR2 & RCC_CFGR2_PREDIV) >> RCC_CFGR2_PREDIV_Pos];
|
||||||
#if defined(RCC_CFGR_PLLSRC_HSI_DIV2)
|
#if defined(RCC_CFGR_PLLSRC_HSI_DIV2)
|
||||||
if ((tmpreg & RCC_CFGR_PLLSRC) != RCC_PLLSOURCE_HSI)
|
if ((tmpreg & RCC_CFGR_PLLSRC) != RCC_PLLSOURCE_HSI)
|
||||||
{
|
{
|
||||||
@ -1097,7 +1100,7 @@ void HAL_RCC_GetOscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct)
|
|||||||
RCC_OscInitStruct->HSIState = RCC_HSI_OFF;
|
RCC_OscInitStruct->HSIState = RCC_HSI_OFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
RCC_OscInitStruct->HSICalibrationValue = (uint32_t)((RCC->CR & RCC_CR_HSITRIM) >> POSITION_VAL(RCC_CR_HSITRIM));
|
RCC_OscInitStruct->HSICalibrationValue = (uint32_t)((RCC->CR & RCC_CR_HSITRIM) >> RCC_CR_HSITRIM_Pos);
|
||||||
|
|
||||||
/* Get the LSE configuration -----------------------------------------------*/
|
/* Get the LSE configuration -----------------------------------------------*/
|
||||||
if((RCC->BDCR &RCC_BDCR_LSEBYP) == RCC_BDCR_LSEBYP)
|
if((RCC->BDCR &RCC_BDCR_LSEBYP) == RCC_BDCR_LSEBYP)
|
||||||
|
@ -1247,12 +1247,12 @@ uint32_t HAL_RCCEx_GetPeriphCLKFreq(uint32_t PeriphClk)
|
|||||||
if (HAL_IS_BIT_SET(RCC->CR, RCC_CR_PLLRDY))
|
if (HAL_IS_BIT_SET(RCC->CR, RCC_CR_PLLRDY))
|
||||||
{
|
{
|
||||||
/* Frequency is the PLL frequency divided by ADC prescaler (1U/2U/4U/6U/8U/10U/12U/16U/32U/64U/128U/256U) */
|
/* Frequency is the PLL frequency divided by ADC prescaler (1U/2U/4U/6U/8U/10U/12U/16U/32U/64U/128U/256U) */
|
||||||
frequency = RCC_GetPLLCLKFreq() / adc_pll_prediv_table[(srcclk >> POSITION_VAL(RCC_CFGR2_ADC1PRES)) & 0xFU];
|
frequency = RCC_GetPLLCLKFreq() / adc_pll_prediv_table[(srcclk >> RCC_CFGR2_ADC1PRES_Pos) & 0xFU];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else /* RCC_CFGR_ADCPRE */
|
#else /* RCC_CFGR_ADCPRE */
|
||||||
/* ADC1 is set to PLCK2 frequency divided by 2U/4U/6U/8U */
|
/* ADC1 is set to PLCK2 frequency divided by 2U/4U/6U/8U */
|
||||||
frequency = HAL_RCC_GetPCLK2Freq() / (((srcclk >> POSITION_VAL(RCC_CFGR_ADCPRE)) + 1U) * 2U);
|
frequency = HAL_RCC_GetPCLK2Freq() / (((srcclk >> RCC_CFGR_ADCPRE_Pos) + 1U) * 2U);
|
||||||
#endif /* RCC_CFGR2_ADC1PRES */
|
#endif /* RCC_CFGR2_ADC1PRES */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1274,7 +1274,7 @@ uint32_t HAL_RCCEx_GetPeriphCLKFreq(uint32_t PeriphClk)
|
|||||||
if (HAL_IS_BIT_SET(RCC->CR, RCC_CR_PLLRDY))
|
if (HAL_IS_BIT_SET(RCC->CR, RCC_CR_PLLRDY))
|
||||||
{
|
{
|
||||||
/* Frequency is the PLL frequency divided by ADC prescaler (1U/2U/4U/6/8U/10U/12U/16U/32U/64U/128U/256U) */
|
/* Frequency is the PLL frequency divided by ADC prescaler (1U/2U/4U/6/8U/10U/12U/16U/32U/64U/128U/256U) */
|
||||||
frequency = RCC_GetPLLCLKFreq() / adc_pll_prediv_table[(srcclk >> POSITION_VAL(RCC_CFGR2_ADCPRE12)) & 0xF];
|
frequency = RCC_GetPLLCLKFreq() / adc_pll_prediv_table[(srcclk >> RCC_CFGR2_ADCPRE12_Pos) & 0xF];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1297,7 +1297,7 @@ uint32_t HAL_RCCEx_GetPeriphCLKFreq(uint32_t PeriphClk)
|
|||||||
if (HAL_IS_BIT_SET(RCC->CR, RCC_CR_PLLRDY))
|
if (HAL_IS_BIT_SET(RCC->CR, RCC_CR_PLLRDY))
|
||||||
{
|
{
|
||||||
/* Frequency is the PLL frequency divided by ADC prescaler (1U/2U/4U/6U/8U/10U/12U/16U/32U/64U/128U/256U) */
|
/* Frequency is the PLL frequency divided by ADC prescaler (1U/2U/4U/6U/8U/10U/12U/16U/32U/64U/128U/256U) */
|
||||||
frequency = RCC_GetPLLCLKFreq() / adc_pll_prediv_table[(srcclk >> POSITION_VAL(RCC_CFGR2_ADCPRE34)) & 0xF];
|
frequency = RCC_GetPLLCLKFreq() / adc_pll_prediv_table[(srcclk >> RCC_CFGR2_ADCPRE34_Pos) & 0xF];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1480,7 +1480,7 @@ uint32_t HAL_RCCEx_GetPeriphCLKFreq(uint32_t PeriphClk)
|
|||||||
/* Get the current SDADC source */
|
/* Get the current SDADC source */
|
||||||
srcclk = __HAL_RCC_GET_SDADC_SOURCE();
|
srcclk = __HAL_RCC_GET_SDADC_SOURCE();
|
||||||
/* Frequency is the system frequency divided by SDADC prescaler (2U/4U/6U/8U/10U/12U/14U/16U/20U/24U/28U/32U/36U/40U/44U/48U) */
|
/* Frequency is the system frequency divided by SDADC prescaler (2U/4U/6U/8U/10U/12U/14U/16U/20U/24U/28U/32U/36U/40U/44U/48U) */
|
||||||
frequency = SystemCoreClock / sdadc_prescaler_table[(srcclk >> POSITION_VAL(RCC_CFGR_SDPRE)) & 0xF];
|
frequency = SystemCoreClock / sdadc_prescaler_table[(srcclk >> RCC_CFGR_SDPRE_Pos) & 0xF];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif /* RCC_CFGR_SDPRE */
|
#endif /* RCC_CFGR_SDPRE */
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities of the Real-Time Clock (RTC) peripheral:
|
* functionalities of the Real-Time Clock (RTC) peripheral:
|
||||||
* + Initialization and de-initialization functions
|
* + Initialization and de-initialization functions
|
||||||
* + RTC Calendar (Time and Date) configuration functions
|
* + Calendar (Time and Date) configuration functions
|
||||||
* + RTC Alarms (Alarm A and Alarm B) configuration functions
|
* + Alarms (Alarm A and Alarm B) configuration functions
|
||||||
* + Peripheral Control functions
|
* + Peripheral Control functions
|
||||||
* + Peripheral State functions
|
* + Peripheral State functions
|
||||||
*
|
*
|
||||||
@ -63,7 +63,7 @@
|
|||||||
|
|
||||||
##### Backup Domain Access #####
|
##### Backup Domain Access #####
|
||||||
==================================================================
|
==================================================================
|
||||||
[..] After reset, the backup domain (RTC registers, RTC backup data registers
|
[..] After reset, the backup domain (RTC registers and RTC backup data registers)
|
||||||
is protected against possible unwanted write accesses.
|
is protected against possible unwanted write accesses.
|
||||||
[..] To enable access to the RTC Domain and RTC registers, proceed as follows:
|
[..] To enable access to the RTC Domain and RTC registers, proceed as follows:
|
||||||
(+) Enable the Power Controller (PWR) APB1 interface clock using the
|
(+) Enable the Power Controller (PWR) APB1 interface clock using the
|
||||||
@ -121,6 +121,12 @@
|
|||||||
*** Callback registration ***
|
*** Callback registration ***
|
||||||
=============================================
|
=============================================
|
||||||
[..]
|
[..]
|
||||||
|
When the compilation define USE_HAL_RTC_REGISTER_CALLBACKS is set to 0 or
|
||||||
|
not defined, the callback registration feature is not available and all
|
||||||
|
callbacks are set to the corresponding weak functions.
|
||||||
|
This is the recommended configuration in order to optimize memory/code
|
||||||
|
consumption footprint/performances.
|
||||||
|
[..]
|
||||||
The compilation define USE_HAL_RTC_REGISTER_CALLBACKS when set to 1
|
The compilation define USE_HAL_RTC_REGISTER_CALLBACKS when set to 1
|
||||||
allows the user to configure dynamically the driver callbacks.
|
allows the user to configure dynamically the driver callbacks.
|
||||||
Use Function HAL_RTC_RegisterCallback() to register an interrupt callback.
|
Use Function HAL_RTC_RegisterCallback() to register an interrupt callback.
|
||||||
@ -132,9 +138,11 @@
|
|||||||
(+) WakeUpTimerEventCallback : RTC WakeUpTimer Event callback.
|
(+) WakeUpTimerEventCallback : RTC WakeUpTimer Event callback.
|
||||||
(+) Tamper1EventCallback : RTC Tamper 1 Event callback.
|
(+) Tamper1EventCallback : RTC Tamper 1 Event callback.
|
||||||
(+) Tamper2EventCallback : RTC Tamper 2 Event callback.
|
(+) Tamper2EventCallback : RTC Tamper 2 Event callback.
|
||||||
(+) Tamper3EventCallback : RTC Tamper 3 Event callback.
|
(+) Tamper3EventCallback : RTC Tamper 3 Event callback. (*)
|
||||||
(+) MspInitCallback : RTC MspInit callback.
|
(+) MspInitCallback : RTC MspInit callback.
|
||||||
(+) MspDeInitCallback : RTC MspDeInit callback.
|
(+) MspDeInitCallback : RTC MspDeInit callback.
|
||||||
|
|
||||||
|
(*) value not applicable to all devices.
|
||||||
[..]
|
[..]
|
||||||
This function takes as parameters the HAL peripheral handle, the Callback ID
|
This function takes as parameters the HAL peripheral handle, the Callback ID
|
||||||
and a pointer to the user callback function.
|
and a pointer to the user callback function.
|
||||||
@ -150,31 +158,29 @@
|
|||||||
(+) WakeUpTimerEventCallback : RTC WakeUpTimer Event callback.
|
(+) WakeUpTimerEventCallback : RTC WakeUpTimer Event callback.
|
||||||
(+) Tamper1EventCallback : RTC Tamper 1 Event callback.
|
(+) Tamper1EventCallback : RTC Tamper 1 Event callback.
|
||||||
(+) Tamper2EventCallback : RTC Tamper 2 Event callback.
|
(+) Tamper2EventCallback : RTC Tamper 2 Event callback.
|
||||||
(+) Tamper3EventCallback : RTC Tamper 3 Event callback.
|
(+) Tamper3EventCallback : RTC Tamper 3 Event callback. (*)
|
||||||
(+) MspInitCallback : RTC MspInit callback.
|
(+) MspInitCallback : RTC MspInit callback.
|
||||||
(+) MspDeInitCallback : RTC MspDeInit callback.
|
(+) MspDeInitCallback : RTC MspDeInit callback.
|
||||||
|
|
||||||
|
(*) value not applicable to all devices.
|
||||||
[..]
|
[..]
|
||||||
By default, after the HAL_RTC_Init() and when the state is HAL_RTC_STATE_RESET,
|
By default, after the HAL_RTC_Init() and when the state is HAL_RTC_STATE_RESET,
|
||||||
all callbacks are set to the corresponding weak functions:
|
all callbacks are set to the corresponding weak functions:
|
||||||
examples AlarmAEventCallback(), WakeUpTimerEventCallback().
|
examples AlarmAEventCallback(), TimeStampEventCallback().
|
||||||
Exception done for MspInit() and MspDeInit() callbacks that are reset to the
|
Exception done for MspInit() and MspDeInit() callbacks that are reset to the
|
||||||
legacy weak function in the HAL_RTC_Init()/HAL_RTC_DeInit() only
|
legacy weak function in the HAL_RTC_Init()/HAL_RTC_DeInit() only when these
|
||||||
when these callbacks are null (not registered beforehand).
|
callbacks are null (not registered beforehand).
|
||||||
If not, MspInit() or MspDeInit() are not null, HAL_RTC_Init()/HAL_RTC_DeInit()
|
If not, MspInit() or MspDeInit() are not null, HAL_RTC_Init()/HAL_RTC_DeInit()
|
||||||
keep and use the user MspInit()/MspDeInit() callbacks (registered beforehand).
|
keep and use the user MspInit()/MspDeInit() callbacks (registered beforehand).
|
||||||
[..]
|
[..]
|
||||||
Callbacks can be registered/unregistered in HAL_RTC_STATE_READY state only.
|
Callbacks can be registered/unregistered in HAL_RTC_STATE_READY state only.
|
||||||
Exception done MspInit()/MspDeInit() that can be registered/unregistered
|
Exception done for MspInit() and MspDeInit() that can be registered/unregistered
|
||||||
in HAL_RTC_STATE_READY or HAL_RTC_STATE_RESET state.
|
in HAL_RTC_STATE_READY or HAL_RTC_STATE_RESET state.
|
||||||
Thus registered (user) MspInit()/MspDeInit() callbacks can be used during the
|
Thus registered (user) MspInit()/MspDeInit() callbacks can be used during the
|
||||||
Init/DeInit.
|
Init/DeInit.
|
||||||
In that case first register the MspInit()/MspDeInit() user callbacks
|
In that case first register the MspInit()/MspDeInit() user callbacks using
|
||||||
using HAL_RTC_RegisterCallback() before calling HAL_RTC_DeInit()
|
HAL_RTC_RegisterCallback() before calling HAL_RTC_DeInit() or HAL_RTC_Init()
|
||||||
or HAL_RTC_Init() functions.
|
functions.
|
||||||
[..]
|
|
||||||
When The compilation define USE_HAL_RTC_REGISTER_CALLBACKS is set to 0 or
|
|
||||||
not defined, the callback registration feature is not available and all
|
|
||||||
callbacks are set to the corresponding weak functions.
|
|
||||||
|
|
||||||
@endverbatim
|
@endverbatim
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
@ -437,12 +443,13 @@ HAL_StatusTypeDef HAL_RTC_DeInit(RTC_HandleTypeDef *hrtc)
|
|||||||
* @arg @ref HAL_RTC_ALARM_B_EVENT_CB_ID Alarm B Event Callback ID
|
* @arg @ref HAL_RTC_ALARM_B_EVENT_CB_ID Alarm B Event Callback ID
|
||||||
* @arg @ref HAL_RTC_TIMESTAMP_EVENT_CB_ID Timestamp Event Callback ID
|
* @arg @ref HAL_RTC_TIMESTAMP_EVENT_CB_ID Timestamp Event Callback ID
|
||||||
* @arg @ref HAL_RTC_WAKEUPTIMER_EVENT_CB_ID Wakeup Timer Event Callback ID
|
* @arg @ref HAL_RTC_WAKEUPTIMER_EVENT_CB_ID Wakeup Timer Event Callback ID
|
||||||
* @arg @ref HAL_RTC_TAMPER1_EVENT_CB_ID Tamper 1 Callback ID
|
* @arg @ref HAL_RTC_TAMPER1_EVENT_CB_ID Tamper 1 Event Callback ID
|
||||||
* @arg @ref HAL_RTC_TAMPER2_EVENT_CB_ID Tamper 2 Callback ID
|
* @arg @ref HAL_RTC_TAMPER2_EVENT_CB_ID Tamper 2 Event Callback ID
|
||||||
* @arg @ref HAL_RTC_TAMPER3_EVENT_CB_ID Tamper 3 Callback ID
|
* @arg @ref HAL_RTC_TAMPER3_EVENT_CB_ID Tamper 3 Event Callback ID (*)
|
||||||
* @arg @ref HAL_RTC_MSPINIT_CB_ID Msp Init callback ID
|
* @arg @ref HAL_RTC_MSPINIT_CB_ID MSP Init callback ID
|
||||||
* @arg @ref HAL_RTC_MSPDEINIT_CB_ID Msp DeInit callback ID
|
* @arg @ref HAL_RTC_MSPDEINIT_CB_ID MSP DeInit callback ID
|
||||||
* @note HAL_RTC_TAMPER3_EVENT_CB_ID is not applicable to all devices.
|
*
|
||||||
|
* (*) value not applicable to all devices.
|
||||||
* @param pCallback pointer to the Callback function
|
* @param pCallback pointer to the Callback function
|
||||||
* @retval HAL status
|
* @retval HAL status
|
||||||
*/
|
*/
|
||||||
@ -547,12 +554,13 @@ HAL_StatusTypeDef HAL_RTC_RegisterCallback(RTC_HandleTypeDef *hrtc, HAL_RTC_Call
|
|||||||
* @arg @ref HAL_RTC_ALARM_B_EVENT_CB_ID Alarm B Event Callback ID
|
* @arg @ref HAL_RTC_ALARM_B_EVENT_CB_ID Alarm B Event Callback ID
|
||||||
* @arg @ref HAL_RTC_TIMESTAMP_EVENT_CB_ID Timestamp Event Callback ID
|
* @arg @ref HAL_RTC_TIMESTAMP_EVENT_CB_ID Timestamp Event Callback ID
|
||||||
* @arg @ref HAL_RTC_WAKEUPTIMER_EVENT_CB_ID Wakeup Timer Event Callback ID
|
* @arg @ref HAL_RTC_WAKEUPTIMER_EVENT_CB_ID Wakeup Timer Event Callback ID
|
||||||
* @arg @ref HAL_RTC_TAMPER1_EVENT_CB_ID Tamper 1 Callback ID
|
* @arg @ref HAL_RTC_TAMPER1_EVENT_CB_ID Tamper 1 Event Callback ID
|
||||||
* @arg @ref HAL_RTC_TAMPER2_EVENT_CB_ID Tamper 2 Callback ID
|
* @arg @ref HAL_RTC_TAMPER2_EVENT_CB_ID Tamper 2 Event Callback ID
|
||||||
* @arg @ref HAL_RTC_TAMPER3_EVENT_CB_ID Tamper 3 Callback ID
|
* @arg @ref HAL_RTC_TAMPER3_EVENT_CB_ID Tamper 3 Event Callback ID (*)
|
||||||
* @arg @ref HAL_RTC_MSPINIT_CB_ID Msp Init callback ID
|
* @arg @ref HAL_RTC_MSPINIT_CB_ID MSP Init callback ID
|
||||||
* @arg @ref HAL_RTC_MSPDEINIT_CB_ID Msp DeInit callback ID
|
* @arg @ref HAL_RTC_MSPDEINIT_CB_ID MSP DeInit callback ID
|
||||||
* @note HAL_RTC_TAMPER3_EVENT_CB_ID is not applicable to all devices.
|
*
|
||||||
|
* (*) value not applicable to all devices.
|
||||||
* @retval HAL status
|
* @retval HAL status
|
||||||
*/
|
*/
|
||||||
HAL_StatusTypeDef HAL_RTC_UnRegisterCallback(RTC_HandleTypeDef *hrtc, HAL_RTC_CallbackIDTypeDef CallbackID)
|
HAL_StatusTypeDef HAL_RTC_UnRegisterCallback(RTC_HandleTypeDef *hrtc, HAL_RTC_CallbackIDTypeDef CallbackID)
|
||||||
@ -1059,7 +1067,7 @@ HAL_StatusTypeDef HAL_RTC_SetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sA
|
|||||||
tmpreg = (((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmTime.Hours) << RTC_ALRMAR_HU_Pos) | \
|
tmpreg = (((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmTime.Hours) << RTC_ALRMAR_HU_Pos) | \
|
||||||
((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmTime.Minutes) << RTC_ALRMAR_MNU_Pos) | \
|
((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmTime.Minutes) << RTC_ALRMAR_MNU_Pos) | \
|
||||||
((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmTime.Seconds)) | \
|
((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmTime.Seconds)) | \
|
||||||
((uint32_t)(sAlarm->AlarmTime.TimeFormat) << RTC_TR_PM_Pos) | \
|
((uint32_t)(sAlarm->AlarmTime.TimeFormat) << RTC_ALRMAR_PM_Pos) | \
|
||||||
((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmDateWeekDay) << RTC_ALRMAR_DU_Pos) | \
|
((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmDateWeekDay) << RTC_ALRMAR_DU_Pos) | \
|
||||||
((uint32_t)sAlarm->AlarmDateWeekDaySel) | \
|
((uint32_t)sAlarm->AlarmDateWeekDaySel) | \
|
||||||
((uint32_t)sAlarm->AlarmMask));
|
((uint32_t)sAlarm->AlarmMask));
|
||||||
@ -1092,7 +1100,7 @@ HAL_StatusTypeDef HAL_RTC_SetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sA
|
|||||||
tmpreg = (((uint32_t)(sAlarm->AlarmTime.Hours) << RTC_ALRMAR_HU_Pos) | \
|
tmpreg = (((uint32_t)(sAlarm->AlarmTime.Hours) << RTC_ALRMAR_HU_Pos) | \
|
||||||
((uint32_t)(sAlarm->AlarmTime.Minutes) << RTC_ALRMAR_MNU_Pos) | \
|
((uint32_t)(sAlarm->AlarmTime.Minutes) << RTC_ALRMAR_MNU_Pos) | \
|
||||||
((uint32_t) sAlarm->AlarmTime.Seconds) | \
|
((uint32_t) sAlarm->AlarmTime.Seconds) | \
|
||||||
((uint32_t)(sAlarm->AlarmTime.TimeFormat) << RTC_TR_PM_Pos) | \
|
((uint32_t)(sAlarm->AlarmTime.TimeFormat) << RTC_ALRMAR_PM_Pos) | \
|
||||||
((uint32_t)(sAlarm->AlarmDateWeekDay) << RTC_ALRMAR_DU_Pos) | \
|
((uint32_t)(sAlarm->AlarmDateWeekDay) << RTC_ALRMAR_DU_Pos) | \
|
||||||
((uint32_t) sAlarm->AlarmDateWeekDaySel) | \
|
((uint32_t) sAlarm->AlarmDateWeekDaySel) | \
|
||||||
((uint32_t) sAlarm->AlarmMask));
|
((uint32_t) sAlarm->AlarmMask));
|
||||||
@ -1105,16 +1113,15 @@ HAL_StatusTypeDef HAL_RTC_SetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sA
|
|||||||
/* Disable the write protection for RTC registers */
|
/* Disable the write protection for RTC registers */
|
||||||
__HAL_RTC_WRITEPROTECTION_DISABLE(hrtc);
|
__HAL_RTC_WRITEPROTECTION_DISABLE(hrtc);
|
||||||
|
|
||||||
/* Configure the Alarm register */
|
|
||||||
if (sAlarm->Alarm == RTC_ALARM_A)
|
if (sAlarm->Alarm == RTC_ALARM_A)
|
||||||
{
|
{
|
||||||
/* Disable the Alarm A */
|
/* Disable Alarm A */
|
||||||
__HAL_RTC_ALARMA_DISABLE(hrtc);
|
__HAL_RTC_ALARMA_DISABLE(hrtc);
|
||||||
|
|
||||||
/* In case interrupt mode is used, the interrupt source must be disabled */
|
/* In case interrupt mode is used, the interrupt source must be disabled */
|
||||||
__HAL_RTC_ALARM_DISABLE_IT(hrtc, RTC_IT_ALRA);
|
__HAL_RTC_ALARM_DISABLE_IT(hrtc, RTC_IT_ALRA);
|
||||||
|
|
||||||
/* Clear the Alarm flag */
|
/* Clear Alarm A flag */
|
||||||
__HAL_RTC_ALARM_CLEAR_FLAG(hrtc, RTC_FLAG_ALRAF);
|
__HAL_RTC_ALARM_CLEAR_FLAG(hrtc, RTC_FLAG_ALRAF);
|
||||||
|
|
||||||
/* Get tick */
|
/* Get tick */
|
||||||
@ -1137,21 +1144,22 @@ HAL_StatusTypeDef HAL_RTC_SetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sA
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Configure Alarm A register */
|
||||||
hrtc->Instance->ALRMAR = (uint32_t)tmpreg;
|
hrtc->Instance->ALRMAR = (uint32_t)tmpreg;
|
||||||
/* Configure the Alarm A Subseconds register */
|
/* Configure Alarm A Subseconds register */
|
||||||
hrtc->Instance->ALRMASSR = subsecondtmpreg;
|
hrtc->Instance->ALRMASSR = subsecondtmpreg;
|
||||||
/* Configure the Alarm state: Enable Alarm */
|
/* Enable Alarm A */
|
||||||
__HAL_RTC_ALARMA_ENABLE(hrtc);
|
__HAL_RTC_ALARMA_ENABLE(hrtc);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Disable the Alarm B */
|
/* Disable Alarm B */
|
||||||
__HAL_RTC_ALARMB_DISABLE(hrtc);
|
__HAL_RTC_ALARMB_DISABLE(hrtc);
|
||||||
|
|
||||||
/* In case interrupt mode is used, the interrupt source must be disabled */
|
/* In case interrupt mode is used, the interrupt source must be disabled */
|
||||||
__HAL_RTC_ALARM_DISABLE_IT(hrtc, RTC_IT_ALRB);
|
__HAL_RTC_ALARM_DISABLE_IT(hrtc, RTC_IT_ALRB);
|
||||||
|
|
||||||
/* Clear the Alarm flag */
|
/* Clear Alarm B flag */
|
||||||
__HAL_RTC_ALARM_CLEAR_FLAG(hrtc, RTC_FLAG_ALRBF);
|
__HAL_RTC_ALARM_CLEAR_FLAG(hrtc, RTC_FLAG_ALRBF);
|
||||||
|
|
||||||
/* Get tick */
|
/* Get tick */
|
||||||
@ -1174,10 +1182,11 @@ HAL_StatusTypeDef HAL_RTC_SetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sA
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Configure Alarm B register */
|
||||||
hrtc->Instance->ALRMBR = (uint32_t)tmpreg;
|
hrtc->Instance->ALRMBR = (uint32_t)tmpreg;
|
||||||
/* Configure the Alarm B Subseconds register */
|
/* Configure Alarm B Subseconds register */
|
||||||
hrtc->Instance->ALRMBSSR = subsecondtmpreg;
|
hrtc->Instance->ALRMBSSR = subsecondtmpreg;
|
||||||
/* Configure the Alarm state: Enable Alarm */
|
/* Enable Alarm B */
|
||||||
__HAL_RTC_ALARMB_ENABLE(hrtc);
|
__HAL_RTC_ALARMB_ENABLE(hrtc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1256,7 +1265,7 @@ HAL_StatusTypeDef HAL_RTC_SetAlarm_IT(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef
|
|||||||
tmpreg = (((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmTime.Hours) << RTC_ALRMAR_HU_Pos) | \
|
tmpreg = (((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmTime.Hours) << RTC_ALRMAR_HU_Pos) | \
|
||||||
((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmTime.Minutes) << RTC_ALRMAR_MNU_Pos) | \
|
((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmTime.Minutes) << RTC_ALRMAR_MNU_Pos) | \
|
||||||
((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmTime.Seconds)) | \
|
((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmTime.Seconds)) | \
|
||||||
((uint32_t)(sAlarm->AlarmTime.TimeFormat) << RTC_TR_PM_Pos) | \
|
((uint32_t)(sAlarm->AlarmTime.TimeFormat) << RTC_ALRMAR_PM_Pos) | \
|
||||||
((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmDateWeekDay) << RTC_ALRMAR_DU_Pos) | \
|
((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmDateWeekDay) << RTC_ALRMAR_DU_Pos) | \
|
||||||
((uint32_t)sAlarm->AlarmDateWeekDaySel) | \
|
((uint32_t)sAlarm->AlarmDateWeekDaySel) | \
|
||||||
((uint32_t)sAlarm->AlarmMask));
|
((uint32_t)sAlarm->AlarmMask));
|
||||||
@ -1289,7 +1298,7 @@ HAL_StatusTypeDef HAL_RTC_SetAlarm_IT(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef
|
|||||||
tmpreg = (((uint32_t)(sAlarm->AlarmTime.Hours) << RTC_ALRMAR_HU_Pos) | \
|
tmpreg = (((uint32_t)(sAlarm->AlarmTime.Hours) << RTC_ALRMAR_HU_Pos) | \
|
||||||
((uint32_t)(sAlarm->AlarmTime.Minutes) << RTC_ALRMAR_MNU_Pos) | \
|
((uint32_t)(sAlarm->AlarmTime.Minutes) << RTC_ALRMAR_MNU_Pos) | \
|
||||||
((uint32_t) sAlarm->AlarmTime.Seconds) | \
|
((uint32_t) sAlarm->AlarmTime.Seconds) | \
|
||||||
((uint32_t)(sAlarm->AlarmTime.TimeFormat) << RTC_TR_PM_Pos) | \
|
((uint32_t)(sAlarm->AlarmTime.TimeFormat) << RTC_ALRMAR_PM_Pos) | \
|
||||||
((uint32_t)(sAlarm->AlarmDateWeekDay) << RTC_ALRMAR_DU_Pos) | \
|
((uint32_t)(sAlarm->AlarmDateWeekDay) << RTC_ALRMAR_DU_Pos) | \
|
||||||
((uint32_t) sAlarm->AlarmDateWeekDaySel) | \
|
((uint32_t) sAlarm->AlarmDateWeekDaySel) | \
|
||||||
((uint32_t) sAlarm->AlarmMask));
|
((uint32_t) sAlarm->AlarmMask));
|
||||||
@ -1302,13 +1311,12 @@ HAL_StatusTypeDef HAL_RTC_SetAlarm_IT(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef
|
|||||||
/* Disable the write protection for RTC registers */
|
/* Disable the write protection for RTC registers */
|
||||||
__HAL_RTC_WRITEPROTECTION_DISABLE(hrtc);
|
__HAL_RTC_WRITEPROTECTION_DISABLE(hrtc);
|
||||||
|
|
||||||
/* Configure the Alarm register */
|
|
||||||
if (sAlarm->Alarm == RTC_ALARM_A)
|
if (sAlarm->Alarm == RTC_ALARM_A)
|
||||||
{
|
{
|
||||||
/* Disable the Alarm A */
|
/* Disable Alarm A */
|
||||||
__HAL_RTC_ALARMA_DISABLE(hrtc);
|
__HAL_RTC_ALARMA_DISABLE(hrtc);
|
||||||
|
|
||||||
/* Clear the Alarm flag */
|
/* Clear Alarm A flag */
|
||||||
__HAL_RTC_ALARM_CLEAR_FLAG(hrtc, RTC_FLAG_ALRAF);
|
__HAL_RTC_ALARM_CLEAR_FLAG(hrtc, RTC_FLAG_ALRAF);
|
||||||
|
|
||||||
/* Wait till RTC ALRAWF flag is set and if timeout is reached exit */
|
/* Wait till RTC ALRAWF flag is set and if timeout is reached exit */
|
||||||
@ -1329,20 +1337,21 @@ HAL_StatusTypeDef HAL_RTC_SetAlarm_IT(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef
|
|||||||
}
|
}
|
||||||
} while (__HAL_RTC_ALARM_GET_FLAG(hrtc, RTC_FLAG_ALRAWF) == 0U);
|
} while (__HAL_RTC_ALARM_GET_FLAG(hrtc, RTC_FLAG_ALRAWF) == 0U);
|
||||||
|
|
||||||
|
/* Configure Alarm A register */
|
||||||
hrtc->Instance->ALRMAR = (uint32_t)tmpreg;
|
hrtc->Instance->ALRMAR = (uint32_t)tmpreg;
|
||||||
/* Configure the Alarm A Subseconds register */
|
/* Configure Alarm A Subseconds register */
|
||||||
hrtc->Instance->ALRMASSR = subsecondtmpreg;
|
hrtc->Instance->ALRMASSR = subsecondtmpreg;
|
||||||
/* Configure the Alarm state: Enable Alarm */
|
/* Enable Alarm A */
|
||||||
__HAL_RTC_ALARMA_ENABLE(hrtc);
|
__HAL_RTC_ALARMA_ENABLE(hrtc);
|
||||||
/* Configure the Alarm interrupt */
|
/* Enable Alarm A interrupt */
|
||||||
__HAL_RTC_ALARM_ENABLE_IT(hrtc, RTC_IT_ALRA);
|
__HAL_RTC_ALARM_ENABLE_IT(hrtc, RTC_IT_ALRA);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Disable the Alarm B */
|
/* Disable Alarm B */
|
||||||
__HAL_RTC_ALARMB_DISABLE(hrtc);
|
__HAL_RTC_ALARMB_DISABLE(hrtc);
|
||||||
|
|
||||||
/* Clear the Alarm flag */
|
/* Clear Alarm B flag */
|
||||||
__HAL_RTC_ALARM_CLEAR_FLAG(hrtc, RTC_FLAG_ALRBF);
|
__HAL_RTC_ALARM_CLEAR_FLAG(hrtc, RTC_FLAG_ALRBF);
|
||||||
|
|
||||||
/* Reload the counter */
|
/* Reload the counter */
|
||||||
@ -1366,16 +1375,17 @@ HAL_StatusTypeDef HAL_RTC_SetAlarm_IT(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef
|
|||||||
}
|
}
|
||||||
} while (__HAL_RTC_ALARM_GET_FLAG(hrtc, RTC_FLAG_ALRBWF) == 0U);
|
} while (__HAL_RTC_ALARM_GET_FLAG(hrtc, RTC_FLAG_ALRBWF) == 0U);
|
||||||
|
|
||||||
|
/* Configure Alarm B register */
|
||||||
hrtc->Instance->ALRMBR = (uint32_t)tmpreg;
|
hrtc->Instance->ALRMBR = (uint32_t)tmpreg;
|
||||||
/* Configure the Alarm B Subseconds register */
|
/* Configure Alarm B Subseconds register */
|
||||||
hrtc->Instance->ALRMBSSR = subsecondtmpreg;
|
hrtc->Instance->ALRMBSSR = subsecondtmpreg;
|
||||||
/* Configure the Alarm state: Enable Alarm */
|
/* Enable Alarm B */
|
||||||
__HAL_RTC_ALARMB_ENABLE(hrtc);
|
__HAL_RTC_ALARMB_ENABLE(hrtc);
|
||||||
/* Configure the Alarm interrupt */
|
/* Enable Alarm B interrupt */
|
||||||
__HAL_RTC_ALARM_ENABLE_IT(hrtc, RTC_IT_ALRB);
|
__HAL_RTC_ALARM_ENABLE_IT(hrtc, RTC_IT_ALRB);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* RTC Alarm Interrupt Configuration: EXTI configuration */
|
/* Enable and configure the EXTI line associated to the RTC Alarm interrupt */
|
||||||
__HAL_RTC_ALARM_EXTI_ENABLE_IT();
|
__HAL_RTC_ALARM_EXTI_ENABLE_IT();
|
||||||
__HAL_RTC_ALARM_EXTI_ENABLE_RISING_EDGE();
|
__HAL_RTC_ALARM_EXTI_ENABLE_RISING_EDGE();
|
||||||
|
|
||||||
@ -1427,7 +1437,7 @@ HAL_StatusTypeDef HAL_RTC_DeactivateAlarm(RTC_HandleTypeDef *hrtc, uint32_t Alar
|
|||||||
/* Get tick */
|
/* Get tick */
|
||||||
tickstart = HAL_GetTick();
|
tickstart = HAL_GetTick();
|
||||||
|
|
||||||
/* Wait till RTC ALRxWF flag is set and if timeout is reached exit */
|
/* Wait till RTC ALRAWF flag is set and if timeout is reached exit */
|
||||||
while (__HAL_RTC_ALARM_GET_FLAG(hrtc, RTC_FLAG_ALRAWF) == 0U)
|
while (__HAL_RTC_ALARM_GET_FLAG(hrtc, RTC_FLAG_ALRAWF) == 0U)
|
||||||
{
|
{
|
||||||
if ((HAL_GetTick() - tickstart) > RTC_TIMEOUT_VALUE)
|
if ((HAL_GetTick() - tickstart) > RTC_TIMEOUT_VALUE)
|
||||||
@ -1455,7 +1465,7 @@ HAL_StatusTypeDef HAL_RTC_DeactivateAlarm(RTC_HandleTypeDef *hrtc, uint32_t Alar
|
|||||||
/* Get tick */
|
/* Get tick */
|
||||||
tickstart = HAL_GetTick();
|
tickstart = HAL_GetTick();
|
||||||
|
|
||||||
/* Wait till RTC ALRxWF flag is set and if timeout is reached exit */
|
/* Wait till RTC ALRBWF flag is set and if timeout is reached exit */
|
||||||
while (__HAL_RTC_ALARM_GET_FLAG(hrtc, RTC_FLAG_ALRBWF) == 0U)
|
while (__HAL_RTC_ALARM_GET_FLAG(hrtc, RTC_FLAG_ALRBWF) == 0U)
|
||||||
{
|
{
|
||||||
if ((HAL_GetTick() - tickstart) > RTC_TIMEOUT_VALUE)
|
if ((HAL_GetTick() - tickstart) > RTC_TIMEOUT_VALUE)
|
||||||
@ -1552,7 +1562,7 @@ HAL_StatusTypeDef HAL_RTC_GetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sA
|
|||||||
*/
|
*/
|
||||||
void HAL_RTC_AlarmIRQHandler(RTC_HandleTypeDef *hrtc)
|
void HAL_RTC_AlarmIRQHandler(RTC_HandleTypeDef *hrtc)
|
||||||
{
|
{
|
||||||
/* Clear the EXTI's line Flag for RTC Alarm */
|
/* Clear the EXTI flag associated to the RTC Alarm interrupt */
|
||||||
__HAL_RTC_ALARM_EXTI_CLEAR_FLAG();
|
__HAL_RTC_ALARM_EXTI_CLEAR_FLAG();
|
||||||
|
|
||||||
/* Get the Alarm A interrupt source enable status */
|
/* Get the Alarm A interrupt source enable status */
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
*** Tamper configuration ***
|
*** Tamper configuration ***
|
||||||
============================
|
============================
|
||||||
[..]
|
[..]
|
||||||
(+) To Enable the RTC Tamper and configure the Tamper filter count, trigger
|
(+) To enable the RTC Tamper and configure the Tamper filter count, trigger
|
||||||
Edge or Level according to the Tamper filter value (if equal to 0 Edge
|
Edge or Level according to the Tamper filter value (if equal to 0 Edge
|
||||||
else Level), sampling frequency, precharge or discharge and Pull-UP use
|
else Level), sampling frequency, precharge or discharge and Pull-UP use
|
||||||
the HAL_RTCEx_SetTamper() function.
|
the HAL_RTCEx_SetTamper() function.
|
||||||
@ -84,9 +84,9 @@
|
|||||||
This cycle is maintained by a 20-bit counter clocked by RTCCLK.
|
This cycle is maintained by a 20-bit counter clocked by RTCCLK.
|
||||||
(+) The smooth calibration register (RTC_CALR) specifies the number of RTCCLK
|
(+) The smooth calibration register (RTC_CALR) specifies the number of RTCCLK
|
||||||
clock cycles to be masked during the 32-second cycle.
|
clock cycles to be masked during the 32-second cycle.
|
||||||
(+) The RTC Smooth Digital Calibration value and the corresponding calibration
|
(+) To configure the RTC Smooth Digital Calibration value and the corresponding
|
||||||
cycle period (32s, 16s, or 8s) can be calibrated using the
|
calibration cycle period (32s,16s and 8s) use the HAL_RTCEx_SetSmoothCalib()
|
||||||
HAL_RTCEx_SetSmoothCalib() function.
|
function.
|
||||||
|
|
||||||
@endverbatim
|
@endverbatim
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
@ -265,7 +265,7 @@ HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t RT
|
|||||||
/* Enable the write protection for RTC registers */
|
/* Enable the write protection for RTC registers */
|
||||||
__HAL_RTC_WRITEPROTECTION_ENABLE(hrtc);
|
__HAL_RTC_WRITEPROTECTION_ENABLE(hrtc);
|
||||||
|
|
||||||
/* RTC Timestamp Interrupt Configuration: EXTI configuration */
|
/* Enable and configure the EXTI line associated to the RTC Timestamp and Tamper interrupts */
|
||||||
__HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT();
|
__HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT();
|
||||||
__HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE();
|
__HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE();
|
||||||
|
|
||||||
@ -296,7 +296,7 @@ HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc)
|
|||||||
/* Disable the write protection for RTC registers */
|
/* Disable the write protection for RTC registers */
|
||||||
__HAL_RTC_WRITEPROTECTION_DISABLE(hrtc);
|
__HAL_RTC_WRITEPROTECTION_DISABLE(hrtc);
|
||||||
|
|
||||||
/* In case of interrupt mode is used, the interrupt source must disabled */
|
/* In case interrupt mode is used, the interrupt source must disabled */
|
||||||
__HAL_RTC_TIMESTAMP_DISABLE_IT(hrtc, RTC_IT_TS);
|
__HAL_RTC_TIMESTAMP_DISABLE_IT(hrtc, RTC_IT_TS);
|
||||||
|
|
||||||
/* Get the RTC_CR register and clear the bits to be configured */
|
/* Get the RTC_CR register and clear the bits to be configured */
|
||||||
@ -513,7 +513,7 @@ HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperType
|
|||||||
/* Copy desired configuration into configuration register */
|
/* Copy desired configuration into configuration register */
|
||||||
hrtc->Instance->TAFCR = tmpreg;
|
hrtc->Instance->TAFCR = tmpreg;
|
||||||
|
|
||||||
/* RTC Tamper Interrupt Configuration: EXTI configuration */
|
/* Enable and configure the EXTI line associated to the RTC Timestamp and Tamper interrupts */
|
||||||
__HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT();
|
__HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT();
|
||||||
__HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE();
|
__HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE();
|
||||||
|
|
||||||
@ -534,8 +534,9 @@ HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperType
|
|||||||
* This parameter can be any combination of the following values:
|
* This parameter can be any combination of the following values:
|
||||||
* @arg RTC_TAMPER_1: Tamper 1
|
* @arg RTC_TAMPER_1: Tamper 1
|
||||||
* @arg RTC_TAMPER_2: Tamper 2
|
* @arg RTC_TAMPER_2: Tamper 2
|
||||||
* @arg RTC_TAMPER_3: Tamper 3
|
* @arg RTC_TAMPER_3: Tamper 3 (*)
|
||||||
* @note RTC_TAMPER_3 is not applicable to all devices.
|
*
|
||||||
|
* (*) value not applicable to all devices.
|
||||||
* @retval HAL status
|
* @retval HAL status
|
||||||
*/
|
*/
|
||||||
HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper)
|
HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper)
|
||||||
@ -566,7 +567,7 @@ HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t T
|
|||||||
*/
|
*/
|
||||||
void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc)
|
void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc)
|
||||||
{
|
{
|
||||||
/* Clear the EXTI's Flag for RTC Timestamp and Tamper */
|
/* Clear the EXTI flag associated to the RTC Timestamp and Tamper interrupts */
|
||||||
__HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG();
|
__HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG();
|
||||||
|
|
||||||
/* Get the Timestamp interrupt source enable status */
|
/* Get the Timestamp interrupt source enable status */
|
||||||
@ -1060,7 +1061,7 @@ HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t
|
|||||||
/* Configure the Wakeup Timer counter */
|
/* Configure the Wakeup Timer counter */
|
||||||
hrtc->Instance->WUTR = (uint32_t)WakeUpCounter;
|
hrtc->Instance->WUTR = (uint32_t)WakeUpCounter;
|
||||||
|
|
||||||
/* RTC wakeup timer Interrupt Configuration: EXTI configuration */
|
/* Enable and configure the EXTI line associated to the RTC Wakeup Timer interrupt */
|
||||||
__HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT();
|
__HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT();
|
||||||
__HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE();
|
__HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE();
|
||||||
|
|
||||||
@ -1102,7 +1103,7 @@ HAL_StatusTypeDef HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc)
|
|||||||
/* Disable the Wakeup Timer */
|
/* Disable the Wakeup Timer */
|
||||||
__HAL_RTC_WAKEUPTIMER_DISABLE(hrtc);
|
__HAL_RTC_WAKEUPTIMER_DISABLE(hrtc);
|
||||||
|
|
||||||
/* In case of interrupt mode is used, the interrupt source must disabled */
|
/* In case interrupt mode is used, the interrupt source must disabled */
|
||||||
__HAL_RTC_WAKEUPTIMER_DISABLE_IT(hrtc, RTC_IT_WUT);
|
__HAL_RTC_WAKEUPTIMER_DISABLE_IT(hrtc, RTC_IT_WUT);
|
||||||
|
|
||||||
/* Get tick */
|
/* Get tick */
|
||||||
@ -1161,7 +1162,7 @@ uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc)
|
|||||||
*/
|
*/
|
||||||
void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc)
|
void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc)
|
||||||
{
|
{
|
||||||
/* Clear the EXTI's line Flag for RTC WakeUpTimer */
|
/* Clear the EXTI flag associated to the RTC Wakeup Timer interrupt */
|
||||||
__HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG();
|
__HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG();
|
||||||
|
|
||||||
/* Get the pending status of the Wakeup timer Interrupt */
|
/* Get the pending status of the Wakeup timer Interrupt */
|
||||||
|
@ -318,6 +318,8 @@ static void SDADC_DMAError(DMA_HandleTypeDef *hdma);
|
|||||||
*/
|
*/
|
||||||
HAL_StatusTypeDef HAL_SDADC_Init(SDADC_HandleTypeDef* hsdadc)
|
HAL_StatusTypeDef HAL_SDADC_Init(SDADC_HandleTypeDef* hsdadc)
|
||||||
{
|
{
|
||||||
|
uint32_t tickstart;
|
||||||
|
|
||||||
/* Check SDADC handle */
|
/* Check SDADC handle */
|
||||||
if(hsdadc == NULL)
|
if(hsdadc == NULL)
|
||||||
{
|
{
|
||||||
@ -393,8 +395,13 @@ HAL_StatusTypeDef HAL_SDADC_Init(SDADC_HandleTypeDef* hsdadc)
|
|||||||
hsdadc->Instance->CR2 |= SDADC_CR2_ADON;
|
hsdadc->Instance->CR2 |= SDADC_CR2_ADON;
|
||||||
|
|
||||||
/* Wait end of stabilization */
|
/* Wait end of stabilization */
|
||||||
|
tickstart = HAL_GetTick();
|
||||||
while((hsdadc->Instance->ISR & SDADC_ISR_STABIP) != 0UL)
|
while((hsdadc->Instance->ISR & SDADC_ISR_STABIP) != 0UL)
|
||||||
{
|
{
|
||||||
|
if((HAL_GetTick()-tickstart) > SDADC_TIMEOUT)
|
||||||
|
{
|
||||||
|
return HAL_TIMEOUT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set SDADC to ready state */
|
/* Set SDADC to ready state */
|
||||||
|
@ -134,7 +134,7 @@
|
|||||||
|
|
||||||
[..]
|
[..]
|
||||||
Use function HAL_SMARTCARD_UnRegisterCallback() to reset a callback to the default
|
Use function HAL_SMARTCARD_UnRegisterCallback() to reset a callback to the default
|
||||||
weak (surcharged) function.
|
weak function.
|
||||||
HAL_SMARTCARD_UnRegisterCallback() takes as parameters the HAL peripheral handle,
|
HAL_SMARTCARD_UnRegisterCallback() takes as parameters the HAL peripheral handle,
|
||||||
and the Callback ID.
|
and the Callback ID.
|
||||||
This function allows to reset following callbacks:
|
This function allows to reset following callbacks:
|
||||||
@ -149,10 +149,10 @@
|
|||||||
|
|
||||||
[..]
|
[..]
|
||||||
By default, after the HAL_SMARTCARD_Init() and when the state is HAL_SMARTCARD_STATE_RESET
|
By default, after the HAL_SMARTCARD_Init() and when the state is HAL_SMARTCARD_STATE_RESET
|
||||||
all callbacks are set to the corresponding weak (surcharged) functions:
|
all callbacks are set to the corresponding weak functions:
|
||||||
examples HAL_SMARTCARD_TxCpltCallback(), HAL_SMARTCARD_RxCpltCallback().
|
examples HAL_SMARTCARD_TxCpltCallback(), HAL_SMARTCARD_RxCpltCallback().
|
||||||
Exception done for MspInit and MspDeInit functions that are respectively
|
Exception done for MspInit and MspDeInit functions that are respectively
|
||||||
reset to the legacy weak (surcharged) functions in the HAL_SMARTCARD_Init()
|
reset to the legacy weak functions in the HAL_SMARTCARD_Init()
|
||||||
and HAL_SMARTCARD_DeInit() only when these callbacks are null (not registered beforehand).
|
and HAL_SMARTCARD_DeInit() only when these callbacks are null (not registered beforehand).
|
||||||
If not, MspInit or MspDeInit are not null, the HAL_SMARTCARD_Init() and HAL_SMARTCARD_DeInit()
|
If not, MspInit or MspDeInit are not null, the HAL_SMARTCARD_Init() and HAL_SMARTCARD_DeInit()
|
||||||
keep and use the user MspInit/MspDeInit callbacks (registered beforehand).
|
keep and use the user MspInit/MspDeInit callbacks (registered beforehand).
|
||||||
@ -169,7 +169,7 @@
|
|||||||
[..]
|
[..]
|
||||||
When The compilation define USE_HAL_SMARTCARD_REGISTER_CALLBACKS is set to 0 or
|
When The compilation define USE_HAL_SMARTCARD_REGISTER_CALLBACKS is set to 0 or
|
||||||
not defined, the callback registration feature is not available
|
not defined, the callback registration feature is not available
|
||||||
and weak (surcharged) callbacks are used.
|
and weak callbacks are used.
|
||||||
|
|
||||||
|
|
||||||
@endverbatim
|
@endverbatim
|
||||||
@ -460,7 +460,7 @@ __weak void HAL_SMARTCARD_MspDeInit(SMARTCARD_HandleTypeDef *hsmartcard)
|
|||||||
#if (USE_HAL_SMARTCARD_REGISTER_CALLBACKS == 1)
|
#if (USE_HAL_SMARTCARD_REGISTER_CALLBACKS == 1)
|
||||||
/**
|
/**
|
||||||
* @brief Register a User SMARTCARD Callback
|
* @brief Register a User SMARTCARD Callback
|
||||||
* To be used instead of the weak predefined callback
|
* To be used to override the weak predefined callback
|
||||||
* @note The HAL_SMARTCARD_RegisterCallback() may be called before HAL_SMARTCARD_Init()
|
* @note The HAL_SMARTCARD_RegisterCallback() may be called before HAL_SMARTCARD_Init()
|
||||||
* in HAL_SMARTCARD_STATE_RESET to register callbacks for HAL_SMARTCARD_MSPINIT_CB_ID
|
* in HAL_SMARTCARD_STATE_RESET to register callbacks for HAL_SMARTCARD_MSPINIT_CB_ID
|
||||||
* and HAL_SMARTCARD_MSPDEINIT_CB_ID
|
* and HAL_SMARTCARD_MSPDEINIT_CB_ID
|
||||||
@ -2282,7 +2282,7 @@ static HAL_StatusTypeDef SMARTCARD_SetConfig(SMARTCARD_HandleTypeDef *hsmartcard
|
|||||||
assert_param(IS_SMARTCARD_TIMEOUT_VALUE(hsmartcard->Init.TimeOutValue));
|
assert_param(IS_SMARTCARD_TIMEOUT_VALUE(hsmartcard->Init.TimeOutValue));
|
||||||
tmpreg |= (uint32_t) hsmartcard->Init.TimeOutValue;
|
tmpreg |= (uint32_t) hsmartcard->Init.TimeOutValue;
|
||||||
}
|
}
|
||||||
MODIFY_REG(hsmartcard->Instance->RTOR, (USART_RTOR_RTO | USART_RTOR_BLEN), tmpreg);
|
WRITE_REG(hsmartcard->Instance->RTOR, tmpreg);
|
||||||
|
|
||||||
/*-------------------------- USART BRR Configuration -----------------------*/
|
/*-------------------------- USART BRR Configuration -----------------------*/
|
||||||
SMARTCARD_GETCLOCKSOURCE(hsmartcard, clocksource);
|
SMARTCARD_GETCLOCKSOURCE(hsmartcard, clocksource);
|
||||||
|
@ -926,6 +926,7 @@ HAL_StatusTypeDef HAL_SMBUS_Master_Transmit_IT(SMBUS_HandleTypeDef *hsmbus, uint
|
|||||||
uint8_t *pData, uint16_t Size, uint32_t XferOptions)
|
uint8_t *pData, uint16_t Size, uint32_t XferOptions)
|
||||||
{
|
{
|
||||||
uint32_t tmp;
|
uint32_t tmp;
|
||||||
|
uint32_t sizetoxfer;
|
||||||
|
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
assert_param(IS_SMBUS_TRANSFER_OPTIONS_REQUEST(XferOptions));
|
assert_param(IS_SMBUS_TRANSFER_OPTIONS_REQUEST(XferOptions));
|
||||||
@ -958,11 +959,35 @@ HAL_StatusTypeDef HAL_SMBUS_Master_Transmit_IT(SMBUS_HandleTypeDef *hsmbus, uint
|
|||||||
hsmbus->XferSize = Size;
|
hsmbus->XferSize = Size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sizetoxfer = hsmbus->XferSize;
|
||||||
|
if ((sizetoxfer > 0U) && ((XferOptions == SMBUS_FIRST_FRAME) ||
|
||||||
|
(XferOptions == SMBUS_FIRST_AND_LAST_FRAME_NO_PEC) ||
|
||||||
|
(XferOptions == SMBUS_FIRST_FRAME_WITH_PEC) ||
|
||||||
|
(XferOptions == SMBUS_FIRST_AND_LAST_FRAME_WITH_PEC)))
|
||||||
|
{
|
||||||
|
if (hsmbus->pBuffPtr != NULL)
|
||||||
|
{
|
||||||
|
/* Preload TX register */
|
||||||
|
/* Write data to TXDR */
|
||||||
|
hsmbus->Instance->TXDR = *hsmbus->pBuffPtr;
|
||||||
|
|
||||||
|
/* Increment Buffer pointer */
|
||||||
|
hsmbus->pBuffPtr++;
|
||||||
|
|
||||||
|
hsmbus->XferCount--;
|
||||||
|
hsmbus->XferSize--;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return HAL_ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Send Slave Address */
|
/* Send Slave Address */
|
||||||
/* Set NBYTES to write and reload if size > MAX_NBYTE_SIZE and generate RESTART */
|
/* Set NBYTES to write and reload if size > MAX_NBYTE_SIZE and generate RESTART */
|
||||||
if ((hsmbus->XferSize < hsmbus->XferCount) && (hsmbus->XferSize == MAX_NBYTE_SIZE))
|
if ((sizetoxfer < hsmbus->XferCount) && (sizetoxfer == MAX_NBYTE_SIZE))
|
||||||
{
|
{
|
||||||
SMBUS_TransferConfig(hsmbus, DevAddress, (uint8_t)hsmbus->XferSize,
|
SMBUS_TransferConfig(hsmbus, DevAddress, (uint8_t)sizetoxfer,
|
||||||
SMBUS_RELOAD_MODE | (hsmbus->XferOptions & SMBUS_SENDPEC_MODE),
|
SMBUS_RELOAD_MODE | (hsmbus->XferOptions & SMBUS_SENDPEC_MODE),
|
||||||
SMBUS_GENERATE_START_WRITE);
|
SMBUS_GENERATE_START_WRITE);
|
||||||
}
|
}
|
||||||
@ -977,7 +1002,7 @@ HAL_StatusTypeDef HAL_SMBUS_Master_Transmit_IT(SMBUS_HandleTypeDef *hsmbus, uint
|
|||||||
if ((hsmbus->PreviousState == HAL_SMBUS_STATE_MASTER_BUSY_TX) && \
|
if ((hsmbus->PreviousState == HAL_SMBUS_STATE_MASTER_BUSY_TX) && \
|
||||||
(IS_SMBUS_TRANSFER_OTHER_OPTIONS_REQUEST(tmp) == 0))
|
(IS_SMBUS_TRANSFER_OTHER_OPTIONS_REQUEST(tmp) == 0))
|
||||||
{
|
{
|
||||||
SMBUS_TransferConfig(hsmbus, DevAddress, (uint8_t)hsmbus->XferSize, hsmbus->XferOptions,
|
SMBUS_TransferConfig(hsmbus, DevAddress, (uint8_t)sizetoxfer, hsmbus->XferOptions,
|
||||||
SMBUS_NO_STARTSTOP);
|
SMBUS_NO_STARTSTOP);
|
||||||
}
|
}
|
||||||
/* Else transfer direction change, so generate Restart with new transfer direction */
|
/* Else transfer direction change, so generate Restart with new transfer direction */
|
||||||
@ -987,7 +1012,7 @@ HAL_StatusTypeDef HAL_SMBUS_Master_Transmit_IT(SMBUS_HandleTypeDef *hsmbus, uint
|
|||||||
SMBUS_ConvertOtherXferOptions(hsmbus);
|
SMBUS_ConvertOtherXferOptions(hsmbus);
|
||||||
|
|
||||||
/* Handle Transfer */
|
/* Handle Transfer */
|
||||||
SMBUS_TransferConfig(hsmbus, DevAddress, (uint8_t)hsmbus->XferSize,
|
SMBUS_TransferConfig(hsmbus, DevAddress, (uint8_t)sizetoxfer,
|
||||||
hsmbus->XferOptions,
|
hsmbus->XferOptions,
|
||||||
SMBUS_GENERATE_START_WRITE);
|
SMBUS_GENERATE_START_WRITE);
|
||||||
}
|
}
|
||||||
@ -995,10 +1020,17 @@ HAL_StatusTypeDef HAL_SMBUS_Master_Transmit_IT(SMBUS_HandleTypeDef *hsmbus, uint
|
|||||||
/* If PEC mode is enable, size to transmit manage by SW part should be Size-1 byte, corresponding to PEC byte */
|
/* If PEC mode is enable, size to transmit manage by SW part should be Size-1 byte, corresponding to PEC byte */
|
||||||
/* PEC byte is automatically sent by HW block, no need to manage it in Transmit process */
|
/* PEC byte is automatically sent by HW block, no need to manage it in Transmit process */
|
||||||
if (SMBUS_GET_PEC_MODE(hsmbus) != 0UL)
|
if (SMBUS_GET_PEC_MODE(hsmbus) != 0UL)
|
||||||
|
{
|
||||||
|
if (hsmbus->XferSize > 0U)
|
||||||
{
|
{
|
||||||
hsmbus->XferSize--;
|
hsmbus->XferSize--;
|
||||||
hsmbus->XferCount--;
|
hsmbus->XferCount--;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return HAL_ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Process Unlocked */
|
/* Process Unlocked */
|
||||||
@ -2587,8 +2619,11 @@ static void SMBUS_ITErrorHandler(SMBUS_HandleTypeDef *hsmbus)
|
|||||||
__HAL_SMBUS_CLEAR_FLAG(hsmbus, SMBUS_FLAG_PECERR);
|
__HAL_SMBUS_CLEAR_FLAG(hsmbus, SMBUS_FLAG_PECERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hsmbus->ErrorCode != HAL_SMBUS_ERROR_NONE)
|
||||||
|
{
|
||||||
/* Flush TX register */
|
/* Flush TX register */
|
||||||
SMBUS_Flush_TXDR(hsmbus);
|
SMBUS_Flush_TXDR(hsmbus);
|
||||||
|
}
|
||||||
|
|
||||||
/* Store current volatile hsmbus->ErrorCode, misra rule */
|
/* Store current volatile hsmbus->ErrorCode, misra rule */
|
||||||
tmperror = hsmbus->ErrorCode;
|
tmperror = hsmbus->ErrorCode;
|
||||||
|
@ -1359,6 +1359,20 @@ HAL_StatusTypeDef HAL_SPI_TransmitReceive(SPI_HandleTypeDef *hspi, uint8_t *pTxD
|
|||||||
hspi->Instance->DR = *((uint16_t *)hspi->pTxBuffPtr);
|
hspi->Instance->DR = *((uint16_t *)hspi->pTxBuffPtr);
|
||||||
hspi->pTxBuffPtr += sizeof(uint16_t);
|
hspi->pTxBuffPtr += sizeof(uint16_t);
|
||||||
hspi->TxXferCount--;
|
hspi->TxXferCount--;
|
||||||
|
|
||||||
|
#if (USE_SPI_CRC != 0U)
|
||||||
|
/* Enable CRC Transmission */
|
||||||
|
if ((hspi->TxXferCount == 0U) && (hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE))
|
||||||
|
{
|
||||||
|
/* Set NSS Soft to received correctly the CRC on slave mode with NSS pulse activated */
|
||||||
|
if ((READ_BIT(spi_cr1, SPI_CR1_MSTR) == 0U) && (READ_BIT(spi_cr2, SPI_CR2_NSSP) == SPI_CR2_NSSP))
|
||||||
|
{
|
||||||
|
SET_BIT(hspi->Instance->CR1, SPI_CR1_SSM);
|
||||||
|
}
|
||||||
|
SET_BIT(hspi->Instance->CR1, SPI_CR1_CRCNEXT);
|
||||||
|
}
|
||||||
|
#endif /* USE_SPI_CRC */
|
||||||
|
|
||||||
}
|
}
|
||||||
while ((hspi->TxXferCount > 0U) || (hspi->RxXferCount > 0U))
|
while ((hspi->TxXferCount > 0U) || (hspi->RxXferCount > 0U))
|
||||||
{
|
{
|
||||||
@ -1418,6 +1432,19 @@ HAL_StatusTypeDef HAL_SPI_TransmitReceive(SPI_HandleTypeDef *hspi, uint8_t *pTxD
|
|||||||
*(__IO uint8_t *)&hspi->Instance->DR = (*hspi->pTxBuffPtr);
|
*(__IO uint8_t *)&hspi->Instance->DR = (*hspi->pTxBuffPtr);
|
||||||
hspi->pTxBuffPtr++;
|
hspi->pTxBuffPtr++;
|
||||||
hspi->TxXferCount--;
|
hspi->TxXferCount--;
|
||||||
|
|
||||||
|
#if (USE_SPI_CRC != 0U)
|
||||||
|
/* Enable CRC Transmission */
|
||||||
|
if ((hspi->TxXferCount == 0U) && (hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE))
|
||||||
|
{
|
||||||
|
/* Set NSS Soft to received correctly the CRC on slave mode with NSS pulse activated */
|
||||||
|
if ((READ_BIT(spi_cr1, SPI_CR1_MSTR) == 0U) && (READ_BIT(spi_cr2, SPI_CR2_NSSP) == SPI_CR2_NSSP))
|
||||||
|
{
|
||||||
|
SET_BIT(hspi->Instance->CR1, SPI_CR1_SSM);
|
||||||
|
}
|
||||||
|
SET_BIT(hspi->Instance->CR1, SPI_CR1_CRCNEXT);
|
||||||
|
}
|
||||||
|
#endif /* USE_SPI_CRC */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while ((hspi->TxXferCount > 0U) || (hspi->RxXferCount > 0U))
|
while ((hspi->TxXferCount > 0U) || (hspi->RxXferCount > 0U))
|
||||||
@ -1579,8 +1606,6 @@ HAL_StatusTypeDef HAL_SPI_Transmit_IT(SPI_HandleTypeDef *hspi, uint8_t *pData, u
|
|||||||
/* Check Direction parameter */
|
/* Check Direction parameter */
|
||||||
assert_param(IS_SPI_DIRECTION_2LINES_OR_1LINE(hspi->Init.Direction));
|
assert_param(IS_SPI_DIRECTION_2LINES_OR_1LINE(hspi->Init.Direction));
|
||||||
|
|
||||||
/* Process Locked */
|
|
||||||
__HAL_LOCK(hspi);
|
|
||||||
|
|
||||||
if ((pData == NULL) || (Size == 0U))
|
if ((pData == NULL) || (Size == 0U))
|
||||||
{
|
{
|
||||||
@ -1594,6 +1619,9 @@ HAL_StatusTypeDef HAL_SPI_Transmit_IT(SPI_HandleTypeDef *hspi, uint8_t *pData, u
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Process Locked */
|
||||||
|
__HAL_LOCK(hspi);
|
||||||
|
|
||||||
/* Set the transaction information */
|
/* Set the transaction information */
|
||||||
hspi->State = HAL_SPI_STATE_BUSY_TX;
|
hspi->State = HAL_SPI_STATE_BUSY_TX;
|
||||||
hspi->ErrorCode = HAL_SPI_ERROR_NONE;
|
hspi->ErrorCode = HAL_SPI_ERROR_NONE;
|
||||||
@ -1633,10 +1661,6 @@ HAL_StatusTypeDef HAL_SPI_Transmit_IT(SPI_HandleTypeDef *hspi, uint8_t *pData, u
|
|||||||
}
|
}
|
||||||
#endif /* USE_SPI_CRC */
|
#endif /* USE_SPI_CRC */
|
||||||
|
|
||||||
/* Enable TXE and ERR interrupt */
|
|
||||||
__HAL_SPI_ENABLE_IT(hspi, (SPI_IT_TXE | SPI_IT_ERR));
|
|
||||||
|
|
||||||
|
|
||||||
/* Check if the SPI is already enabled */
|
/* Check if the SPI is already enabled */
|
||||||
if ((hspi->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE)
|
if ((hspi->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE)
|
||||||
{
|
{
|
||||||
@ -1644,8 +1668,12 @@ HAL_StatusTypeDef HAL_SPI_Transmit_IT(SPI_HandleTypeDef *hspi, uint8_t *pData, u
|
|||||||
__HAL_SPI_ENABLE(hspi);
|
__HAL_SPI_ENABLE(hspi);
|
||||||
}
|
}
|
||||||
|
|
||||||
error :
|
/* Process Unlocked */
|
||||||
__HAL_UNLOCK(hspi);
|
__HAL_UNLOCK(hspi);
|
||||||
|
/* Enable TXE and ERR interrupt */
|
||||||
|
__HAL_SPI_ENABLE_IT(hspi, (SPI_IT_TXE | SPI_IT_ERR));
|
||||||
|
|
||||||
|
error :
|
||||||
return errorcode;
|
return errorcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1675,8 +1703,6 @@ HAL_StatusTypeDef HAL_SPI_Receive_IT(SPI_HandleTypeDef *hspi, uint8_t *pData, ui
|
|||||||
return HAL_SPI_TransmitReceive_IT(hspi, pData, pData, Size);
|
return HAL_SPI_TransmitReceive_IT(hspi, pData, pData, Size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Process Locked */
|
|
||||||
__HAL_LOCK(hspi);
|
|
||||||
|
|
||||||
if ((pData == NULL) || (Size == 0U))
|
if ((pData == NULL) || (Size == 0U))
|
||||||
{
|
{
|
||||||
@ -1684,6 +1710,9 @@ HAL_StatusTypeDef HAL_SPI_Receive_IT(SPI_HandleTypeDef *hspi, uint8_t *pData, ui
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Process Locked */
|
||||||
|
__HAL_LOCK(hspi);
|
||||||
|
|
||||||
/* Set the transaction information */
|
/* Set the transaction information */
|
||||||
hspi->State = HAL_SPI_STATE_BUSY_RX;
|
hspi->State = HAL_SPI_STATE_BUSY_RX;
|
||||||
hspi->ErrorCode = HAL_SPI_ERROR_NONE;
|
hspi->ErrorCode = HAL_SPI_ERROR_NONE;
|
||||||
@ -1736,9 +1765,6 @@ HAL_StatusTypeDef HAL_SPI_Receive_IT(SPI_HandleTypeDef *hspi, uint8_t *pData, ui
|
|||||||
}
|
}
|
||||||
#endif /* USE_SPI_CRC */
|
#endif /* USE_SPI_CRC */
|
||||||
|
|
||||||
/* Enable TXE and ERR interrupt */
|
|
||||||
__HAL_SPI_ENABLE_IT(hspi, (SPI_IT_RXNE | SPI_IT_ERR));
|
|
||||||
|
|
||||||
/* Note : The SPI must be enabled after unlocking current process
|
/* Note : The SPI must be enabled after unlocking current process
|
||||||
to avoid the risk of SPI interrupt handle execution before current
|
to avoid the risk of SPI interrupt handle execution before current
|
||||||
process unlock */
|
process unlock */
|
||||||
@ -1750,9 +1776,12 @@ HAL_StatusTypeDef HAL_SPI_Receive_IT(SPI_HandleTypeDef *hspi, uint8_t *pData, ui
|
|||||||
__HAL_SPI_ENABLE(hspi);
|
__HAL_SPI_ENABLE(hspi);
|
||||||
}
|
}
|
||||||
|
|
||||||
error :
|
|
||||||
/* Process Unlocked */
|
/* Process Unlocked */
|
||||||
__HAL_UNLOCK(hspi);
|
__HAL_UNLOCK(hspi);
|
||||||
|
/* Enable RXNE and ERR interrupt */
|
||||||
|
__HAL_SPI_ENABLE_IT(hspi, (SPI_IT_RXNE | SPI_IT_ERR));
|
||||||
|
|
||||||
|
error :
|
||||||
return errorcode;
|
return errorcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1774,9 +1803,6 @@ HAL_StatusTypeDef HAL_SPI_TransmitReceive_IT(SPI_HandleTypeDef *hspi, uint8_t *p
|
|||||||
/* Check Direction parameter */
|
/* Check Direction parameter */
|
||||||
assert_param(IS_SPI_DIRECTION_2LINES(hspi->Init.Direction));
|
assert_param(IS_SPI_DIRECTION_2LINES(hspi->Init.Direction));
|
||||||
|
|
||||||
/* Process locked */
|
|
||||||
__HAL_LOCK(hspi);
|
|
||||||
|
|
||||||
/* Init temporary variables */
|
/* Init temporary variables */
|
||||||
tmp_state = hspi->State;
|
tmp_state = hspi->State;
|
||||||
tmp_mode = hspi->Init.Mode;
|
tmp_mode = hspi->Init.Mode;
|
||||||
@ -1794,6 +1820,9 @@ HAL_StatusTypeDef HAL_SPI_TransmitReceive_IT(SPI_HandleTypeDef *hspi, uint8_t *p
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Process locked */
|
||||||
|
__HAL_LOCK(hspi);
|
||||||
|
|
||||||
/* Don't overwrite in case of HAL_SPI_STATE_BUSY_RX */
|
/* Don't overwrite in case of HAL_SPI_STATE_BUSY_RX */
|
||||||
if (hspi->State != HAL_SPI_STATE_BUSY_RX)
|
if (hspi->State != HAL_SPI_STATE_BUSY_RX)
|
||||||
{
|
{
|
||||||
@ -1850,8 +1879,6 @@ HAL_StatusTypeDef HAL_SPI_TransmitReceive_IT(SPI_HandleTypeDef *hspi, uint8_t *p
|
|||||||
SET_BIT(hspi->Instance->CR2, SPI_RXFIFO_THRESHOLD);
|
SET_BIT(hspi->Instance->CR2, SPI_RXFIFO_THRESHOLD);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Enable TXE, RXNE and ERR interrupt */
|
|
||||||
__HAL_SPI_ENABLE_IT(hspi, (SPI_IT_TXE | SPI_IT_RXNE | SPI_IT_ERR));
|
|
||||||
|
|
||||||
/* Check if the SPI is already enabled */
|
/* Check if the SPI is already enabled */
|
||||||
if ((hspi->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE)
|
if ((hspi->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE)
|
||||||
@ -1860,9 +1887,12 @@ HAL_StatusTypeDef HAL_SPI_TransmitReceive_IT(SPI_HandleTypeDef *hspi, uint8_t *p
|
|||||||
__HAL_SPI_ENABLE(hspi);
|
__HAL_SPI_ENABLE(hspi);
|
||||||
}
|
}
|
||||||
|
|
||||||
error :
|
|
||||||
/* Process Unlocked */
|
/* Process Unlocked */
|
||||||
__HAL_UNLOCK(hspi);
|
__HAL_UNLOCK(hspi);
|
||||||
|
/* Enable TXE, RXNE and ERR interrupt */
|
||||||
|
__HAL_SPI_ENABLE_IT(hspi, (SPI_IT_TXE | SPI_IT_RXNE | SPI_IT_ERR));
|
||||||
|
|
||||||
|
error :
|
||||||
return errorcode;
|
return errorcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@
|
|||||||
* the configuration information for the specified SPI module.
|
* the configuration information for the specified SPI module.
|
||||||
* @retval HAL status
|
* @retval HAL status
|
||||||
*/
|
*/
|
||||||
HAL_StatusTypeDef HAL_SPIEx_FlushRxFifo(SPI_HandleTypeDef *hspi)
|
HAL_StatusTypeDef HAL_SPIEx_FlushRxFifo(const SPI_HandleTypeDef *hspi)
|
||||||
{
|
{
|
||||||
__IO uint32_t tmpreg;
|
__IO uint32_t tmpreg;
|
||||||
uint8_t count = 0U;
|
uint8_t count = 0U;
|
||||||
|
@ -83,15 +83,15 @@
|
|||||||
and a pointer to the user callback function.
|
and a pointer to the user callback function.
|
||||||
|
|
||||||
Use function HAL_SRAM_UnRegisterCallback() to reset a callback to the default
|
Use function HAL_SRAM_UnRegisterCallback() to reset a callback to the default
|
||||||
weak (surcharged) function. It allows to reset following callbacks:
|
weak (overridden) function. It allows to reset following callbacks:
|
||||||
(+) MspInitCallback : SRAM MspInit.
|
(+) MspInitCallback : SRAM MspInit.
|
||||||
(+) MspDeInitCallback : SRAM MspDeInit.
|
(+) MspDeInitCallback : SRAM MspDeInit.
|
||||||
This function) takes as parameters the HAL peripheral handle and the Callback ID.
|
This function) takes as parameters the HAL peripheral handle and the Callback ID.
|
||||||
|
|
||||||
By default, after the HAL_SRAM_Init and if the state is HAL_SRAM_STATE_RESET
|
By default, after the HAL_SRAM_Init and if the state is HAL_SRAM_STATE_RESET
|
||||||
all callbacks are reset to the corresponding legacy weak (surcharged) functions.
|
all callbacks are reset to the corresponding legacy weak (overridden) functions.
|
||||||
Exception done for MspInit and MspDeInit callbacks that are respectively
|
Exception done for MspInit and MspDeInit callbacks that are respectively
|
||||||
reset to the legacy weak (surcharged) functions in the HAL_SRAM_Init
|
reset to the legacy weak (overridden) functions in the HAL_SRAM_Init
|
||||||
and HAL_SRAM_DeInit only when these callbacks are null (not registered beforehand).
|
and HAL_SRAM_DeInit only when these callbacks are null (not registered beforehand).
|
||||||
If not, MspInit or MspDeInit are not null, the HAL_SRAM_Init and HAL_SRAM_DeInit
|
If not, MspInit or MspDeInit are not null, the HAL_SRAM_Init and HAL_SRAM_DeInit
|
||||||
keep and use the user MspInit/MspDeInit callbacks (registered beforehand)
|
keep and use the user MspInit/MspDeInit callbacks (registered beforehand)
|
||||||
@ -106,7 +106,7 @@
|
|||||||
|
|
||||||
When The compilation define USE_HAL_SRAM_REGISTER_CALLBACKS is set to 0 or
|
When The compilation define USE_HAL_SRAM_REGISTER_CALLBACKS is set to 0 or
|
||||||
not defined, the callback registering feature is not available
|
not defined, the callback registering feature is not available
|
||||||
and weak (surcharged) callbacks are used.
|
and weak (overridden) callbacks are used.
|
||||||
|
|
||||||
@endverbatim
|
@endverbatim
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
@ -737,7 +737,7 @@ HAL_StatusTypeDef HAL_SRAM_Write_DMA(SRAM_HandleTypeDef *hsram, uint32_t *pAddre
|
|||||||
#if (USE_HAL_SRAM_REGISTER_CALLBACKS == 1)
|
#if (USE_HAL_SRAM_REGISTER_CALLBACKS == 1)
|
||||||
/**
|
/**
|
||||||
* @brief Register a User SRAM Callback
|
* @brief Register a User SRAM Callback
|
||||||
* To be used instead of the weak (surcharged) predefined callback
|
* To be used to override the weak predefined callback
|
||||||
* @param hsram : SRAM handle
|
* @param hsram : SRAM handle
|
||||||
* @param CallbackId : ID of the callback to be registered
|
* @param CallbackId : ID of the callback to be registered
|
||||||
* This parameter can be one of the following values:
|
* This parameter can be one of the following values:
|
||||||
@ -757,9 +757,6 @@ HAL_StatusTypeDef HAL_SRAM_RegisterCallback(SRAM_HandleTypeDef *hsram, HAL_SRAM_
|
|||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Process locked */
|
|
||||||
__HAL_LOCK(hsram);
|
|
||||||
|
|
||||||
state = hsram->State;
|
state = hsram->State;
|
||||||
if ((state == HAL_SRAM_STATE_READY) || (state == HAL_SRAM_STATE_RESET) || (state == HAL_SRAM_STATE_PROTECTED))
|
if ((state == HAL_SRAM_STATE_READY) || (state == HAL_SRAM_STATE_RESET) || (state == HAL_SRAM_STATE_PROTECTED))
|
||||||
{
|
{
|
||||||
@ -783,14 +780,12 @@ HAL_StatusTypeDef HAL_SRAM_RegisterCallback(SRAM_HandleTypeDef *hsram, HAL_SRAM_
|
|||||||
status = HAL_ERROR;
|
status = HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Release Lock */
|
|
||||||
__HAL_UNLOCK(hsram);
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Unregister a User SRAM Callback
|
* @brief Unregister a User SRAM Callback
|
||||||
* SRAM Callback is redirected to the weak (surcharged) predefined callback
|
* SRAM Callback is redirected to the weak predefined callback
|
||||||
* @param hsram : SRAM handle
|
* @param hsram : SRAM handle
|
||||||
* @param CallbackId : ID of the callback to be unregistered
|
* @param CallbackId : ID of the callback to be unregistered
|
||||||
* This parameter can be one of the following values:
|
* This parameter can be one of the following values:
|
||||||
@ -805,9 +800,6 @@ HAL_StatusTypeDef HAL_SRAM_UnRegisterCallback(SRAM_HandleTypeDef *hsram, HAL_SRA
|
|||||||
HAL_StatusTypeDef status = HAL_OK;
|
HAL_StatusTypeDef status = HAL_OK;
|
||||||
HAL_SRAM_StateTypeDef state;
|
HAL_SRAM_StateTypeDef state;
|
||||||
|
|
||||||
/* Process locked */
|
|
||||||
__HAL_LOCK(hsram);
|
|
||||||
|
|
||||||
state = hsram->State;
|
state = hsram->State;
|
||||||
if ((state == HAL_SRAM_STATE_READY) || (state == HAL_SRAM_STATE_PROTECTED))
|
if ((state == HAL_SRAM_STATE_READY) || (state == HAL_SRAM_STATE_PROTECTED))
|
||||||
{
|
{
|
||||||
@ -853,14 +845,12 @@ HAL_StatusTypeDef HAL_SRAM_UnRegisterCallback(SRAM_HandleTypeDef *hsram, HAL_SRA
|
|||||||
status = HAL_ERROR;
|
status = HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Release Lock */
|
|
||||||
__HAL_UNLOCK(hsram);
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Register a User SRAM Callback for DMA transfers
|
* @brief Register a User SRAM Callback for DMA transfers
|
||||||
* To be used instead of the weak (surcharged) predefined callback
|
* To be used to override the weak predefined callback
|
||||||
* @param hsram : SRAM handle
|
* @param hsram : SRAM handle
|
||||||
* @param CallbackId : ID of the callback to be registered
|
* @param CallbackId : ID of the callback to be registered
|
||||||
* This parameter can be one of the following values:
|
* This parameter can be one of the following values:
|
||||||
|
@ -894,7 +894,7 @@ HAL_StatusTypeDef HAL_TIM_OC_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel)
|
|||||||
uint32_t tmpsmcr;
|
uint32_t tmpsmcr;
|
||||||
|
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel));
|
assert_param(IS_TIM_CCX_CHANNEL(htim->Instance, Channel));
|
||||||
|
|
||||||
/* Check the TIM channel state */
|
/* Check the TIM channel state */
|
||||||
if (TIM_CHANNEL_STATE_GET(htim, Channel) != HAL_TIM_CHANNEL_STATE_READY)
|
if (TIM_CHANNEL_STATE_GET(htim, Channel) != HAL_TIM_CHANNEL_STATE_READY)
|
||||||
@ -986,7 +986,7 @@ HAL_StatusTypeDef HAL_TIM_OC_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel)
|
|||||||
HAL_StatusTypeDef status = HAL_OK;
|
HAL_StatusTypeDef status = HAL_OK;
|
||||||
|
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel));
|
assert_param(IS_TIM_CCX_CHANNEL(htim->Instance, Channel));
|
||||||
|
|
||||||
switch (Channel)
|
switch (Channel)
|
||||||
{
|
{
|
||||||
@ -1065,7 +1065,7 @@ HAL_StatusTypeDef HAL_TIM_OC_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel
|
|||||||
uint32_t tmpsmcr;
|
uint32_t tmpsmcr;
|
||||||
|
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel));
|
assert_param(IS_TIM_CCX_CHANNEL(htim->Instance, Channel));
|
||||||
|
|
||||||
/* Set the TIM channel state */
|
/* Set the TIM channel state */
|
||||||
if (TIM_CHANNEL_STATE_GET(htim, Channel) == HAL_TIM_CHANNEL_STATE_BUSY)
|
if (TIM_CHANNEL_STATE_GET(htim, Channel) == HAL_TIM_CHANNEL_STATE_BUSY)
|
||||||
@ -1227,7 +1227,7 @@ HAL_StatusTypeDef HAL_TIM_OC_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel)
|
|||||||
HAL_StatusTypeDef status = HAL_OK;
|
HAL_StatusTypeDef status = HAL_OK;
|
||||||
|
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel));
|
assert_param(IS_TIM_CCX_CHANNEL(htim->Instance, Channel));
|
||||||
|
|
||||||
switch (Channel)
|
switch (Channel)
|
||||||
{
|
{
|
||||||
@ -1565,7 +1565,7 @@ HAL_StatusTypeDef HAL_TIM_PWM_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel
|
|||||||
uint32_t tmpsmcr;
|
uint32_t tmpsmcr;
|
||||||
|
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel));
|
assert_param(IS_TIM_CCX_CHANNEL(htim->Instance, Channel));
|
||||||
|
|
||||||
/* Check the TIM channel state */
|
/* Check the TIM channel state */
|
||||||
if (TIM_CHANNEL_STATE_GET(htim, Channel) != HAL_TIM_CHANNEL_STATE_READY)
|
if (TIM_CHANNEL_STATE_GET(htim, Channel) != HAL_TIM_CHANNEL_STATE_READY)
|
||||||
@ -1657,7 +1657,7 @@ HAL_StatusTypeDef HAL_TIM_PWM_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel)
|
|||||||
HAL_StatusTypeDef status = HAL_OK;
|
HAL_StatusTypeDef status = HAL_OK;
|
||||||
|
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel));
|
assert_param(IS_TIM_CCX_CHANNEL(htim->Instance, Channel));
|
||||||
|
|
||||||
switch (Channel)
|
switch (Channel)
|
||||||
{
|
{
|
||||||
@ -1736,7 +1736,7 @@ HAL_StatusTypeDef HAL_TIM_PWM_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channe
|
|||||||
uint32_t tmpsmcr;
|
uint32_t tmpsmcr;
|
||||||
|
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel));
|
assert_param(IS_TIM_CCX_CHANNEL(htim->Instance, Channel));
|
||||||
|
|
||||||
/* Set the TIM channel state */
|
/* Set the TIM channel state */
|
||||||
if (TIM_CHANNEL_STATE_GET(htim, Channel) == HAL_TIM_CHANNEL_STATE_BUSY)
|
if (TIM_CHANNEL_STATE_GET(htim, Channel) == HAL_TIM_CHANNEL_STATE_BUSY)
|
||||||
@ -1897,7 +1897,7 @@ HAL_StatusTypeDef HAL_TIM_PWM_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel
|
|||||||
HAL_StatusTypeDef status = HAL_OK;
|
HAL_StatusTypeDef status = HAL_OK;
|
||||||
|
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel));
|
assert_param(IS_TIM_CCX_CHANNEL(htim->Instance, Channel));
|
||||||
|
|
||||||
switch (Channel)
|
switch (Channel)
|
||||||
{
|
{
|
||||||
@ -2141,7 +2141,7 @@ HAL_StatusTypeDef HAL_TIM_IC_Start(TIM_HandleTypeDef *htim, uint32_t Channel)
|
|||||||
HAL_TIM_ChannelStateTypeDef complementary_channel_state = TIM_CHANNEL_N_STATE_GET(htim, Channel);
|
HAL_TIM_ChannelStateTypeDef complementary_channel_state = TIM_CHANNEL_N_STATE_GET(htim, Channel);
|
||||||
|
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel));
|
assert_param(IS_TIM_CCX_CHANNEL(htim->Instance, Channel));
|
||||||
|
|
||||||
/* Check the TIM channel state */
|
/* Check the TIM channel state */
|
||||||
if ((channel_state != HAL_TIM_CHANNEL_STATE_READY)
|
if ((channel_state != HAL_TIM_CHANNEL_STATE_READY)
|
||||||
@ -2189,7 +2189,7 @@ HAL_StatusTypeDef HAL_TIM_IC_Start(TIM_HandleTypeDef *htim, uint32_t Channel)
|
|||||||
HAL_StatusTypeDef HAL_TIM_IC_Stop(TIM_HandleTypeDef *htim, uint32_t Channel)
|
HAL_StatusTypeDef HAL_TIM_IC_Stop(TIM_HandleTypeDef *htim, uint32_t Channel)
|
||||||
{
|
{
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel));
|
assert_param(IS_TIM_CCX_CHANNEL(htim->Instance, Channel));
|
||||||
|
|
||||||
/* Disable the Input Capture channel */
|
/* Disable the Input Capture channel */
|
||||||
TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_DISABLE);
|
TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_DISABLE);
|
||||||
@ -2225,7 +2225,7 @@ HAL_StatusTypeDef HAL_TIM_IC_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel)
|
|||||||
HAL_TIM_ChannelStateTypeDef complementary_channel_state = TIM_CHANNEL_N_STATE_GET(htim, Channel);
|
HAL_TIM_ChannelStateTypeDef complementary_channel_state = TIM_CHANNEL_N_STATE_GET(htim, Channel);
|
||||||
|
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel));
|
assert_param(IS_TIM_CCX_CHANNEL(htim->Instance, Channel));
|
||||||
|
|
||||||
/* Check the TIM channel state */
|
/* Check the TIM channel state */
|
||||||
if ((channel_state != HAL_TIM_CHANNEL_STATE_READY)
|
if ((channel_state != HAL_TIM_CHANNEL_STATE_READY)
|
||||||
@ -2313,7 +2313,7 @@ HAL_StatusTypeDef HAL_TIM_IC_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel)
|
|||||||
HAL_StatusTypeDef status = HAL_OK;
|
HAL_StatusTypeDef status = HAL_OK;
|
||||||
|
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel));
|
assert_param(IS_TIM_CCX_CHANNEL(htim->Instance, Channel));
|
||||||
|
|
||||||
switch (Channel)
|
switch (Channel)
|
||||||
{
|
{
|
||||||
@ -2389,7 +2389,7 @@ HAL_StatusTypeDef HAL_TIM_IC_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel
|
|||||||
HAL_TIM_ChannelStateTypeDef complementary_channel_state = TIM_CHANNEL_N_STATE_GET(htim, Channel);
|
HAL_TIM_ChannelStateTypeDef complementary_channel_state = TIM_CHANNEL_N_STATE_GET(htim, Channel);
|
||||||
|
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel));
|
assert_param(IS_TIM_CCX_CHANNEL(htim->Instance, Channel));
|
||||||
assert_param(IS_TIM_DMA_CC_INSTANCE(htim->Instance));
|
assert_param(IS_TIM_DMA_CC_INSTANCE(htim->Instance));
|
||||||
|
|
||||||
/* Set the TIM channel state */
|
/* Set the TIM channel state */
|
||||||
@ -2544,7 +2544,7 @@ HAL_StatusTypeDef HAL_TIM_IC_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel)
|
|||||||
HAL_StatusTypeDef status = HAL_OK;
|
HAL_StatusTypeDef status = HAL_OK;
|
||||||
|
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel));
|
assert_param(IS_TIM_CCX_CHANNEL(htim->Instance, Channel));
|
||||||
assert_param(IS_TIM_DMA_CC_INSTANCE(htim->Instance));
|
assert_param(IS_TIM_DMA_CC_INSTANCE(htim->Instance));
|
||||||
|
|
||||||
/* Disable the Input Capture channel */
|
/* Disable the Input Capture channel */
|
||||||
@ -3841,13 +3841,16 @@ HAL_StatusTypeDef HAL_TIM_Encoder_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Cha
|
|||||||
*/
|
*/
|
||||||
void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim)
|
void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim)
|
||||||
{
|
{
|
||||||
|
uint32_t itsource = htim->Instance->DIER;
|
||||||
|
uint32_t itflag = htim->Instance->SR;
|
||||||
|
|
||||||
/* Capture compare 1 event */
|
/* Capture compare 1 event */
|
||||||
if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_CC1) != RESET)
|
if ((itflag & (TIM_FLAG_CC1)) == (TIM_FLAG_CC1))
|
||||||
{
|
{
|
||||||
if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_CC1) != RESET)
|
if ((itsource & (TIM_IT_CC1)) == (TIM_IT_CC1))
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
__HAL_TIM_CLEAR_IT(htim, TIM_IT_CC1);
|
__HAL_TIM_CLEAR_FLAG(htim, TIM_FLAG_CC1);
|
||||||
htim->Channel = HAL_TIM_ACTIVE_CHANNEL_1;
|
htim->Channel = HAL_TIM_ACTIVE_CHANNEL_1;
|
||||||
|
|
||||||
/* Input capture event */
|
/* Input capture event */
|
||||||
@ -3875,11 +3878,11 @@ void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Capture compare 2 event */
|
/* Capture compare 2 event */
|
||||||
if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_CC2) != RESET)
|
if ((itflag & (TIM_FLAG_CC2)) == (TIM_FLAG_CC2))
|
||||||
{
|
{
|
||||||
if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_CC2) != RESET)
|
if ((itsource & (TIM_IT_CC2)) == (TIM_IT_CC2))
|
||||||
{
|
{
|
||||||
__HAL_TIM_CLEAR_IT(htim, TIM_IT_CC2);
|
__HAL_TIM_CLEAR_FLAG(htim, TIM_FLAG_CC2);
|
||||||
htim->Channel = HAL_TIM_ACTIVE_CHANNEL_2;
|
htim->Channel = HAL_TIM_ACTIVE_CHANNEL_2;
|
||||||
/* Input capture event */
|
/* Input capture event */
|
||||||
if ((htim->Instance->CCMR1 & TIM_CCMR1_CC2S) != 0x00U)
|
if ((htim->Instance->CCMR1 & TIM_CCMR1_CC2S) != 0x00U)
|
||||||
@ -3905,11 +3908,11 @@ void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Capture compare 3 event */
|
/* Capture compare 3 event */
|
||||||
if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_CC3) != RESET)
|
if ((itflag & (TIM_FLAG_CC3)) == (TIM_FLAG_CC3))
|
||||||
{
|
{
|
||||||
if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_CC3) != RESET)
|
if ((itsource & (TIM_IT_CC3)) == (TIM_IT_CC3))
|
||||||
{
|
{
|
||||||
__HAL_TIM_CLEAR_IT(htim, TIM_IT_CC3);
|
__HAL_TIM_CLEAR_FLAG(htim, TIM_FLAG_CC3);
|
||||||
htim->Channel = HAL_TIM_ACTIVE_CHANNEL_3;
|
htim->Channel = HAL_TIM_ACTIVE_CHANNEL_3;
|
||||||
/* Input capture event */
|
/* Input capture event */
|
||||||
if ((htim->Instance->CCMR2 & TIM_CCMR2_CC3S) != 0x00U)
|
if ((htim->Instance->CCMR2 & TIM_CCMR2_CC3S) != 0x00U)
|
||||||
@ -3935,11 +3938,11 @@ void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Capture compare 4 event */
|
/* Capture compare 4 event */
|
||||||
if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_CC4) != RESET)
|
if ((itflag & (TIM_FLAG_CC4)) == (TIM_FLAG_CC4))
|
||||||
{
|
{
|
||||||
if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_CC4) != RESET)
|
if ((itsource & (TIM_IT_CC4)) == (TIM_IT_CC4))
|
||||||
{
|
{
|
||||||
__HAL_TIM_CLEAR_IT(htim, TIM_IT_CC4);
|
__HAL_TIM_CLEAR_FLAG(htim, TIM_FLAG_CC4);
|
||||||
htim->Channel = HAL_TIM_ACTIVE_CHANNEL_4;
|
htim->Channel = HAL_TIM_ACTIVE_CHANNEL_4;
|
||||||
/* Input capture event */
|
/* Input capture event */
|
||||||
if ((htim->Instance->CCMR2 & TIM_CCMR2_CC4S) != 0x00U)
|
if ((htim->Instance->CCMR2 & TIM_CCMR2_CC4S) != 0x00U)
|
||||||
@ -3965,11 +3968,11 @@ void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* TIM Update event */
|
/* TIM Update event */
|
||||||
if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_UPDATE) != RESET)
|
if ((itflag & (TIM_FLAG_UPDATE)) == (TIM_FLAG_UPDATE))
|
||||||
{
|
{
|
||||||
if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_UPDATE) != RESET)
|
if ((itsource & (TIM_IT_UPDATE)) == (TIM_IT_UPDATE))
|
||||||
{
|
{
|
||||||
__HAL_TIM_CLEAR_IT(htim, TIM_IT_UPDATE);
|
__HAL_TIM_CLEAR_FLAG(htim, TIM_FLAG_UPDATE);
|
||||||
#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
|
#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
|
||||||
htim->PeriodElapsedCallback(htim);
|
htim->PeriodElapsedCallback(htim);
|
||||||
#else
|
#else
|
||||||
@ -3978,11 +3981,11 @@ void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* TIM Break input event */
|
/* TIM Break input event */
|
||||||
if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_BREAK) != RESET)
|
if ((itflag & (TIM_FLAG_BREAK)) == (TIM_FLAG_BREAK))
|
||||||
{
|
{
|
||||||
if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_BREAK) != RESET)
|
if ((itsource & (TIM_IT_BREAK)) == (TIM_IT_BREAK))
|
||||||
{
|
{
|
||||||
__HAL_TIM_CLEAR_IT(htim, TIM_IT_BREAK);
|
__HAL_TIM_CLEAR_FLAG(htim, TIM_FLAG_BREAK);
|
||||||
#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
|
#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
|
||||||
htim->BreakCallback(htim);
|
htim->BreakCallback(htim);
|
||||||
#else
|
#else
|
||||||
@ -3992,9 +3995,9 @@ void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim)
|
|||||||
}
|
}
|
||||||
#if defined(TIM_BDTR_BK2E)
|
#if defined(TIM_BDTR_BK2E)
|
||||||
/* TIM Break2 input event */
|
/* TIM Break2 input event */
|
||||||
if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_BREAK2) != RESET)
|
if ((itflag & (TIM_FLAG_BREAK2)) == (TIM_FLAG_BREAK2))
|
||||||
{
|
{
|
||||||
if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_BREAK) != RESET)
|
if ((itsource & (TIM_IT_BREAK)) == (TIM_IT_BREAK))
|
||||||
{
|
{
|
||||||
__HAL_TIM_CLEAR_FLAG(htim, TIM_FLAG_BREAK2);
|
__HAL_TIM_CLEAR_FLAG(htim, TIM_FLAG_BREAK2);
|
||||||
#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
|
#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
|
||||||
@ -4006,11 +4009,11 @@ void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim)
|
|||||||
}
|
}
|
||||||
#endif /* TIM_BDTR_BK2E */
|
#endif /* TIM_BDTR_BK2E */
|
||||||
/* TIM Trigger detection event */
|
/* TIM Trigger detection event */
|
||||||
if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_TRIGGER) != RESET)
|
if ((itflag & (TIM_FLAG_TRIGGER)) == (TIM_FLAG_TRIGGER))
|
||||||
{
|
{
|
||||||
if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_TRIGGER) != RESET)
|
if ((itsource & (TIM_IT_TRIGGER)) == (TIM_IT_TRIGGER))
|
||||||
{
|
{
|
||||||
__HAL_TIM_CLEAR_IT(htim, TIM_IT_TRIGGER);
|
__HAL_TIM_CLEAR_FLAG(htim, TIM_FLAG_TRIGGER);
|
||||||
#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
|
#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
|
||||||
htim->TriggerCallback(htim);
|
htim->TriggerCallback(htim);
|
||||||
#else
|
#else
|
||||||
@ -4019,11 +4022,11 @@ void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* TIM commutation event */
|
/* TIM commutation event */
|
||||||
if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_COM) != RESET)
|
if ((itflag & (TIM_FLAG_COM)) == (TIM_FLAG_COM))
|
||||||
{
|
{
|
||||||
if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_COM) != RESET)
|
if ((itsource & (TIM_IT_COM)) == (TIM_IT_COM))
|
||||||
{
|
{
|
||||||
__HAL_TIM_CLEAR_IT(htim, TIM_FLAG_COM);
|
__HAL_TIM_CLEAR_FLAG(htim, TIM_FLAG_COM);
|
||||||
#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
|
#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
|
||||||
htim->CommutationCallback(htim);
|
htim->CommutationCallback(htim);
|
||||||
#else
|
#else
|
||||||
@ -4583,7 +4586,8 @@ HAL_StatusTypeDef HAL_TIM_OnePulse_ConfigChannel(TIM_HandleTypeDef *htim, TIM_O
|
|||||||
* @retval HAL status
|
* @retval HAL status
|
||||||
*/
|
*/
|
||||||
HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStart(TIM_HandleTypeDef *htim, uint32_t BurstBaseAddress,
|
HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStart(TIM_HandleTypeDef *htim, uint32_t BurstBaseAddress,
|
||||||
uint32_t BurstRequestSrc, const uint32_t *BurstBuffer, uint32_t BurstLength)
|
uint32_t BurstRequestSrc, const uint32_t *BurstBuffer,
|
||||||
|
uint32_t BurstLength)
|
||||||
{
|
{
|
||||||
HAL_StatusTypeDef status;
|
HAL_StatusTypeDef status;
|
||||||
|
|
||||||
@ -7004,6 +7008,13 @@ void TIM_Base_SetConfig(TIM_TypeDef *TIMx, const TIM_Base_InitTypeDef *Structure
|
|||||||
/* Generate an update event to reload the Prescaler
|
/* Generate an update event to reload the Prescaler
|
||||||
and the repetition counter (only for advanced timer) value immediately */
|
and the repetition counter (only for advanced timer) value immediately */
|
||||||
TIMx->EGR = TIM_EGR_UG;
|
TIMx->EGR = TIM_EGR_UG;
|
||||||
|
|
||||||
|
/* Check if the update flag is set after the Update Generation, if so clear the UIF flag */
|
||||||
|
if (HAL_IS_BIT_SET(TIMx->SR, TIM_FLAG_UPDATE))
|
||||||
|
{
|
||||||
|
/* Clear the update flag */
|
||||||
|
CLEAR_BIT(TIMx->SR, TIM_FLAG_UPDATE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -7018,11 +7029,12 @@ static void TIM_OC1_SetConfig(TIM_TypeDef *TIMx, const TIM_OC_InitTypeDef *OC_Co
|
|||||||
uint32_t tmpccer;
|
uint32_t tmpccer;
|
||||||
uint32_t tmpcr2;
|
uint32_t tmpcr2;
|
||||||
|
|
||||||
|
/* Get the TIMx CCER register value */
|
||||||
|
tmpccer = TIMx->CCER;
|
||||||
|
|
||||||
/* Disable the Channel 1: Reset the CC1E Bit */
|
/* Disable the Channel 1: Reset the CC1E Bit */
|
||||||
TIMx->CCER &= ~TIM_CCER_CC1E;
|
TIMx->CCER &= ~TIM_CCER_CC1E;
|
||||||
|
|
||||||
/* Get the TIMx CCER register value */
|
|
||||||
tmpccer = TIMx->CCER;
|
|
||||||
/* Get the TIMx CR2 register value */
|
/* Get the TIMx CR2 register value */
|
||||||
tmpcr2 = TIMx->CR2;
|
tmpcr2 = TIMx->CR2;
|
||||||
|
|
||||||
@ -7093,11 +7105,12 @@ void TIM_OC2_SetConfig(TIM_TypeDef *TIMx, const TIM_OC_InitTypeDef *OC_Config)
|
|||||||
uint32_t tmpccer;
|
uint32_t tmpccer;
|
||||||
uint32_t tmpcr2;
|
uint32_t tmpcr2;
|
||||||
|
|
||||||
|
/* Get the TIMx CCER register value */
|
||||||
|
tmpccer = TIMx->CCER;
|
||||||
|
|
||||||
/* Disable the Channel 2: Reset the CC2E Bit */
|
/* Disable the Channel 2: Reset the CC2E Bit */
|
||||||
TIMx->CCER &= ~TIM_CCER_CC2E;
|
TIMx->CCER &= ~TIM_CCER_CC2E;
|
||||||
|
|
||||||
/* Get the TIMx CCER register value */
|
|
||||||
tmpccer = TIMx->CCER;
|
|
||||||
/* Get the TIMx CR2 register value */
|
/* Get the TIMx CR2 register value */
|
||||||
tmpcr2 = TIMx->CR2;
|
tmpcr2 = TIMx->CR2;
|
||||||
|
|
||||||
@ -7126,7 +7139,6 @@ void TIM_OC2_SetConfig(TIM_TypeDef *TIMx, const TIM_OC_InitTypeDef *OC_Config)
|
|||||||
tmpccer |= (OC_Config->OCNPolarity << 4U);
|
tmpccer |= (OC_Config->OCNPolarity << 4U);
|
||||||
/* Reset the Output N State */
|
/* Reset the Output N State */
|
||||||
tmpccer &= ~TIM_CCER_CC2NE;
|
tmpccer &= ~TIM_CCER_CC2NE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_TIM_BREAK_INSTANCE(TIMx))
|
if (IS_TIM_BREAK_INSTANCE(TIMx))
|
||||||
@ -7171,11 +7183,12 @@ static void TIM_OC3_SetConfig(TIM_TypeDef *TIMx, const TIM_OC_InitTypeDef *OC_Co
|
|||||||
uint32_t tmpccer;
|
uint32_t tmpccer;
|
||||||
uint32_t tmpcr2;
|
uint32_t tmpcr2;
|
||||||
|
|
||||||
|
/* Get the TIMx CCER register value */
|
||||||
|
tmpccer = TIMx->CCER;
|
||||||
|
|
||||||
/* Disable the Channel 3: Reset the CC2E Bit */
|
/* Disable the Channel 3: Reset the CC2E Bit */
|
||||||
TIMx->CCER &= ~TIM_CCER_CC3E;
|
TIMx->CCER &= ~TIM_CCER_CC3E;
|
||||||
|
|
||||||
/* Get the TIMx CCER register value */
|
|
||||||
tmpccer = TIMx->CCER;
|
|
||||||
/* Get the TIMx CR2 register value */
|
/* Get the TIMx CR2 register value */
|
||||||
tmpcr2 = TIMx->CR2;
|
tmpcr2 = TIMx->CR2;
|
||||||
|
|
||||||
@ -7247,11 +7260,12 @@ static void TIM_OC4_SetConfig(TIM_TypeDef *TIMx, const TIM_OC_InitTypeDef *OC_Co
|
|||||||
uint32_t tmpccer;
|
uint32_t tmpccer;
|
||||||
uint32_t tmpcr2;
|
uint32_t tmpcr2;
|
||||||
|
|
||||||
|
/* Get the TIMx CCER register value */
|
||||||
|
tmpccer = TIMx->CCER;
|
||||||
|
|
||||||
/* Disable the Channel 4: Reset the CC4E Bit */
|
/* Disable the Channel 4: Reset the CC4E Bit */
|
||||||
TIMx->CCER &= ~TIM_CCER_CC4E;
|
TIMx->CCER &= ~TIM_CCER_CC4E;
|
||||||
|
|
||||||
/* Get the TIMx CCER register value */
|
|
||||||
tmpccer = TIMx->CCER;
|
|
||||||
/* Get the TIMx CR2 register value */
|
/* Get the TIMx CR2 register value */
|
||||||
tmpcr2 = TIMx->CR2;
|
tmpcr2 = TIMx->CR2;
|
||||||
|
|
||||||
@ -7311,11 +7325,12 @@ static void TIM_OC5_SetConfig(TIM_TypeDef *TIMx,
|
|||||||
uint32_t tmpccer;
|
uint32_t tmpccer;
|
||||||
uint32_t tmpcr2;
|
uint32_t tmpcr2;
|
||||||
|
|
||||||
|
/* Get the TIMx CCER register value */
|
||||||
|
tmpccer = TIMx->CCER;
|
||||||
|
|
||||||
/* Disable the output: Reset the CCxE Bit */
|
/* Disable the output: Reset the CCxE Bit */
|
||||||
TIMx->CCER &= ~TIM_CCER_CC5E;
|
TIMx->CCER &= ~TIM_CCER_CC5E;
|
||||||
|
|
||||||
/* Get the TIMx CCER register value */
|
|
||||||
tmpccer = TIMx->CCER;
|
|
||||||
/* Get the TIMx CR2 register value */
|
/* Get the TIMx CR2 register value */
|
||||||
tmpcr2 = TIMx->CR2;
|
tmpcr2 = TIMx->CR2;
|
||||||
/* Get the TIMx CCMR1 register value */
|
/* Get the TIMx CCMR1 register value */
|
||||||
@ -7366,11 +7381,12 @@ static void TIM_OC6_SetConfig(TIM_TypeDef *TIMx,
|
|||||||
uint32_t tmpccer;
|
uint32_t tmpccer;
|
||||||
uint32_t tmpcr2;
|
uint32_t tmpcr2;
|
||||||
|
|
||||||
|
/* Get the TIMx CCER register value */
|
||||||
|
tmpccer = TIMx->CCER;
|
||||||
|
|
||||||
/* Disable the output: Reset the CCxE Bit */
|
/* Disable the output: Reset the CCxE Bit */
|
||||||
TIMx->CCER &= ~TIM_CCER_CC6E;
|
TIMx->CCER &= ~TIM_CCER_CC6E;
|
||||||
|
|
||||||
/* Get the TIMx CCER register value */
|
|
||||||
tmpccer = TIMx->CCER;
|
|
||||||
/* Get the TIMx CR2 register value */
|
/* Get the TIMx CR2 register value */
|
||||||
tmpcr2 = TIMx->CR2;
|
tmpcr2 = TIMx->CR2;
|
||||||
/* Get the TIMx CCMR1 register value */
|
/* Get the TIMx CCMR1 register value */
|
||||||
@ -7555,9 +7571,9 @@ void TIM_TI1_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_
|
|||||||
uint32_t tmpccer;
|
uint32_t tmpccer;
|
||||||
|
|
||||||
/* Disable the Channel 1: Reset the CC1E Bit */
|
/* Disable the Channel 1: Reset the CC1E Bit */
|
||||||
|
tmpccer = TIMx->CCER;
|
||||||
TIMx->CCER &= ~TIM_CCER_CC1E;
|
TIMx->CCER &= ~TIM_CCER_CC1E;
|
||||||
tmpccmr1 = TIMx->CCMR1;
|
tmpccmr1 = TIMx->CCMR1;
|
||||||
tmpccer = TIMx->CCER;
|
|
||||||
|
|
||||||
/* Select the Input */
|
/* Select the Input */
|
||||||
if (IS_TIM_CC2_INSTANCE(TIMx) != RESET)
|
if (IS_TIM_CC2_INSTANCE(TIMx) != RESET)
|
||||||
@ -7645,9 +7661,9 @@ static void TIM_TI2_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32
|
|||||||
uint32_t tmpccer;
|
uint32_t tmpccer;
|
||||||
|
|
||||||
/* Disable the Channel 2: Reset the CC2E Bit */
|
/* Disable the Channel 2: Reset the CC2E Bit */
|
||||||
|
tmpccer = TIMx->CCER;
|
||||||
TIMx->CCER &= ~TIM_CCER_CC2E;
|
TIMx->CCER &= ~TIM_CCER_CC2E;
|
||||||
tmpccmr1 = TIMx->CCMR1;
|
tmpccmr1 = TIMx->CCMR1;
|
||||||
tmpccer = TIMx->CCER;
|
|
||||||
|
|
||||||
/* Select the Input */
|
/* Select the Input */
|
||||||
tmpccmr1 &= ~TIM_CCMR1_CC2S;
|
tmpccmr1 &= ~TIM_CCMR1_CC2S;
|
||||||
@ -7684,9 +7700,9 @@ static void TIM_TI2_ConfigInputStage(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity,
|
|||||||
uint32_t tmpccer;
|
uint32_t tmpccer;
|
||||||
|
|
||||||
/* Disable the Channel 2: Reset the CC2E Bit */
|
/* Disable the Channel 2: Reset the CC2E Bit */
|
||||||
|
tmpccer = TIMx->CCER;
|
||||||
TIMx->CCER &= ~TIM_CCER_CC2E;
|
TIMx->CCER &= ~TIM_CCER_CC2E;
|
||||||
tmpccmr1 = TIMx->CCMR1;
|
tmpccmr1 = TIMx->CCMR1;
|
||||||
tmpccer = TIMx->CCER;
|
|
||||||
|
|
||||||
/* Set the filter */
|
/* Set the filter */
|
||||||
tmpccmr1 &= ~TIM_CCMR1_IC2F;
|
tmpccmr1 &= ~TIM_CCMR1_IC2F;
|
||||||
@ -7728,9 +7744,9 @@ static void TIM_TI3_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32
|
|||||||
uint32_t tmpccer;
|
uint32_t tmpccer;
|
||||||
|
|
||||||
/* Disable the Channel 3: Reset the CC3E Bit */
|
/* Disable the Channel 3: Reset the CC3E Bit */
|
||||||
|
tmpccer = TIMx->CCER;
|
||||||
TIMx->CCER &= ~TIM_CCER_CC3E;
|
TIMx->CCER &= ~TIM_CCER_CC3E;
|
||||||
tmpccmr2 = TIMx->CCMR2;
|
tmpccmr2 = TIMx->CCMR2;
|
||||||
tmpccer = TIMx->CCER;
|
|
||||||
|
|
||||||
/* Select the Input */
|
/* Select the Input */
|
||||||
tmpccmr2 &= ~TIM_CCMR2_CC3S;
|
tmpccmr2 &= ~TIM_CCMR2_CC3S;
|
||||||
@ -7776,9 +7792,9 @@ static void TIM_TI4_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32
|
|||||||
uint32_t tmpccer;
|
uint32_t tmpccer;
|
||||||
|
|
||||||
/* Disable the Channel 4: Reset the CC4E Bit */
|
/* Disable the Channel 4: Reset the CC4E Bit */
|
||||||
|
tmpccer = TIMx->CCER;
|
||||||
TIMx->CCER &= ~TIM_CCER_CC4E;
|
TIMx->CCER &= ~TIM_CCER_CC4E;
|
||||||
tmpccmr2 = TIMx->CCMR2;
|
tmpccmr2 = TIMx->CCMR2;
|
||||||
tmpccer = TIMx->CCER;
|
|
||||||
|
|
||||||
/* Select the Input */
|
/* Select the Input */
|
||||||
tmpccmr2 &= ~TIM_CCMR2_CC4S;
|
tmpccmr2 &= ~TIM_CCMR2_CC4S;
|
||||||
|
@ -837,7 +837,7 @@ HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channe
|
|||||||
|
|
||||||
/* Disable the TIM Break interrupt (only if no more channel is active) */
|
/* Disable the TIM Break interrupt (only if no more channel is active) */
|
||||||
tmpccer = htim->Instance->CCER;
|
tmpccer = htim->Instance->CCER;
|
||||||
if ((tmpccer & (TIM_CCER_CC1NE | TIM_CCER_CC2NE | TIM_CCER_CC3NE)) == (uint32_t)RESET)
|
if ((tmpccer & TIM_CCER_CCxNE_MASK) == (uint32_t)RESET)
|
||||||
{
|
{
|
||||||
__HAL_TIM_DISABLE_IT(htim, TIM_IT_BREAK);
|
__HAL_TIM_DISABLE_IT(htim, TIM_IT_BREAK);
|
||||||
}
|
}
|
||||||
@ -1083,17 +1083,6 @@ HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Chann
|
|||||||
(+) Stop the Complementary PWM and disable interrupts.
|
(+) Stop the Complementary PWM and disable interrupts.
|
||||||
(+) Start the Complementary PWM and enable DMA transfers.
|
(+) Start the Complementary PWM and enable DMA transfers.
|
||||||
(+) Stop the Complementary PWM and disable DMA transfers.
|
(+) Stop the Complementary PWM and disable DMA transfers.
|
||||||
(+) Start the Complementary Input Capture measurement.
|
|
||||||
(+) Stop the Complementary Input Capture.
|
|
||||||
(+) Start the Complementary Input Capture and enable interrupts.
|
|
||||||
(+) Stop the Complementary Input Capture and disable interrupts.
|
|
||||||
(+) Start the Complementary Input Capture and enable DMA transfers.
|
|
||||||
(+) Stop the Complementary Input Capture and disable DMA transfers.
|
|
||||||
(+) Start the Complementary One Pulse generation.
|
|
||||||
(+) Stop the Complementary One Pulse.
|
|
||||||
(+) Start the Complementary One Pulse and enable interrupts.
|
|
||||||
(+) Stop the Complementary One Pulse and disable interrupts.
|
|
||||||
|
|
||||||
@endverbatim
|
@endverbatim
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
@ -1319,7 +1308,7 @@ HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Chann
|
|||||||
|
|
||||||
/* Disable the TIM Break interrupt (only if no more channel is active) */
|
/* Disable the TIM Break interrupt (only if no more channel is active) */
|
||||||
tmpccer = htim->Instance->CCER;
|
tmpccer = htim->Instance->CCER;
|
||||||
if ((tmpccer & (TIM_CCER_CC1NE | TIM_CCER_CC2NE | TIM_CCER_CC3NE)) == (uint32_t)RESET)
|
if ((tmpccer & TIM_CCER_CCxNE_MASK) == (uint32_t)RESET)
|
||||||
{
|
{
|
||||||
__HAL_TIM_DISABLE_IT(htim, TIM_IT_BREAK);
|
__HAL_TIM_DISABLE_IT(htim, TIM_IT_BREAK);
|
||||||
}
|
}
|
||||||
@ -2260,7 +2249,7 @@ HAL_StatusTypeDef HAL_TIMEx_GroupChannel5(TIM_HandleTypeDef *htim, uint32_t Chan
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Hall commutation changed callback in non-blocking mode
|
* @brief Commutation callback in non-blocking mode
|
||||||
* @param htim TIM handle
|
* @param htim TIM handle
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
@ -2274,7 +2263,7 @@ __weak void HAL_TIMEx_CommutCallback(TIM_HandleTypeDef *htim)
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @brief Hall commutation changed half complete callback in non-blocking mode
|
* @brief Commutation half complete callback in non-blocking mode
|
||||||
* @param htim TIM handle
|
* @param htim TIM handle
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
@ -2289,7 +2278,7 @@ __weak void HAL_TIMEx_CommutHalfCpltCallback(TIM_HandleTypeDef *htim)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Hall Break detection callback in non-blocking mode
|
* @brief Break detection callback in non-blocking mode
|
||||||
* @param htim TIM handle
|
* @param htim TIM handle
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
@ -2305,7 +2294,7 @@ __weak void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef *htim)
|
|||||||
|
|
||||||
#if defined(TIM_BDTR_BK2E)
|
#if defined(TIM_BDTR_BK2E)
|
||||||
/**
|
/**
|
||||||
* @brief Hall Break2 detection callback in non blocking mode
|
* @brief Break2 detection callback in non blocking mode
|
||||||
* @param htim: TIM handle
|
* @param htim: TIM handle
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
@ -2457,15 +2446,6 @@ static void TIM_DMADelayPulseNCplt(DMA_HandleTypeDef *hdma)
|
|||||||
TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_3, HAL_TIM_CHANNEL_STATE_READY);
|
TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_3, HAL_TIM_CHANNEL_STATE_READY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (hdma == htim->hdma[TIM_DMA_ID_CC4])
|
|
||||||
{
|
|
||||||
htim->Channel = HAL_TIM_ACTIVE_CHANNEL_4;
|
|
||||||
|
|
||||||
if (hdma->Init.Mode == DMA_NORMAL)
|
|
||||||
{
|
|
||||||
TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_4, HAL_TIM_CHANNEL_STATE_READY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* nothing to do */
|
/* nothing to do */
|
||||||
@ -2534,13 +2514,13 @@ static void TIM_CCxNChannelCmd(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t Cha
|
|||||||
{
|
{
|
||||||
uint32_t tmp;
|
uint32_t tmp;
|
||||||
|
|
||||||
tmp = TIM_CCER_CC1NE << (Channel & 0x1FU); /* 0x1FU = 31 bits max shift */
|
tmp = TIM_CCER_CC1NE << (Channel & 0xFU); /* 0xFU = 15 bits max shift */
|
||||||
|
|
||||||
/* Reset the CCxNE Bit */
|
/* Reset the CCxNE Bit */
|
||||||
TIMx->CCER &= ~tmp;
|
TIMx->CCER &= ~tmp;
|
||||||
|
|
||||||
/* Set or reset the CCxNE Bit */
|
/* Set or reset the CCxNE Bit */
|
||||||
TIMx->CCER |= (uint32_t)(ChannelNState << (Channel & 0x1FU)); /* 0x1FU = 31 bits max shift */
|
TIMx->CCER |= (uint32_t)(ChannelNState << (Channel & 0xFU)); /* 0xFU = 15 bits max shift */
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
|
@ -103,19 +103,19 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
|
|||||||
HAL_StatusTypeDef status;
|
HAL_StatusTypeDef status;
|
||||||
|
|
||||||
#ifdef RTC_CLOCK_SOURCE_LSE
|
#ifdef RTC_CLOCK_SOURCE_LSE
|
||||||
/* Configue LSE as RTC clock soucre */
|
/* Configure LSE as RTC clock source */
|
||||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
|
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
|
||||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
|
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
|
||||||
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
|
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
|
||||||
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
|
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
|
||||||
#elif defined (RTC_CLOCK_SOURCE_LSI)
|
#elif defined (RTC_CLOCK_SOURCE_LSI)
|
||||||
/* Configue LSI as RTC clock soucre */
|
/* Configure LSI as RTC clock source */
|
||||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI;
|
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI;
|
||||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
|
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
|
||||||
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
|
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
|
||||||
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
|
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
|
||||||
#elif defined (RTC_CLOCK_SOURCE_HSE)
|
#elif defined (RTC_CLOCK_SOURCE_HSE)
|
||||||
/* Configue HSE as RTC clock soucre */
|
/* Configure HSE as RTC clock source */
|
||||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
|
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
|
||||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
|
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
|
||||||
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
||||||
|
@ -110,19 +110,19 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
|
|||||||
HAL_StatusTypeDef status;
|
HAL_StatusTypeDef status;
|
||||||
|
|
||||||
#ifdef RTC_CLOCK_SOURCE_LSE
|
#ifdef RTC_CLOCK_SOURCE_LSE
|
||||||
/* Configue LSE as RTC clock soucre */
|
/* Configure LSE as RTC clock source */
|
||||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
|
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
|
||||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
|
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
|
||||||
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
|
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
|
||||||
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
|
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
|
||||||
#elif defined (RTC_CLOCK_SOURCE_LSI)
|
#elif defined (RTC_CLOCK_SOURCE_LSI)
|
||||||
/* Configue LSI as RTC clock soucre */
|
/* Configure LSI as RTC clock source */
|
||||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI;
|
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI;
|
||||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
|
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
|
||||||
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
|
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
|
||||||
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
|
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
|
||||||
#elif defined (RTC_CLOCK_SOURCE_HSE)
|
#elif defined (RTC_CLOCK_SOURCE_HSE)
|
||||||
/* Configue HSE as RTC clock soucre */
|
/* Configure HSE as RTC clock source */
|
||||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
|
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
|
||||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
|
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
|
||||||
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
||||||
|
@ -105,7 +105,7 @@
|
|||||||
|
|
||||||
[..]
|
[..]
|
||||||
Use function HAL_UART_UnRegisterCallback() to reset a callback to the default
|
Use function HAL_UART_UnRegisterCallback() to reset a callback to the default
|
||||||
weak (surcharged) function.
|
weak function.
|
||||||
HAL_UART_UnRegisterCallback() takes as parameters the HAL peripheral handle,
|
HAL_UART_UnRegisterCallback() takes as parameters the HAL peripheral handle,
|
||||||
and the Callback ID.
|
and the Callback ID.
|
||||||
This function allows to reset following callbacks:
|
This function allows to reset following callbacks:
|
||||||
@ -127,10 +127,10 @@
|
|||||||
|
|
||||||
[..]
|
[..]
|
||||||
By default, after the HAL_UART_Init() and when the state is HAL_UART_STATE_RESET
|
By default, after the HAL_UART_Init() and when the state is HAL_UART_STATE_RESET
|
||||||
all callbacks are set to the corresponding weak (surcharged) functions:
|
all callbacks are set to the corresponding weak functions:
|
||||||
examples HAL_UART_TxCpltCallback(), HAL_UART_RxHalfCpltCallback().
|
examples HAL_UART_TxCpltCallback(), HAL_UART_RxHalfCpltCallback().
|
||||||
Exception done for MspInit and MspDeInit functions that are respectively
|
Exception done for MspInit and MspDeInit functions that are respectively
|
||||||
reset to the legacy weak (surcharged) functions in the HAL_UART_Init()
|
reset to the legacy weak functions in the HAL_UART_Init()
|
||||||
and HAL_UART_DeInit() only when these callbacks are null (not registered beforehand).
|
and HAL_UART_DeInit() only when these callbacks are null (not registered beforehand).
|
||||||
If not, MspInit or MspDeInit are not null, the HAL_UART_Init() and HAL_UART_DeInit()
|
If not, MspInit or MspDeInit are not null, the HAL_UART_Init() and HAL_UART_DeInit()
|
||||||
keep and use the user MspInit/MspDeInit callbacks (registered beforehand).
|
keep and use the user MspInit/MspDeInit callbacks (registered beforehand).
|
||||||
@ -147,7 +147,7 @@
|
|||||||
[..]
|
[..]
|
||||||
When The compilation define USE_HAL_UART_REGISTER_CALLBACKS is set to 0 or
|
When The compilation define USE_HAL_UART_REGISTER_CALLBACKS is set to 0 or
|
||||||
not defined, the callback registration feature is not available
|
not defined, the callback registration feature is not available
|
||||||
and weak (surcharged) callbacks are used.
|
and weak callbacks are used.
|
||||||
|
|
||||||
|
|
||||||
@endverbatim
|
@endverbatim
|
||||||
@ -191,8 +191,8 @@
|
|||||||
/** @addtogroup UART_Private_Functions
|
/** @addtogroup UART_Private_Functions
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
static void UART_EndTxTransfer(UART_HandleTypeDef *huart);
|
|
||||||
static void UART_EndRxTransfer(UART_HandleTypeDef *huart);
|
static void UART_EndRxTransfer(UART_HandleTypeDef *huart);
|
||||||
|
static void UART_EndTxTransfer(UART_HandleTypeDef *huart);
|
||||||
static void UART_DMATransmitCplt(DMA_HandleTypeDef *hdma);
|
static void UART_DMATransmitCplt(DMA_HandleTypeDef *hdma);
|
||||||
static void UART_DMAReceiveCplt(DMA_HandleTypeDef *hdma);
|
static void UART_DMAReceiveCplt(DMA_HandleTypeDef *hdma);
|
||||||
static void UART_DMARxHalfCplt(DMA_HandleTypeDef *hdma);
|
static void UART_DMARxHalfCplt(DMA_HandleTypeDef *hdma);
|
||||||
@ -330,17 +330,19 @@ HAL_StatusTypeDef HAL_UART_Init(UART_HandleTypeDef *huart)
|
|||||||
|
|
||||||
__HAL_UART_DISABLE(huart);
|
__HAL_UART_DISABLE(huart);
|
||||||
|
|
||||||
|
/* Perform advanced settings configuration */
|
||||||
|
/* For some items, configuration requires to be done prior TE and RE bits are set */
|
||||||
|
if (huart->AdvancedInit.AdvFeatureInit != UART_ADVFEATURE_NO_INIT)
|
||||||
|
{
|
||||||
|
UART_AdvFeatureConfig(huart);
|
||||||
|
}
|
||||||
|
|
||||||
/* Set the UART Communication parameters */
|
/* Set the UART Communication parameters */
|
||||||
if (UART_SetConfig(huart) == HAL_ERROR)
|
if (UART_SetConfig(huart) == HAL_ERROR)
|
||||||
{
|
{
|
||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (huart->AdvancedInit.AdvFeatureInit != UART_ADVFEATURE_NO_INIT)
|
|
||||||
{
|
|
||||||
UART_AdvFeatureConfig(huart);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* In asynchronous mode, the following bits must be kept cleared:
|
/* In asynchronous mode, the following bits must be kept cleared:
|
||||||
- LINEN and CLKEN bits in the USART_CR2 register,
|
- LINEN and CLKEN bits in the USART_CR2 register,
|
||||||
- SCEN, HDSEL and IREN bits in the USART_CR3 register.*/
|
- SCEN, HDSEL and IREN bits in the USART_CR3 register.*/
|
||||||
@ -395,17 +397,19 @@ HAL_StatusTypeDef HAL_HalfDuplex_Init(UART_HandleTypeDef *huart)
|
|||||||
|
|
||||||
__HAL_UART_DISABLE(huart);
|
__HAL_UART_DISABLE(huart);
|
||||||
|
|
||||||
|
/* Perform advanced settings configuration */
|
||||||
|
/* For some items, configuration requires to be done prior TE and RE bits are set */
|
||||||
|
if (huart->AdvancedInit.AdvFeatureInit != UART_ADVFEATURE_NO_INIT)
|
||||||
|
{
|
||||||
|
UART_AdvFeatureConfig(huart);
|
||||||
|
}
|
||||||
|
|
||||||
/* Set the UART Communication parameters */
|
/* Set the UART Communication parameters */
|
||||||
if (UART_SetConfig(huart) == HAL_ERROR)
|
if (UART_SetConfig(huart) == HAL_ERROR)
|
||||||
{
|
{
|
||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (huart->AdvancedInit.AdvFeatureInit != UART_ADVFEATURE_NO_INIT)
|
|
||||||
{
|
|
||||||
UART_AdvFeatureConfig(huart);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* In half-duplex mode, the following bits must be kept cleared:
|
/* In half-duplex mode, the following bits must be kept cleared:
|
||||||
- LINEN and CLKEN bits in the USART_CR2 register,
|
- LINEN and CLKEN bits in the USART_CR2 register,
|
||||||
- SCEN and IREN bits in the USART_CR3 register.*/
|
- SCEN and IREN bits in the USART_CR3 register.*/
|
||||||
@ -481,17 +485,19 @@ HAL_StatusTypeDef HAL_LIN_Init(UART_HandleTypeDef *huart, uint32_t BreakDetectLe
|
|||||||
|
|
||||||
__HAL_UART_DISABLE(huart);
|
__HAL_UART_DISABLE(huart);
|
||||||
|
|
||||||
|
/* Perform advanced settings configuration */
|
||||||
|
/* For some items, configuration requires to be done prior TE and RE bits are set */
|
||||||
|
if (huart->AdvancedInit.AdvFeatureInit != UART_ADVFEATURE_NO_INIT)
|
||||||
|
{
|
||||||
|
UART_AdvFeatureConfig(huart);
|
||||||
|
}
|
||||||
|
|
||||||
/* Set the UART Communication parameters */
|
/* Set the UART Communication parameters */
|
||||||
if (UART_SetConfig(huart) == HAL_ERROR)
|
if (UART_SetConfig(huart) == HAL_ERROR)
|
||||||
{
|
{
|
||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (huart->AdvancedInit.AdvFeatureInit != UART_ADVFEATURE_NO_INIT)
|
|
||||||
{
|
|
||||||
UART_AdvFeatureConfig(huart);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* In LIN mode, the following bits must be kept cleared:
|
/* In LIN mode, the following bits must be kept cleared:
|
||||||
- LINEN and CLKEN bits in the USART_CR2 register,
|
- LINEN and CLKEN bits in the USART_CR2 register,
|
||||||
- SCEN and IREN bits in the USART_CR3 register.*/
|
- SCEN and IREN bits in the USART_CR3 register.*/
|
||||||
@ -565,17 +571,19 @@ HAL_StatusTypeDef HAL_MultiProcessor_Init(UART_HandleTypeDef *huart, uint8_t Add
|
|||||||
|
|
||||||
__HAL_UART_DISABLE(huart);
|
__HAL_UART_DISABLE(huart);
|
||||||
|
|
||||||
|
/* Perform advanced settings configuration */
|
||||||
|
/* For some items, configuration requires to be done prior TE and RE bits are set */
|
||||||
|
if (huart->AdvancedInit.AdvFeatureInit != UART_ADVFEATURE_NO_INIT)
|
||||||
|
{
|
||||||
|
UART_AdvFeatureConfig(huart);
|
||||||
|
}
|
||||||
|
|
||||||
/* Set the UART Communication parameters */
|
/* Set the UART Communication parameters */
|
||||||
if (UART_SetConfig(huart) == HAL_ERROR)
|
if (UART_SetConfig(huart) == HAL_ERROR)
|
||||||
{
|
{
|
||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (huart->AdvancedInit.AdvFeatureInit != UART_ADVFEATURE_NO_INIT)
|
|
||||||
{
|
|
||||||
UART_AdvFeatureConfig(huart);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* In multiprocessor mode, the following bits must be kept cleared:
|
/* In multiprocessor mode, the following bits must be kept cleared:
|
||||||
- LINEN and CLKEN bits in the USART_CR2 register,
|
- LINEN and CLKEN bits in the USART_CR2 register,
|
||||||
- SCEN, HDSEL and IREN bits in the USART_CR3 register. */
|
- SCEN, HDSEL and IREN bits in the USART_CR3 register. */
|
||||||
@ -678,7 +686,7 @@ __weak void HAL_UART_MspDeInit(UART_HandleTypeDef *huart)
|
|||||||
#if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
|
#if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
|
||||||
/**
|
/**
|
||||||
* @brief Register a User UART Callback
|
* @brief Register a User UART Callback
|
||||||
* To be used instead of the weak predefined callback
|
* To be used to override the weak predefined callback
|
||||||
* @note The HAL_UART_RegisterCallback() may be called before HAL_UART_Init(), HAL_HalfDuplex_Init(),
|
* @note The HAL_UART_RegisterCallback() may be called before HAL_UART_Init(), HAL_HalfDuplex_Init(),
|
||||||
* HAL_LIN_Init(), HAL_MultiProcessor_Init() or HAL_RS485Ex_Init() in HAL_UART_STATE_RESET to register
|
* HAL_LIN_Init(), HAL_MultiProcessor_Init() or HAL_RS485Ex_Init() in HAL_UART_STATE_RESET to register
|
||||||
* callbacks for HAL_UART_MSPINIT_CB_ID and HAL_UART_MSPDEINIT_CB_ID
|
* callbacks for HAL_UART_MSPINIT_CB_ID and HAL_UART_MSPDEINIT_CB_ID
|
||||||
@ -926,10 +934,7 @@ HAL_StatusTypeDef HAL_UART_RegisterRxEventCallback(UART_HandleTypeDef *huart, pU
|
|||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Process locked */
|
if (huart->RxState == HAL_UART_STATE_READY)
|
||||||
__HAL_LOCK(huart);
|
|
||||||
|
|
||||||
if (huart->gState == HAL_UART_STATE_READY)
|
|
||||||
{
|
{
|
||||||
huart->RxEventCallback = pCallback;
|
huart->RxEventCallback = pCallback;
|
||||||
}
|
}
|
||||||
@ -940,9 +945,6 @@ HAL_StatusTypeDef HAL_UART_RegisterRxEventCallback(UART_HandleTypeDef *huart, pU
|
|||||||
status = HAL_ERROR;
|
status = HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Release Lock */
|
|
||||||
__HAL_UNLOCK(huart);
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -956,10 +958,7 @@ HAL_StatusTypeDef HAL_UART_UnRegisterRxEventCallback(UART_HandleTypeDef *huart)
|
|||||||
{
|
{
|
||||||
HAL_StatusTypeDef status = HAL_OK;
|
HAL_StatusTypeDef status = HAL_OK;
|
||||||
|
|
||||||
/* Process locked */
|
if (huart->RxState == HAL_UART_STATE_READY)
|
||||||
__HAL_LOCK(huart);
|
|
||||||
|
|
||||||
if (huart->gState == HAL_UART_STATE_READY)
|
|
||||||
{
|
{
|
||||||
huart->RxEventCallback = HAL_UARTEx_RxEventCallback; /* Legacy weak UART Rx Event Callback */
|
huart->RxEventCallback = HAL_UARTEx_RxEventCallback; /* Legacy weak UART Rx Event Callback */
|
||||||
}
|
}
|
||||||
@ -970,8 +969,6 @@ HAL_StatusTypeDef HAL_UART_UnRegisterRxEventCallback(UART_HandleTypeDef *huart)
|
|||||||
status = HAL_ERROR;
|
status = HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Release Lock */
|
|
||||||
__HAL_UNLOCK(huart);
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3012,6 +3009,13 @@ void UART_AdvFeatureConfig(UART_HandleTypeDef *huart)
|
|||||||
/* Check whether the set of advanced features to configure is properly set */
|
/* Check whether the set of advanced features to configure is properly set */
|
||||||
assert_param(IS_UART_ADVFEATURE_INIT(huart->AdvancedInit.AdvFeatureInit));
|
assert_param(IS_UART_ADVFEATURE_INIT(huart->AdvancedInit.AdvFeatureInit));
|
||||||
|
|
||||||
|
/* if required, configure RX/TX pins swap */
|
||||||
|
if (HAL_IS_BIT_SET(huart->AdvancedInit.AdvFeatureInit, UART_ADVFEATURE_SWAP_INIT))
|
||||||
|
{
|
||||||
|
assert_param(IS_UART_ADVFEATURE_SWAP(huart->AdvancedInit.Swap));
|
||||||
|
MODIFY_REG(huart->Instance->CR2, USART_CR2_SWAP, huart->AdvancedInit.Swap);
|
||||||
|
}
|
||||||
|
|
||||||
/* if required, configure TX pin active level inversion */
|
/* if required, configure TX pin active level inversion */
|
||||||
if (HAL_IS_BIT_SET(huart->AdvancedInit.AdvFeatureInit, UART_ADVFEATURE_TXINVERT_INIT))
|
if (HAL_IS_BIT_SET(huart->AdvancedInit.AdvFeatureInit, UART_ADVFEATURE_TXINVERT_INIT))
|
||||||
{
|
{
|
||||||
@ -3033,13 +3037,6 @@ void UART_AdvFeatureConfig(UART_HandleTypeDef *huart)
|
|||||||
MODIFY_REG(huart->Instance->CR2, USART_CR2_DATAINV, huart->AdvancedInit.DataInvert);
|
MODIFY_REG(huart->Instance->CR2, USART_CR2_DATAINV, huart->AdvancedInit.DataInvert);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if required, configure RX/TX pins swap */
|
|
||||||
if (HAL_IS_BIT_SET(huart->AdvancedInit.AdvFeatureInit, UART_ADVFEATURE_SWAP_INIT))
|
|
||||||
{
|
|
||||||
assert_param(IS_UART_ADVFEATURE_SWAP(huart->AdvancedInit.Swap));
|
|
||||||
MODIFY_REG(huart->Instance->CR2, USART_CR2_SWAP, huart->AdvancedInit.Swap);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* if required, configure RX overrun detection disabling */
|
/* if required, configure RX overrun detection disabling */
|
||||||
if (HAL_IS_BIT_SET(huart->AdvancedInit.AdvFeatureInit, UART_ADVFEATURE_RXOVERRUNDISABLE_INIT))
|
if (HAL_IS_BIT_SET(huart->AdvancedInit.AdvFeatureInit, UART_ADVFEATURE_RXOVERRUNDISABLE_INIT))
|
||||||
{
|
{
|
||||||
@ -3165,7 +3162,7 @@ HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout(UART_HandleTypeDef *huart, uint32_
|
|||||||
return HAL_TIMEOUT;
|
return HAL_TIMEOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (READ_BIT(huart->Instance->CR1, USART_CR1_RE) != 0U)
|
if ((READ_BIT(huart->Instance->CR1, USART_CR1_RE) != 0U) && (Flag != UART_FLAG_TXE) && (Flag != UART_FLAG_TC))
|
||||||
{
|
{
|
||||||
if (__HAL_UART_GET_FLAG(huart, UART_FLAG_ORE) == SET)
|
if (__HAL_UART_GET_FLAG(huart, UART_FLAG_ORE) == SET)
|
||||||
{
|
{
|
||||||
|
@ -193,17 +193,19 @@ HAL_StatusTypeDef HAL_RS485Ex_Init(UART_HandleTypeDef *huart, uint32_t Polarity,
|
|||||||
/* Disable the Peripheral */
|
/* Disable the Peripheral */
|
||||||
__HAL_UART_DISABLE(huart);
|
__HAL_UART_DISABLE(huart);
|
||||||
|
|
||||||
|
/* Perform advanced settings configuration */
|
||||||
|
/* For some items, configuration requires to be done prior TE and RE bits are set */
|
||||||
|
if (huart->AdvancedInit.AdvFeatureInit != UART_ADVFEATURE_NO_INIT)
|
||||||
|
{
|
||||||
|
UART_AdvFeatureConfig(huart);
|
||||||
|
}
|
||||||
|
|
||||||
/* Set the UART Communication parameters */
|
/* Set the UART Communication parameters */
|
||||||
if (UART_SetConfig(huart) == HAL_ERROR)
|
if (UART_SetConfig(huart) == HAL_ERROR)
|
||||||
{
|
{
|
||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (huart->AdvancedInit.AdvFeatureInit != UART_ADVFEATURE_NO_INIT)
|
|
||||||
{
|
|
||||||
UART_AdvFeatureConfig(huart);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Enable the Driver Enable mode by setting the DEM bit in the CR3 register */
|
/* Enable the Driver Enable mode by setting the DEM bit in the CR3 register */
|
||||||
SET_BIT(huart->Instance->CR3, USART_CR3_DEM);
|
SET_BIT(huart->Instance->CR3, USART_CR3_DEM);
|
||||||
|
|
||||||
@ -597,7 +599,7 @@ HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle(UART_HandleTypeDef *huart, uint8_t *p
|
|||||||
*/
|
*/
|
||||||
HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size)
|
HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size)
|
||||||
{
|
{
|
||||||
HAL_StatusTypeDef status;
|
HAL_StatusTypeDef status = HAL_OK;
|
||||||
|
|
||||||
/* Check that a Rx process is not already ongoing */
|
/* Check that a Rx process is not already ongoing */
|
||||||
if (huart->RxState == HAL_UART_STATE_READY)
|
if (huart->RxState == HAL_UART_STATE_READY)
|
||||||
@ -611,11 +613,8 @@ HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle_IT(UART_HandleTypeDef *huart, uint8_t
|
|||||||
huart->ReceptionType = HAL_UART_RECEPTION_TOIDLE;
|
huart->ReceptionType = HAL_UART_RECEPTION_TOIDLE;
|
||||||
huart->RxEventType = HAL_UART_RXEVENT_TC;
|
huart->RxEventType = HAL_UART_RXEVENT_TC;
|
||||||
|
|
||||||
status = UART_Start_Receive_IT(huart, pData, Size);
|
(void)UART_Start_Receive_IT(huart, pData, Size);
|
||||||
|
|
||||||
/* Check Rx process has been successfully started */
|
|
||||||
if (status == HAL_OK)
|
|
||||||
{
|
|
||||||
if (huart->ReceptionType == HAL_UART_RECEPTION_TOIDLE)
|
if (huart->ReceptionType == HAL_UART_RECEPTION_TOIDLE)
|
||||||
{
|
{
|
||||||
__HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_IDLEF);
|
__HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_IDLEF);
|
||||||
@ -629,7 +628,6 @@ HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle_IT(UART_HandleTypeDef *huart, uint8_t
|
|||||||
In such case Reception Type has been reset to HAL_UART_RECEPTION_STANDARD. */
|
In such case Reception Type has been reset to HAL_UART_RECEPTION_STANDARD. */
|
||||||
status = HAL_ERROR;
|
status = HAL_ERROR;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@ -724,7 +722,7 @@ HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle_DMA(UART_HandleTypeDef *huart, uint8_
|
|||||||
* @param huart UART handle.
|
* @param huart UART handle.
|
||||||
* @retval Rx Event Type (return vale will be a value of @ref UART_RxEvent_Type_Values)
|
* @retval Rx Event Type (return vale will be a value of @ref UART_RxEvent_Type_Values)
|
||||||
*/
|
*/
|
||||||
HAL_UART_RxEventTypeTypeDef HAL_UARTEx_GetRxEventType(UART_HandleTypeDef *huart)
|
HAL_UART_RxEventTypeTypeDef HAL_UARTEx_GetRxEventType(const UART_HandleTypeDef *huart)
|
||||||
{
|
{
|
||||||
/* Return Rx Event type value, as stored in UART handle */
|
/* Return Rx Event type value, as stored in UART handle */
|
||||||
return (huart->RxEventType);
|
return (huart->RxEventType);
|
||||||
|
@ -89,7 +89,7 @@
|
|||||||
|
|
||||||
[..]
|
[..]
|
||||||
Use function HAL_USART_UnRegisterCallback() to reset a callback to the default
|
Use function HAL_USART_UnRegisterCallback() to reset a callback to the default
|
||||||
weak (surcharged) function.
|
weak function.
|
||||||
HAL_USART_UnRegisterCallback() takes as parameters the HAL peripheral handle,
|
HAL_USART_UnRegisterCallback() takes as parameters the HAL peripheral handle,
|
||||||
and the Callback ID.
|
and the Callback ID.
|
||||||
This function allows to reset following callbacks:
|
This function allows to reset following callbacks:
|
||||||
@ -105,10 +105,10 @@
|
|||||||
|
|
||||||
[..]
|
[..]
|
||||||
By default, after the HAL_USART_Init() and when the state is HAL_USART_STATE_RESET
|
By default, after the HAL_USART_Init() and when the state is HAL_USART_STATE_RESET
|
||||||
all callbacks are set to the corresponding weak (surcharged) functions:
|
all callbacks are set to the corresponding weak functions:
|
||||||
examples HAL_USART_TxCpltCallback(), HAL_USART_RxHalfCpltCallback().
|
examples HAL_USART_TxCpltCallback(), HAL_USART_RxHalfCpltCallback().
|
||||||
Exception done for MspInit and MspDeInit functions that are respectively
|
Exception done for MspInit and MspDeInit functions that are respectively
|
||||||
reset to the legacy weak (surcharged) functions in the HAL_USART_Init()
|
reset to the legacy weak functions in the HAL_USART_Init()
|
||||||
and HAL_USART_DeInit() only when these callbacks are null (not registered beforehand).
|
and HAL_USART_DeInit() only when these callbacks are null (not registered beforehand).
|
||||||
If not, MspInit or MspDeInit are not null, the HAL_USART_Init() and HAL_USART_DeInit()
|
If not, MspInit or MspDeInit are not null, the HAL_USART_Init() and HAL_USART_DeInit()
|
||||||
keep and use the user MspInit/MspDeInit callbacks (registered beforehand).
|
keep and use the user MspInit/MspDeInit callbacks (registered beforehand).
|
||||||
@ -125,7 +125,7 @@
|
|||||||
[..]
|
[..]
|
||||||
When The compilation define USE_HAL_USART_REGISTER_CALLBACKS is set to 0 or
|
When The compilation define USE_HAL_USART_REGISTER_CALLBACKS is set to 0 or
|
||||||
not defined, the callback registration feature is not available
|
not defined, the callback registration feature is not available
|
||||||
and weak (surcharged) callbacks are used.
|
and weak callbacks are used.
|
||||||
|
|
||||||
|
|
||||||
@endverbatim
|
@endverbatim
|
||||||
@ -140,7 +140,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/** @defgroup USART USART
|
/** @defgroup USART USART
|
||||||
* @brief HAL USART Synchronous module driver
|
* @brief HAL USART Synchronous SPI module driver
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -212,8 +212,8 @@ static void USART_RxISR_16BIT(USART_HandleTypeDef *husart);
|
|||||||
===============================================================================
|
===============================================================================
|
||||||
[..]
|
[..]
|
||||||
This subsection provides a set of functions allowing to initialize the USART
|
This subsection provides a set of functions allowing to initialize the USART
|
||||||
in asynchronous and in synchronous modes.
|
in synchronous SPI master mode.
|
||||||
(+) For the asynchronous mode only these parameters can be configured:
|
(+) For the synchronous SPI mode only these parameters can be configured:
|
||||||
(++) Baud Rate
|
(++) Baud Rate
|
||||||
(++) Word Length
|
(++) Word Length
|
||||||
(++) Stop Bit
|
(++) Stop Bit
|
||||||
@ -225,7 +225,7 @@ static void USART_RxISR_16BIT(USART_HandleTypeDef *husart);
|
|||||||
(++) Receiver/transmitter modes
|
(++) Receiver/transmitter modes
|
||||||
|
|
||||||
[..]
|
[..]
|
||||||
The HAL_USART_Init() function follows the USART synchronous configuration
|
The HAL_USART_Init() function follows the USART synchronous SPI configuration
|
||||||
procedure (details for the procedure are available in reference manual).
|
procedure (details for the procedure are available in reference manual).
|
||||||
|
|
||||||
@endverbatim
|
@endverbatim
|
||||||
@ -314,7 +314,7 @@ HAL_StatusTypeDef HAL_USART_Init(USART_HandleTypeDef *husart)
|
|||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* In Synchronous mode, the following bits must be kept cleared:
|
/* In Synchronous SPI mode, the following bits must be kept cleared:
|
||||||
- LINEN bit in the USART_CR2 register
|
- LINEN bit in the USART_CR2 register
|
||||||
- HDSEL, SCEN and IREN bits in the USART_CR3 register.
|
- HDSEL, SCEN and IREN bits in the USART_CR3 register.
|
||||||
*/
|
*/
|
||||||
@ -404,7 +404,7 @@ __weak void HAL_USART_MspDeInit(USART_HandleTypeDef *husart)
|
|||||||
#if (USE_HAL_USART_REGISTER_CALLBACKS == 1)
|
#if (USE_HAL_USART_REGISTER_CALLBACKS == 1)
|
||||||
/**
|
/**
|
||||||
* @brief Register a User USART Callback
|
* @brief Register a User USART Callback
|
||||||
* To be used instead of the weak predefined callback
|
* To be used to override the weak predefined callback
|
||||||
* @note The HAL_USART_RegisterCallback() may be called before HAL_USART_Init() in HAL_USART_STATE_RESET
|
* @note The HAL_USART_RegisterCallback() may be called before HAL_USART_Init() in HAL_USART_STATE_RESET
|
||||||
* to register callbacks for HAL_USART_MSPINIT_CB_ID and HAL_USART_MSPDEINIT_CB_ID
|
* to register callbacks for HAL_USART_MSPINIT_CB_ID and HAL_USART_MSPDEINIT_CB_ID
|
||||||
* @param husart usart handle
|
* @param husart usart handle
|
||||||
@ -637,10 +637,10 @@ HAL_StatusTypeDef HAL_USART_UnRegisterCallback(USART_HandleTypeDef *husart, HAL_
|
|||||||
===============================================================================
|
===============================================================================
|
||||||
##### IO operation functions #####
|
##### IO operation functions #####
|
||||||
===============================================================================
|
===============================================================================
|
||||||
[..] This subsection provides a set of functions allowing to manage the USART synchronous
|
[..] This subsection provides a set of functions allowing to manage the USART synchronous SPI
|
||||||
data transfers.
|
data transfers.
|
||||||
|
|
||||||
[..] The USART supports master mode only: it cannot receive or send data related to an input
|
[..] The USART Synchronous SPI supports master mode only: it cannot receive or send data related to an input
|
||||||
clock (SCLK is always an output).
|
clock (SCLK is always an output).
|
||||||
|
|
||||||
[..]
|
[..]
|
||||||
@ -2730,7 +2730,7 @@ static HAL_StatusTypeDef USART_SetConfig(USART_HandleTypeDef *husart)
|
|||||||
/* Clear and configure the USART Clock, CPOL, CPHA, LBCL and STOP bits:
|
/* Clear and configure the USART Clock, CPOL, CPHA, LBCL and STOP bits:
|
||||||
* set CPOL bit according to husart->Init.CLKPolarity value
|
* set CPOL bit according to husart->Init.CLKPolarity value
|
||||||
* set CPHA bit according to husart->Init.CLKPhase value
|
* set CPHA bit according to husart->Init.CLKPhase value
|
||||||
* set LBCL bit according to husart->Init.CLKLastBit value (used in SPI master mode only)
|
* set LBCL bit according to husart->Init.CLKLastBit value (used in USART Synchronous SPI master mode only)
|
||||||
* set STOP[13:12] bits according to husart->Init.StopBits value */
|
* set STOP[13:12] bits according to husart->Init.StopBits value */
|
||||||
tmpreg = (uint32_t)(USART_CLOCK_ENABLE);
|
tmpreg = (uint32_t)(USART_CLOCK_ENABLE);
|
||||||
tmpreg |= (uint32_t)husart->Init.CLKLastBit;
|
tmpreg |= (uint32_t)husart->Init.CLKLastBit;
|
||||||
|
@ -122,7 +122,6 @@
|
|||||||
(+) __HAL_WWDG_ENABLE_IT: Enable the WWDG early wakeup interrupt
|
(+) __HAL_WWDG_ENABLE_IT: Enable the WWDG early wakeup interrupt
|
||||||
|
|
||||||
@endverbatim
|
@endverbatim
|
||||||
******************************************************************************
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
@ -418,3 +417,4 @@ __weak void HAL_WWDG_EarlyWakeupCallback(WWDG_HandleTypeDef *hwwdg)
|
|||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -794,7 +794,8 @@ ErrorStatus LL_ADC_DeInit(ADC_TypeDef *ADCx)
|
|||||||
while (( LL_ADC_REG_IsStopConversionOngoing(ADCx)
|
while (( LL_ADC_REG_IsStopConversionOngoing(ADCx)
|
||||||
| LL_ADC_INJ_IsStopConversionOngoing(ADCx)) == 1U)
|
| LL_ADC_INJ_IsStopConversionOngoing(ADCx)) == 1U)
|
||||||
{
|
{
|
||||||
if(timeout_cpu_cycles-- == 0U)
|
timeout_cpu_cycles--;
|
||||||
|
if(timeout_cpu_cycles == 0U)
|
||||||
{
|
{
|
||||||
/* Time-out error */
|
/* Time-out error */
|
||||||
status = ERROR;
|
status = ERROR;
|
||||||
@ -813,7 +814,8 @@ ErrorStatus LL_ADC_DeInit(ADC_TypeDef *ADCx)
|
|||||||
timeout_cpu_cycles = ADC_TIMEOUT_DISABLE_CPU_CYCLES;
|
timeout_cpu_cycles = ADC_TIMEOUT_DISABLE_CPU_CYCLES;
|
||||||
while (LL_ADC_IsDisableOngoing(ADCx) == 1U)
|
while (LL_ADC_IsDisableOngoing(ADCx) == 1U)
|
||||||
{
|
{
|
||||||
if(timeout_cpu_cycles-- == 0U)
|
timeout_cpu_cycles--;
|
||||||
|
if(timeout_cpu_cycles == 0U)
|
||||||
{
|
{
|
||||||
/* Time-out error */
|
/* Time-out error */
|
||||||
status = ERROR;
|
status = ERROR;
|
||||||
|
@ -59,7 +59,8 @@
|
|||||||
/** @addtogroup STM32F3xx_HAL_Driver
|
/** @addtogroup STM32F3xx_HAL_Driver
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#if defined(HAL_NOR_MODULE_ENABLED) || defined(HAL_SRAM_MODULE_ENABLED) || defined(HAL_NAND_MODULE_ENABLED) || defined(HAL_PCCARD_MODULE_ENABLED)
|
#if defined(HAL_NOR_MODULE_ENABLED) || defined(HAL_NAND_MODULE_ENABLED) || defined(HAL_PCCARD_MODULE_ENABLED) \
|
||||||
|
|| defined(HAL_SRAM_MODULE_ENABLED)
|
||||||
|
|
||||||
/** @defgroup FMC_LL FMC Low Layer
|
/** @defgroup FMC_LL FMC Low Layer
|
||||||
* @brief FMC driver modules
|
* @brief FMC driver modules
|
||||||
@ -339,13 +340,14 @@ HAL_StatusTypeDef FMC_NORSRAM_Timing_Init(FMC_NORSRAM_TypeDef *Device,
|
|||||||
assert_param(IS_FMC_NORSRAM_BANK(Bank));
|
assert_param(IS_FMC_NORSRAM_BANK(Bank));
|
||||||
|
|
||||||
/* Set FMC_NORSRAM device timing parameters */
|
/* Set FMC_NORSRAM device timing parameters */
|
||||||
MODIFY_REG(Device->BTCR[Bank + 1U], BTR_CLEAR_MASK, (Timing->AddressSetupTime |
|
Device->BTCR[Bank + 1U] =
|
||||||
((Timing->AddressHoldTime) << FMC_BTRx_ADDHLD_Pos) |
|
(Timing->AddressSetupTime << FMC_BTRx_ADDSET_Pos) |
|
||||||
((Timing->DataSetupTime) << FMC_BTRx_DATAST_Pos) |
|
(Timing->AddressHoldTime << FMC_BTRx_ADDHLD_Pos) |
|
||||||
((Timing->BusTurnAroundDuration) << FMC_BTRx_BUSTURN_Pos) |
|
(Timing->DataSetupTime << FMC_BTRx_DATAST_Pos) |
|
||||||
(((Timing->CLKDivision) - 1U) << FMC_BTRx_CLKDIV_Pos) |
|
(Timing->BusTurnAroundDuration << FMC_BTRx_BUSTURN_Pos) |
|
||||||
(((Timing->DataLatency) - 2U) << FMC_BTRx_DATLAT_Pos) |
|
((Timing->CLKDivision - 1U) << FMC_BTRx_CLKDIV_Pos) |
|
||||||
(Timing->AccessMode)));
|
((Timing->DataLatency - 2U) << FMC_BTRx_DATLAT_Pos) |
|
||||||
|
Timing->AccessMode;
|
||||||
|
|
||||||
/* Configure Clock division value (in NORSRAM bank 1) when continuous clock is enabled */
|
/* Configure Clock division value (in NORSRAM bank 1) when continuous clock is enabled */
|
||||||
if (HAL_IS_BIT_SET(Device->BTCR[FMC_NORSRAM_BANK1], FMC_BCR1_CCLKEN))
|
if (HAL_IS_BIT_SET(Device->BTCR[FMC_NORSRAM_BANK1], FMC_BCR1_CCLKEN))
|
||||||
|
@ -67,8 +67,8 @@
|
|||||||
|| ((__VALUE__) == LL_TIM_OCMODE_RETRIG_OPM2) \
|
|| ((__VALUE__) == LL_TIM_OCMODE_RETRIG_OPM2) \
|
||||||
|| ((__VALUE__) == LL_TIM_OCMODE_COMBINED_PWM1) \
|
|| ((__VALUE__) == LL_TIM_OCMODE_COMBINED_PWM1) \
|
||||||
|| ((__VALUE__) == LL_TIM_OCMODE_COMBINED_PWM2) \
|
|| ((__VALUE__) == LL_TIM_OCMODE_COMBINED_PWM2) \
|
||||||
|| ((__VALUE__) == LL_TIM_OCMODE_ASSYMETRIC_PWM1) \
|
|| ((__VALUE__) == LL_TIM_OCMODE_ASYMMETRIC_PWM1) \
|
||||||
|| ((__VALUE__) == LL_TIM_OCMODE_ASSYMETRIC_PWM2))
|
|| ((__VALUE__) == LL_TIM_OCMODE_ASYMMETRIC_PWM2))
|
||||||
#else
|
#else
|
||||||
#define IS_LL_TIM_OCMODE(__VALUE__) (((__VALUE__) == LL_TIM_OCMODE_FROZEN) \
|
#define IS_LL_TIM_OCMODE(__VALUE__) (((__VALUE__) == LL_TIM_OCMODE_FROZEN) \
|
||||||
|| ((__VALUE__) == LL_TIM_OCMODE_ACTIVE) \
|
|| ((__VALUE__) == LL_TIM_OCMODE_ACTIVE) \
|
||||||
@ -495,10 +495,12 @@ ErrorStatus LL_TIM_OC_Init(TIM_TypeDef *TIMx, uint32_t Channel, const LL_TIM_OC_
|
|||||||
case LL_TIM_CHANNEL_CH5:
|
case LL_TIM_CHANNEL_CH5:
|
||||||
result = OC5Config(TIMx, TIM_OC_InitStruct);
|
result = OC5Config(TIMx, TIM_OC_InitStruct);
|
||||||
break;
|
break;
|
||||||
|
#endif /* TIM_CCER_CC5E */
|
||||||
|
#if defined(TIM_CCER_CC6E)
|
||||||
case LL_TIM_CHANNEL_CH6:
|
case LL_TIM_CHANNEL_CH6:
|
||||||
result = OC6Config(TIMx, TIM_OC_InitStruct);
|
result = OC6Config(TIMx, TIM_OC_InitStruct);
|
||||||
break;
|
break;
|
||||||
#endif /* TIM_CCER_CC5E */
|
#endif /* TIM_CCER_CC6E */
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -813,6 +815,9 @@ ErrorStatus LL_TIM_BDTR_Init(TIM_TypeDef *TIMx, const LL_TIM_BDTR_InitTypeDef *T
|
|||||||
assert_param(IS_LL_TIM_BREAK_STATE(TIM_BDTRInitStruct->BreakState));
|
assert_param(IS_LL_TIM_BREAK_STATE(TIM_BDTRInitStruct->BreakState));
|
||||||
assert_param(IS_LL_TIM_BREAK_POLARITY(TIM_BDTRInitStruct->BreakPolarity));
|
assert_param(IS_LL_TIM_BREAK_POLARITY(TIM_BDTRInitStruct->BreakPolarity));
|
||||||
assert_param(IS_LL_TIM_AUTOMATIC_OUTPUT_STATE(TIM_BDTRInitStruct->AutomaticOutput));
|
assert_param(IS_LL_TIM_AUTOMATIC_OUTPUT_STATE(TIM_BDTRInitStruct->AutomaticOutput));
|
||||||
|
#if defined(TIM_BDTR_BKF)
|
||||||
|
assert_param(IS_LL_TIM_BREAK_FILTER(TIM_BDTRInitStruct->BreakFilter));
|
||||||
|
#endif /* TIM_BDTR_BKF */
|
||||||
|
|
||||||
/* Set the Lock level, the Break enable Bit and the Polarity, the OSSR State,
|
/* Set the Lock level, the Break enable Bit and the Polarity, the OSSR State,
|
||||||
the OSSI State, the dead time value and the Automatic Output Enable Bit */
|
the OSSI State, the dead time value and the Automatic Output Enable Bit */
|
||||||
@ -825,9 +830,7 @@ ErrorStatus LL_TIM_BDTR_Init(TIM_TypeDef *TIMx, const LL_TIM_BDTR_InitTypeDef *T
|
|||||||
MODIFY_REG(tmpbdtr, TIM_BDTR_BKE, TIM_BDTRInitStruct->BreakState);
|
MODIFY_REG(tmpbdtr, TIM_BDTR_BKE, TIM_BDTRInitStruct->BreakState);
|
||||||
MODIFY_REG(tmpbdtr, TIM_BDTR_BKP, TIM_BDTRInitStruct->BreakPolarity);
|
MODIFY_REG(tmpbdtr, TIM_BDTR_BKP, TIM_BDTRInitStruct->BreakPolarity);
|
||||||
MODIFY_REG(tmpbdtr, TIM_BDTR_AOE, TIM_BDTRInitStruct->AutomaticOutput);
|
MODIFY_REG(tmpbdtr, TIM_BDTR_AOE, TIM_BDTRInitStruct->AutomaticOutput);
|
||||||
MODIFY_REG(tmpbdtr, TIM_BDTR_MOE, TIM_BDTRInitStruct->AutomaticOutput);
|
|
||||||
#if defined(TIM_BDTR_BKF)
|
#if defined(TIM_BDTR_BKF)
|
||||||
assert_param(IS_LL_TIM_BREAK_FILTER(TIM_BDTRInitStruct->BreakFilter));
|
|
||||||
MODIFY_REG(tmpbdtr, TIM_BDTR_BKF, TIM_BDTRInitStruct->BreakFilter);
|
MODIFY_REG(tmpbdtr, TIM_BDTR_BKF, TIM_BDTRInitStruct->BreakFilter);
|
||||||
#endif /* TIM_BDTR_BKF */
|
#endif /* TIM_BDTR_BKF */
|
||||||
#if defined(TIM_BDTR_BK2E)
|
#if defined(TIM_BDTR_BK2E)
|
||||||
@ -881,8 +884,6 @@ static ErrorStatus OC1Config(TIM_TypeDef *TIMx, const LL_TIM_OC_InitTypeDef *TIM
|
|||||||
assert_param(IS_LL_TIM_OCMODE(TIM_OCInitStruct->OCMode));
|
assert_param(IS_LL_TIM_OCMODE(TIM_OCInitStruct->OCMode));
|
||||||
assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCState));
|
assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCState));
|
||||||
assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCPolarity));
|
assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCPolarity));
|
||||||
assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCNState));
|
|
||||||
assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCNPolarity));
|
|
||||||
|
|
||||||
/* Disable the Channel 1: Reset the CC1E Bit */
|
/* Disable the Channel 1: Reset the CC1E Bit */
|
||||||
CLEAR_BIT(TIMx->CCER, TIM_CCER_CC1E);
|
CLEAR_BIT(TIMx->CCER, TIM_CCER_CC1E);
|
||||||
@ -910,8 +911,10 @@ static ErrorStatus OC1Config(TIM_TypeDef *TIMx, const LL_TIM_OC_InitTypeDef *TIM
|
|||||||
|
|
||||||
if (IS_TIM_BREAK_INSTANCE(TIMx))
|
if (IS_TIM_BREAK_INSTANCE(TIMx))
|
||||||
{
|
{
|
||||||
assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCNIdleState));
|
|
||||||
assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCIdleState));
|
assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCIdleState));
|
||||||
|
assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCNState));
|
||||||
|
assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCNPolarity));
|
||||||
|
assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCNIdleState));
|
||||||
|
|
||||||
/* Set the complementary output Polarity */
|
/* Set the complementary output Polarity */
|
||||||
MODIFY_REG(tmpccer, TIM_CCER_CC1NP, TIM_OCInitStruct->OCNPolarity << 2U);
|
MODIFY_REG(tmpccer, TIM_CCER_CC1NP, TIM_OCInitStruct->OCNPolarity << 2U);
|
||||||
@ -960,8 +963,6 @@ static ErrorStatus OC2Config(TIM_TypeDef *TIMx, const LL_TIM_OC_InitTypeDef *TIM
|
|||||||
assert_param(IS_LL_TIM_OCMODE(TIM_OCInitStruct->OCMode));
|
assert_param(IS_LL_TIM_OCMODE(TIM_OCInitStruct->OCMode));
|
||||||
assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCState));
|
assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCState));
|
||||||
assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCPolarity));
|
assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCPolarity));
|
||||||
assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCNState));
|
|
||||||
assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCNPolarity));
|
|
||||||
|
|
||||||
/* Disable the Channel 2: Reset the CC2E Bit */
|
/* Disable the Channel 2: Reset the CC2E Bit */
|
||||||
CLEAR_BIT(TIMx->CCER, TIM_CCER_CC2E);
|
CLEAR_BIT(TIMx->CCER, TIM_CCER_CC2E);
|
||||||
@ -989,8 +990,10 @@ static ErrorStatus OC2Config(TIM_TypeDef *TIMx, const LL_TIM_OC_InitTypeDef *TIM
|
|||||||
|
|
||||||
if (IS_TIM_BREAK_INSTANCE(TIMx))
|
if (IS_TIM_BREAK_INSTANCE(TIMx))
|
||||||
{
|
{
|
||||||
assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCNIdleState));
|
|
||||||
assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCIdleState));
|
assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCIdleState));
|
||||||
|
assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCNState));
|
||||||
|
assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCNPolarity));
|
||||||
|
assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCNIdleState));
|
||||||
|
|
||||||
/* Set the complementary output Polarity */
|
/* Set the complementary output Polarity */
|
||||||
MODIFY_REG(tmpccer, TIM_CCER_CC2NP, TIM_OCInitStruct->OCNPolarity << 6U);
|
MODIFY_REG(tmpccer, TIM_CCER_CC2NP, TIM_OCInitStruct->OCNPolarity << 6U);
|
||||||
@ -1042,8 +1045,6 @@ static ErrorStatus OC3Config(TIM_TypeDef *TIMx, const LL_TIM_OC_InitTypeDef *TIM
|
|||||||
assert_param(IS_LL_TIM_OCMODE(TIM_OCInitStruct->OCMode));
|
assert_param(IS_LL_TIM_OCMODE(TIM_OCInitStruct->OCMode));
|
||||||
assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCState));
|
assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCState));
|
||||||
assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCPolarity));
|
assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCPolarity));
|
||||||
assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCNState));
|
|
||||||
assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCNPolarity));
|
|
||||||
|
|
||||||
/* Disable the Channel 3: Reset the CC3E Bit */
|
/* Disable the Channel 3: Reset the CC3E Bit */
|
||||||
CLEAR_BIT(TIMx->CCER, TIM_CCER_CC3E);
|
CLEAR_BIT(TIMx->CCER, TIM_CCER_CC3E);
|
||||||
@ -1071,8 +1072,10 @@ static ErrorStatus OC3Config(TIM_TypeDef *TIMx, const LL_TIM_OC_InitTypeDef *TIM
|
|||||||
|
|
||||||
if (IS_TIM_BREAK_INSTANCE(TIMx))
|
if (IS_TIM_BREAK_INSTANCE(TIMx))
|
||||||
{
|
{
|
||||||
assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCNIdleState));
|
|
||||||
assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCIdleState));
|
assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCIdleState));
|
||||||
|
assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCNState));
|
||||||
|
assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCNPolarity));
|
||||||
|
assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCNIdleState));
|
||||||
|
|
||||||
/* Set the complementary output Polarity */
|
/* Set the complementary output Polarity */
|
||||||
MODIFY_REG(tmpccer, TIM_CCER_CC3NP, TIM_OCInitStruct->OCNPolarity << 10U);
|
MODIFY_REG(tmpccer, TIM_CCER_CC3NP, TIM_OCInitStruct->OCNPolarity << 10U);
|
||||||
@ -1124,8 +1127,6 @@ static ErrorStatus OC4Config(TIM_TypeDef *TIMx, const LL_TIM_OC_InitTypeDef *TIM
|
|||||||
assert_param(IS_LL_TIM_OCMODE(TIM_OCInitStruct->OCMode));
|
assert_param(IS_LL_TIM_OCMODE(TIM_OCInitStruct->OCMode));
|
||||||
assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCState));
|
assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCState));
|
||||||
assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCPolarity));
|
assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCPolarity));
|
||||||
assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCNPolarity));
|
|
||||||
assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCNState));
|
|
||||||
|
|
||||||
/* Disable the Channel 4: Reset the CC4E Bit */
|
/* Disable the Channel 4: Reset the CC4E Bit */
|
||||||
CLEAR_BIT(TIMx->CCER, TIM_CCER_CC4E);
|
CLEAR_BIT(TIMx->CCER, TIM_CCER_CC4E);
|
||||||
@ -1153,7 +1154,6 @@ static ErrorStatus OC4Config(TIM_TypeDef *TIMx, const LL_TIM_OC_InitTypeDef *TIM
|
|||||||
|
|
||||||
if (IS_TIM_BREAK_INSTANCE(TIMx))
|
if (IS_TIM_BREAK_INSTANCE(TIMx))
|
||||||
{
|
{
|
||||||
assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCNIdleState));
|
|
||||||
assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCIdleState));
|
assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCIdleState));
|
||||||
|
|
||||||
#if defined(STM32F373xC) || defined(STM32F378xx)
|
#if defined(STM32F373xC) || defined(STM32F378xx)
|
||||||
@ -1240,7 +1240,9 @@ static ErrorStatus OC5Config(TIM_TypeDef *TIMx, const LL_TIM_OC_InitTypeDef *TIM
|
|||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
#endif /* TIM_CCER_CC5E */
|
||||||
|
|
||||||
|
#if defined(TIM_CCER_CC6E)
|
||||||
/**
|
/**
|
||||||
* @brief Configure the TIMx output channel 6.
|
* @brief Configure the TIMx output channel 6.
|
||||||
* @param TIMx Timer Instance
|
* @param TIMx Timer Instance
|
||||||
@ -1301,7 +1303,7 @@ static ErrorStatus OC6Config(TIM_TypeDef *TIMx, const LL_TIM_OC_InitTypeDef *TIM
|
|||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
#endif /* TIM_CCER_CC5E */
|
#endif /* TIM_CCER_CC6E */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configure the TIMx input channel 1.
|
* @brief Configure the TIMx input channel 1.
|
||||||
@ -1427,7 +1429,7 @@ static ErrorStatus IC4Config(TIM_TypeDef *TIMx, const LL_TIM_IC_InitTypeDef *TIM
|
|||||||
(TIM_CCMR2_CC4S | TIM_CCMR2_IC4F | TIM_CCMR2_IC4PSC),
|
(TIM_CCMR2_CC4S | TIM_CCMR2_IC4F | TIM_CCMR2_IC4PSC),
|
||||||
(TIM_ICInitStruct->ICActiveInput | TIM_ICInitStruct->ICFilter | TIM_ICInitStruct->ICPrescaler) >> 8U);
|
(TIM_ICInitStruct->ICActiveInput | TIM_ICInitStruct->ICFilter | TIM_ICInitStruct->ICPrescaler) >> 8U);
|
||||||
|
|
||||||
/* Select the Polarity and set the CC2E Bit */
|
/* Select the Polarity and set the CC4E Bit */
|
||||||
MODIFY_REG(TIMx->CCER,
|
MODIFY_REG(TIMx->CCER,
|
||||||
(TIM_CCER_CC4P | TIM_CCER_CC4NP),
|
(TIM_CCER_CC4P | TIM_CCER_CC4NP),
|
||||||
((TIM_ICInitStruct->ICPolarity << 12U) | TIM_CCER_CC4E));
|
((TIM_ICInitStruct->ICPolarity << 12U) | TIM_CCER_CC4E));
|
||||||
|
@ -172,6 +172,47 @@ HAL_StatusTypeDef USB_DevInit(USB_TypeDef *USBx, USB_CfgTypeDef cfg)
|
|||||||
return HAL_OK;
|
return HAL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief USB_FlushTxFifo : Flush a Tx FIFO
|
||||||
|
* @param USBx : Selected device
|
||||||
|
* @param num : FIFO number
|
||||||
|
* This parameter can be a value from 1 to 15
|
||||||
|
15 means Flush all Tx FIFOs
|
||||||
|
* @retval HAL status
|
||||||
|
*/
|
||||||
|
HAL_StatusTypeDef USB_FlushTxFifo(USB_TypeDef const *USBx, uint32_t num)
|
||||||
|
{
|
||||||
|
/* Prevent unused argument(s) compilation warning */
|
||||||
|
UNUSED(USBx);
|
||||||
|
UNUSED(num);
|
||||||
|
|
||||||
|
/* NOTE : - This function is not required by USB Device FS peripheral, it is used
|
||||||
|
only by USB OTG FS peripheral.
|
||||||
|
- This function is added to ensure compatibility across platforms.
|
||||||
|
*/
|
||||||
|
|
||||||
|
return HAL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief USB_FlushRxFifo : Flush Rx FIFO
|
||||||
|
* @param USBx : Selected device
|
||||||
|
* @retval HAL status
|
||||||
|
*/
|
||||||
|
HAL_StatusTypeDef USB_FlushRxFifo(USB_TypeDef const *USBx)
|
||||||
|
{
|
||||||
|
/* Prevent unused argument(s) compilation warning */
|
||||||
|
UNUSED(USBx);
|
||||||
|
|
||||||
|
/* NOTE : - This function is not required by USB Device FS peripheral, it is used
|
||||||
|
only by USB OTG FS peripheral.
|
||||||
|
- This function is added to ensure compatibility across platforms.
|
||||||
|
*/
|
||||||
|
|
||||||
|
return HAL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined (HAL_PCD_MODULE_ENABLED)
|
#if defined (HAL_PCD_MODULE_ENABLED)
|
||||||
/**
|
/**
|
||||||
* @brief Activate and configure an endpoint
|
* @brief Activate and configure an endpoint
|
||||||
@ -761,7 +802,7 @@ HAL_StatusTypeDef USB_DevDisconnect(USB_TypeDef *USBx)
|
|||||||
* @param USBx Selected device
|
* @param USBx Selected device
|
||||||
* @retval USB Global Interrupt status
|
* @retval USB Global Interrupt status
|
||||||
*/
|
*/
|
||||||
uint32_t USB_ReadInterrupts(USB_TypeDef *USBx)
|
uint32_t USB_ReadInterrupts(USB_TypeDef const *USBx)
|
||||||
{
|
{
|
||||||
uint32_t tmpreg;
|
uint32_t tmpreg;
|
||||||
|
|
||||||
@ -801,7 +842,7 @@ HAL_StatusTypeDef USB_DeActivateRemoteWakeup(USB_TypeDef *USBx)
|
|||||||
* @param wNBytes no. of bytes to be copied.
|
* @param wNBytes no. of bytes to be copied.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
void USB_WritePMA(USB_TypeDef *USBx, uint8_t *pbUsrBuf, uint16_t wPMABufAddr, uint16_t wNBytes)
|
void USB_WritePMA(USB_TypeDef const *USBx, uint8_t *pbUsrBuf, uint16_t wPMABufAddr, uint16_t wNBytes)
|
||||||
{
|
{
|
||||||
uint32_t n = ((uint32_t)wNBytes + 1U) >> 1;
|
uint32_t n = ((uint32_t)wNBytes + 1U) >> 1;
|
||||||
uint32_t BaseAddr = (uint32_t)USBx;
|
uint32_t BaseAddr = (uint32_t)USBx;
|
||||||
@ -836,7 +877,7 @@ void USB_WritePMA(USB_TypeDef *USBx, uint8_t *pbUsrBuf, uint16_t wPMABufAddr, ui
|
|||||||
* @param wNBytes no. of bytes to be copied.
|
* @param wNBytes no. of bytes to be copied.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
void USB_ReadPMA(USB_TypeDef *USBx, uint8_t *pbUsrBuf, uint16_t wPMABufAddr, uint16_t wNBytes)
|
void USB_ReadPMA(USB_TypeDef const *USBx, uint8_t *pbUsrBuf, uint16_t wPMABufAddr, uint16_t wNBytes)
|
||||||
{
|
{
|
||||||
uint32_t n = (uint32_t)wNBytes >> 1;
|
uint32_t n = (uint32_t)wNBytes >> 1;
|
||||||
uint32_t BaseAddr = (uint32_t)USBx;
|
uint32_t BaseAddr = (uint32_t)USBx;
|
||||||
|
@ -266,8 +266,6 @@ ErrorStatus LL_SetFlashLatency(uint32_t Frequency)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status != ERROR)
|
|
||||||
{
|
|
||||||
LL_FLASH_SetLatency(latency);
|
LL_FLASH_SetLatency(latency);
|
||||||
|
|
||||||
/* Check that the new number of wait states is taken into account to access the Flash
|
/* Check that the new number of wait states is taken into account to access the Flash
|
||||||
@ -285,7 +283,6 @@ ErrorStatus LL_SetFlashLatency(uint32_t Frequency)
|
|||||||
status = ERROR;
|
status = ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
@ -115,8 +115,8 @@ Mcu.PinsNb=38
|
|||||||
Mcu.ThirdPartyNb=0
|
Mcu.ThirdPartyNb=0
|
||||||
Mcu.UserConstants=
|
Mcu.UserConstants=
|
||||||
Mcu.UserName=STM32F302RBTx
|
Mcu.UserName=STM32F302RBTx
|
||||||
MxCube.Version=6.9.2
|
MxCube.Version=6.11.1
|
||||||
MxDb.Version=DB.6.0.92
|
MxDb.Version=DB.6.0.111
|
||||||
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
||||||
NVIC.CAN_RX1_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
|
NVIC.CAN_RX1_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
|
||||||
NVIC.CAN_SCE_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
|
NVIC.CAN_SCE_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
|
||||||
@ -281,7 +281,7 @@ ProjectManager.CustomerFirmwarePackage=
|
|||||||
ProjectManager.DefaultFWLocation=true
|
ProjectManager.DefaultFWLocation=true
|
||||||
ProjectManager.DeletePrevious=true
|
ProjectManager.DeletePrevious=true
|
||||||
ProjectManager.DeviceId=STM32F302RBTx
|
ProjectManager.DeviceId=STM32F302RBTx
|
||||||
ProjectManager.FirmwarePackage=STM32Cube FW_F3 V1.11.4
|
ProjectManager.FirmwarePackage=STM32Cube FW_F3 V1.11.5
|
||||||
ProjectManager.FreePins=false
|
ProjectManager.FreePins=false
|
||||||
ProjectManager.HalAssertFull=false
|
ProjectManager.HalAssertFull=false
|
||||||
ProjectManager.HeapSize=0x200
|
ProjectManager.HeapSize=0x200
|
||||||
|
@ -44,6 +44,8 @@ Core/Src/can-halal.c \
|
|||||||
Core/Src/main.c \
|
Core/Src/main.c \
|
||||||
Core/Src/stm32f3xx_hal_msp.c \
|
Core/Src/stm32f3xx_hal_msp.c \
|
||||||
Core/Src/stm32f3xx_it.c \
|
Core/Src/stm32f3xx_it.c \
|
||||||
|
Core/Src/syscalls.c \
|
||||||
|
Core/Src/sysmem.c \
|
||||||
Core/Src/system_stm32f3xx.c \
|
Core/Src/system_stm32f3xx.c \
|
||||||
Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal.c \
|
Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal.c \
|
||||||
Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_adc.c \
|
Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_adc.c \
|
||||||
@ -83,7 +85,7 @@ PREFIX = arm-none-eabi-
|
|||||||
POSTFIX = "
|
POSTFIX = "
|
||||||
# The gcc compiler bin path can be either defined in make command via GCC_PATH variable (> make GCC_PATH=xxx)
|
# The gcc compiler bin path can be either defined in make command via GCC_PATH variable (> make GCC_PATH=xxx)
|
||||||
# either it can be added to the PATH environment variable.
|
# either it can be added to the PATH environment variable.
|
||||||
GCC_PATH="c:/Users/nived/AppData/Roaming/Code/User/globalStorage/bmd.stm32-for-vscode/@xpack-dev-tools/arm-none-eabi-gcc/12.3.1-1.2.1/.content/bin
|
GCC_PATH="c:/Users/GETAC/AppData/Roaming/Code/User/globalStorage/bmd.stm32-for-vscode/@xpack-dev-tools/arm-none-eabi-gcc/13.2.1-1.1.1/.content/bin
|
||||||
ifdef GCC_PATH
|
ifdef GCC_PATH
|
||||||
CXX = $(GCC_PATH)/$(PREFIX)g++$(POSTFIX)
|
CXX = $(GCC_PATH)/$(PREFIX)g++$(POSTFIX)
|
||||||
CC = $(GCC_PATH)/$(PREFIX)gcc$(POSTFIX)
|
CC = $(GCC_PATH)/$(PREFIX)gcc$(POSTFIX)
|
||||||
@ -236,13 +238,13 @@ $(BUILD_DIR):
|
|||||||
# flash
|
# flash
|
||||||
#######################################
|
#######################################
|
||||||
flash: $(BUILD_DIR)/$(TARGET).elf
|
flash: $(BUILD_DIR)/$(TARGET).elf
|
||||||
"C:/USERS/NIVED/APPDATA/ROAMING/CODE/USER/GLOBALSTORAGE/BMD.STM32-FOR-VSCODE/@XPACK-DEV-TOOLS/OPENOCD/0.12.0-2.1/.CONTENT/BIN/OPENOCD.EXE" -f ./openocd.cfg -c "program $(BUILD_DIR)/$(TARGET).elf verify reset exit"
|
"C:/USERS/GETAC/APPDATA/ROAMING/CODE/USER/GLOBALSTORAGE/BMD.STM32-FOR-VSCODE/@XPACK-DEV-TOOLS/OPENOCD/0.12.0-3.1/.CONTENT/BIN/OPENOCD.EXE" -f ./openocd.cfg -c "program $(BUILD_DIR)/$(TARGET).elf verify reset exit"
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# erase
|
# erase
|
||||||
#######################################
|
#######################################
|
||||||
erase: $(BUILD_DIR)/$(TARGET).elf
|
erase: $(BUILD_DIR)/$(TARGET).elf
|
||||||
"C:/USERS/NIVED/APPDATA/ROAMING/CODE/USER/GLOBALSTORAGE/BMD.STM32-FOR-VSCODE/@XPACK-DEV-TOOLS/OPENOCD/0.12.0-2.1/.CONTENT/BIN/OPENOCD.EXE" -f ./openocd.cfg -c "init; reset halt; stm32f3x mass_erase 0; exit"
|
"C:/USERS/GETAC/APPDATA/ROAMING/CODE/USER/GLOBALSTORAGE/BMD.STM32-FOR-VSCODE/@XPACK-DEV-TOOLS/OPENOCD/0.12.0-3.1/.CONTENT/BIN/OPENOCD.EXE" -f ./openocd.cfg -c "init; reset halt; stm32f3x mass_erase 0; exit"
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# clean up
|
# clean up
|
||||||
|
Loading…
x
Reference in New Issue
Block a user