philippe s. / mbed-dev

Fork of mbed-dev by mbed official

Committer:
neurofun
Date:
Tue Feb 23 21:59:35 2016 +0000
Revision:
70:b3a5af880266
Parent:
0:9b334a45a8ff
Edited DAC routines to allow for the simultaneous use of three channels from two DACs as seen on the STM32F334R8 and STM32F303K8. Edited ADC routines to allow for the simultaneous use of more than one ADC.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 0:9b334a45a8ff 1 /**
bogdanm 0:9b334a45a8ff 2 ******************************************************************************
bogdanm 0:9b334a45a8ff 3 * @file stm32f30x_crc.h
bogdanm 0:9b334a45a8ff 4 * @author MCD Application Team
bogdanm 0:9b334a45a8ff 5 * @version V1.1.0
bogdanm 0:9b334a45a8ff 6 * @date 27-February-2014
bogdanm 0:9b334a45a8ff 7 * @brief This file contains all the functions prototypes for the CRC firmware
bogdanm 0:9b334a45a8ff 8 * library.
bogdanm 0:9b334a45a8ff 9 ******************************************************************************
bogdanm 0:9b334a45a8ff 10 * @attention
bogdanm 0:9b334a45a8ff 11 *
bogdanm 0:9b334a45a8ff 12 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
bogdanm 0:9b334a45a8ff 13 *
bogdanm 0:9b334a45a8ff 14 * Redistribution and use in source and binary forms, with or without modification,
bogdanm 0:9b334a45a8ff 15 * are permitted provided that the following conditions are met:
bogdanm 0:9b334a45a8ff 16 * 1. Redistributions of source code must retain the above copyright notice,
bogdanm 0:9b334a45a8ff 17 * this list of conditions and the following disclaimer.
bogdanm 0:9b334a45a8ff 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
bogdanm 0:9b334a45a8ff 19 * this list of conditions and the following disclaimer in the documentation
bogdanm 0:9b334a45a8ff 20 * and/or other materials provided with the distribution.
bogdanm 0:9b334a45a8ff 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bogdanm 0:9b334a45a8ff 22 * may be used to endorse or promote products derived from this software
bogdanm 0:9b334a45a8ff 23 * without specific prior written permission.
bogdanm 0:9b334a45a8ff 24 *
bogdanm 0:9b334a45a8ff 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bogdanm 0:9b334a45a8ff 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bogdanm 0:9b334a45a8ff 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bogdanm 0:9b334a45a8ff 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bogdanm 0:9b334a45a8ff 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bogdanm 0:9b334a45a8ff 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bogdanm 0:9b334a45a8ff 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bogdanm 0:9b334a45a8ff 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bogdanm 0:9b334a45a8ff 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bogdanm 0:9b334a45a8ff 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bogdanm 0:9b334a45a8ff 35 *
bogdanm 0:9b334a45a8ff 36 ******************************************************************************
bogdanm 0:9b334a45a8ff 37 */
bogdanm 0:9b334a45a8ff 38
bogdanm 0:9b334a45a8ff 39 /* Define to prevent recursive inclusion -------------------------------------*/
bogdanm 0:9b334a45a8ff 40 #ifndef __STM32F30x_CRC_H
bogdanm 0:9b334a45a8ff 41 #define __STM32F30x_CRC_H
bogdanm 0:9b334a45a8ff 42
bogdanm 0:9b334a45a8ff 43 #ifdef __cplusplus
bogdanm 0:9b334a45a8ff 44 extern "C" {
bogdanm 0:9b334a45a8ff 45 #endif
bogdanm 0:9b334a45a8ff 46
bogdanm 0:9b334a45a8ff 47 /*!< Includes ----------------------------------------------------------------*/
bogdanm 0:9b334a45a8ff 48 #include "stm32f30x.h"
bogdanm 0:9b334a45a8ff 49
bogdanm 0:9b334a45a8ff 50 /** @addtogroup STM32F30x_StdPeriph_Driver
bogdanm 0:9b334a45a8ff 51 * @{
bogdanm 0:9b334a45a8ff 52 */
bogdanm 0:9b334a45a8ff 53
bogdanm 0:9b334a45a8ff 54 /** @addtogroup CRC
bogdanm 0:9b334a45a8ff 55 * @{
bogdanm 0:9b334a45a8ff 56 */
bogdanm 0:9b334a45a8ff 57
bogdanm 0:9b334a45a8ff 58 /* Exported types ------------------------------------------------------------*/
bogdanm 0:9b334a45a8ff 59 /* Exported constants --------------------------------------------------------*/
bogdanm 0:9b334a45a8ff 60
bogdanm 0:9b334a45a8ff 61 /** @defgroup CRC_ReverseInputData
bogdanm 0:9b334a45a8ff 62 * @{
bogdanm 0:9b334a45a8ff 63 */
bogdanm 0:9b334a45a8ff 64 #define CRC_ReverseInputData_No ((uint32_t)0x00000000) /*!< No reverse operation of Input Data */
bogdanm 0:9b334a45a8ff 65 #define CRC_ReverseInputData_8bits CRC_CR_REV_IN_0 /*!< Reverse operation of Input Data on 8 bits */
bogdanm 0:9b334a45a8ff 66 #define CRC_ReverseInputData_16bits CRC_CR_REV_IN_1 /*!< Reverse operation of Input Data on 16 bits */
bogdanm 0:9b334a45a8ff 67 #define CRC_ReverseInputData_32bits CRC_CR_REV_IN /*!< Reverse operation of Input Data on 32 bits */
bogdanm 0:9b334a45a8ff 68
bogdanm 0:9b334a45a8ff 69 #define IS_CRC_REVERSE_INPUT_DATA(DATA) (((DATA) == CRC_ReverseInputData_No) || \
bogdanm 0:9b334a45a8ff 70 ((DATA) == CRC_ReverseInputData_8bits) || \
bogdanm 0:9b334a45a8ff 71 ((DATA) == CRC_ReverseInputData_16bits) || \
bogdanm 0:9b334a45a8ff 72 ((DATA) == CRC_ReverseInputData_32bits))
bogdanm 0:9b334a45a8ff 73
bogdanm 0:9b334a45a8ff 74 /**
bogdanm 0:9b334a45a8ff 75 * @}
bogdanm 0:9b334a45a8ff 76 */
bogdanm 0:9b334a45a8ff 77
bogdanm 0:9b334a45a8ff 78 /** @defgroup CRC_PolynomialSize
bogdanm 0:9b334a45a8ff 79 * @{
bogdanm 0:9b334a45a8ff 80 */
bogdanm 0:9b334a45a8ff 81 #define CRC_PolSize_7 CRC_CR_POLSIZE /*!< 7-bit polynomial for CRC calculation */
bogdanm 0:9b334a45a8ff 82 #define CRC_PolSize_8 CRC_CR_POLSIZE_1 /*!< 8-bit polynomial for CRC calculation */
bogdanm 0:9b334a45a8ff 83 #define CRC_PolSize_16 CRC_CR_POLSIZE_0 /*!< 16-bit polynomial for CRC calculation */
bogdanm 0:9b334a45a8ff 84 #define CRC_PolSize_32 ((uint32_t)0x00000000)/*!< 32-bit polynomial for CRC calculation */
bogdanm 0:9b334a45a8ff 85
bogdanm 0:9b334a45a8ff 86 #define IS_CRC_POL_SIZE(SIZE) (((SIZE) == CRC_PolSize_7) || \
bogdanm 0:9b334a45a8ff 87 ((SIZE) == CRC_PolSize_8) || \
bogdanm 0:9b334a45a8ff 88 ((SIZE) == CRC_PolSize_16) || \
bogdanm 0:9b334a45a8ff 89 ((SIZE) == CRC_PolSize_32))
bogdanm 0:9b334a45a8ff 90
bogdanm 0:9b334a45a8ff 91 /**
bogdanm 0:9b334a45a8ff 92 * @}
bogdanm 0:9b334a45a8ff 93 */
bogdanm 0:9b334a45a8ff 94
bogdanm 0:9b334a45a8ff 95 /* Exported macro ------------------------------------------------------------*/
bogdanm 0:9b334a45a8ff 96 /* Exported functions ------------------------------------------------------- */
bogdanm 0:9b334a45a8ff 97 /* Configuration of the CRC computation unit **********************************/
bogdanm 0:9b334a45a8ff 98 void CRC_DeInit(void);
bogdanm 0:9b334a45a8ff 99 void CRC_ResetDR(void);
bogdanm 0:9b334a45a8ff 100 void CRC_PolynomialSizeSelect(uint32_t CRC_PolSize);
bogdanm 0:9b334a45a8ff 101 void CRC_ReverseInputDataSelect(uint32_t CRC_ReverseInputData);
bogdanm 0:9b334a45a8ff 102 void CRC_ReverseOutputDataCmd(FunctionalState NewState);
bogdanm 0:9b334a45a8ff 103 void CRC_SetInitRegister(uint32_t CRC_InitValue);
bogdanm 0:9b334a45a8ff 104 void CRC_SetPolynomial(uint32_t CRC_Pol);
bogdanm 0:9b334a45a8ff 105
bogdanm 0:9b334a45a8ff 106 /* CRC computation ************************************************************/
bogdanm 0:9b334a45a8ff 107 uint32_t CRC_CalcCRC(uint32_t CRC_Data);
bogdanm 0:9b334a45a8ff 108 uint32_t CRC_CalcCRC16bits(uint16_t CRC_Data);
bogdanm 0:9b334a45a8ff 109 uint32_t CRC_CalcCRC8bits(uint8_t CRC_Data);
bogdanm 0:9b334a45a8ff 110 uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength);
bogdanm 0:9b334a45a8ff 111 uint32_t CRC_GetCRC(void);
bogdanm 0:9b334a45a8ff 112
bogdanm 0:9b334a45a8ff 113 /* Independent register (IDR) access (write/read) *****************************/
bogdanm 0:9b334a45a8ff 114 void CRC_SetIDRegister(uint8_t CRC_IDValue);
bogdanm 0:9b334a45a8ff 115 uint8_t CRC_GetIDRegister(void);
bogdanm 0:9b334a45a8ff 116
bogdanm 0:9b334a45a8ff 117 #ifdef __cplusplus
bogdanm 0:9b334a45a8ff 118 }
bogdanm 0:9b334a45a8ff 119 #endif
bogdanm 0:9b334a45a8ff 120
bogdanm 0:9b334a45a8ff 121 #endif /* __STM32F30x_CRC_H */
bogdanm 0:9b334a45a8ff 122
bogdanm 0:9b334a45a8ff 123 /**
bogdanm 0:9b334a45a8ff 124 * @}
bogdanm 0:9b334a45a8ff 125 */
bogdanm 0:9b334a45a8ff 126
bogdanm 0:9b334a45a8ff 127 /**
bogdanm 0:9b334a45a8ff 128 * @}
bogdanm 0:9b334a45a8ff 129 */
bogdanm 0:9b334a45a8ff 130
bogdanm 0:9b334a45a8ff 131 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/