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);
//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 );
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