Subversion Repositories LedShow

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 mjames 1
/**
2
  ******************************************************************************
3
  * @file    stm32f1xx_hal_crc.h
4
  * @author  MCD Application Team
5
  * @brief   Header file of CRC HAL module.
6
  ******************************************************************************
7
  * @attention
8
  *
9 mjames 9
  * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
10
  * All rights reserved.</center></h2>
2 mjames 11
  *
9 mjames 12
  * This software component is licensed by ST under BSD 3-Clause license,
13
  * the "License"; You may not use this file except in compliance with the
14
  * License. You may obtain a copy of the License at:
15
  *                        opensource.org/licenses/BSD-3-Clause
2 mjames 16
  *
17
  ******************************************************************************
9 mjames 18
  */
2 mjames 19
 
20
/* Define to prevent recursive inclusion -------------------------------------*/
9 mjames 21
#ifndef STM32F1xx_HAL_CRC_H
22
#define STM32F1xx_HAL_CRC_H
2 mjames 23
 
24
#ifdef __cplusplus
9 mjames 25
extern "C" {
2 mjames 26
#endif
27
 
28
/* Includes ------------------------------------------------------------------*/
29
#include "stm32f1xx_hal_def.h"
30
 
31
/** @addtogroup STM32F1xx_HAL_Driver
32
  * @{
33
  */
34
 
35
/** @addtogroup CRC
36
  * @{
9 mjames 37
  */
2 mjames 38
 
39
/* Exported types ------------------------------------------------------------*/
40
/** @defgroup CRC_Exported_Types CRC Exported Types
41
  * @{
42
  */
43
 
9 mjames 44
/**
45
  * @brief  CRC HAL State Structure definition
46
  */
2 mjames 47
typedef enum
48
{
49
  HAL_CRC_STATE_RESET     = 0x00U,  /*!< CRC not yet initialized or disabled */
50
  HAL_CRC_STATE_READY     = 0x01U,  /*!< CRC initialized and ready for use   */
51
  HAL_CRC_STATE_BUSY      = 0x02U,  /*!< CRC internal process is ongoing     */
52
  HAL_CRC_STATE_TIMEOUT   = 0x03U,  /*!< CRC timeout state                   */
53
  HAL_CRC_STATE_ERROR     = 0x04U   /*!< CRC error state                     */
9 mjames 54
} HAL_CRC_StateTypeDef;
2 mjames 55
 
56
 
9 mjames 57
/**
58
  * @brief  CRC Handle Structure definition
59
  */
2 mjames 60
typedef struct
61
{
9 mjames 62
  CRC_TypeDef                 *Instance;   /*!< Register base address        */
2 mjames 63
 
9 mjames 64
  HAL_LockTypeDef             Lock;        /*!< CRC Locking object           */
2 mjames 65
 
9 mjames 66
  __IO HAL_CRC_StateTypeDef   State;       /*!< CRC communication state      */
2 mjames 67
 
9 mjames 68
} CRC_HandleTypeDef;
2 mjames 69
/**
70
  * @}
9 mjames 71
  */
2 mjames 72
 
73
/* Exported constants --------------------------------------------------------*/
9 mjames 74
/** @defgroup CRC_Exported_Constants CRC Exported Constants
75
  * @{
76
  */
2 mjames 77
 
9 mjames 78
/**
79
  * @}
80
  */
81
 
82
/* Exported macros -----------------------------------------------------------*/
2 mjames 83
/** @defgroup CRC_Exported_Macros CRC Exported Macros
84
  * @{
85
  */
86
 
9 mjames 87
/** @brief Reset CRC handle state.
88
  * @param  __HANDLE__ CRC handle.
2 mjames 89
  * @retval None
90
  */
9 mjames 91
#define __HAL_CRC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_CRC_STATE_RESET)
2 mjames 92
 
93
/**
9 mjames 94
  * @brief  Reset CRC Data Register.
95
  * @param  __HANDLE__ CRC handle
2 mjames 96
  * @retval None
97
  */
9 mjames 98
#define __HAL_CRC_DR_RESET(__HANDLE__) ((__HANDLE__)->Instance->CR |= CRC_CR_RESET)
2 mjames 99
 
100
/**
9 mjames 101
  * @brief Store data in the Independent Data (ID) register.
102
  * @param __HANDLE__ CRC handle
103
  * @param __VALUE__  Value to be stored in the ID register
104
  * @note  Refer to the Reference Manual to get the authorized __VALUE__ length in bits
2 mjames 105
  * @retval None
106
  */
107
#define __HAL_CRC_SET_IDR(__HANDLE__, __VALUE__) (WRITE_REG((__HANDLE__)->Instance->IDR, (__VALUE__)))
108
 
109
/**
9 mjames 110
  * @brief Return the data stored in the Independent Data (ID) register.
111
  * @param __HANDLE__ CRC handle
112
  * @note  Refer to the Reference Manual to get the authorized __VALUE__ length in bits
113
  * @retval Value of the ID register
2 mjames 114
  */
115
#define __HAL_CRC_GET_IDR(__HANDLE__) (((__HANDLE__)->Instance->IDR) & CRC_IDR_IDR)
9 mjames 116
/**
117
  * @}
118
  */
2 mjames 119
 
9 mjames 120
 
121
/* Private macros --------------------------------------------------------*/
122
/** @defgroup  CRC_Private_Macros CRC Private Macros
123
  * @{
124
  */
125
 
2 mjames 126
/**
127
  * @}
9 mjames 128
  */
2 mjames 129
 
130
/* Exported functions --------------------------------------------------------*/
9 mjames 131
/** @defgroup CRC_Exported_Functions CRC Exported Functions
2 mjames 132
  * @{
9 mjames 133
  */
2 mjames 134
 
9 mjames 135
/* Initialization and de-initialization functions  ****************************/
136
/** @defgroup CRC_Exported_Functions_Group1 Initialization and de-initialization functions
2 mjames 137
  * @{
9 mjames 138
  */
139
HAL_StatusTypeDef HAL_CRC_Init(CRC_HandleTypeDef *hcrc);
140
HAL_StatusTypeDef HAL_CRC_DeInit(CRC_HandleTypeDef *hcrc);
141
void HAL_CRC_MspInit(CRC_HandleTypeDef *hcrc);
142
void HAL_CRC_MspDeInit(CRC_HandleTypeDef *hcrc);
2 mjames 143
/**
144
  * @}
9 mjames 145
  */
2 mjames 146
 
9 mjames 147
/* Peripheral Control functions ***********************************************/
148
/** @defgroup CRC_Exported_Functions_Group2 Peripheral Control functions
2 mjames 149
  * @{
9 mjames 150
  */
151
uint32_t HAL_CRC_Accumulate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength);
152
uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength);
2 mjames 153
/**
154
  * @}
9 mjames 155
  */
2 mjames 156
 
9 mjames 157
/* Peripheral State and Error functions ***************************************/
158
/** @defgroup CRC_Exported_Functions_Group3 Peripheral State functions
159
  * @{
160
  */
161
HAL_CRC_StateTypeDef HAL_CRC_GetState(CRC_HandleTypeDef *hcrc);
2 mjames 162
/**
163
  * @}
9 mjames 164
  */
2 mjames 165
 
166
/**
167
  * @}
9 mjames 168
  */
2 mjames 169
 
170
/**
171
  * @}
9 mjames 172
  */
2 mjames 173
 
174
/**
175
  * @}
176
  */
9 mjames 177
 
2 mjames 178
#ifdef __cplusplus
179
}
180
#endif
181
 
9 mjames 182
#endif /* STM32F1xx_HAL_CRC_H */
2 mjames 183
 
184
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/