Maxime mauger / BSP_DISCO_F746NG

Dependencies:   LCD_DISCO_F746NG

Dependents:   nfc_interfacage

Committer:
maximemau
Date:
Fri Jun 26 09:15:32 2020 +0000
Revision:
14:fc03321bc32f
Parent:
10:1050c589b2ad
Projet_interfacage_MAUGER_Maxime

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bcostm 6:e1d9da7fe856 1 /**
bcostm 6:e1d9da7fe856 2 ******************************************************************************
bcostm 6:e1d9da7fe856 3 * @file stm32746g_discovery_eeprom.h
bcostm 6:e1d9da7fe856 4 * @author MCD Application Team
bcostm 6:e1d9da7fe856 5 * @brief This file contains all the functions prototypes for
bcostm 6:e1d9da7fe856 6 * the stm32746g_discovery_eeprom.c firmware driver.
bcostm 6:e1d9da7fe856 7 ******************************************************************************
bcostm 6:e1d9da7fe856 8 * @attention
bcostm 6:e1d9da7fe856 9 *
bcostm 6:e1d9da7fe856 10 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
bcostm 6:e1d9da7fe856 11 *
bcostm 6:e1d9da7fe856 12 * Redistribution and use in source and binary forms, with or without modification,
bcostm 6:e1d9da7fe856 13 * are permitted provided that the following conditions are met:
bcostm 6:e1d9da7fe856 14 * 1. Redistributions of source code must retain the above copyright notice,
bcostm 6:e1d9da7fe856 15 * this list of conditions and the following disclaimer.
bcostm 6:e1d9da7fe856 16 * 2. Redistributions in binary form must reproduce the above copyright notice,
bcostm 6:e1d9da7fe856 17 * this list of conditions and the following disclaimer in the documentation
bcostm 6:e1d9da7fe856 18 * and/or other materials provided with the distribution.
bcostm 6:e1d9da7fe856 19 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bcostm 6:e1d9da7fe856 20 * may be used to endorse or promote products derived from this software
bcostm 6:e1d9da7fe856 21 * without specific prior written permission.
bcostm 6:e1d9da7fe856 22 *
bcostm 6:e1d9da7fe856 23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bcostm 6:e1d9da7fe856 24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bcostm 6:e1d9da7fe856 25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bcostm 6:e1d9da7fe856 26 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bcostm 6:e1d9da7fe856 27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bcostm 6:e1d9da7fe856 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bcostm 6:e1d9da7fe856 29 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bcostm 6:e1d9da7fe856 30 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bcostm 6:e1d9da7fe856 31 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bcostm 6:e1d9da7fe856 32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bcostm 6:e1d9da7fe856 33 *
bcostm 6:e1d9da7fe856 34 ******************************************************************************
bcostm 6:e1d9da7fe856 35 */
bcostm 6:e1d9da7fe856 36
bcostm 6:e1d9da7fe856 37 /* Define to prevent recursive inclusion -------------------------------------*/
bcostm 6:e1d9da7fe856 38 #ifndef __STM32746G_DISCOVERY_EEPROM_H
bcostm 6:e1d9da7fe856 39 #define __STM32746G_DISCOVERY_EEPROM_H
bcostm 6:e1d9da7fe856 40
bcostm 6:e1d9da7fe856 41 #ifdef __cplusplus
bcostm 6:e1d9da7fe856 42 extern "C" {
bcostm 6:e1d9da7fe856 43 #endif
bcostm 6:e1d9da7fe856 44
bcostm 6:e1d9da7fe856 45 /* Includes ------------------------------------------------------------------*/
bcostm 6:e1d9da7fe856 46 #include "stm32746g_discovery.h"
bcostm 6:e1d9da7fe856 47
bcostm 6:e1d9da7fe856 48 /** @addtogroup BSP
bcostm 6:e1d9da7fe856 49 * @{
bcostm 6:e1d9da7fe856 50 */
bcostm 6:e1d9da7fe856 51
bcostm 6:e1d9da7fe856 52 /** @addtogroup STM32746G_DISCOVERY
bcostm 6:e1d9da7fe856 53 * @{
bcostm 6:e1d9da7fe856 54 */
bcostm 6:e1d9da7fe856 55
bcostm 6:e1d9da7fe856 56 /** @addtogroup STM32746G_DISCOVERY_EEPROM
bcostm 6:e1d9da7fe856 57 * @brief This file includes the I2C EEPROM driver of STM32746G-Discovery board.
bcostm 6:e1d9da7fe856 58 * @{
bcostm 6:e1d9da7fe856 59 */
bcostm 6:e1d9da7fe856 60
bcostm 6:e1d9da7fe856 61 /** @defgroup STM32746G_DISCOVERY_EEPROM_Exported_Types STM32746G_DISCOVERY_EEPROM Exported Types
bcostm 6:e1d9da7fe856 62 * @{
bcostm 6:e1d9da7fe856 63 */
bcostm 6:e1d9da7fe856 64 /**
bcostm 6:e1d9da7fe856 65 * @}
bcostm 6:e1d9da7fe856 66 */
bcostm 6:e1d9da7fe856 67
bcostm 6:e1d9da7fe856 68 /** @defgroup STM32746G_DISCOVERY_EEPROM_Exported_Constants STM32746G_DISCOVERY_EEPROM Exported Constants
bcostm 6:e1d9da7fe856 69 * @{
bcostm 6:e1d9da7fe856 70 */
bcostm 6:e1d9da7fe856 71 /* EEPROM hardware address and page size */
bcostm 6:e1d9da7fe856 72 #define EEPROM_PAGESIZE ((uint8_t)4)
bcostm 6:e1d9da7fe856 73 #define EEPROM_MAX_SIZE ((uint16_t)0x2000) /* 64Kbit */
bcostm 6:e1d9da7fe856 74
bcostm 6:e1d9da7fe856 75
bcostm 6:e1d9da7fe856 76 /* Maximum number of trials for EEPROM_WaitEepromStandbyState() function */
bcostm 6:e1d9da7fe856 77 #define EEPROM_MAX_TRIALS ((uint32_t)3000)
bcostm 6:e1d9da7fe856 78
bcostm 6:e1d9da7fe856 79 #define EEPROM_OK ((uint32_t)0)
bcostm 6:e1d9da7fe856 80 #define EEPROM_FAIL ((uint32_t)1)
bcostm 6:e1d9da7fe856 81 #define EEPROM_TIMEOUT ((uint32_t)2)
bcostm 6:e1d9da7fe856 82 /**
bcostm 6:e1d9da7fe856 83 * @}
bcostm 6:e1d9da7fe856 84 */
bcostm 6:e1d9da7fe856 85
bcostm 6:e1d9da7fe856 86 /** @defgroup STM32746G_DISCOVERY_EEPROM_Exported_Macros STM32746G_DISCOVERY_EEPROM Exported Macros
bcostm 6:e1d9da7fe856 87 * @{
bcostm 6:e1d9da7fe856 88 */
bcostm 6:e1d9da7fe856 89 /**
bcostm 6:e1d9da7fe856 90 * @}
bcostm 6:e1d9da7fe856 91 */
bcostm 6:e1d9da7fe856 92
bcostm 6:e1d9da7fe856 93 /** @addtogroup STM32746G_DISCOVERY_EEPROM_Exported_Functions
bcostm 6:e1d9da7fe856 94 * @{
bcostm 6:e1d9da7fe856 95 */
bcostm 6:e1d9da7fe856 96 uint32_t BSP_EEPROM_Init(void);
bcostm 6:e1d9da7fe856 97 uint8_t BSP_EEPROM_DeInit(void);
bcostm 6:e1d9da7fe856 98 uint32_t BSP_EEPROM_ReadBuffer(uint8_t* pBuffer, uint16_t ReadAddr, uint16_t* NumByteToRead);
bcostm 6:e1d9da7fe856 99 uint32_t BSP_EEPROM_WritePage(uint8_t* pBuffer, uint16_t WriteAddr, uint8_t* NumByteToWrite);
bcostm 6:e1d9da7fe856 100 uint32_t BSP_EEPROM_WriteBuffer(uint8_t* pBuffer, uint16_t WriteAddr, uint16_t NumByteToWrite);
bcostm 6:e1d9da7fe856 101 uint32_t BSP_EEPROM_WaitEepromStandbyState(void);
bcostm 6:e1d9da7fe856 102
bcostm 6:e1d9da7fe856 103 /* USER Callbacks: This function is declared as __weak in EEPROM driver and
bcostm 6:e1d9da7fe856 104 should be implemented into user application.
bcostm 6:e1d9da7fe856 105 BSP_EEPROM_TIMEOUT_UserCallback() function is called whenever a timeout condition
bcostm 6:e1d9da7fe856 106 occurs during communication (waiting on an event that doesn't occur, bus
bcostm 6:e1d9da7fe856 107 errors, busy devices ...). */
bcostm 6:e1d9da7fe856 108 void BSP_EEPROM_TIMEOUT_UserCallback(void);
bcostm 6:e1d9da7fe856 109
bcostm 6:e1d9da7fe856 110 /* Link function for I2C EEPROM peripheral */
bcostm 6:e1d9da7fe856 111 void EEPROM_IO_Init(void);
bcostm 6:e1d9da7fe856 112 HAL_StatusTypeDef EEPROM_IO_WriteData(uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize);
bcostm 6:e1d9da7fe856 113 HAL_StatusTypeDef EEPROM_IO_ReadData(uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize);
bcostm 6:e1d9da7fe856 114 HAL_StatusTypeDef EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials);
bcostm 6:e1d9da7fe856 115
bcostm 6:e1d9da7fe856 116 /**
bcostm 6:e1d9da7fe856 117 * @}
bcostm 6:e1d9da7fe856 118 */
bcostm 6:e1d9da7fe856 119
bcostm 6:e1d9da7fe856 120 /**
bcostm 6:e1d9da7fe856 121 * @}
bcostm 6:e1d9da7fe856 122 */
bcostm 6:e1d9da7fe856 123
bcostm 6:e1d9da7fe856 124 /**
bcostm 6:e1d9da7fe856 125 * @}
bcostm 6:e1d9da7fe856 126 */
bcostm 6:e1d9da7fe856 127
bcostm 6:e1d9da7fe856 128 /**
bcostm 6:e1d9da7fe856 129 * @}
bcostm 6:e1d9da7fe856 130 */
bcostm 6:e1d9da7fe856 131
bcostm 6:e1d9da7fe856 132 #ifdef __cplusplus
bcostm 6:e1d9da7fe856 133 }
bcostm 6:e1d9da7fe856 134 #endif
bcostm 6:e1d9da7fe856 135
bcostm 6:e1d9da7fe856 136 #endif /* __STM32746G_DISCOVERY_EEPROM_H */
bcostm 6:e1d9da7fe856 137
bcostm 6:e1d9da7fe856 138 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/