From: kyz Date: Thu, 23 May 2024 03:32:06 +0000 (+0800) Subject: 修改以太网RMII接口GPIO引脚配置到高速模式 X-Git-Url: http://kyz.pub/gitweb/?a=commitdiff_plain;h=89d5a55071ed5888e8bd54d504f35b9de9f378e9;p=yn%2Fweldingcontroller.git 修改以太网RMII接口GPIO引脚配置到高速模式 --- diff --git a/LWIP/Target/ethernetif.c b/LWIP/Target/ethernetif.c index 3afdc95..dbb4d99 100644 --- a/LWIP/Target/ethernetif.c +++ b/LWIP/Target/ethernetif.c @@ -625,21 +625,21 @@ void HAL_ETH_MspInit(ETH_HandleTypeDef* ethHandle) GPIO_InitStruct.Pin = GPIO_PIN_1|GPIO_PIN_4|GPIO_PIN_5; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; GPIO_InitStruct.Alternate = GPIO_AF11_ETH; HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); GPIO_InitStruct.Pin = GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_7; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; GPIO_InitStruct.Alternate = GPIO_AF11_ETH; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); GPIO_InitStruct.Pin = GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_13; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; GPIO_InitStruct.Alternate = GPIO_AF11_ETH; HAL_GPIO_Init(GPIOG, &GPIO_InitStruct); diff --git a/user/ht1622.c b/user/ht1622.c index 81c73cb..a085efa 100644 --- a/user/ht1622.c +++ b/user/ht1622.c @@ -273,6 +273,21 @@ void lcd_init( void ) //LCD Power ON lcd_power_on(); +#if 1 + //Test LCD, for debug + volatile uint32_t test_ram_wr = 0x12345678; + volatile uint32_t test_ram_rd = 0; + + ht1622_ram_write( 0, &test_ram_wr, sizeof( test_ram_wr) ); + ht1622_ram_read( 0, &test_ram_rd, sizeof( test_ram_rd ) ); + + if( test_ram_wr == test_ram_rd ){ + printf( "ht122 lcd test ok, %02X\n", test_ram_wr); + }else{ + printf( "ht122 lcd test fail, %02X -- %02X\n", test_ram_wr, test_ram_rd ); + } +#endif + ht1622_command( CMD_SYS_EN ); memset( &g_disp_ram, 0xFF, sizeof( g_disp_ram ) ); //ALL ON ht1622_ram_write( 0, (uint8_t*)&g_disp_ram, 32 ); diff --git a/user/user_eth.c b/user/user_eth.c index c0edecd..6bdd880 100644 --- a/user/user_eth.c +++ b/user/user_eth.c @@ -269,6 +269,23 @@ void user_eth_task( void* unused ) uint32_t tcp_err_cnt = 0; + #if 0 + //test eth output + while(1){ + if( netif_is_link_up(g_iot_client.p_netif) ){ + struct pbuf *p; + /* Allocate a new pbuf */ + p = pbuf_alloc(PBUF_LINK, 64, PBUF_RAM); + if( p ){ + for( int i=0; i<64; i++ ) + ((uint8_t*)p->payload)[i] = i; + g_iot_client.p_netif->linkoutput( g_iot_client.p_netif, p ); + } + } + osDelay( 5000 ); + } + #endif + while(1){ //1. wait linkup