diff --git a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/W7500x.h b/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x.h similarity index 99% rename from libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/W7500x.h rename to libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x.h index 4adb010f60..b4a6946c76 100644 --- a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/W7500x.h +++ b/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x.h @@ -125,7 +125,6 @@ typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus; - /** * @} */ @@ -1147,6 +1146,23 @@ typedef struct +typedef enum +{ + PAD_PA = 0, + PAD_PB, + PAD_PC, + PAD_PD +}PAD_Type; + +typedef enum +{ + PAD_AF0 = Px_AFSR_AF0, + PAD_AF1 = Px_AFSR_AF1, + PAD_AF2 = Px_AFSR_AF2, + PAD_AF3 = Px_AFSR_AF3 +}PAD_AF_TypeDef; + + #if !defined (USE_HAL_DRIVER) #define USE_HAL_DRIVER #endif /* USE_HAL_DRIVER */ @@ -1154,9 +1170,16 @@ typedef struct #if defined (USE_HAL_DRIVER) - #include "W7500x_conf.h" +// #include "system_W7500x.h" +// #include "W7500x_conf.h" #endif +#ifdef USE_FULL_ASSERT + #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__,__LINE__)) +#else + #define assert_param(expr) ((void)0) +#endif /* USE_FULL_ASSERT */ + #ifdef __cplusplus } #endif diff --git a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/cmsis.h b/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/cmsis.h similarity index 100% rename from libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/cmsis.h rename to libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/cmsis.h diff --git a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/cmsis_nvic.c b/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/cmsis_nvic.c similarity index 100% rename from libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/cmsis_nvic.c rename to libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/cmsis_nvic.c diff --git a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/cmsis_nvic.h b/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/cmsis_nvic.h similarity index 100% rename from libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/cmsis_nvic.h rename to libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/cmsis_nvic.h diff --git a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/system_W7500x.c b/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/system_W7500x.c similarity index 100% rename from libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/system_W7500x.c rename to libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/system_W7500x.c diff --git a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/system_W7500x.h b/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/system_W7500x.h similarity index 100% rename from libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/system_W7500x.h rename to libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/system_W7500x.h diff --git a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/PeripheralNames.h b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/PeripheralNames.h similarity index 96% rename from libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/PeripheralNames.h rename to libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/PeripheralNames.h index ca7b5392d3..973ff199b8 100644 --- a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/PeripheralNames.h +++ b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/PeripheralNames.h @@ -46,9 +46,6 @@ typedef enum { UART_1 = (int)W7500x_UART1_BASE } UARTName; -#define STDIO_UART_TX PC_2 -#define STDIO_UART_RX PC_3 -#define STDIO_UART UART_1 typedef enum { SPI_0 = (int)SSP0_BASE, diff --git a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/PortNames.h b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/PortNames.h similarity index 100% rename from libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/PortNames.h rename to libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/PortNames.h diff --git a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/PeripheralPins.c b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/PeripheralPins.c index 6c5c5ae6d4..8df216352e 100644 --- a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/PeripheralPins.c +++ b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/PeripheralPins.c @@ -73,7 +73,7 @@ const PinMap PinMap_I2C_SCL[] = { {PA_9, I2C_0, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF0)}, {PC_8, I2C_0, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF2)}, {PC_4, I2C_1, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF0)}, - {PC_5, I2C_1, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF2)}, + {PA_5, I2C_1, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF2)}, {NC, NC, 0} }; @@ -82,32 +82,32 @@ const PinMap PinMap_I2C_SCL[] = { const PinMap PinMap_SPI_SCLK[] = { {PA_6 , SPI_0, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF0)}, {PB_1 , SPI_1, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF0)}, - {PC_12, SPI_0, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF3)}, - {PA_12, SPI_1, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF3)}, + {PC_13, SPI_0, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF2)}, + {PA_12, SPI_1, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF2)}, {NC , NC , 0} }; const PinMap PinMap_SPI_MOSI[] = { {PA_8 , SPI_0, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF0)}, {PB_3 , SPI_1, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF0)}, - {PC_10, SPI_0, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF3)}, - {PA_14, SPI_1, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF3)}, + {PC_15, SPI_0, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF2)}, + {PA_14, SPI_1, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF2)}, {NC , NC , 0} }; const PinMap PinMap_SPI_MISO[] = { {PA_7 , SPI_0, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF0)}, {PB_2 , SPI_1, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF0)}, - {PC_11, SPI_0, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF3)}, - {PA_13, SPI_1, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF3)}, + {PC_14, SPI_0, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF2)}, + {PA_13, SPI_1, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF2)}, {NC , NC , 0} }; const PinMap PinMap_SPI_SSEL[] = { {PA_5 , SPI_0, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF0)}, {PB_0 , SPI_1, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF0)}, - {PC_13, SPI_0, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF3)}, - {PA_11, SPI_1, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF3)}, + {PC_12, SPI_0, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF2)}, + {PA_11, SPI_1, WIZ_PIN_DATA(WIZ_MODE_AF, WIZ_GPIO_NOPULL, Px_AFSR_AF2)}, {NC , NC , 0} }; diff --git a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/device.h b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/device.h index 1e5a50d2c1..fe976be652 100644 --- a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/device.h +++ b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/device.h @@ -67,6 +67,11 @@ #define DEVICE_STDIO_MESSAGES 1 +#define STDIO_UART_TX PC_2 +#define STDIO_UART_RX PC_3 +#define STDIO_UART UART_1 + + #define DEVICE_ERROR_RED 0 #include "objects.h" diff --git a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_adc.c b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_adc.c similarity index 97% rename from libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_adc.c rename to libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_adc.c index cd473752b5..c713cc5698 100644 --- a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_adc.c +++ b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_adc.c @@ -1,4 +1,5 @@ #include "W7500x.h" +#include "W7500x_adc.h" void ADC_PowerDownEnable (FunctionalState NewState) { diff --git a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_adc.h b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_adc.h similarity index 100% rename from libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_adc.h rename to libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_adc.h diff --git a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_conf.h b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_conf.h similarity index 100% rename from libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_conf.h rename to libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_conf.h diff --git a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_crg.c b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_crg.c similarity index 100% rename from libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_crg.c rename to libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_crg.c diff --git a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_crg.h b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_crg.h similarity index 100% rename from libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_crg.h rename to libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_crg.h diff --git a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_dualtimer.c b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_dualtimer.c similarity index 99% rename from libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_dualtimer.c rename to libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_dualtimer.c index 64eec8836b..4b28fa56f5 100644 --- a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_dualtimer.c +++ b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_dualtimer.c @@ -13,6 +13,7 @@ /* Includes -------------------------------------------*/ #include "W7500x.h" +#include "W7500x_dualtimer.h" void DUALTIMER_ClockEnable(DUALTIMER_TypeDef* DUALTIMERn) { diff --git a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_dualtimer.h b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_dualtimer.h similarity index 100% rename from libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_dualtimer.h rename to libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_dualtimer.h diff --git a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_exti.c b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_exti.c similarity index 98% rename from libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_exti.c rename to libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_exti.c index ab6b1e4948..c3008f5803 100644 --- a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_exti.c +++ b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_exti.c @@ -1,5 +1,6 @@ #include "W7500x.h" - +#include "W7500x_exti.h" +#include "W7500x_gpio.h" /** diff --git a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_exti.h b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_exti.h similarity index 100% rename from libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_exti.h rename to libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_exti.h diff --git a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_gpio.c b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_gpio.c similarity index 99% rename from libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_gpio.c rename to libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_gpio.c index 7ee38aa721..1257eb4fa8 100644 --- a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_gpio.c +++ b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_gpio.c @@ -1,6 +1,5 @@ #include "W7500x.h" - - +#include "W7500x_gpio.h" void HAL_GPIO_DeInit(GPIO_TypeDef* GPIOx) { diff --git a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_gpio.h b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_gpio.h similarity index 95% rename from libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_gpio.h rename to libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_gpio.h index b8dad4332b..8f2834bddf 100644 --- a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_gpio.h +++ b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_gpio.h @@ -83,21 +83,6 @@ typedef enum Bit_SET }BitAction; -typedef enum -{ - PAD_PA = 0, - PAD_PB, - PAD_PC, - PAD_PD -}PAD_Type; - -typedef enum -{ - PAD_AF0 = Px_AFSR_AF0, - PAD_AF1 = Px_AFSR_AF1, - PAD_AF2 = Px_AFSR_AF2, - PAD_AF3 = Px_AFSR_AF3 -}PAD_AF_TypeDef; #define IS_PAD_TYPE(Px) (((Px) == PAD_PA) || ((Px) == PAD_PB) \ ((Px) == PAD_PC) || ((Px) == PAD_PD)) diff --git a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_i2c.c b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_i2c.c similarity index 94% rename from libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_i2c.c rename to libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_i2c.c index 01ea720476..5efe1ac9fc 100644 --- a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_i2c.c +++ b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_i2c.c @@ -28,8 +28,9 @@ ******************************************************************************* */ /*include -------------------------------------*/ -#include #include "W7500x.h" +#include "W7500x_i2c.h" +#include "W7500x_gpio.h" GPIO_InitTypeDef GPIO_InitDef; @@ -61,8 +62,8 @@ uint32_t I2C_Init(I2C_ConfigStruct* conf) HAL_GPIO_ResetBits((GPIO_TypeDef*)(GPIOA_BASE + (sda_port_num << 24)), sda_pin_index); //Pin muxing - HAL_PAD_AFConfig(scl_port_num, scl_pin_index, PAD_AF1); - HAL_PAD_AFConfig(sda_port_num, sda_pin_index, PAD_AF1); + HAL_PAD_AFConfig((PAD_Type)scl_port_num, (uint16_t)scl_pin_index, PAD_AF1); + HAL_PAD_AFConfig((PAD_Type)sda_port_num, (uint16_t)sda_pin_index, PAD_AF1); return 0; } @@ -98,9 +99,6 @@ uint8_t I2C_ReadBitSDA(I2C_ConfigStruct* conf) if(HAL_GPIO_ReadInputDataBit((GPIO_TypeDef*)(GPIOA_BASE + (sda_port_num << 24)), sda_pin_index)) return 1; - else - return 0; - return 0; } @@ -193,7 +191,7 @@ int I2C_Write(I2C_ConfigStruct* conf, uint8_t addr, uint8_t* data, uint32_t len) //Write addr if(I2C_WriteByte(conf, addr) != 0) { - printf("Received NACK at address phase!!\r\n"); + //printf("Received NACK at address phase!!\r\n"); return -1; } @@ -218,7 +216,7 @@ int I2C_WriteRepeated(I2C_ConfigStruct* conf, uint8_t addr, uint8_t* data, uint3 //Write addr if(I2C_WriteByte(conf, addr) != 0) { - printf("Received NACK at address phase!!\r\n"); + //printf("Received NACK at address phase!!\r\n"); return -1; } @@ -241,7 +239,7 @@ int I2C_Read(I2C_ConfigStruct* conf, uint8_t addr, uint8_t* data, uint32_t len) //Write addr | read command if(I2C_WriteByte(conf, (addr | 1)) != 0) { - printf("Received NACK at address phase!!\r\n"); + //printf("Received NACK at address phase!!\r\n"); return -1; } @@ -270,7 +268,7 @@ int I2C_ReadRepeated(I2C_ConfigStruct* conf, uint8_t addr, uint8_t* data, uint32 //Write addr | read command if(I2C_WriteByte(conf, (addr | 1)) != 0) { - printf("Received NACK at address phase!!\r\n"); + //printf("Received NACK at address phase!!\r\n"); return -1; } diff --git a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_i2c.h b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_i2c.h similarity index 100% rename from libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_i2c.h rename to libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_i2c.h index 60685f8b20..f99545796a 100644 --- a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_i2c.h +++ b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_i2c.h @@ -28,11 +28,11 @@ ******************************************************************************* */ /*include -------------------------------------*/ -#include "W7500x.h" - #ifndef __W7500X_I2C_H #define __W7500X_I2C_H +#include "W7500x.h" + typedef enum { I2C_PA_5 = 0x05, diff --git a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_pwm.c b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_pwm.c similarity index 99% rename from libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_pwm.c rename to libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_pwm.c index d364279a3a..aff33d3915 100644 --- a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_pwm.c +++ b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_pwm.c @@ -13,6 +13,7 @@ /* Includes -------------------------------------------*/ #include "W7500x.h" +#include "W7500x_pwm.h" void PWM_DeInit(PWM_CHn_TypeDef* PWM_CHn) { diff --git a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_pwm.h b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_pwm.h similarity index 100% rename from libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_pwm.h rename to libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_pwm.h diff --git a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_uart.c b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_uart.c similarity index 99% rename from libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_uart.c rename to libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_uart.c index 67eba2e88d..fb90e393f9 100644 --- a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_uart.c +++ b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_uart.c @@ -14,6 +14,7 @@ /* Includes ------------------------------------------------------------------*/ #include "W7500x.h" +#include "W7500x_uart.h" void UART_StructInit(UART_InitTypeDef* UART_InitStruct) { diff --git a/libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_uart.h b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_uart.h similarity index 100% rename from libraries/mbed/targets/cmsis/TARGET_WIZNET/TARGET_W7500x/W7500x_uart.h rename to libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_uart.h diff --git a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/analogin_api.c b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/analogin_api.c index 0725ce673a..6b3b45961a 100644 --- a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/analogin_api.c +++ b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/analogin_api.c @@ -36,6 +36,7 @@ #include "wait_api.h" #include "cmsis.h" #include "pinmap.h" +#include "W7500x_adc.h" #include "PeripheralPins.h" diff --git a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/gpio_irq_api.c b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/gpio_irq_api.c index fd84f5951a..10ef6ae19b 100644 --- a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/gpio_irq_api.c +++ b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/gpio_irq_api.c @@ -46,7 +46,7 @@ static uint32_t channel_ids[4][16]; #ifdef __cplusplus extern "C"{ #endif - +void port_generic_handler(GPIO_TypeDef* GPIOx, uint32_t port_num); void PORT0_Handler(void) { diff --git a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/gpio_object.h b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/gpio_object.h index ff64208b31..005fa7ec17 100644 --- a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/gpio_object.h +++ b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/gpio_object.h @@ -32,6 +32,7 @@ #define MBED_GPIO_OBJECT_H #include "mbed_assert.h" +#include "W7500x_gpio.h" #ifdef __cplusplus extern "C" { diff --git a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/i2c_api.c b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/i2c_api.c index d8bf78ceea..e06a1a2acc 100644 --- a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/i2c_api.c +++ b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/i2c_api.c @@ -40,6 +40,7 @@ #include "wait_api.h" #include "us_ticker_api.h" +#include "W7500x_i2c.h" /* Timeout values for flags and events waiting loops. These timeouts are not based on accurate values, they just guarantee that the application will @@ -106,12 +107,12 @@ int i2c_read(i2c_t *obj, int address, char *data, int length, int stop) if(stop) { - if(I2C_Read(&conf, address, data, length) != 0) + if(I2C_Read(&conf, address, (uint8_t*)data, length) != 0) return -1; } else { - if(I2C_ReadRepeated(&conf, address, data, length) != 0) + if(I2C_ReadRepeated(&conf, address, (uint8_t*)data, length) != 0) return -1; } @@ -129,12 +130,12 @@ int i2c_write(i2c_t *obj, int address, const char *data, int length, int stop) if(stop) { - if(I2C_Write(&conf, address, data, length) != 0) + if(I2C_Write(&conf, address, (uint8_t*)data, length) != 0) return -1; } else { - if(I2C_WriteRepeated(&conf, address, data, length) != 0) + if(I2C_WriteRepeated(&conf, address, (uint8_t*)data, length) != 0) return -1; } diff --git a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/objects.h b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/objects.h similarity index 100% rename from libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/objects.h rename to libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/objects.h diff --git a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/pinmap.c b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/pinmap.c index 6f4579cdf0..c69be952a2 100644 --- a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/pinmap.c +++ b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/pinmap.c @@ -32,6 +32,8 @@ #include "pinmap.h" #include "PortNames.h" #include "mbed_error.h" +#include "W7500x.h" +#include "W7500x_gpio.h" uint32_t Get_GPIO_BaseAddress(uint32_t port_idx) diff --git a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/pwmout_api.c b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/pwmout_api.c index db6d9a5ef7..b659084f81 100644 --- a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/pwmout_api.c +++ b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/pwmout_api.c @@ -35,6 +35,7 @@ #include "pinmap.h" #include "mbed_error.h" #include "PeripheralPins.h" +#include "W7500x_pwm.h" static PWM_TimerModeInitTypeDef TimerModeStructure; diff --git a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/rtc_api.c b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/rtc_api.c index 1b58166e08..e789f4afb1 100644 --- a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/rtc_api.c +++ b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/rtc_api.c @@ -14,6 +14,8 @@ * limitations under the License. */ #include "rtc_api.h" +#include "cmsis.h" +#include "W7500x_pwm.h" time_t wiz_rtc_time; char rtc_enabled = 0; diff --git a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/serial_api.c b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/serial_api.c index 8867d39f80..ab29cd73f9 100644 --- a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/serial_api.c +++ b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/serial_api.c @@ -37,6 +37,7 @@ #include "pinmap.h" #include #include "PeripheralPins.h" +#include "W7500x_uart.h" #define UART_NUM (2) diff --git a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/us_ticker.c b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/us_ticker.c index e230963441..cd4e3071c6 100644 --- a/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/us_ticker.c +++ b/libraries/mbed/targets/hal/TARGET_WIZNET/TARGET_W7500x/us_ticker.c @@ -32,6 +32,8 @@ #include "us_ticker_api.h" #include "PeripheralNames.h" #include "system_W7500x.h" +#include "W7500x_dualtimer.h" +#include "W7500x_pwm.h" #define TIMER_0 DUALTIMER0_0 #define TIMER_1 PWM_CH1