diff options
Diffstat (limited to 'src/stm32lib/examples/I2C/M24C08_EEPROM')
-rwxr-xr-x | src/stm32lib/examples/I2C/M24C08_EEPROM/i2c_ee.c | 385 | ||||
-rwxr-xr-x | src/stm32lib/examples/I2C/M24C08_EEPROM/i2c_ee.h | 44 | ||||
-rwxr-xr-x | src/stm32lib/examples/I2C/M24C08_EEPROM/main.c | 230 | ||||
-rwxr-xr-x | src/stm32lib/examples/I2C/M24C08_EEPROM/readme.txt | 79 | ||||
-rwxr-xr-x | src/stm32lib/examples/I2C/M24C08_EEPROM/stm32f10x_conf.h | 170 | ||||
-rwxr-xr-x | src/stm32lib/examples/I2C/M24C08_EEPROM/stm32f10x_it.c | 810 | ||||
-rwxr-xr-x | src/stm32lib/examples/I2C/M24C08_EEPROM/stm32f10x_it.h | 100 |
7 files changed, 1818 insertions, 0 deletions
diff --git a/src/stm32lib/examples/I2C/M24C08_EEPROM/i2c_ee.c b/src/stm32lib/examples/I2C/M24C08_EEPROM/i2c_ee.c new file mode 100755 index 0000000..f95858a --- /dev/null +++ b/src/stm32lib/examples/I2C/M24C08_EEPROM/i2c_ee.c @@ -0,0 +1,385 @@ +/******************** (C) COPYRIGHT 2008 STMicroelectronics ********************
+* File Name : i2c_ee.c
+* Author : MCD Application Team
+* Version : V2.0.1
+* Date : 06/13/2008
+* Description : This file provides a set of functions needed to manage the
+* communication between I2C peripheral and I2C M24C08 EEPROM.
+********************************************************************************
+* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
+* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
+* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
+* CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
+* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+*******************************************************************************/
+
+/* Includes ------------------------------------------------------------------*/
+#include "i2c_ee.h"
+
+/* Private typedef -----------------------------------------------------------*/
+/* Private define ------------------------------------------------------------*/
+#define I2C_Speed 400000
+#define I2C1_SLAVE_ADDRESS7 0xA0
+#define I2C_PageSize 16
+
+/* Private macro -------------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+u16 EEPROM_ADDRESS;
+
+/* Private function prototypes -----------------------------------------------*/
+void GPIO_Configuration(void);
+void I2C_Configuration(void);
+
+/* Private functions ---------------------------------------------------------*/
+/*******************************************************************************
+* Function Name : GPIO_Configuration
+* Description : Configure the used I/O ports pin
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void GPIO_Configuration(void)
+{
+ GPIO_InitTypeDef GPIO_InitStructure;
+
+ /* Configure I2C1 pins: SCL and SDA */
+ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7;
+ GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
+ GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_OD;
+ GPIO_Init(GPIOB, &GPIO_InitStructure);
+}
+
+/*******************************************************************************
+* Function Name : I2C_Configuration
+* Description : I2C Configuration
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void I2C_Configuration(void)
+{
+ I2C_InitTypeDef I2C_InitStructure;
+
+ /* I2C configuration */
+ I2C_InitStructure.I2C_Mode = I2C_Mode_I2C;
+ I2C_InitStructure.I2C_DutyCycle = I2C_DutyCycle_2;
+ I2C_InitStructure.I2C_OwnAddress1 = I2C1_SLAVE_ADDRESS7;
+ I2C_InitStructure.I2C_Ack = I2C_Ack_Enable;
+ I2C_InitStructure.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;
+ I2C_InitStructure.I2C_ClockSpeed = I2C_Speed;
+
+ /* I2C Peripheral Enable */
+ I2C_Cmd(I2C1, ENABLE);
+ /* Apply I2C configuration after enabling it */
+ I2C_Init(I2C1, &I2C_InitStructure);
+}
+
+/*******************************************************************************
+* Function Name : I2C_EE_Init
+* Description : Initializes peripherals used by the I2C EEPROM driver.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void I2C_EE_Init()
+{
+ /* GPIO configuration */
+ GPIO_Configuration();
+
+ /* I2C configuration */
+ I2C_Configuration();
+
+ /* depending on the EEPROM Address selected in the i2c_ee.h file */
+#ifdef EEPROM_Block0_ADDRESS
+ /* Select the EEPROM Block0 to write on */
+ EEPROM_ADDRESS = EEPROM_Block0_ADDRESS;
+#endif
+#ifdef EEPROM_Block1_ADDRESS
+ /* Select the EEPROM Block1 to write on */
+ EEPROM_ADDRESS = EEPROM_Block1_ADDRESS;
+#endif
+#ifdef EEPROM_Block2_ADDRESS
+ /* Select the EEPROM Block2 to write on */
+ EEPROM_ADDRESS = EEPROM_Block2_ADDRESS;
+#endif
+#ifdef EEPROM_Block3_ADDRESS
+ /* Select the EEPROM Block3 to write on */
+ EEPROM_ADDRESS = EEPROM_Block3_ADDRESS;
+#endif
+}
+
+/*******************************************************************************
+* Function Name : I2C_EE_BufferWrite
+* Description : Writes buffer of data to the I2C EEPROM.
+* Input : - pBuffer : pointer to the buffer containing the data to be
+* written to the EEPROM.
+* - WriteAddr : EEPROM's internal address to write to.
+* - NumByteToWrite : number of bytes to write to the EEPROM.
+* Output : None
+* Return : None
+*******************************************************************************/
+void I2C_EE_BufferWrite(u8* pBuffer, u8 WriteAddr, u16 NumByteToWrite)
+{
+ u8 NumOfPage = 0, NumOfSingle = 0, Addr = 0, count = 0;
+
+ Addr = WriteAddr % I2C_PageSize;
+ count = I2C_PageSize - Addr;
+ NumOfPage = NumByteToWrite / I2C_PageSize;
+ NumOfSingle = NumByteToWrite % I2C_PageSize;
+
+ /* If WriteAddr is I2C_PageSize aligned */
+ if(Addr == 0)
+ {
+ /* If NumByteToWrite < I2C_PageSize */
+ if(NumOfPage == 0)
+ {
+ I2C_EE_PageWrite(pBuffer, WriteAddr, NumOfSingle);
+ I2C_EE_WaitEepromStandbyState();
+ }
+ /* If NumByteToWrite > I2C_PageSize */
+ else
+ {
+ while(NumOfPage--)
+ {
+ I2C_EE_PageWrite(pBuffer, WriteAddr, I2C_PageSize);
+ I2C_EE_WaitEepromStandbyState();
+ WriteAddr += I2C_PageSize;
+ pBuffer += I2C_PageSize;
+ }
+
+ if(NumOfSingle!=0)
+ {
+ I2C_EE_PageWrite(pBuffer, WriteAddr, NumOfSingle);
+ I2C_EE_WaitEepromStandbyState();
+ }
+ }
+ }
+ /* If WriteAddr is not I2C_PageSize aligned */
+ else
+ {
+ /* If NumByteToWrite < I2C_PageSize */
+ if(NumOfPage== 0)
+ {
+ I2C_EE_PageWrite(pBuffer, WriteAddr, NumOfSingle);
+ I2C_EE_WaitEepromStandbyState();
+ }
+ /* If NumByteToWrite > I2C_PageSize */
+ else
+ {
+ NumByteToWrite -= count;
+ NumOfPage = NumByteToWrite / I2C_PageSize;
+ NumOfSingle = NumByteToWrite % I2C_PageSize;
+
+ if(count != 0)
+ {
+ I2C_EE_PageWrite(pBuffer, WriteAddr, count);
+ I2C_EE_WaitEepromStandbyState();
+ WriteAddr += count;
+ pBuffer += count;
+ }
+
+ while(NumOfPage--)
+ {
+ I2C_EE_PageWrite(pBuffer, WriteAddr, I2C_PageSize);
+ I2C_EE_WaitEepromStandbyState();
+ WriteAddr += I2C_PageSize;
+ pBuffer += I2C_PageSize;
+ }
+ if(NumOfSingle != 0)
+ {
+ I2C_EE_PageWrite(pBuffer, WriteAddr, NumOfSingle);
+ I2C_EE_WaitEepromStandbyState();
+ }
+ }
+ }
+}
+
+/*******************************************************************************
+* Function Name : I2C_EE_ByteWrite
+* Description : Writes one byte to the I2C EEPROM.
+* Input : - pBuffer : pointer to the buffer containing the data to be
+* written to the EEPROM.
+* - WriteAddr : EEPROM's internal address to write to.
+* Output : None
+* Return : None
+*******************************************************************************/
+void I2C_EE_ByteWrite(u8* pBuffer, u8 WriteAddr)
+{
+ /* Send STRAT condition */
+ I2C_GenerateSTART(I2C1, ENABLE);
+
+ /* Test on EV5 and clear it */
+ while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_MODE_SELECT));
+
+ /* Send EEPROM address for write */
+ I2C_Send7bitAddress(I2C1, EEPROM_ADDRESS, I2C_Direction_Transmitter);
+
+ /* Test on EV6 and clear it */
+ while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED));
+
+ /* Send the EEPROM's internal address to write to */
+ I2C_SendData(I2C1, WriteAddr);
+
+ /* Test on EV8 and clear it */
+ while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED));
+
+ /* Send the byte to be written */
+ I2C_SendData(I2C1, *pBuffer);
+
+ /* Test on EV8 and clear it */
+ while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED));
+
+ /* Send STOP condition */
+ I2C_GenerateSTOP(I2C1, ENABLE);
+}
+
+/*******************************************************************************
+* Function Name : I2C_EE_PageWrite
+* Description : Writes more than one byte to the EEPROM with a single WRITE
+* cycle. The number of byte can't exceed the EEPROM page size.
+* Input : - pBuffer : pointer to the buffer containing the data to be
+* written to the EEPROM.
+* - WriteAddr : EEPROM's internal address to write to.
+* - NumByteToWrite : number of bytes to write to the EEPROM.
+* Output : None
+* Return : None
+*******************************************************************************/
+void I2C_EE_PageWrite(u8* pBuffer, u8 WriteAddr, u8 NumByteToWrite)
+{
+ /* Send START condition */
+ I2C_GenerateSTART(I2C1, ENABLE);
+
+ /* Test on EV5 and clear it */
+ while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_MODE_SELECT));
+
+ /* Send EEPROM address for write */
+ I2C_Send7bitAddress(I2C1, EEPROM_ADDRESS, I2C_Direction_Transmitter);
+
+ /* Test on EV6 and clear it */
+ while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED));
+
+ /* Send the EEPROM's internal address to write to */
+ I2C_SendData(I2C1, WriteAddr);
+
+ /* Test on EV8 and clear it */
+ while(! I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED));
+
+ /* While there is data to be written */
+ while(NumByteToWrite--)
+ {
+ /* Send the current byte */
+ I2C_SendData(I2C1, *pBuffer);
+
+ /* Point to the next byte to be written */
+ pBuffer++;
+
+ /* Test on EV8 and clear it */
+ while (!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED));
+ }
+
+ /* Send STOP condition */
+ I2C_GenerateSTOP(I2C1, ENABLE);
+}
+
+/*******************************************************************************
+* Function Name : I2C_EE_BufferRead
+* Description : Reads a block of data from the EEPROM.
+* Input : - pBuffer : pointer to the buffer that receives the data read
+* from the EEPROM.
+* - ReadAddr : EEPROM's internal address to read from.
+* - NumByteToRead : number of bytes to read from the EEPROM.
+* Output : None
+* Return : None
+*******************************************************************************/
+void I2C_EE_BufferRead(u8* pBuffer, u8 ReadAddr, u16 NumByteToRead)
+{
+ /* Send START condition */
+ I2C_GenerateSTART(I2C1, ENABLE);
+
+ /* Test on EV5 and clear it */
+ while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_MODE_SELECT));
+
+ /* Send EEPROM address for write */
+ I2C_Send7bitAddress(I2C1, EEPROM_ADDRESS, I2C_Direction_Transmitter);
+
+ /* Test on EV6 and clear it */
+ while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED));
+
+ /* Clear EV6 by setting again the PE bit */
+ I2C_Cmd(I2C1, ENABLE);
+
+ /* Send the EEPROM's internal address to write to */
+ I2C_SendData(I2C1, ReadAddr);
+
+ /* Test on EV8 and clear it */
+ while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED));
+
+ /* Send STRAT condition a second time */
+ I2C_GenerateSTART(I2C1, ENABLE);
+
+ /* Test on EV5 and clear it */
+ while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_MODE_SELECT));
+
+ /* Send EEPROM address for read */
+ I2C_Send7bitAddress(I2C1, EEPROM_ADDRESS, I2C_Direction_Receiver);
+
+ /* Test on EV6 and clear it */
+ while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_RECEIVER_MODE_SELECTED));
+
+ /* While there is data to be read */
+ while(NumByteToRead)
+ {
+ if(NumByteToRead == 1)
+ {
+ /* Disable Acknowledgement */
+ I2C_AcknowledgeConfig(I2C1, DISABLE);
+
+ /* Send STOP Condition */
+ I2C_GenerateSTOP(I2C1, ENABLE);
+ }
+
+ /* Test on EV7 and clear it */
+ if(I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_RECEIVED))
+ {
+ /* Read a byte from the EEPROM */
+ *pBuffer = I2C_ReceiveData(I2C1);
+
+ /* Point to the next location where the byte read will be saved */
+ pBuffer++;
+
+ /* Decrement the read bytes counter */
+ NumByteToRead--;
+ }
+ }
+
+ /* Enable Acknowledgement to be ready for another reception */
+ I2C_AcknowledgeConfig(I2C1, ENABLE);
+}
+
+/*******************************************************************************
+* Function Name : I2C_EE_WaitEepromStandbyState
+* Description : Wait for EEPROM Standby state
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void I2C_EE_WaitEepromStandbyState(void)
+{
+ vu16 SR1_Tmp = 0;
+
+ do
+ {
+ /* Send START condition */
+ I2C_GenerateSTART(I2C1, ENABLE);
+ /* Read I2C1 SR1 register */
+ SR1_Tmp = I2C_ReadRegister(I2C1, I2C_Register_SR1);
+ /* Send EEPROM address for write */
+ I2C_Send7bitAddress(I2C1, EEPROM_ADDRESS, I2C_Direction_Transmitter);
+ }while(!(I2C_ReadRegister(I2C1, I2C_Register_SR1) & 0x0002));
+
+ /* Clear AF flag */
+ I2C_ClearFlag(I2C1, I2C_FLAG_AF);
+}
+
+/******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/
diff --git a/src/stm32lib/examples/I2C/M24C08_EEPROM/i2c_ee.h b/src/stm32lib/examples/I2C/M24C08_EEPROM/i2c_ee.h new file mode 100755 index 0000000..d9552ab --- /dev/null +++ b/src/stm32lib/examples/I2C/M24C08_EEPROM/i2c_ee.h @@ -0,0 +1,44 @@ +/******************** (C) COPYRIGHT 2008 STMicroelectronics ********************
+* File Name : i2c_ee.h
+* Author : MCD Application Team
+* Version : V2.0.1
+* Date : 06/13/2008
+* Description : Header for i2c_ee.c module
+********************************************************************************
+* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
+* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
+* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
+* CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
+* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+*******************************************************************************/
+/* Define to prevent recursive inclusion ------------------------------------ */
+#ifndef __I2C_EE_H
+#define __I2C_EE_H
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32f10x_lib.h"
+
+/* Exported types ------------------------------------------------------------*/
+/* Exported constants --------------------------------------------------------*/
+/* The M24C08W contains 4 blocks (128byte each) with the adresses below: E2 = 0 */
+/* EEPROM Addresses defines */
+//#define EEPROM_Block0_ADDRESS 0xA0 /* E2 = 0 */
+#define EEPROM_Block1_ADDRESS 0xA2 /* E2 = 0 */
+//#define EEPROM_Block2_ADDRESS 0xA4 /* E2 = 0 */
+//#define EEPROM_Block3_ADDRESS 0xA6 /* E2 = 0 */
+
+/* Exported macro ------------------------------------------------------------*/
+/* Exported functions ------------------------------------------------------- */
+void I2C_EE_Init(void);
+void I2C_EE_ByteWrite(u8* pBuffer, u8 WriteAddr);
+void I2C_EE_PageWrite(u8* pBuffer, u8 WriteAddr, u8 NumByteToWrite);
+void I2C_EE_BufferWrite(u8* pBuffer, u8 WriteAddr, u16 NumByteToWrite);
+void I2C_EE_BufferRead(u8* pBuffer, u8 ReadAddr, u16 NumByteToRead);
+void I2C_EE_WaitEepromStandbyState(void);
+
+#endif /* __I2C_EE_H */
+
+/******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/
+
+
diff --git a/src/stm32lib/examples/I2C/M24C08_EEPROM/main.c b/src/stm32lib/examples/I2C/M24C08_EEPROM/main.c new file mode 100755 index 0000000..89be1ce --- /dev/null +++ b/src/stm32lib/examples/I2C/M24C08_EEPROM/main.c @@ -0,0 +1,230 @@ +/******************** (C) COPYRIGHT 2008 STMicroelectronics ********************
+* File Name : main.c
+* Author : MCD Application Team
+* Version : V2.0.1
+* Date : 06/13/2008
+* Description : Main program body
+********************************************************************************
+* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
+* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
+* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
+* CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
+* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+*******************************************************************************/
+
+/* Includes ------------------------------------------------------------------*/
+#include "i2c_ee.h"
+
+/* Private typedef -----------------------------------------------------------*/
+typedef enum {FAILED = 0, PASSED = !FAILED} TestStatus;
+
+/* Private define ------------------------------------------------------------*/
+#define EEPROM_WriteAddress1 0x05
+#define EEPROM_ReadAddress1 0x05
+#define BufferSize1 (countof(Tx1_Buffer)-1)
+#define BufferSize2 (countof(Tx2_Buffer)-1)
+#define EEPROM_WriteAddress2 (EEPROM_WriteAddress1 + BufferSize1)
+#define EEPROM_ReadAddress2 (EEPROM_ReadAddress1 + BufferSize1)
+
+/* Private macro -------------------------------------------------------------*/
+#define countof(a) (sizeof(a) / sizeof(*(a)))
+
+/* Private variables ---------------------------------------------------------*/
+u8 Tx1_Buffer[] = "/* STM32F10x I2C Firmware ";
+u8 Tx2_Buffer[] = "Library Example */";
+u8 Rx1_Buffer[BufferSize1], Rx2_Buffer[BufferSize2];
+volatile TestStatus TransferStatus1 = FAILED, TransferStatus2 = FAILED;
+ErrorStatus HSEStartUpStatus;
+
+/* Private functions ---------------------------------------------------------*/
+void RCC_Configuration(void);
+void NVIC_Configuration(void);
+TestStatus Buffercmp(u8* pBuffer1, u8* pBuffer2, u16 BufferLength);
+
+/*******************************************************************************
+* Function Name : main
+* Description : Main program
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+int main(void)
+{
+#ifdef DEBUG
+ debug();
+#endif
+
+ /* System clocks configuration ---------------------------------------------*/
+ RCC_Configuration();
+
+ /* NVIC configuration ------------------------------------------------------*/
+ NVIC_Configuration();
+
+ /* Initialize the I2C EEPROM driver ----------------------------------------*/
+ I2C_EE_Init();
+
+ /* First write in the memory followed by a read of the written data --------*/
+ /* Write on I2C EEPROM from EEPROM_WriteAddress1 */
+ I2C_EE_BufferWrite(Tx1_Buffer, EEPROM_WriteAddress1, BufferSize1);
+
+ /* Read from I2C EEPROM from EEPROM_ReadAddress1 */
+ I2C_EE_BufferRead(Rx1_Buffer, EEPROM_ReadAddress1, BufferSize1);
+
+ /* Check if the data written to the memory is read correctly */
+ TransferStatus1 = Buffercmp(Tx1_Buffer, Rx1_Buffer, BufferSize1);
+ /* TransferStatus1 = PASSED, if the transmitted and received data
+ to/from the EEPROM are the same */
+ /* TransferStatus1 = FAILED, if the transmitted and received data
+ to/from the EEPROM are different */
+
+ /* Wait for EEPROM standby state */
+ I2C_EE_WaitEepromStandbyState();
+
+ /* Second write in the memory followed by a read of the written data -------*/
+ /* Write on I2C EEPROM from EEPROM_WriteAddress2 */
+ I2C_EE_BufferWrite(Tx2_Buffer, EEPROM_WriteAddress2, BufferSize2);
+
+ /* Read from I2C EEPROM from EEPROM_ReadAddress2 */
+ I2C_EE_BufferRead(Rx2_Buffer, EEPROM_ReadAddress2, BufferSize2);
+
+ /* Check if the data written to the memory is read correctly */
+ TransferStatus2 = Buffercmp(Tx2_Buffer, Rx2_Buffer, BufferSize2);
+ /* TransferStatus2 = PASSED, if the transmitted and received data
+ to/from the EEPROM are the same */
+ /* TransferStatus2 = FAILED, if the transmitted and received data
+ to/from the EEPROM are different */
+
+ while (1)
+ {
+ }
+}
+
+/*******************************************************************************
+* Function Name : RCC_Configuration
+* Description : Configures the different system clocks.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void RCC_Configuration(void)
+{
+ /* RCC system reset(for debug purpose) */
+ RCC_DeInit();
+
+ /* Enable HSE */
+ RCC_HSEConfig(RCC_HSE_ON);
+
+ /* Wait till HSE is ready */
+ HSEStartUpStatus = RCC_WaitForHSEStartUp();
+
+ if(HSEStartUpStatus == SUCCESS)
+ {
+ /* Enable Prefetch Buffer */
+ FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
+
+ /* Flash 2 wait state */
+ FLASH_SetLatency(FLASH_Latency_2);
+
+ /* HCLK = SYSCLK */
+ RCC_HCLKConfig(RCC_SYSCLK_Div1);
+
+ /* PCLK2 = HCLK */
+ RCC_PCLK2Config(RCC_HCLK_Div1);
+
+ /* PCLK1 = HCLK/2 */
+ RCC_PCLK1Config(RCC_HCLK_Div2);
+
+ /* PLLCLK = 8MHz * 9 = 72 MHz */
+ RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_9);
+
+ /* Enable PLL */
+ RCC_PLLCmd(ENABLE);
+
+ /* Wait till PLL is ready */
+ while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)
+ {
+ }
+
+ /* Select PLL as system clock source */
+ RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
+
+ /* Wait till PLL is used as system clock source */
+ while(RCC_GetSYSCLKSource() != 0x08)
+ {
+ }
+ }
+
+/* Enable peripheral clocks --------------------------------------------------*/
+ /* GPIOB Periph clock enable */
+ RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
+ /* I2C1 Periph clock enable */
+ RCC_APB1PeriphClockCmd(RCC_APB1Periph_I2C1, ENABLE);
+}
+
+/*******************************************************************************
+* Function Name : NVIC_Configuration
+* Description : Configures Vector Table base location.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void NVIC_Configuration(void)
+{
+#ifdef VECT_TAB_RAM
+ /* Set the Vector Table base location at 0x20000000 */
+ NVIC_SetVectorTable(NVIC_VectTab_RAM, 0x0);
+#else /* VECT_TAB_FLASH */
+ /* Set the Vector Table base location at 0x08000000 */
+ NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x0);
+#endif
+}
+
+/*******************************************************************************
+* Function Name : Buffercmp
+* Description : Compares two buffers.
+* Input : - pBuffer1, pBuffer2: buffers to be compared.
+* : - BufferLength: buffer's length
+* Output : None
+* Return : PASSED: pBuffer1 identical to pBuffer2
+* FAILED: pBuffer1 differs from pBuffer2
+*******************************************************************************/
+TestStatus Buffercmp(u8* pBuffer1, u8* pBuffer2, u16 BufferLength)
+{
+ while(BufferLength--)
+ {
+ if(*pBuffer1 != *pBuffer2)
+ {
+ return FAILED;
+ }
+
+ pBuffer1++;
+ pBuffer2++;
+ }
+
+ return PASSED;
+}
+
+#ifdef DEBUG
+/*******************************************************************************
+* Function Name : assert_failed
+* Description : Reports the name of the source file and the source line number
+* where the assert_param error has occurred.
+* Input : - file: pointer to the source file name
+* - line: assert_param error line source number
+* Output : None
+* Return : None
+*******************************************************************************/
+void assert_failed(u8* file, u32 line)
+{
+ /* User can add his own implementation to report the file name and line number,
+ ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
+
+ /* Infinite loop */
+ while (1)
+ {
+ }
+}
+#endif
+
+/******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/
diff --git a/src/stm32lib/examples/I2C/M24C08_EEPROM/readme.txt b/src/stm32lib/examples/I2C/M24C08_EEPROM/readme.txt new file mode 100755 index 0000000..d1b9c50 --- /dev/null +++ b/src/stm32lib/examples/I2C/M24C08_EEPROM/readme.txt @@ -0,0 +1,79 @@ +/******************** (C) COPYRIGHT 2008 STMicroelectronics ********************
+* File Name : readme.txt
+* Author : MCD Application Team
+* Version : V2.0.1
+* Date : 06/13/2008
+* Description : Description of the I2C and M24C08 EEPROM communication example.
+********************************************************************************
+* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
+* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
+* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
+* CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
+* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+*******************************************************************************/
+
+Example description
+===================
+This example provides a basic example of how to use the I2C software library
+and an associate I2C EEPROM driver to communicate with an M24C08 EEPROM.
+I2C1 is configured in Master transmitter during write operation and in Master
+receiver during read operation from I2C EEPROM.
+The speed is set to the maximum frequency of 400kHz. This value is defined in
+the I2c_ee.c file, which could be in the range of 0 to 400KHZ.
+One I2C EEPROM Block address where the program will write the buffer have to be
+selected from the four address available and defined in the I2c_ee.h file.
+The EEPROM address where the program start the write and the read operations is
+defined in the main.c file.
+
+First, the contents of Tx1_Buffer are written to the EEPROM_WriteAddress1 and the
+written data are read. The written and the read buffers data are then compared.
+Following the read operation, the program wait that the EEPROM reverts to its
+Standby state. A second write operation is, then, performed and this time, Tx2_Buffer
+is written to EEPROM_WriteAddress2, which represents the address just after the last
+written one in the first write. After completion of the second write operation, the
+written data are read. The contents of the written and the read buffers are compared.
+
+
+Directory contents
+==================
+stm32f10x_conf.h Library Configuration file
+stm32f10x_it.c Interrupt handlers
+stm32f10x_it.h Interrupt handlers header file
+main.c Main program
+i2c_ee.c I2C EEPROM driver
+i2c_ee.h Header for the i2c_ee.c file
+
+
+Hardware environment
+====================
+This example runs on STMicroelectronics STM3210B-EVAL and STM3210E-EVAL evaluation
+boards with addition of the following hardware connection:
+ - Connect I2C1 SCL pin (PB.06) to I2C EEPROM SCL (pin6)
+ - Connect I2C1 SDA pin (PB.07) to I2C EEPROM SDA (pin5)
+ - Check that a pull-up resistor is connected on one I2C SDA pin
+ - Check that a pull-up resistor is connected on one I2C SCL pin
+ - Connect I2C EEPROM Vcc (pin8) to Vdd
+ - Connect I2C EEPROM Vss (pin4) to Vss
+
+Note: The pull-up resitors are already implemented on the STM3210B-EVAL and
+ STM3210E-EVAL evaluation boards.
+
+
+How to use it
+=============
+In order to make the program work, you must do the following :
+- Create a project and setup all your toolchain's start-up files
+- Compile the directory content files and required Library files :
+ + stm32f10x_lib.c
+ + stm32f10x_i2c.c
+ + stm32f10x_rcc.c
+ + stm32f10x_nvic.c
+ + stm32f10x_gpio.c
+ + stm32f10x_flash.c
+
+- Link all compiled files and load your image into target memory
+- Run the example
+
+
+******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE******
diff --git a/src/stm32lib/examples/I2C/M24C08_EEPROM/stm32f10x_conf.h b/src/stm32lib/examples/I2C/M24C08_EEPROM/stm32f10x_conf.h new file mode 100755 index 0000000..080839c --- /dev/null +++ b/src/stm32lib/examples/I2C/M24C08_EEPROM/stm32f10x_conf.h @@ -0,0 +1,170 @@ +/******************** (C) COPYRIGHT 2008 STMicroelectronics ********************
+* File Name : stm32f10x_conf.h
+* Author : MCD Application Team
+* Version : V2.0.1
+* Date : 06/13/2008
+* Description : Library configuration file.
+********************************************************************************
+* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
+* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
+* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
+* CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
+* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+*******************************************************************************/
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32F10x_CONF_H
+#define __STM32F10x_CONF_H
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32f10x_type.h"
+
+/* Exported types ------------------------------------------------------------*/
+/* Exported constants --------------------------------------------------------*/
+/* Uncomment the line below to compile the library in DEBUG mode, this will expanse
+ the "assert_param" macro in the firmware library code (see "Exported macro"
+ section below) */
+/*#define DEBUG 1*/
+
+/* Comment the line below to disable the specific peripheral inclusion */
+/************************************* ADC ************************************/
+//#define _ADC
+//#define _ADC1
+//#define _ADC2
+//#define _ADC3
+
+/************************************* BKP ************************************/
+//#define _BKP
+
+/************************************* CAN ************************************/
+//#define _CAN
+
+/************************************* CRC ************************************/
+//#define _CRC
+
+/************************************* DAC ************************************/
+//#define _DAC
+
+/************************************* DBGMCU *********************************/
+//#define _DBGMCU
+
+/************************************* DMA ************************************/
+//#define _DMA
+//#define _DMA1_Channel1
+//#define _DMA1_Channel2
+//#define _DMA1_Channel3
+//#define _DMA1_Channel4
+//#define _DMA1_Channel5
+//#define _DMA1_Channel6
+//#define _DMA1_Channel7
+//#define _DMA2_Channel1
+//#define _DMA2_Channel2
+//#define _DMA2_Channel3
+//#define _DMA2_Channel4
+//#define _DMA2_Channel5
+
+/************************************* EXTI ***********************************/
+//#define _EXTI
+
+/************************************* FLASH and Option Bytes *****************/
+#define _FLASH
+/* Uncomment the line below to enable FLASH program/erase/protections functions,
+ otherwise only FLASH configuration (latency, prefetch, half cycle) functions
+ are enabled */
+/* #define _FLASH_PROG */
+
+/************************************* FSMC ***********************************/
+//#define _FSMC
+
+/************************************* GPIO ***********************************/
+#define _GPIO
+//#define _GPIOA
+#define _GPIOB
+//#define _GPIOC
+//#define _GPIOD
+//#define _GPIOE
+//#define _GPIOF
+//#define _GPIOG
+#define _AFIO
+
+/************************************* I2C ************************************/
+#define _I2C
+#define _I2C1
+//#define _I2C2
+
+/************************************* IWDG ***********************************/
+//#define _IWDG
+
+/************************************* NVIC ***********************************/
+#define _NVIC
+
+/************************************* PWR ************************************/
+//#define _PWR
+
+/************************************* RCC ************************************/
+#define _RCC
+
+/************************************* RTC ************************************/
+//#define _RTC
+
+/************************************* SDIO ***********************************/
+//#define _SDIO
+
+/************************************* SPI ************************************/
+//#define _SPI
+//#define _SPI1
+//#define _SPI2
+//#define _SPI3
+
+/************************************* SysTick ********************************/
+//#define _SysTick
+
+/************************************* TIM ************************************/
+//#define _TIM
+//#define _TIM1
+//#define _TIM2
+//#define _TIM3
+//#define _TIM4
+//#define _TIM5
+//#define _TIM6
+//#define _TIM7
+//#define _TIM8
+
+/************************************* USART **********************************/
+//#define _USART
+//#define _USART1
+//#define _USART2
+//#define _USART3
+//#define _UART4
+//#define _UART5
+
+/************************************* WWDG ***********************************/
+//#define _WWDG
+
+/* In the following line adjust the value of External High Speed oscillator (HSE)
+ used in your application */
+#define HSE_Value ((u32)8000000) /* Value of the External oscillator in Hz*/
+
+/* Exported macro ------------------------------------------------------------*/
+#ifdef DEBUG
+/*******************************************************************************
+* Macro Name : assert_param
+* Description : The assert_param macro is used for function's parameters check.
+* It is used only if the library is compiled in DEBUG mode.
+* Input : - expr: If expr is false, it calls assert_failed function
+* which reports the name of the source file and the source
+* line number of the call that failed.
+* If expr is true, it returns no value.
+* Return : None
+*******************************************************************************/
+ #define assert_param(expr) ((expr) ? (void)0 : assert_failed((u8 *)__FILE__, __LINE__))
+/* Exported functions ------------------------------------------------------- */
+ void assert_failed(u8* file, u32 line);
+#else
+ #define assert_param(expr) ((void)0)
+#endif /* DEBUG */
+
+#endif /* __STM32F10x_CONF_H */
+
+/******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/
diff --git a/src/stm32lib/examples/I2C/M24C08_EEPROM/stm32f10x_it.c b/src/stm32lib/examples/I2C/M24C08_EEPROM/stm32f10x_it.c new file mode 100755 index 0000000..e27c1e7 --- /dev/null +++ b/src/stm32lib/examples/I2C/M24C08_EEPROM/stm32f10x_it.c @@ -0,0 +1,810 @@ +/******************** (C) COPYRIGHT 2008 STMicroelectronics ********************
+* File Name : stm32f10x_it.c
+* Author : MCD Application Team
+* Version : V2.0.1
+* Date : 06/13/2008
+* Description : Main Interrupt Service Routines.
+* This file provides template for all exceptions handler
+* and peripherals interrupt service routine.
+********************************************************************************
+* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
+* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
+* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
+* CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
+* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+*******************************************************************************/
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32f10x_it.h"
+
+/* Private typedef -----------------------------------------------------------*/
+/* Private define ------------------------------------------------------------*/
+/* Private macro -------------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+/* Private function prototypes -----------------------------------------------*/
+/* Private functions ---------------------------------------------------------*/
+
+/*******************************************************************************
+* Function Name : NMIException
+* Description : This function handles NMI exception.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void NMIException(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : HardFaultException
+* Description : This function handles Hard Fault exception.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void HardFaultException(void)
+{
+ /* Go to infinite loop when Hard Fault exception occurs */
+ while (1)
+ {
+ }
+}
+
+/*******************************************************************************
+* Function Name : MemManageException
+* Description : This function handles Memory Manage exception.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void MemManageException(void)
+{
+ /* Go to infinite loop when Memory Manage exception occurs */
+ while (1)
+ {
+ }
+}
+
+/*******************************************************************************
+* Function Name : BusFaultException
+* Description : This function handles Bus Fault exception.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void BusFaultException(void)
+{
+ /* Go to infinite loop when Bus Fault exception occurs */
+ while (1)
+ {
+ }
+}
+
+/*******************************************************************************
+* Function Name : UsageFaultException
+* Description : This function handles Usage Fault exception.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void UsageFaultException(void)
+{
+ /* Go to infinite loop when Usage Fault exception occurs */
+ while (1)
+ {
+ }
+}
+
+/*******************************************************************************
+* Function Name : DebugMonitor
+* Description : This function handles Debug Monitor exception.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void DebugMonitor(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : SVCHandler
+* Description : This function handles SVCall exception.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void SVCHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : PendSVC
+* Description : This function handles PendSVC exception.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void PendSVC(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : SysTickHandler
+* Description : This function handles SysTick Handler.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void SysTickHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : WWDG_IRQHandler
+* Description : This function handles WWDG interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void WWDG_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : PVD_IRQHandler
+* Description : This function handles PVD interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void PVD_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : TAMPER_IRQHandler
+* Description : This function handles Tamper interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void TAMPER_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : RTC_IRQHandler
+* Description : This function handles RTC global interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void RTC_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : FLASH_IRQHandler
+* Description : This function handles Flash interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void FLASH_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : RCC_IRQHandler
+* Description : This function handles RCC interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void RCC_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : EXTI0_IRQHandler
+* Description : This function handles External interrupt Line 0 request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void EXTI0_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : EXTI1_IRQHandler
+* Description : This function handles External interrupt Line 1 request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void EXTI1_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : EXTI2_IRQHandler
+* Description : This function handles External interrupt Line 2 request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void EXTI2_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : EXTI3_IRQHandler
+* Description : This function handles External interrupt Line 3 request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void EXTI3_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : EXTI4_IRQHandler
+* Description : This function handles External interrupt Line 4 request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void EXTI4_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : DMA1_Channel1_IRQHandler
+* Description : This function handles DMA1 Channel 1 interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void DMA1_Channel1_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : DMA1_Channel2_IRQHandler
+* Description : This function handles DMA1 Channel 2 interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void DMA1_Channel2_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : DMA1_Channel3_IRQHandler
+* Description : This function handles DMA1 Channel 3 interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void DMA1_Channel3_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : DMA1_Channel4_IRQHandler
+* Description : This function handles DMA1 Channel 4 interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void DMA1_Channel4_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : DMA1_Channel5_IRQHandler
+* Description : This function handles DMA1 Channel 5 interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void DMA1_Channel5_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : DMA1_Channel6_IRQHandler
+* Description : This function handles DMA1 Channel 6 interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void DMA1_Channel6_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : DMA1_Channel7_IRQHandler
+* Description : This function handles DMA1 Channel 7 interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void DMA1_Channel7_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : ADC1_2_IRQHandler
+* Description : This function handles ADC1 and ADC2 global interrupts requests.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void ADC1_2_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : USB_HP_CAN_TX_IRQHandler
+* Description : This function handles USB High Priority or CAN TX interrupts
+* requests.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void USB_HP_CAN_TX_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : USB_LP_CAN_RX0_IRQHandler
+* Description : This function handles USB Low Priority or CAN RX0 interrupts
+* requests.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void USB_LP_CAN_RX0_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : CAN_RX1_IRQHandler
+* Description : This function handles CAN RX1 interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void CAN_RX1_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : CAN_SCE_IRQHandler
+* Description : This function handles CAN SCE interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void CAN_SCE_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : EXTI9_5_IRQHandler
+* Description : This function handles External lines 9 to 5 interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void EXTI9_5_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : TIM1_BRK_IRQHandler
+* Description : This function handles TIM1 Break interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void TIM1_BRK_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : TIM1_UP_IRQHandler
+* Description : This function handles TIM1 overflow and update interrupt
+* request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void TIM1_UP_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : TIM1_TRG_COM_IRQHandler
+* Description : This function handles TIM1 Trigger and commutation interrupts
+* requests.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void TIM1_TRG_COM_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : TIM1_CC_IRQHandler
+* Description : This function handles TIM1 capture compare interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void TIM1_CC_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : TIM2_IRQHandler
+* Description : This function handles TIM2 global interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void TIM2_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : TIM3_IRQHandler
+* Description : This function handles TIM3 global interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void TIM3_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : TIM4_IRQHandler
+* Description : This function handles TIM4 global interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void TIM4_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : I2C1_EV_IRQHandler
+* Description : This function handles I2C1 Event interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void I2C1_EV_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : I2C1_ER_IRQHandler
+* Description : This function handles I2C1 Error interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void I2C1_ER_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : I2C2_EV_IRQHandler
+* Description : This function handles I2C2 Event interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void I2C2_EV_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : I2C2_ER_IRQHandler
+* Description : This function handles I2C2 Error interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void I2C2_ER_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : SPI1_IRQHandler
+* Description : This function handles SPI1 global interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void SPI1_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : SPI2_IRQHandler
+* Description : This function handles SPI2 global interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void SPI2_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : USART1_IRQHandler
+* Description : This function handles USART1 global interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void USART1_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : USART2_IRQHandler
+* Description : This function handles USART2 global interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void USART2_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : USART3_IRQHandler
+* Description : This function handles USART3 global interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void USART3_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : EXTI15_10_IRQHandler
+* Description : This function handles External lines 15 to 10 interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void EXTI15_10_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : RTCAlarm_IRQHandler
+* Description : This function handles RTC Alarm interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void RTCAlarm_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : USBWakeUp_IRQHandler
+* Description : This function handles USB WakeUp interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void USBWakeUp_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : TIM8_BRK_IRQHandler
+* Description : This function handles TIM8 Break interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void TIM8_BRK_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : TIM8_UP_IRQHandler
+* Description : This function handles TIM8 overflow and update interrupt
+* request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void TIM8_UP_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : TIM8_TRG_COM_IRQHandler
+* Description : This function handles TIM8 Trigger and commutation interrupts
+* requests.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void TIM8_TRG_COM_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : TIM8_CC_IRQHandler
+* Description : This function handles TIM8 capture compare interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void TIM8_CC_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : ADC3_IRQHandler
+* Description : This function handles ADC3 global interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void ADC3_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : FSMC_IRQHandler
+* Description : This function handles FSMC global interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void FSMC_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : SDIO_IRQHandler
+* Description : This function handles SDIO global interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void SDIO_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : TIM5_IRQHandler
+* Description : This function handles TIM5 global interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void TIM5_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : SPI3_IRQHandler
+* Description : This function handles SPI3 global interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void SPI3_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : UART4_IRQHandler
+* Description : This function handles UART4 global interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void UART4_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : UART5_IRQHandler
+* Description : This function handles UART5 global interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void UART5_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : TIM6_IRQHandler
+* Description : This function handles TIM6 global interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void TIM6_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : TIM7_IRQHandler
+* Description : This function handles TIM7 global interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void TIM7_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : DMA2_Channel1_IRQHandler
+* Description : This function handles DMA2 Channel 1 interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void DMA2_Channel1_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : DMA2_Channel2_IRQHandler
+* Description : This function handles DMA2 Channel 2 interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void DMA2_Channel2_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : DMA2_Channel3_IRQHandler
+* Description : This function handles DMA2 Channel 3 interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void DMA2_Channel3_IRQHandler(void)
+{
+}
+
+/*******************************************************************************
+* Function Name : DMA2_Channel4_5_IRQHandler
+* Description : This function handles DMA2 Channel 4 and DMA2 Channel 5
+* interrupt request.
+* Input : None
+* Output : None
+* Return : None
+*******************************************************************************/
+void DMA2_Channel4_5_IRQHandler(void)
+{
+}
+
+/******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/
diff --git a/src/stm32lib/examples/I2C/M24C08_EEPROM/stm32f10x_it.h b/src/stm32lib/examples/I2C/M24C08_EEPROM/stm32f10x_it.h new file mode 100755 index 0000000..e74b6cc --- /dev/null +++ b/src/stm32lib/examples/I2C/M24C08_EEPROM/stm32f10x_it.h @@ -0,0 +1,100 @@ +/******************** (C) COPYRIGHT 2008 STMicroelectronics ********************
+* File Name : stm32f10x_it.h
+* Author : MCD Application Team
+* Version : V2.0.1
+* Date : 06/13/2008
+* Description : This file contains the headers of the interrupt handlers.
+********************************************************************************
+* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
+* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
+* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
+* CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
+* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+*******************************************************************************/
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32F10x_IT_H
+#define __STM32F10x_IT_H
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32f10x_lib.h"
+
+/* Exported types ------------------------------------------------------------*/
+/* Exported constants --------------------------------------------------------*/
+/* Exported macro ------------------------------------------------------------*/
+/* Exported functions ------------------------------------------------------- */
+
+void NMIException(void);
+void HardFaultException(void);
+void MemManageException(void);
+void BusFaultException(void);
+void UsageFaultException(void);
+void DebugMonitor(void);
+void SVCHandler(void);
+void PendSVC(void);
+void SysTickHandler(void);
+void WWDG_IRQHandler(void);
+void PVD_IRQHandler(void);
+void TAMPER_IRQHandler(void);
+void RTC_IRQHandler(void);
+void FLASH_IRQHandler(void);
+void RCC_IRQHandler(void);
+void EXTI0_IRQHandler(void);
+void EXTI1_IRQHandler(void);
+void EXTI2_IRQHandler(void);
+void EXTI3_IRQHandler(void);
+void EXTI4_IRQHandler(void);
+void DMA1_Channel1_IRQHandler(void);
+void DMA1_Channel2_IRQHandler(void);
+void DMA1_Channel3_IRQHandler(void);
+void DMA1_Channel4_IRQHandler(void);
+void DMA1_Channel5_IRQHandler(void);
+void DMA1_Channel6_IRQHandler(void);
+void DMA1_Channel7_IRQHandler(void);
+void ADC1_2_IRQHandler(void);
+void USB_HP_CAN_TX_IRQHandler(void);
+void USB_LP_CAN_RX0_IRQHandler(void);
+void CAN_RX1_IRQHandler(void);
+void CAN_SCE_IRQHandler(void);
+void EXTI9_5_IRQHandler(void);
+void TIM1_BRK_IRQHandler(void);
+void TIM1_UP_IRQHandler(void);
+void TIM1_TRG_COM_IRQHandler(void);
+void TIM1_CC_IRQHandler(void);
+void TIM2_IRQHandler(void);
+void TIM3_IRQHandler(void);
+void TIM4_IRQHandler(void);
+void I2C1_EV_IRQHandler(void);
+void I2C1_ER_IRQHandler(void);
+void I2C2_EV_IRQHandler(void);
+void I2C2_ER_IRQHandler(void);
+void SPI1_IRQHandler(void);
+void SPI2_IRQHandler(void);
+void USART1_IRQHandler(void);
+void USART2_IRQHandler(void);
+void USART3_IRQHandler(void);
+void EXTI15_10_IRQHandler(void);
+void RTCAlarm_IRQHandler(void);
+void USBWakeUp_IRQHandler(void);
+void TIM8_BRK_IRQHandler(void);
+void TIM8_UP_IRQHandler(void);
+void TIM8_TRG_COM_IRQHandler(void);
+void TIM8_CC_IRQHandler(void);
+void ADC3_IRQHandler(void);
+void FSMC_IRQHandler(void);
+void SDIO_IRQHandler(void);
+void TIM5_IRQHandler(void);
+void SPI3_IRQHandler(void);
+void UART4_IRQHandler(void);
+void UART5_IRQHandler(void);
+void TIM6_IRQHandler(void);
+void TIM7_IRQHandler(void);
+void DMA2_Channel1_IRQHandler(void);
+void DMA2_Channel2_IRQHandler(void);
+void DMA2_Channel3_IRQHandler(void);
+void DMA2_Channel4_5_IRQHandler(void);
+
+#endif /* __STM32F10x_IT_H */
+
+/******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/
|