forked from xuos/xiuos
test framework
This commit is contained in:
parent
d3836f1a6f
commit
b8cf052d49
|
@ -26,14 +26,42 @@ menu "test app"
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
menuconfig USER_TEST_SD
|
menuconfig USER_TEST_FS
|
||||||
bool "Config test sd"
|
bool "Config test fs with sd or usb"
|
||||||
default n
|
default n
|
||||||
if USER_TEST_SD
|
if USER_TEST_FS
|
||||||
if ADD_XIZI_FETURES
|
if ADD_XIZI_FETURES
|
||||||
config SD_FPATH
|
config SD_FPATH
|
||||||
string "Set sd file path"
|
string "Set test file path"
|
||||||
default "/sdcard_testfile"
|
default "/test_file"
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
menuconfig USER_TEST_GPIO
|
||||||
|
select BSP_USING_GPIO
|
||||||
|
select RESOURCES_PIN
|
||||||
|
select BSP_USING_LED
|
||||||
|
select BSP_USING_KEY
|
||||||
|
bool "Config test gpio with led and key"
|
||||||
|
default n
|
||||||
|
if USER_TEST_GPIO
|
||||||
|
if ADD_XIZI_FETURES
|
||||||
|
config GPIO_DEV_DRIVER
|
||||||
|
string "Set gpio dev path"
|
||||||
|
default "/dev/pin_dev"
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
menuconfig USER_TEST_I2C
|
||||||
|
select BSP_USING_I2C
|
||||||
|
bool "Config test i2c"
|
||||||
|
default n
|
||||||
|
if USER_TEST_I2C
|
||||||
|
if ADD_XIZI_FETURES
|
||||||
|
config I2C_DEV_DRIVER
|
||||||
|
string "Set i2c dev path"
|
||||||
|
default "/dev/i2c_dev"
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,8 @@ ifeq ($(CONFIG_ADD_XIZI_FETURES),y)
|
||||||
SRC_FILES += test_dac.c
|
SRC_FILES += test_dac.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_USER_TEST_SD),y)
|
ifeq ($(CONFIG_USER_TEST_FS),y)
|
||||||
SRC_FILES += test_softspi_sd.c
|
SRC_FILES += test_fs.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_USER_TEST_SEMC),y)
|
ifeq ($(CONFIG_USER_TEST_SEMC),y)
|
||||||
|
@ -37,5 +37,13 @@ ifeq ($(CONFIG_ADD_XIZI_FETURES),y)
|
||||||
SRC_FILES +=
|
SRC_FILES +=
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_USER_TEST_I2C),y)
|
||||||
|
SRC_FILES += test_i2c.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_USER_TEST_GPIO),y)
|
||||||
|
SRC_FILES += test_gpio.c
|
||||||
|
endif
|
||||||
|
|
||||||
include $(KERNEL_ROOT)/compiler.mk
|
include $(KERNEL_ROOT)/compiler.mk
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -15,7 +15,7 @@ void TestSD(void)
|
||||||
//read and write then close file
|
//read and write then close file
|
||||||
read(fd,filewords,MAX_READ_LENGTH);
|
read(fd,filewords,MAX_READ_LENGTH);
|
||||||
printf("read data is \n%s\n",filewords);
|
printf("read data is \n%s\n",filewords);
|
||||||
const char *input_words = "these words are going to write in sdcard\n";
|
const char *input_words = "these words are going to write in fs\n";
|
||||||
write(fd,input_words,strlen(input_words));
|
write(fd,input_words,strlen(input_words));
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <transform.h>
|
||||||
|
|
||||||
|
|
||||||
|
void TestGpio(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <transform.h>
|
||||||
|
|
||||||
|
|
||||||
|
void TestI2C(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
|
@ -97,12 +97,22 @@ static struct io_config
|
||||||
IOCONFIG(BSP_CH438_D6_PIN, HS_GPIO(FPIOA_CH438_D6)),
|
IOCONFIG(BSP_CH438_D6_PIN, HS_GPIO(FPIOA_CH438_D6)),
|
||||||
IOCONFIG(BSP_CH438_D7_PIN, HS_GPIO(FPIOA_CH438_D7)),
|
IOCONFIG(BSP_CH438_D7_PIN, HS_GPIO(FPIOA_CH438_D7)),
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BSP_USING_SOFT_SPI
|
#ifdef BSP_USING_SOFT_SPI
|
||||||
IOCONFIG(BSP_SOFT_SPI_SCK_PIN, HS_GPIO(FPIOA_SOFT_SPI_SCK)),
|
IOCONFIG(BSP_SOFT_SPI_SCK_PIN, HS_GPIO(FPIOA_SOFT_SPI_SCK)),
|
||||||
IOCONFIG(BSP_SOFT_SPI_MIOS_PIN, HS_GPIO(FPIOA_SOFT_SPI_MIOS)),
|
IOCONFIG(BSP_SOFT_SPI_MIOS_PIN, HS_GPIO(FPIOA_SOFT_SPI_MIOS)),
|
||||||
IOCONFIG(BSP_SOFT_SPI_MSOI_PIN, HS_GPIO(FPIOA_SOFT_SPI_MSOI)),
|
IOCONFIG(BSP_SOFT_SPI_MSOI_PIN, HS_GPIO(FPIOA_SOFT_SPI_MSOI)),
|
||||||
IOCONFIG(BSP_SOFT_SPI_NCS_PIN, HS_GPIO(FPIOA_SOFT_SPI_NCS)),
|
IOCONFIG(BSP_SOFT_SPI_NCS_PIN, HS_GPIO(FPIOA_SOFT_SPI_NCS)),
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef BSP_USING_LED
|
||||||
|
IOCONFIG(BSP_LED_PIN,FUNC_GPIO5);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef BSP_USING_KEY
|
||||||
|
IOCONFIG(BSP_KEY_PIN,FUNC_GPIO6);
|
||||||
|
#endif
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static int PrintIoConfig()
|
static int PrintIoConfig()
|
||||||
|
|
|
@ -39,9 +39,5 @@ if BSP_USING_SOFT_SPI
|
||||||
int "clk in microsecond"
|
int "clk in microsecond"
|
||||||
default 0
|
default 0
|
||||||
|
|
||||||
config SOFT_SPI_READ_DELAY
|
|
||||||
int "read after millisecond"
|
|
||||||
default 1
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue