Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed by
Diff: TARGET_WIZwiki_W7500/W7500x_i2c.h
- Revision:
- 102:da0ca467f8b5
- Parent:
- 101:7cff1c4259d7
- Child:
- 104:b9ad9a133dc7
--- a/TARGET_WIZwiki_W7500/W7500x_i2c.h Tue Jun 09 14:29:26 2015 +0100
+++ b/TARGET_WIZwiki_W7500/W7500x_i2c.h Wed Jul 08 11:22:30 2015 +0100
@@ -1,18 +1,41 @@
+/* mbed Microcontroller Library
+ *******************************************************************************
+ * Copyright (c) 2015 WIZnet Co.,Ltd. All rights reserved.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 3. Neither the name of ARM Limited nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *******************************************************************************
+ */
+
#include "W7500x.h"
-/**
-* @defgroup I2C_Public_Types I2X Public Types
-*/
typedef enum
{
I2C_WRITE_SA7=0,
I2C_READ_SA7,
- //I2C_WRITE_SA10,
- //I2C_READ_SA10,
I2C_CTRWRITE_SA7,
I2C_CTRREAD_SA7,
- //I2C_CTRWRITE_SA10,
- //I2C_CTRREAD_SA10,
} I2C_CTR;
typedef enum
@@ -64,32 +87,6 @@
((REGISTER) == I2C_Register_ISR)|| \
((REGISTER) == I2C_Register_ISCR)| \
((REGISTER) == I2C_Register_ISMR))
-/**
- * @}
- */
-/** @addtogroup Peripheral_registers_structures
- * @{
- */
-
-
-
-
-
-
-/**
- * @}
- */
-
-/**
- * @brief I2C Interrput Status Register Mask flags
- */
-//------------------------------------------------
-// I2C_ISMR_BIT
-//------------------------------------------------
-
-/**
- * @}
- */
/** @defgroup I2C_Private_Defines
* @{
@@ -196,8 +193,6 @@
int I2C_Burst_Read (I2C_TypeDef* I2Cx, uint16_t address, uint8_t *data, int length, int stop);
int I2C_Burst_Write (I2C_TypeDef* I2Cx, uint16_t address, uint8_t *data, int length, int stop);
-void I2C_Delay (uint32_t nCount);
-
void I2C_GenerateSTART (I2C_TypeDef* I2Cx, FunctionalState NewState);
void I2C_GenerateSTOP (I2C_TypeDef* I2Cx, FunctionalState NewState);
@@ -225,6 +220,16 @@
int8_t I2C_Restart_Structure(I2C_TypeDef * I2Cx,uint32_t SlaveAddress,I2C_CTR Ctr);
uint16_t I2C_ReadRegister (I2C_TypeDef* I2Cx, uint8_t I2C_Register);
+void I2C_GPIO(void);
+void GPIO_I2C(void );
+
+void WriteByte(uint8_t val);
+
+void digitalWrite(GPIO_TypeDef* GPIOx,uint16_t pin, uint16_t val);
+uint16_t digitalRead(GPIO_TypeDef* GPIOx,uint16_t pin);
+void i2c_loop_us(int us);
+void i2c_loop_ms(int count) ;
+
/**
* @}
*/
