int osd_event_init(void) { #ifdef CONFIG_DRIVER_PD pd_Init(); #endif key_Init(); return 0; }
void gui_event_init(void) { gui_epool = mempool_create(sizeof(gevent), CONFIG_GUI_EPSZ); INIT_LIST_HEAD(&gui_equeue_public); #ifdef CONFIG_DRIVER_PD pd_Init(); #endif key_Init(); }
void sys_Start() { uint_t i; p_gpio_def p; #if I2C_ENABLE p_dev_i2c pI2c; #endif #if SPI_ENABLE p_dev_spi pSpi; #endif #if UART_ENABLE p_dev_uart pUart; #endif arch_Init(); #if IRQ_ENABLE irq_VectorInit(); #endif #if GPIO_ENABLE for (p = tbl_bspGpio[0]; p < tbl_bspGpio[1]; p++) { sys_GpioConf(p); } #endif #if HC138_ENABLE for (p = tbl_bspHC138[0]; p < tbl_bspHC138[1]; p++) { sys_GpioConf(p); } #endif #if HC165_ENABLE for (p = tbl_bspHC165[0]; p < tbl_bspHC165[1]; p++) { sys_GpioConf(p); } #endif #if HC595_ENABLE for (p = tbl_bspHC595[0]; p < tbl_bspHC595[1]; p++) { sys_GpioConf(p); } #endif #if BATTERY_ENABLE for (p = tbl_bspBattery[0]; p < tbl_bspBattery[1]; p++) { sys_GpioConf(p); } #if BAT_VOL_ENABLE arch_AdcInit(); #endif #endif #if WDG_ENABLE wdg_Init(); #endif #if BKP_ENABLE bkp_Init(); #endif #if KEY_ENABLE key_Init(); #endif #if IO_BUF_TYPE == BUF_T_DQUEUE dque_Init(dqueue); #endif #if EPI_SOFTWARE for (p = tbl_bspEpiData[0]; p < tbl_bspEpiData[1]; p++) { sys_GpioConf(p); } #endif #if I2C_ENABLE bzero(dev_I2c, sizeof(dev_I2c)); for (pI2c = dev_I2c, i = 0; pI2c < ARR_ENDADR(dev_I2c); pI2c++, i++) { pI2c->parent->id = i; pI2c->parent->type = DEV_T_I2C; #if I2C_SOFTWARE i2cbus_Init(pI2c); #else pI2c->def = &tbl_bspI2cDef[i]; arch_I2cInit(pI2c); #endif } #endif #if SPI_ENABLE bzero(dev_Spi, sizeof(dev_Spi)); for (pSpi = dev_Spi, i = 0; pSpi < ARR_ENDADR(dev_Spi); pSpi++, i++) { pSpi->parent->id = i; pSpi->parent->type = DEV_T_SPI; pSpi->csid = SPI_CSID_INVALID; #if SPI_SOFTWARE spibus_Init(pSpi); #else pSpi->def = &tbl_bspSpiDef[i]; arch_SpiInit(pSpi); #endif } #endif #if UART_ENABLE bzero(dev_Uart, sizeof(dev_Uart)); for (pUart = dev_Uart, i = 0; pUart < ARR_ENDADR(dev_Uart); pUart++, i++) { pUart->parent->id = i; pUart->parent->type = DEV_T_UART; pUart->def = &tbl_bspUartDef[i]; uart_Init(pUart); } #endif #if OS_TYPE os_Start(); #else sys_Init(); #endif }