├── .gitignore ├── Driver ├── Include │ ├── 2d.h │ ├── adc.h │ ├── can.h │ ├── cap.h │ ├── crypto.h │ ├── etimer.h │ ├── fmi.h │ ├── gpio.h │ ├── i2c.h │ ├── i2s.h │ ├── jpeg.h │ ├── jpegcodec.h │ ├── lcd.h │ ├── mtp.h │ ├── nuc970.h │ ├── pwm.h │ ├── rtc.h │ ├── sc.h │ ├── scuart.h │ ├── sdh.h │ ├── spi.h │ ├── sys.h │ ├── uart.h │ ├── usbd.h │ └── wwdt.h └── Source │ ├── 2d.c │ ├── GCC.ld │ ├── Startup_GCC.S │ ├── adc.c │ ├── can.c │ ├── cap.c │ ├── crypto.c │ ├── etimer.c │ ├── fmi.c │ ├── gpio.c │ ├── i2c.c │ ├── i2s.c │ ├── jpegcodec.c │ ├── lcd.c │ ├── mtp.c │ ├── pwm.c │ ├── rtc.c │ ├── sc.c │ ├── scuart.c │ ├── sdh.c │ ├── spi.c │ ├── standalone.c │ ├── startup_NUC970.s │ ├── sys.c │ ├── sys_ebi.c │ ├── sys_nuc970.s │ ├── sys_timer.c │ ├── sys_uart.c │ ├── system_nuc970.c │ ├── uart.c │ ├── usbd.c │ └── wwdt.c ├── Library ├── SmartcardLib │ ├── Include │ │ └── sclib.h │ ├── SmartCardLib_Keil.lib │ └── libsmartcard.a └── UsbHostLib │ ├── inc │ ├── config.h │ ├── ehci.h │ ├── hub.h │ ├── ohci.h │ ├── usb.h │ ├── usbh_cdc.h │ ├── usbh_hid.h │ ├── usbh_lib.h │ ├── usbh_uac.h │ └── usbh_uvc.h │ ├── src_cdc │ ├── cdc_core.c │ ├── cdc_driver.c │ └── cdc_parser.c │ ├── src_core │ ├── ehci.c │ ├── ehci_iso.c │ ├── hub.c │ ├── mem_alloc.c │ ├── ohci.c │ ├── support.c │ └── usb_core.c │ ├── src_hid │ ├── hid_core.c │ └── hid_driver.c │ ├── src_msc │ ├── msc.h │ ├── msc_driver.c │ └── msc_xfer.c │ ├── src_uac │ ├── uac.h │ ├── uac_core.c │ ├── uac_driver.c │ └── uac_parser.c │ └── src_uvc │ ├── uvc_core.c │ ├── uvc_driver.c │ └── uvc_parser.c ├── Loader ├── NAND │ ├── u-boot-spl.bin │ └── u-boot.bin ├── SPI │ └── u-boot.bin └── eMMC │ └── u-boot.bin ├── README.md ├── SampleCode ├── 2D │ ├── 160x120RGB565.dat │ ├── 40x30RGB888.dat │ ├── 64x80RGB332.dat │ ├── 64x80RGB565.dat │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── 2d.uvproj │ ├── main.c │ ├── pat8x8-0.dat │ └── pat8x8-1.dat ├── ADC │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── ADC.uvproj │ └── main.c ├── CAN │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── CAN.uvproj │ └── main.c ├── CAP │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── CAP.uvproj │ ├── i2c_gpio.c │ ├── i2c_gpio.h │ ├── main.c │ ├── sensor_hm1055.c │ ├── sensor_nt99050.c │ └── sensor_nt99141.c ├── CRYPTO_AES │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── crypto_aes.uvproj │ └── main.c ├── CRYPTO_HMAC │ ├── GCC │ │ ├── .cproject │ │ ├── .project │ │ └── hmac_image.gnu.S │ ├── HMAC_NIST.rsp │ ├── HMAC_fips198a.rsp │ ├── Keil │ │ └── crypto_hmac.uvproj │ ├── hmac_image.s │ ├── main.c │ └── parser.c ├── CRYPTO_PRNG │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── crypto_prng.uvproj │ └── main.c ├── CRYPTO_SHA │ ├── GCC │ │ ├── .cproject │ │ ├── .project │ │ └── sha_image.gnu.S │ ├── Keil │ │ └── crypto_sha.uvproj │ ├── main.c │ ├── sha_test_vector │ ├── vector.s │ └── vector_parser.c ├── CRYPTO_SHA_MTP │ ├── GCC │ │ ├── .cproject │ │ ├── .project │ │ └── image.S │ ├── Keil │ │ └── crypto_sha_mtp.uvproj │ ├── image.bin │ ├── image.s │ └── main.c ├── CRYPTO_TDES │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── crypto_tdes.uvproj │ └── main.c ├── ETIMER_FreeCounting │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── ETIMER_FreeCounting.uvproj │ └── main.c ├── ETIMER_Perodic │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── ETIMER_Perodic.uvproj │ └── main.c ├── ETIMER_ToggleOut │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── ETIMER_ToggleOut.uvproj │ └── main.c ├── FreeRTOS │ ├── Demo │ │ ├── BlockQ.c │ │ ├── PollQ.c │ │ ├── dynamic.c │ │ └── semtest.c │ ├── FreeRTOSConfig.h │ ├── GCC │ │ ├── .cproject │ │ ├── .project │ │ └── Startup │ │ │ └── startup.S │ ├── Keil │ │ ├── RTOSDemo.uvproj │ │ └── Startup │ │ │ └── startup.s │ ├── main.c │ ├── multithread.c │ └── standalone.c ├── GPIO │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── gpio.uvproj │ └── main.c ├── I2C_EEPROM │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── i2c_eeprom.uvproj │ └── i2c_eeprom.c ├── I2S_MP3Player │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── I2S_MP3Player.uvproj │ ├── MP3HeaderParser.c │ ├── SDGlue.c │ ├── config.h │ ├── diskio.c │ ├── main.c │ └── mp3.c ├── I2S_NAU8822 │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── i2s_nau8822.uvproj │ └── main.c ├── JPEG │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── JPEG.uvproj │ ├── SDGlue.c │ ├── common.c │ ├── debug.c │ ├── diskio.c │ ├── jpegDec.c │ ├── jpegEnc.c │ ├── jpegsample.h │ └── main.c ├── LCD │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── lcd.uvproj │ ├── image_rgb565.dat │ ├── image_rgb565_320x240.dat │ ├── image_rgb888.dat │ ├── image_rgb888_320x240.dat │ └── main.c ├── LCD_MPU │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── lcd.uvproj │ ├── image_rgb565_240x320.dat │ └── main.c ├── LwIP_httpd │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── LwIP_httpd.uvproj │ ├── lwip-1.4.1 │ │ ├── include │ │ │ ├── arch │ │ │ │ ├── bpstruct.h │ │ │ │ ├── cc.h │ │ │ │ ├── cpu.h │ │ │ │ ├── epstruct.h │ │ │ │ └── perf.h │ │ │ ├── lwipopts.h │ │ │ └── netif │ │ │ │ ├── ethernetif.h │ │ │ │ └── nuc970_eth.h │ │ ├── netif │ │ │ ├── ethernetif.c │ │ │ ├── nuc970_eth0.c │ │ │ └── nuc970_eth1.c │ │ └── sys_arch.c │ ├── main.c │ └── makefsdata │ │ ├── fs │ │ ├── 404.htm │ │ └── index.htm │ │ ├── fsdata.c │ │ ├── makefsdata │ │ ├── makefsdata.c │ │ └── readme.txt ├── MTP_KEY │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── mtp_key.uvproj │ └── main.c ├── NAND_Yaffs2 │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── NAND_Yaffs2.uvproj │ ├── main.c │ ├── yaffs_glue.c │ └── yaffs_glue.h ├── PWM │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── pwm.uvproj │ └── main.c ├── RTC │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── rtc.uvproj │ ├── main.c │ └── powercontrol.c ├── SCUART_TxRx │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── SCUART_TxRx.uvproj │ └── main.c ├── SC_ReadSimPhoneBook │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── SC_ReadSimPhoneBook.uvproj │ └── main.c ├── SD_FATFS │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── SD_FATFS.uvproj │ ├── SDGlue.c │ ├── diskio.c │ └── main.c ├── SPI_FLASH │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── spi_flash.uvproj │ └── spi_flash.c ├── UART │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── uart.uvproj │ └── main.c ├── USBD_HID_MouseKeyboard │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── USBD_HID_MouseKeyboard.uvproj │ ├── descriptors.c │ ├── hid_mousekeyboard.c │ ├── hid_mousekeyboard.h │ └── main.c ├── USBD_HID_Transfer │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── USBD_HID_Transfer.uvproj │ ├── WindowsTool │ │ ├── HIDTransferTest.ncb │ │ ├── HIDTransferTest.sln │ │ └── HIDTransferTest │ │ │ ├── EXE │ │ │ └── HIDTransferTest_512.exe │ │ │ ├── HID.hpp │ │ │ ├── HIDTransferTest.cpp │ │ │ ├── HIDTransferTest.h │ │ │ ├── HIDTransferTest.rc │ │ │ ├── HIDTransferTest.vcproj │ │ │ ├── Resource.h │ │ │ ├── hid.lib │ │ │ ├── hidpi.h │ │ │ ├── hidsdi.h │ │ │ ├── hidusage.h │ │ │ ├── stdafx.cpp │ │ │ └── stdafx.h │ ├── descriptors.c │ ├── hid_transfer.c │ ├── hid_transfer.h │ └── main.c ├── USBD_Mass_Storage_SRAM │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── USBD_Mass_Storage_SRAM.uvproj │ ├── MassStorage.c │ ├── descriptors.c │ ├── main.c │ └── massstorage.h ├── USBD_VCOM_SerialEmulator │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── USBD_VCOM_SerialEmulator.uvproj │ ├── Windows Driver │ │ ├── NuvotonCDC.inf │ │ ├── nuvotoncdc.cat │ │ └── readme.txt │ ├── descriptors.c │ ├── main.c │ ├── vcom_serial.c │ └── vcom_serial.h ├── USBH_HID │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── usbh_hid.uvproj │ └── main.c ├── USBH_HID_KEYBOARD │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── usbh_hid_kbd.uvproj │ ├── main.c │ ├── usbh_hid_kbd.c │ └── usbh_hid_kbd.h ├── USBH_MassStorage │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── usbh_umass.uvproj │ ├── diskio.c │ └── main.c ├── USBH_MassStorage_HID │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── usbh_umass_hid.uvproj │ ├── diskio.c │ └── main.c ├── USBH_UAC_HID │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── usbh_uac_hid.uvproj │ └── main.c ├── USBH_UVC │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── usbh_uvc.uvproj │ └── main.c ├── USBH_VCOM │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── usbh_vcom.uvproj │ └── main.c ├── WDT │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── wdt.uvproj │ └── main.c ├── WWDT │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── wwdt.uvproj │ └── main.c ├── eMMC_FATFS │ ├── GCC │ │ ├── .cproject │ │ └── .project │ ├── Keil │ │ └── eMMC_FATFS.uvproj │ ├── diskio.c │ ├── eMMCGlue.c │ └── main.c └── hello │ ├── GCC │ ├── .cproject │ └── .project │ ├── Keil │ └── hello.uvproj │ └── main.c ├── Script ├── InitDDR2.ini └── nuc970.sct └── ThirdParty ├── FATFS ├── doc │ ├── 00index_e.html │ ├── 00index_j.html │ ├── css_e.css │ ├── css_j.css │ ├── css_p.css │ ├── en │ │ ├── appnote.html │ │ ├── chdir.html │ │ ├── chdrive.html │ │ ├── chmod.html │ │ ├── close.html │ │ ├── closedir.html │ │ ├── config.html │ │ ├── dinit.html │ │ ├── dioctl.html │ │ ├── dread.html │ │ ├── dstat.html │ │ ├── dwrite.html │ │ ├── eof.html │ │ ├── error.html │ │ ├── fattime.html │ │ ├── fdisk.html │ │ ├── filename.html │ │ ├── findfirst.html │ │ ├── findnext.html │ │ ├── forward.html │ │ ├── getcwd.html │ │ ├── getfree.html │ │ ├── getlabel.html │ │ ├── gets.html │ │ ├── lseek.html │ │ ├── mkdir.html │ │ ├── mkfs.html │ │ ├── mount.html │ │ ├── open.html │ │ ├── opendir.html │ │ ├── printf.html │ │ ├── putc.html │ │ ├── puts.html │ │ ├── rc.html │ │ ├── read.html │ │ ├── readdir.html │ │ ├── rename.html │ │ ├── sdir.html │ │ ├── setlabel.html │ │ ├── sfatfs.html │ │ ├── sfile.html │ │ ├── sfileinfo.html │ │ ├── size.html │ │ ├── stat.html │ │ ├── sync.html │ │ ├── tell.html │ │ ├── truncate.html │ │ ├── unlink.html │ │ ├── utime.html │ │ └── write.html │ ├── img │ │ ├── app1.c │ │ ├── app2.c │ │ ├── app3.c │ │ ├── app4.c │ │ ├── f1.png │ │ ├── f2.png │ │ ├── f3.png │ │ ├── f4.png │ │ ├── f5.png │ │ ├── f6.png │ │ ├── f7.png │ │ ├── funcs.png │ │ ├── layers.png │ │ ├── layers1.png │ │ ├── layers2.png │ │ ├── layers3.png │ │ ├── mkfatimg.zip │ │ ├── modules.png │ │ ├── rwtest.png │ │ ├── rwtest2.png │ │ └── rwtest3.png │ ├── ja │ │ ├── appnote.html │ │ ├── chdir.html │ │ ├── chdrive.html │ │ ├── chmod.html │ │ ├── close.html │ │ ├── closedir.html │ │ ├── config.html │ │ ├── dinit.html │ │ ├── dioctl.html │ │ ├── dread.html │ │ ├── dstat.html │ │ ├── dwrite.html │ │ ├── eof.html │ │ ├── error.html │ │ ├── fattime.html │ │ ├── fdisk.html │ │ ├── filename.html │ │ ├── findfirst.html │ │ ├── findnext.html │ │ ├── forward.html │ │ ├── getcwd.html │ │ ├── getfree.html │ │ ├── getlabel.html │ │ ├── gets.html │ │ ├── lseek.html │ │ ├── mkdir.html │ │ ├── mkfs.html │ │ ├── mount.html │ │ ├── open.html │ │ ├── opendir.html │ │ ├── printf.html │ │ ├── putc.html │ │ ├── puts.html │ │ ├── rc.html │ │ ├── read.html │ │ ├── readdir.html │ │ ├── rename.html │ │ ├── sdir.html │ │ ├── setlabel.html │ │ ├── sfatfs.html │ │ ├── sfile.html │ │ ├── sfileinfo.html │ │ ├── size.html │ │ ├── stat.html │ │ ├── sync.html │ │ ├── tell.html │ │ ├── truncate.html │ │ ├── unlink.html │ │ ├── utime.html │ │ └── write.html │ └── updates.txt └── src │ ├── 00readme.txt │ ├── diskio.c │ ├── diskio.h │ ├── ff.c │ ├── ff.h │ ├── ffconf.h │ ├── history.txt │ ├── integer.h │ └── option │ ├── cc932.c │ ├── cc936.c │ ├── cc949.c │ ├── cc950.c │ ├── ccsbcs.c │ ├── syscall.c │ └── unicode.c ├── FreeRTOSV9.0.0 └── FreeRTOS │ ├── Demo │ └── Common │ │ ├── Full │ │ ├── BlockQ.c │ │ ├── PollQ.c │ │ ├── comtest.c │ │ ├── death.c │ │ ├── dynamic.c │ │ ├── events.c │ │ ├── flash.c │ │ ├── flop.c │ │ ├── integer.c │ │ ├── print.c │ │ └── semtest.c │ │ ├── Minimal │ │ ├── AbortDelay.c │ │ ├── BlockQ.c │ │ ├── EventGroupsDemo.c │ │ ├── GenQTest.c │ │ ├── IntQueue.c │ │ ├── IntSemTest.c │ │ ├── PollQ.c │ │ ├── QPeek.c │ │ ├── QueueOverwrite.c │ │ ├── QueueSet.c │ │ ├── QueueSetPolling.c │ │ ├── StaticAllocation.c │ │ ├── TaskNotify.c │ │ ├── TimerDemo.c │ │ ├── blocktim.c │ │ ├── comtest.c │ │ ├── comtest_strings.c │ │ ├── countsem.c │ │ ├── crflash.c │ │ ├── crhook.c │ │ ├── death.c │ │ ├── dynamic.c │ │ ├── flash.c │ │ ├── flash_timer.c │ │ ├── flop.c │ │ ├── integer.c │ │ ├── recmutex.c │ │ ├── semtest.c │ │ └── sp_flop.c │ │ └── include │ │ ├── AbortDelay.h │ │ ├── BlockQ.h │ │ ├── EventGroupsDemo.h │ │ ├── GenQTest.h │ │ ├── IntQueue.h │ │ ├── IntSemTest.h │ │ ├── PollQ.h │ │ ├── QPeek.h │ │ ├── QueueOverwrite.h │ │ ├── QueueSet.h │ │ ├── QueueSetPolling.h │ │ ├── StaticAllocation.h │ │ ├── TaskNotify.h │ │ ├── TimerDemo.h │ │ ├── blocktim.h │ │ ├── comtest.h │ │ ├── comtest2.h │ │ ├── comtest_strings.h │ │ ├── countsem.h │ │ ├── crflash.h │ │ ├── crhook.h │ │ ├── death.h │ │ ├── dynamic.h │ │ ├── fileIO.h │ │ ├── flash.h │ │ ├── flash_timer.h │ │ ├── flop.h │ │ ├── integer.h │ │ ├── mevents.h │ │ ├── partest.h │ │ ├── print.h │ │ ├── recmutex.h │ │ ├── semtest.h │ │ └── serial.h │ ├── Source │ ├── croutine.c │ ├── event_groups.c │ ├── include │ │ ├── FreeRTOS.h │ │ ├── StackMacros.h │ │ ├── croutine.h │ │ ├── deprecated_definitions.h │ │ ├── event_groups.h │ │ ├── list.h │ │ ├── mpu_prototypes.h │ │ ├── mpu_wrappers.h │ │ ├── portable.h │ │ ├── projdefs.h │ │ ├── queue.h │ │ ├── semphr.h │ │ ├── stdint.readme │ │ ├── task.h │ │ └── timers.h │ ├── list.c │ ├── portable │ │ ├── GCC │ │ │ └── ARM9_NUC970 │ │ │ │ ├── port.c │ │ │ │ ├── portISR.c │ │ │ │ └── portmacro.h │ │ ├── MemMang │ │ │ ├── ReadMe.url │ │ │ ├── heap_1.c │ │ │ ├── heap_2.c │ │ │ ├── heap_3.c │ │ │ ├── heap_4.c │ │ │ └── heap_5.c │ │ └── RVDS │ │ │ └── ARM9_NUC970 │ │ │ ├── port.c │ │ │ ├── portASM.s │ │ │ ├── portmacro.h │ │ │ └── portmacro.inc │ ├── queue.c │ ├── tasks.c │ └── timers.c │ └── links_to_doc_pages_for_the_demo_projects.url ├── LibMAD ├── inc │ ├── D.dat │ ├── bit.h │ ├── decoder.h │ ├── fixed.h │ ├── frame.h │ ├── global.h │ ├── huffman.h │ ├── imdct_s.dat │ ├── layer12.h │ ├── layer3.h │ ├── mad.h │ ├── mad_timer.h │ ├── qc_table.dat │ ├── rq_table.dat │ ├── sf_table.dat │ ├── stream.h │ ├── synth.h │ └── version.h └── src │ ├── MP3Func.c │ ├── bit.c │ ├── decoder.c │ ├── fixed.c │ ├── frame.c │ ├── huffman.c │ ├── layer12.c │ ├── layer3.c │ ├── stream.c │ ├── synth.c │ ├── timer.c │ └── version.c ├── lwip-1.4.1 ├── CHANGELOG ├── COPYING ├── FILES ├── README ├── UPGRADING ├── doc │ ├── FILES │ ├── contrib.txt │ ├── rawapi.txt │ ├── savannah.txt │ ├── snmp_agent.txt │ └── sys_arch.txt ├── src │ ├── FILES │ ├── api │ │ ├── api_lib.c │ │ ├── api_msg.c │ │ ├── err.c │ │ ├── netbuf.c │ │ ├── netdb.c │ │ ├── netifapi.c │ │ ├── sockets.c │ │ └── tcpip.c │ ├── core │ │ ├── def.c │ │ ├── dhcp.c │ │ ├── dns.c │ │ ├── init.c │ │ ├── ipv4 │ │ │ ├── autoip.c │ │ │ ├── icmp.c │ │ │ ├── igmp.c │ │ │ ├── inet.c │ │ │ ├── inet_chksum.c │ │ │ ├── ip.c │ │ │ ├── ip_addr.c │ │ │ └── ip_frag.c │ │ ├── ipv6 │ │ │ ├── README │ │ │ ├── icmp6.c │ │ │ ├── inet6.c │ │ │ ├── ip6.c │ │ │ └── ip6_addr.c │ │ ├── mem.c │ │ ├── memp.c │ │ ├── netif.c │ │ ├── pbuf.c │ │ ├── raw.c │ │ ├── snmp │ │ │ ├── asn1_dec.c │ │ │ ├── asn1_enc.c │ │ │ ├── mib2.c │ │ │ ├── mib_structs.c │ │ │ ├── msg_in.c │ │ │ └── msg_out.c │ │ ├── stats.c │ │ ├── sys.c │ │ ├── tcp.c │ │ ├── tcp_in.c │ │ ├── tcp_out.c │ │ ├── timers.c │ │ └── udp.c │ ├── include │ │ ├── ipv4 │ │ │ └── lwip │ │ │ │ ├── autoip.h │ │ │ │ ├── icmp.h │ │ │ │ ├── igmp.h │ │ │ │ ├── inet.h │ │ │ │ ├── inet_chksum.h │ │ │ │ ├── ip.h │ │ │ │ ├── ip_addr.h │ │ │ │ └── ip_frag.h │ │ ├── ipv6 │ │ │ └── lwip │ │ │ │ ├── icmp.h │ │ │ │ ├── inet.h │ │ │ │ ├── ip.h │ │ │ │ └── ip_addr.h │ │ ├── lwip │ │ │ ├── api.h │ │ │ ├── api_msg.h │ │ │ ├── arch.h │ │ │ ├── debug.h │ │ │ ├── def.h │ │ │ ├── dhcp.h │ │ │ ├── dns.h │ │ │ ├── err.h │ │ │ ├── init.h │ │ │ ├── mem.h │ │ │ ├── memp.h │ │ │ ├── memp_std.h │ │ │ ├── netbuf.h │ │ │ ├── netdb.h │ │ │ ├── netif.h │ │ │ ├── netifapi.h │ │ │ ├── opt.h │ │ │ ├── pbuf.h │ │ │ ├── raw.h │ │ │ ├── sio.h │ │ │ ├── snmp.h │ │ │ ├── snmp_asn1.h │ │ │ ├── snmp_msg.h │ │ │ ├── snmp_structs.h │ │ │ ├── sockets.h │ │ │ ├── stats.h │ │ │ ├── sys.h │ │ │ ├── tcp.h │ │ │ ├── tcp_impl.h │ │ │ ├── tcpip.h │ │ │ ├── timers.h │ │ │ └── udp.h │ │ ├── netif │ │ │ ├── etharp.h │ │ │ ├── ppp_oe.h │ │ │ └── slipif.h │ │ └── posix │ │ │ ├── netdb.h │ │ │ └── sys │ │ │ └── socket.h │ └── netif │ │ ├── FILES │ │ ├── etharp.c │ │ ├── ethernetif.c │ │ ├── ppp │ │ ├── auth.c │ │ ├── auth.h │ │ ├── chap.c │ │ ├── chap.h │ │ ├── chpms.c │ │ ├── chpms.h │ │ ├── fsm.c │ │ ├── fsm.h │ │ ├── ipcp.c │ │ ├── ipcp.h │ │ ├── lcp.c │ │ ├── lcp.h │ │ ├── magic.c │ │ ├── magic.h │ │ ├── md5.c │ │ ├── md5.h │ │ ├── pap.c │ │ ├── pap.h │ │ ├── ppp.c │ │ ├── ppp.h │ │ ├── ppp_impl.h │ │ ├── ppp_oe.c │ │ ├── pppdebug.h │ │ ├── randm.c │ │ ├── randm.h │ │ ├── vj.c │ │ └── vj.h │ │ └── slipif.c └── test │ └── unit │ ├── core │ ├── test_mem.c │ └── test_mem.h │ ├── etharp │ ├── test_etharp.c │ └── test_etharp.h │ ├── lwip_check.h │ ├── lwip_unittests.c │ ├── lwipopts.h │ ├── tcp │ ├── tcp_helper.c │ ├── tcp_helper.h │ ├── test_tcp.c │ ├── test_tcp.h │ ├── test_tcp_oos.c │ └── test_tcp_oos.h │ └── udp │ ├── test_udp.c │ └── test_udp.h └── yaffs2 ├── Makefile ├── ctype.c ├── include ├── asm-generic │ ├── bitops │ │ ├── __ffs.h │ │ ├── __fls.h │ │ ├── fls.h │ │ └── fls64.h │ └── errno.h ├── asm-offsets.h ├── asm │ ├── barriers.h │ ├── bitops.h │ ├── byteorder.h │ ├── cache.h │ ├── config.h │ ├── errno.h │ ├── io.h │ ├── posix_types.h │ ├── string.h │ ├── system.h │ └── types.h ├── command.h ├── common.h ├── compiler.h ├── div64.h ├── errno.h ├── iotrace.h ├── jffs2 │ ├── jffs2.h │ └── load_kernel.h ├── linker_lists.h ├── linux │ ├── bitops.h │ ├── compat.h │ ├── compiler.h │ ├── crc32.h │ ├── ctype.h │ ├── err.h │ ├── errno.h │ ├── kernel.h │ ├── linux_string.h │ ├── list.h │ ├── log2.h │ ├── math64.h │ ├── mtd │ │ ├── bbm.h │ │ ├── concat.h │ │ ├── flashchip.h │ │ ├── mtd.h │ │ ├── nand.h │ │ ├── nand_bch.h │ │ ├── nand_ecc.h │ │ ├── partitions.h │ │ └── ubi.h │ ├── poison.h │ ├── posix_types.h │ ├── rbtree.h │ ├── sizes.h │ ├── stat.h │ ├── stddef.h │ ├── string.h │ ├── time.h │ └── types.h ├── malloc.h ├── memalign.h ├── mtd │ └── mtd-abi.h ├── nand.h ├── ubi_uboot.h └── watchdog.h ├── linux_string.c ├── mtdcore.c ├── mtdcore.h ├── mtdpart.c ├── nand.c ├── nand_base.c ├── nand_bbt.c ├── nand_ids.c ├── nand_util.c ├── platform └── fmi_nand.c ├── stdio.h ├── stdlib.h ├── string.h ├── yaffs_allocator.c ├── yaffs_allocator.h ├── yaffs_attribs.c ├── yaffs_attribs.h ├── yaffs_bitmap.c ├── yaffs_bitmap.h ├── yaffs_checkptrw.c ├── yaffs_checkptrw.h ├── yaffs_ecc.c ├── yaffs_ecc.h ├── yaffs_error.c ├── yaffs_flashif.h ├── yaffs_flashif2.h ├── yaffs_getblockinfo.h ├── yaffs_guts.c ├── yaffs_guts.h ├── yaffs_hweight.c ├── yaffs_hweight.h ├── yaffs_list.h ├── yaffs_malloc.c ├── yaffs_malloc.h ├── yaffs_mtdif.c ├── yaffs_mtdif.h ├── yaffs_mtdif2.c ├── yaffs_mtdif2.h ├── yaffs_nameval.c ├── yaffs_nameval.h ├── yaffs_nand.c ├── yaffs_nand.h ├── yaffs_nandemul2k.h ├── yaffs_nandif.c ├── yaffs_nandif.h ├── yaffs_osglue.h ├── yaffs_packedtags1.c ├── yaffs_packedtags1.h ├── yaffs_packedtags2.c ├── yaffs_packedtags2.h ├── yaffs_qsort.c ├── yaffs_summary.c ├── yaffs_summary.h ├── yaffs_tagscompat.c ├── yaffs_tagscompat.h ├── yaffs_trace.h ├── yaffs_verify.c ├── yaffs_verify.h ├── yaffs_yaffs1.c ├── yaffs_yaffs1.h ├── yaffs_yaffs2.c ├── yaffs_yaffs2.h ├── yaffscfg.h ├── yaffsfs.c ├── yaffsfs.h ├── ydirectenv.h └── yportenv.h /.gitignore: -------------------------------------------------------------------------------- 1 | #For Keil 2 | obj/ 3 | lst/ 4 | 5 | #For OSX 6 | .DS_Store 7 | 8 | #Files 9 | *.log 10 | *.dep 11 | *.bak 12 | *.uvgui.* 13 | *.uvopt 14 | *.old 15 | *.bin 16 | *.obj 17 | *.orig 18 | *.ok 19 | *~ 20 | *.o 21 | *.i 22 | *.lst 23 | *.map 24 | *.d 25 | *.crf 26 | *.axf 27 | *.out 28 | *.pbi 29 | *.cout 30 | *.browse 31 | *.scc 32 | *.tra 33 | *.txt 34 | 35 | #Large stuff 36 | *.zip 37 | *.gz 38 | *.bz 39 | *.gzip 40 | *.7z 41 | *.rar 42 | !ThirdParty/FATFS/doc/img/mkfatimg.zip 43 | !SampleCode/CRYPTO_SHA_MTP/image.bin 44 | !Loader/eMMC/u-boot.bin 45 | !Loader/NAND/u-boot.bin 46 | !Loader/NAND/u-boot-spl.bin 47 | !Loader/SPI/u-boot.bin 48 | 49 | -------------------------------------------------------------------------------- /Driver/Include/cap.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/Driver/Include/cap.h -------------------------------------------------------------------------------- /Driver/Source/GCC.ld: -------------------------------------------------------------------------------- 1 | ;/*************************************************************************** 2 | ; * * 3 | ; * Copyright (c) 2019 Nuvoton Technology. All rights reserved. * 4 | ; * * 5 | ; ***************************************************************************/ 6 | 7 | ENTRY(__vector) 8 | 9 | MEMORY 10 | { 11 | RAM (rwx) : ORIGIN = 0x000000, LENGTH = 0x08000000 12 | } 13 | 14 | SECTIONS 15 | { 16 | .text : 17 | { 18 | PROVIDE(__image_start = .); 19 | PROVIDE(__text_start = .); 20 | 21 | PROVIDE(__vectors_start = .); 22 | *(.vectors); 23 | . = ALIGN(4); 24 | PROVIDE(__vectors_end = .); 25 | *(.init); 26 | . = ALIGN(4); 27 | *(.text); 28 | . = ALIGN(4); 29 | *(.rodata); 30 | . = ALIGN(4); 31 | *(.rodata*); 32 | . = ALIGN(4); 33 | 34 | etext = .; 35 | 36 | PROVIDE(__text_end = .); 37 | } > RAM 38 | 39 | . = ALIGN(4); 40 | _etext = . ; 41 | PROVIDE (etext = .); 42 | 43 | .data : AT (_etext) 44 | { 45 | PROVIDE(__data_start__ = .); 46 | _data = . ; 47 | *(.data) 48 | . = ALIGN(4); 49 | PROVIDE(__data_end__ = .); 50 | } > RAM 51 | 52 | . = ALIGN(4); 53 | _edata = . ; 54 | PROVIDE (edata = .); 55 | 56 | sbss = .; 57 | .bss : 58 | { 59 | PROVIDE (__bss_start__ = .); 60 | *(.bss) 61 | *(.bss.**) 62 | *(COMMON) 63 | . = ALIGN(4); 64 | PROVIDE (__bss_end__ = .); 65 | }>RAM 66 | ebss = .; 67 | bss_size = ebss - sbss; 68 | 69 | .heap : 70 | { 71 | . = ALIGN(8); 72 | end = .; 73 | } > RAM 74 | 75 | PROVIDE_HIDDEN (__exidx_start = .); 76 | .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } 77 | PROVIDE_HIDDEN (__exidx_end = .); 78 | } 79 | 80 | -------------------------------------------------------------------------------- /Driver/Source/cap.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/Driver/Source/cap.c -------------------------------------------------------------------------------- /Driver/Source/jpegcodec.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/Driver/Source/jpegcodec.c -------------------------------------------------------------------------------- /Driver/Source/standalone.c: -------------------------------------------------------------------------------- 1 | /* 2 | * standalone.c - minimal bootstrap for C library 3 | * SPDX-License-Identifier: Apache-2.0 4 | * Copyright (C) 2000 ARM Limited. 5 | * All rights reserved. 6 | */ 7 | 8 | /* 9 | * RCS $Revision: 2 $ 10 | * Checkin $Date: 15/05/18 2:47p $ 0 11 | * Revising $Author: Hpchen0 $ 12 | */ 13 | 14 | /* 15 | * This code defines a run-time environment for the C library. 16 | * Without this, the C startup code will attempt to use semi-hosting 17 | * calls to get environment information. 18 | */ 19 | 20 | extern unsigned int Image$$RW_RAM1$$ZI$$Limit; 21 | 22 | 23 | void _sys_exit(int return_code) 24 | { 25 | label: goto label; /* endless loop */ 26 | } 27 | 28 | void _ttywrch(int ch) 29 | { 30 | char tempch = (char)ch; 31 | (void)tempch; 32 | } 33 | 34 | 35 | /// @cond HIDDEN_SYMBOLS 36 | 37 | __value_in_regs struct R0_R3 {unsigned heap_base, stack_base, heap_limit, stack_limit;} 38 | __user_setup_stackheap(unsigned int R0, unsigned int SP, unsigned int R2, unsigned int SL) 39 | 40 | { 41 | struct R0_R3 config; 42 | 43 | 44 | config.heap_base = (unsigned int)&Image$$RW_RAM1$$ZI$$Limit; 45 | config.stack_base = SP; 46 | 47 | 48 | return config; 49 | } 50 | /// @endcond HIDDEN_SYMBOLS 51 | 52 | 53 | /* end of file standalone.c */ 54 | -------------------------------------------------------------------------------- /Driver/Source/sys_nuc970.s: -------------------------------------------------------------------------------- 1 | ;/*************************************************************************** 2 | ; * * 3 | ; * SPDX-License-Identifier: Apache-2.0 * 4 | ; * Copyright (c) 2015 Nuvoton Technology. All rights reserved. * 5 | ; * * 6 | ; ***************************************************************************/ 7 | 8 | 9 | AREA SYS_INIT, CODE, READONLY 10 | 11 | EXPORT sysSetupCP15 12 | EXPORT sys_flush_and_clean_dcache 13 | 14 | sysSetupCP15 15 | 16 | MOV r1, r0 ; _mmuSectionTable 17 | MCR p15, 0, r1, c2, c0, 0 ; write translation table base register c2 18 | 19 | MOV r1, #0x40000000 20 | MCR p15, 0, r1, c3, c0, 0 ; domain access control register c3 21 | 22 | MRC p15, 0, r1, c1, c0, 0 ; read control register c1 23 | ORR r1, r1, #0x1000 ; set enable icache bit 24 | ORR r1, r1, #0x5 ; set enable dcache and MMU bits 25 | MCR p15, 0, r1, c1, c0, 0 ; write control regiser c1 26 | 27 | BX r14 28 | 29 | sys_flush_and_clean_dcache 30 | 31 | tci_loop 32 | MRC p15, 0, r15, c7, c14, 3 ; test clean and invalidate 33 | BNE tci_loop 34 | 35 | BX r14 36 | 37 | 38 | END 39 | -------------------------------------------------------------------------------- /Library/SmartcardLib/SmartCardLib_Keil.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/Library/SmartcardLib/SmartCardLib_Keil.lib -------------------------------------------------------------------------------- /Library/SmartcardLib/libsmartcard.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/Library/SmartcardLib/libsmartcard.a -------------------------------------------------------------------------------- /Library/UsbHostLib/inc/usbh_lib.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/Library/UsbHostLib/inc/usbh_lib.h -------------------------------------------------------------------------------- /Library/UsbHostLib/inc/usbh_uvc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/Library/UsbHostLib/inc/usbh_uvc.h -------------------------------------------------------------------------------- /Loader/NAND/u-boot-spl.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/Loader/NAND/u-boot-spl.bin -------------------------------------------------------------------------------- /Loader/NAND/u-boot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/Loader/NAND/u-boot.bin -------------------------------------------------------------------------------- /Loader/SPI/u-boot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/Loader/SPI/u-boot.bin -------------------------------------------------------------------------------- /Loader/eMMC/u-boot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/Loader/eMMC/u-boot.bin -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Disclaimer 2 | The Software is furnished "AS IS", without warranty as to performance or results, and 3 | the entire risk as to performance or results is assumed by YOU. Nuvoton disclaims all 4 | warranties, express, implied or otherwise, with regard to the Software, its use, or 5 | operation, including without limitation any and all warranties of merchantability, fitness 6 | for a particular purpose, and non-infringement of intellectual property rights. 7 | 8 | # Important Notice 9 | 10 | Nuvoton Products are neither intended nor warranted for usage in systems or equipment, 11 | any malfunction or failure of which may cause loss of human life, bodily injury or severe 12 | property damage. Such applications are deemed, "Insecure Usage". 13 | 14 | Insecure usage includes, but is not limited to: equipment for surgical implementation, 15 | atomic energy control instruments, airplane or spaceship instruments, the control or 16 | operation of dynamic, brake or safety systems designed for vehicular use, traffic signal 17 | instruments, all types of safety devices, and other applications intended to support or 18 | sustain life. 19 | 20 | All Insecure Usage shall be made at customer's risk, and in the event that third parties 21 | lay claims to Nuvoton as a result of customer's Insecure Usage, customer shall indemnify 22 | the damages and liabilities thus incurred by Nuvoton. 23 | 24 | Please note that all data and specifications are subject to change without notice. All the 25 | trademarks of products and companies mentioned in this datasheet belong to their respective 26 | owners. 27 | 28 | **Copyright (C) 2016 Nuvoton Technology Corp. All rights reserved** -------------------------------------------------------------------------------- /SampleCode/CAP/i2c_gpio.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/SampleCode/CAP/i2c_gpio.c -------------------------------------------------------------------------------- /SampleCode/CRYPTO_HMAC/GCC/hmac_image.gnu.S: -------------------------------------------------------------------------------- 1 | ;/*---------------------------------------------------------------------------------------------------------*/ 2 | ;/* */ 3 | ;/* Copyright(c) 2017 Nuvoton Technology Corp. All rights reserved. */ 4 | ;/* */ 5 | ;/*---------------------------------------------------------------------------------------------------------*/ 6 | 7 | 8 | .syntax unified 9 | 10 | .globl VectorDataBase 11 | .globl VectorDataLimit 12 | 13 | .align 4 14 | 15 | .text 16 | 17 | VectorDataBase: 18 | .incbin "../../HMAC_fips198a.rsp" 19 | VectorDataLimit: 20 | .space 4 21 | 22 | .end 23 | 24 | -------------------------------------------------------------------------------- /SampleCode/CRYPTO_HMAC/hmac_image.s: -------------------------------------------------------------------------------- 1 | ;/*---------------------------------------------------------------------------------------------------------*/ 2 | ;/* */ 3 | ;/* Copyright(c) 2010 Nuvoton Technology Corp. All rights reserved. */ 4 | ;/* */ 5 | ;/*---------------------------------------------------------------------------------------------------------*/ 6 | 7 | 8 | AREA _image, DATA, READONLY 9 | 10 | EXPORT VectorDataBase 11 | EXPORT VectorDataLimit 12 | 13 | ALIGN 4 14 | 15 | VectorDataBase 16 | ; INCBIN .\HMAC_NIST.rsp 17 | INCBIN .\HMAC_fips198a.rsp 18 | VectorDataLimit 19 | 20 | END -------------------------------------------------------------------------------- /SampleCode/CRYPTO_SHA/GCC/sha_image.gnu.S: -------------------------------------------------------------------------------- 1 | ;/*---------------------------------------------------------------------------------------------------------*/ 2 | ;/* */ 3 | ;/* Copyright(c) 2017 Nuvoton Technology Corp. All rights reserved. */ 4 | ;/* */ 5 | ;/*---------------------------------------------------------------------------------------------------------*/ 6 | 7 | 8 | .syntax unified 9 | 10 | .globl VectorDataBase 11 | .globl VectorDataLimit 12 | 13 | .align 4 14 | 15 | .text 16 | 17 | VectorDataBase: 18 | .incbin "../../sha_test_vector" 19 | VectorDataLimit: 20 | .space 4 21 | 22 | .end 23 | 24 | -------------------------------------------------------------------------------- /SampleCode/CRYPTO_SHA/vector.s: -------------------------------------------------------------------------------- 1 | ;/*---------------------------------------------------------------------------------------------------------*/ 2 | ;/* */ 3 | ;/* Copyright(c) 2010 Nuvoton Technology Corp. All rights reserved. */ 4 | ;/* */ 5 | ;/*---------------------------------------------------------------------------------------------------------*/ 6 | 7 | 8 | AREA _image, DATA, READONLY 9 | 10 | EXPORT VectorDataBase 11 | EXPORT VectorDataLimit 12 | 13 | ALIGN 4 14 | 15 | VectorDataBase 16 | INCBIN .\sha_test_vector 17 | VectorDataLimit 18 | 19 | END -------------------------------------------------------------------------------- /SampleCode/CRYPTO_SHA_MTP/GCC/image.S: -------------------------------------------------------------------------------- 1 | ;/*---------------------------------------------------------------------------------------------------------*/ 2 | ;/* */ 3 | ;/* Copyright(c) 2017 Nuvoton Technology Corp. All rights reserved. */ 4 | ;/* */ 5 | ;/*---------------------------------------------------------------------------------------------------------*/ 6 | 7 | 8 | .syntax unified 9 | 10 | .globl ImageDataBase 11 | .globl ImageDataLimit 12 | 13 | .align 4 14 | 15 | .text 16 | 17 | ImageDataBase: 18 | .incbin "../../image.bin" 19 | ImageDataLimit: 20 | .space 4 21 | 22 | .end 23 | 24 | -------------------------------------------------------------------------------- /SampleCode/CRYPTO_SHA_MTP/image.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/SampleCode/CRYPTO_SHA_MTP/image.bin -------------------------------------------------------------------------------- /SampleCode/CRYPTO_SHA_MTP/image.s: -------------------------------------------------------------------------------- 1 | ;/*---------------------------------------------------------------------------------------------------------*/ 2 | ;/* */ 3 | ;/* Copyright(c) 2010 Nuvoton Technology Corp. All rights reserved. */ 4 | ;/* */ 5 | ;/*---------------------------------------------------------------------------------------------------------*/ 6 | 7 | 8 | AREA _image, DATA, READONLY 9 | 10 | EXPORT ImageDataBase 11 | EXPORT ImageDataLimit 12 | 13 | ALIGN 4 14 | 15 | ImageDataBase 16 | INCBIN .\image.bin 17 | ImageDataLimit 18 | 19 | END -------------------------------------------------------------------------------- /SampleCode/ETIMER_Perodic/main.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file main.c 3 | * @version V1.00 4 | * $Date: 15/05/11 3:23p $ 5 | * @brief NUC970 ETIMER Sample Code 6 | * 7 | * @note 8 | * Copyright (C) 2015 Nuvoton Technology Corp. All rights reserved. 9 | ******************************************************************************/ 10 | #include "nuc970.h" 11 | #include "sys.h" 12 | #include "etimer.h" 13 | 14 | void ETMR0_IRQHandler(void) 15 | { 16 | static uint32_t sec = 1; 17 | sysprintf("%d sec\n", sec++); 18 | 19 | // clear timer interrupt flag 20 | ETIMER_ClearIntFlag(0); 21 | 22 | } 23 | 24 | /*-----------------------------------------------------------------------------*/ 25 | int main(void) 26 | { 27 | 28 | sysDisableCache(); 29 | sysFlushCache(I_D_CACHE); 30 | sysEnableCache(CACHE_WRITE_BACK); 31 | sysInitializeUART(); 32 | 33 | sysprintf("\nThis sample code use timer to generate interrupt every 1 second \n"); 34 | 35 | outpw(REG_CLK_PCLKEN0, inpw(REG_CLK_PCLKEN0) | (1 << 4)); // Enable ETIMER0 engine clock 36 | 37 | // Set timer frequency to 1HZ 38 | ETIMER_Open(0, ETIMER_PERIODIC_MODE, 1); 39 | 40 | // Enable timer interrupt 41 | ETIMER_EnableInt(0); 42 | sysInstallISR(HIGH_LEVEL_SENSITIVE | IRQ_LEVEL_1, ETMR0_IRQn, (PVOID)ETMR0_IRQHandler); 43 | sysSetLocalInterrupt(ENABLE_IRQ); 44 | sysEnableInterrupt(ETMR0_IRQn); 45 | 46 | // Start Timer 0 47 | ETIMER_Start(0); 48 | 49 | while(1); 50 | } 51 | -------------------------------------------------------------------------------- /SampleCode/ETIMER_ToggleOut/main.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file main.c 3 | * @version V1.00 4 | * $Date: 15/05/11 3:23p $ 5 | * @brief NUC970 ETIMER Sample Code 6 | * 7 | * @note 8 | * Copyright (C) 2015 Nuvoton Technology Corp. All rights reserved. 9 | ******************************************************************************/ 10 | #include "nuc970.h" 11 | #include "sys.h" 12 | #include "etimer.h" 13 | 14 | /*-----------------------------------------------------------------------------*/ 15 | int main(void) 16 | { 17 | 18 | sysDisableCache(); 19 | sysFlushCache(I_D_CACHE); 20 | sysEnableCache(CACHE_WRITE_BACK); 21 | sysInitializeUART(); 22 | 23 | outpw(REG_CLK_PCLKEN0, inpw(REG_CLK_PCLKEN0) | (1 << 4)); // Enable ETIMER0 engine clock 24 | outpw(REG_SYS_GPC_MFPL, (inpw(REG_SYS_GPC_MFPL) & ~(0xF << 24)) | (0xD << 24)); // Enable ETIMER0 toggle out pin @ PC6 25 | 26 | sysprintf("\nThis sample code use timer 0 to generate 500Hz toggle output to PC.6 pin\n"); 27 | 28 | /* To generate 500HZ toggle output, timer frequency must set to 1000Hz. 29 | Because toggle output state change on every timer timeout event */ 30 | ETIMER_Open(0, ETIMER_TOGGLE_MODE, 1000); 31 | ETIMER_Start(0); 32 | 33 | while(1); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /SampleCode/FreeRTOS/multithread.c: -------------------------------------------------------------------------------- 1 | /* 2 | * multithread.c - Make some functions of Keil C lib to support thread safety in FreeRTOS 3 | */ 4 | 5 | /* Scheduler include files. */ 6 | #include "FreeRTOS.h" 7 | #include "task.h" 8 | #include "semphr.h" 9 | 10 | /*---------------------------------------------------------------------------- 11 | * Standard Library multithreading interface 12 | *---------------------------------------------------------------------------*/ 13 | 14 | /*--------------------------- _mutex_initialize -----------------------------*/ 15 | 16 | int _mutex_initialize(SemaphoreHandle_t *mutex) { 17 | /* Allocate and initialize a system mutex. */ 18 | 19 | *mutex = xSemaphoreCreateBinary(); 20 | xSemaphoreGive(*mutex); 21 | 22 | return 1; 23 | } 24 | 25 | /*--------------------------- _mutex_acquire --------------------------------*/ 26 | 27 | __attribute__((used)) void _mutex_acquire(SemaphoreHandle_t *mutex) { 28 | /* Acquire a system mutex, lock stdlib resources. */ 29 | 30 | if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED) { 31 | /* FreeRTOS running, acquire a mutex. */ 32 | xSemaphoreTake(*mutex, portMAX_DELAY); 33 | } 34 | } 35 | 36 | /*--------------------------- _mutex_release --------------------------------*/ 37 | 38 | __attribute__((used)) void _mutex_release(SemaphoreHandle_t *mutex) { 39 | /* Release a system mutex, unlock stdlib resources. */ 40 | 41 | if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED) { 42 | /* FreeRTOS running, release a mutex. */ 43 | xSemaphoreGive(*mutex); 44 | } 45 | } 46 | 47 | /* end of file multithread.c */ 48 | -------------------------------------------------------------------------------- /SampleCode/FreeRTOS/standalone.c: -------------------------------------------------------------------------------- 1 | /* 2 | * standalone.c - minimal bootstrap for C library 3 | * Copyright (C) 2000 ARM Limited. 4 | * All rights reserved. 5 | */ 6 | 7 | /* 8 | * RCS $Revision: 2 $ 9 | * Checkin $Date: 15/05/18 2:47p $ 0 10 | * Revising $Author: Hpchen0 $ 11 | */ 12 | 13 | /* 14 | * This code defines a run-time environment for the C library. 15 | * Without this, the C startup code will attempt to use semi-hosting 16 | * calls to get environment information. 17 | */ 18 | 19 | extern unsigned int Image$$RW_RAM1$$ZI$$Limit; 20 | 21 | 22 | void _sys_exit(int return_code) 23 | { 24 | label: 25 | goto label; /* endless loop */ 26 | } 27 | 28 | void _ttywrch(int ch) 29 | { 30 | char tempch = (char)ch; 31 | (void)tempch; 32 | } 33 | 34 | 35 | /// @cond HIDDEN_SYMBOLS 36 | #pragma import(__use_two_region_memory) 37 | __value_in_regs struct R0_R3 { 38 | unsigned heap_base, stack_base, heap_limit, stack_limit; 39 | } 40 | __user_initial_stackheap(unsigned int R0, unsigned int SP, unsigned int R2, unsigned int SL) 41 | 42 | { 43 | struct R0_R3 config; 44 | 45 | 46 | config.heap_base = (unsigned int)&Image$$RW_RAM1$$ZI$$Limit; 47 | config.stack_base = SP; 48 | config.heap_limit = SP - 0x10000; 49 | 50 | 51 | return config; 52 | } 53 | /// @endcond HIDDEN_SYMBOLS 54 | 55 | 56 | /* end of file standalone.c */ 57 | -------------------------------------------------------------------------------- /SampleCode/I2S_MP3Player/SDGlue.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * @file SDGlue.c 3 | * @version V1.00 4 | * $Revision: 2 $ 5 | * $Date: 15/06/12 10:03a $ 6 | * @brief SD glue functions for FATFS 7 | * 8 | * @note 9 | * Copyright (C) 2013 Nuvoton Technology Corp. All rights reserved. 10 | *****************************************************************************/ 11 | #include 12 | #include 13 | #include 14 | #include "nuc970.h" 15 | #include "sys.h" 16 | #include "sdh.h" 17 | #include "ff.h" 18 | #include "diskio.h" 19 | 20 | extern int sd0_ok; 21 | extern int sd1_ok; 22 | 23 | FATFS _FatfsVolSd0; 24 | FATFS _FatfsVolSd1; 25 | 26 | static TCHAR _Path[3] = { '0', ':', 0 }; 27 | 28 | void SD_Open_Disk(unsigned int cardSel) 29 | { 30 | switch(cardSel & 0xff) 31 | { 32 | case SD_PORT0: 33 | SD_Open(cardSel); 34 | if (SD_Probe(cardSel & 0x00ff) != TRUE) { 35 | sysprintf("SD0 initial fail!!\n"); 36 | return; 37 | } 38 | f_mount(&_FatfsVolSd0, _Path, 1); 39 | break; 40 | 41 | case SD_PORT1: 42 | SD_Open(cardSel); 43 | if (SD_Probe(cardSel & 0x00ff) != TRUE) { 44 | sysprintf("SD1 initial fail!!\n"); 45 | return; 46 | } 47 | _Path[0] = 1 + '0'; 48 | f_mount(&_FatfsVolSd1, _Path, 1); 49 | break; 50 | } 51 | } 52 | 53 | void SD_Close_Disk(unsigned int cardSel) 54 | { 55 | if (cardSel == SD_PORT0) { 56 | sd0_ok = 0; 57 | memset(&SD0, 0, sizeof(SD_INFO_T)); 58 | f_mount(NULL, _Path, 1); 59 | memset(&_FatfsVolSd0, 0, sizeof(FATFS)); 60 | } else if(cardSel == SD_PORT1) { 61 | sd1_ok = 0; 62 | memset(&SD1, 0, sizeof(SD_INFO_T)); 63 | _Path[0] = 1 + '0'; 64 | f_mount(NULL, _Path, 1); 65 | memset(&_FatfsVolSd1, 0, sizeof(FATFS)); 66 | } 67 | } 68 | 69 | -------------------------------------------------------------------------------- /SampleCode/I2S_MP3Player/config.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file config.h 3 | * @version V1.00 4 | * @brief MuMicro I2S Driver Sample Configuration Header File 5 | * 6 | * @copyright (C) 2024 Nuvoton Technology Corp. All rights reserved. 7 | * 8 | ******************************************************************************/ 9 | #ifndef PROJECT_CONFIG_H 10 | #define PROJECT_CONFIG_H 11 | 12 | /*---------------------------------------------------------------------------------------------------------*/ 13 | /* Global variables */ 14 | /*---------------------------------------------------------------------------------------------------------*/ 15 | #define USE_SDH 16 | //#define USE_USBH 17 | 18 | #define PCM_BUFFER_SIZE 2304 19 | #define FILE_IO_BUFFER_SIZE 4096 20 | 21 | struct mp3Header 22 | { 23 | unsigned int sync : 11; 24 | unsigned int version : 2; 25 | unsigned int layer : 2; 26 | unsigned int protect : 1; 27 | unsigned int bitrate : 4; 28 | unsigned int samfreq : 2; 29 | unsigned int padding : 1; 30 | unsigned int private : 1; 31 | unsigned int channel : 2; 32 | unsigned int mode : 2; 33 | unsigned int copy : 1; 34 | unsigned int original : 1; 35 | unsigned int emphasis : 2; 36 | }; 37 | 38 | struct AudioInfoObject 39 | { 40 | unsigned int playFileSize; 41 | unsigned int mp3FileEndFlag; 42 | unsigned int mp3SampleRate; 43 | unsigned int mp3BitRate; 44 | unsigned int mp3Channel; 45 | unsigned int mp3PlayTime; 46 | unsigned int mp3Playing; 47 | }; 48 | 49 | 50 | int mp3CountV1L3Headers(unsigned char *pBytes, size_t size); 51 | void MP3Player(void); 52 | void i2sConfigSampleRate(unsigned int u32SampleRate); 53 | 54 | #endif 55 | 56 | /*** (C) COPYRIGHT 2024 Nuvoton Technology Corp. ***/ 57 | -------------------------------------------------------------------------------- /SampleCode/JPEG/SDGlue.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * @file SDGlue.c 3 | * @version V1.00 4 | * $Revision: 1 $ 5 | * $Date: 15/06/08 11:48a $ 6 | * @brief SD glue functions for FATFS 7 | * 8 | * @note 9 | * Copyright (C) 2013 Nuvoton Technology Corp. All rights reserved. 10 | *****************************************************************************/ 11 | #include 12 | #include 13 | #include 14 | #include "nuc970.h" 15 | #include "sys.h" 16 | #include "sdh.h" 17 | #include "ff.h" 18 | #include "diskio.h" 19 | 20 | extern int sd0_ok; 21 | extern int sd1_ok; 22 | 23 | FATFS _FatfsVolSd0; 24 | FATFS _FatfsVolSd1; 25 | 26 | static TCHAR _Path[3] = { '0', ':', 0 }; 27 | 28 | void SD_Open_(unsigned int cardSel) 29 | { 30 | switch (cardSel & 0xff) 31 | { 32 | case SD_PORT0: 33 | SD_Open(cardSel); 34 | 35 | if (SD_Probe(cardSel & 0x00ff) != TRUE) 36 | { 37 | sysprintf("SD0 initial fail!!\n"); 38 | return; 39 | } 40 | 41 | f_mount(&_FatfsVolSd0, _Path, 1); 42 | break; 43 | 44 | case SD_PORT1: 45 | SD_Open(cardSel); 46 | 47 | if (SD_Probe(cardSel & 0x00ff) != TRUE) 48 | { 49 | sysprintf("SD1 initial fail!!\n"); 50 | return; 51 | } 52 | 53 | _Path[0] = 1 + '0'; 54 | f_mount(&_FatfsVolSd1, _Path, 1); 55 | break; 56 | } 57 | } 58 | 59 | void SD_Close_(unsigned int cardSel) 60 | { 61 | if (cardSel == SD_PORT0) 62 | { 63 | sd0_ok = 0; 64 | memset(&SD0, 0, sizeof(SD_INFO_T)); 65 | f_mount(NULL, _Path, 1); 66 | memset(&_FatfsVolSd0, 0, sizeof(FATFS)); 67 | } 68 | else if (cardSel == SD_PORT1) 69 | { 70 | sd1_ok = 0; 71 | memset(&SD1, 0, sizeof(SD_INFO_T)); 72 | _Path[0] = 1 + '0'; 73 | f_mount(NULL, _Path, 1); 74 | memset(&_FatfsVolSd1, 0, sizeof(FATFS)); 75 | } 76 | } 77 | 78 | -------------------------------------------------------------------------------- /SampleCode/LwIP_httpd/lwip-1.4.1/include/arch/bpstruct.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | 33 | #if defined(__IAR_SYSTEMS_ICC__) 34 | #pragma pack(1) 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /SampleCode/LwIP_httpd/lwip-1.4.1/include/arch/cpu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __CPU_H__ 33 | #define __CPU_H__ 34 | 35 | #ifdef BYTE_ORDER 36 | #undef BYTE_ORDER 37 | #endif 38 | #define BYTE_ORDER LITTLE_ENDIAN 39 | 40 | 41 | #endif /* __CPU_H__ */ 42 | -------------------------------------------------------------------------------- /SampleCode/LwIP_httpd/lwip-1.4.1/include/arch/epstruct.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | 33 | #if defined(__IAR_SYSTEMS_ICC__) 34 | #pragma pack() 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /SampleCode/LwIP_httpd/lwip-1.4.1/include/arch/perf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __PERF_H__ 33 | #define __PERF_H__ 34 | 35 | #define PERF_START /* null definition */ 36 | #define PERF_STOP(x) /* null definition */ 37 | 38 | #endif /* __PERF_H__ */ 39 | -------------------------------------------------------------------------------- /SampleCode/LwIP_httpd/lwip-1.4.1/include/netif/ethernetif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 Nuvoton Technology Corp. 3 | * 4 | * See file CREDITS for list of people who contributed to this 5 | * project. 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License as 9 | * published by the Free Software Foundation; either version 2 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 20 | * MA 02111-1307 USA 21 | * 22 | * Description: EMAC driver header file 23 | */ 24 | #ifndef __ETHERNETIF_H__ 25 | #define __ETHERNETIF_H__ 26 | 27 | 28 | #include "lwip/err.h" 29 | #include "lwip/netif.h" 30 | 31 | err_t ethernetif_init0(struct netif *netif); 32 | err_t ethernetif_init1(struct netif *netif); 33 | 34 | 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /SampleCode/LwIP_httpd/makefsdata/fs/404.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | ERROR - File not found 4 | 5 | 6 | -------------------------------------------------------------------------------- /SampleCode/LwIP_httpd/makefsdata/fs/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | NUC970 web server demo based on LwIP 4 |

5 | The NUC970 series targeted for general purpose 32-bit microcontroller 6 | embeds an outstanding CPU core ARM926EJ-S, a RISC processor designed 7 | by Advanced RISC Machines Ltd., runs up to 300 MHz, with 16 KB I-cache, 8 | 16 KB D-cache and MMU, 56KB embedded SRAM and 16 KB IBR (Internal Boot 9 | ROM) for booting from eMMC, USB, NAND and SPI FLASH. 10 |

11 | 12 | 13 | -------------------------------------------------------------------------------- /SampleCode/LwIP_httpd/makefsdata/readme.txt: -------------------------------------------------------------------------------- 1 | This directory contains a script ('makefsdata') to create C code suitable for 2 | httpd for given html pages (or other files) in a directory. 3 | 4 | There is also a plain C console application doing the same and extended a bit. 5 | 6 | Usage: htmlgen [targetdir] [-s] [-i]s 7 | targetdir: relative or absolute path to files to convert 8 | switch -s: toggle processing of subdirectories (default is on) 9 | switch -e: exclude HTTP header from file (header is created at runtime, default is on) 10 | switch -11: include HTTP 1.1 header (1.0 is default) 11 | 12 | if targetdir not specified, makefsdata will attempt to 13 | process files in subdirectory 'fs'. 14 | -------------------------------------------------------------------------------- /SampleCode/NAND_Yaffs2/yaffs_glue.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __YAFFS_UBOOT_GLUE_H__ 3 | #define __YAFFS_UBOOT_GLUE_H__ 4 | 5 | 6 | int cmd_yaffs_dev_ls(void); 7 | int cmd_yaffs_tracemask(unsigned set, unsigned mask); 8 | int cmd_yaffs_devconfig(char *mp, int flash_dev, 9 | int start_block, int end_block); 10 | int cmd_yaffs_mount(char *mp); 11 | int cmd_yaffs_umount(char *mp); 12 | int cmd_yaffs_read_file(char *fn); 13 | int cmd_yaffs_write_file(char *fn, char bval, int sizeOfFile); 14 | int cmd_yaffs_ls(const char *mountpt, int longlist); 15 | int cmd_yaffs_check(const char *fn, const char *type); 16 | int cmd_yaffs_mwrite_file(char *fn, char *addr, int size); 17 | int cmd_yaffs_mread_file(char *fn, char *addr); 18 | int cmd_yaffs_mkdir(const char *dir); 19 | int cmd_yaffs_rmdir(const char *dir); 20 | int cmd_yaffs_rm(const char *path); 21 | int cmd_yaffs_mv(const char *oldPath, const char *newPath); 22 | 23 | int yaffs_dump_dev(const char *path); 24 | #endif 25 | -------------------------------------------------------------------------------- /SampleCode/SD_FATFS/SDGlue.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * @file SDGlue.c 3 | * @version V1.00 4 | * $Revision: 2 $ 5 | * $Date: 15/06/12 10:03a $ 6 | * @brief SD glue functions for FATFS 7 | * 8 | * @note 9 | * Copyright (C) 2013 Nuvoton Technology Corp. All rights reserved. 10 | *****************************************************************************/ 11 | #include 12 | #include 13 | #include 14 | #include "nuc970.h" 15 | #include "sys.h" 16 | #include "sdh.h" 17 | #include "ff.h" 18 | #include "diskio.h" 19 | 20 | extern int sd0_ok; 21 | extern int sd1_ok; 22 | 23 | FATFS _FatfsVolSd0; 24 | FATFS _FatfsVolSd1; 25 | 26 | static TCHAR _Path[3] = { '0', ':', 0 }; 27 | 28 | void SD_Open_Disk(unsigned int cardSel) 29 | { 30 | switch(cardSel & 0xff) 31 | { 32 | case SD_PORT0: 33 | SD_Open(cardSel); 34 | if (SD_Probe(cardSel & 0x00ff) != TRUE) { 35 | sysprintf("SD0 initial fail!!\n"); 36 | return; 37 | } 38 | f_mount(&_FatfsVolSd0, _Path, 1); 39 | break; 40 | 41 | case SD_PORT1: 42 | SD_Open(cardSel); 43 | if (SD_Probe(cardSel & 0x00ff) != TRUE) { 44 | sysprintf("SD1 initial fail!!\n"); 45 | return; 46 | } 47 | _Path[0] = 1 + '0'; 48 | f_mount(&_FatfsVolSd1, _Path, 1); 49 | break; 50 | } 51 | } 52 | 53 | void SD_Close_Disk(unsigned int cardSel) 54 | { 55 | if (cardSel == SD_PORT0) { 56 | sd0_ok = 0; 57 | memset(&SD0, 0, sizeof(SD_INFO_T)); 58 | f_mount(NULL, _Path, 1); 59 | memset(&_FatfsVolSd0, 0, sizeof(FATFS)); 60 | } else if(cardSel == SD_PORT1) { 61 | sd1_ok = 0; 62 | memset(&SD1, 0, sizeof(SD_INFO_T)); 63 | _Path[0] = 1 + '0'; 64 | f_mount(NULL, _Path, 1); 65 | memset(&_FatfsVolSd1, 0, sizeof(FATFS)); 66 | } 67 | } 68 | 69 | -------------------------------------------------------------------------------- /SampleCode/USBD_HID_MouseKeyboard/main.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file main.c 3 | * @version V1.00 4 | * $Date: 15/05/11 10:06a $ 5 | * @brief Simulate an USB mouse and draws circle on the screen 6 | * 7 | * @note 8 | * Copyright (C) 2015 Nuvoton Technology Corp. All rights reserved. 9 | ******************************************************************************/ 10 | #include 11 | #include "nuc970.h" 12 | #include "sys.h" 13 | #include "usbd.h" 14 | #include "hid_mousekeyboard.h" 15 | 16 | extern void USBD_IRQHandler(void); 17 | 18 | /*---------------------------------------------------------------------------------------------------------*/ 19 | /* Main Function */ 20 | /*---------------------------------------------------------------------------------------------------------*/ 21 | int32_t main (void) 22 | { 23 | sysInitializeUART(); 24 | sysprintf("\n"); 25 | sysprintf("========================================\n"); 26 | sysprintf(" NUC970 USB HID Mouse/ Keyboard \n"); 27 | sysprintf("========================================\n"); 28 | 29 | sysDisableCache(); 30 | sysInvalidCache(); 31 | sysSetMMUMappingMethod(MMU_DIRECT_MAPPING); 32 | sysEnableCache(CACHE_WRITE_BACK); 33 | 34 | sysInstallISR(HIGH_LEVEL_SENSITIVE|IRQ_LEVEL_1, USBD_IRQn, (PVOID)USBD_IRQHandler); 35 | /* enable CPSR I bit */ 36 | sysSetLocalInterrupt(ENABLE_IRQ); 37 | 38 | USBD_Open(&gsInfo, HID_ClassRequest, NULL); 39 | USBD_SetVendorRequest(HID_VendorRequest); 40 | 41 | /* Endpoint configuration */ 42 | HID_Init(); 43 | 44 | sysEnableInterrupt(USBD_IRQn); 45 | 46 | while(1) { 47 | HID_UpdateMouseData(); 48 | HID_UpdateKeyboardData(); 49 | } 50 | } 51 | 52 | 53 | 54 | /*** (C) COPYRIGHT 2015 Nuvoton Technology Corp. ***/ 55 | 56 | -------------------------------------------------------------------------------- /SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest.ncb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest.ncb -------------------------------------------------------------------------------- /SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HIDTransferTest", "HIDTransferTest\HIDTransferTest.vcproj", "{F7B82D43-D0AF-4433-AC26-16D76DEAC8CE}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {F7B82D43-D0AF-4433-AC26-16D76DEAC8CE}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {F7B82D43-D0AF-4433-AC26-16D76DEAC8CE}.Debug|Win32.Build.0 = Debug|Win32 14 | {F7B82D43-D0AF-4433-AC26-16D76DEAC8CE}.Release|Win32.ActiveCfg = Release|Win32 15 | {F7B82D43-D0AF-4433-AC26-16D76DEAC8CE}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest/EXE/HIDTransferTest_512.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest/EXE/HIDTransferTest_512.exe -------------------------------------------------------------------------------- /SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest/HID.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest/HID.hpp -------------------------------------------------------------------------------- /SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest/HIDTransferTest.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest/HIDTransferTest.cpp -------------------------------------------------------------------------------- /SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest/HIDTransferTest.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "resource.h" 4 | -------------------------------------------------------------------------------- /SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest/HIDTransferTest.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest/HIDTransferTest.rc -------------------------------------------------------------------------------- /SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest/HIDTransferTest.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest/HIDTransferTest.vcproj -------------------------------------------------------------------------------- /SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest/Resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest/Resource.h -------------------------------------------------------------------------------- /SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest/hid.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest/hid.lib -------------------------------------------------------------------------------- /SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest/hidpi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest/hidpi.h -------------------------------------------------------------------------------- /SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest/stdafx.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest/stdafx.cpp -------------------------------------------------------------------------------- /SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest/stdafx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/SampleCode/USBD_HID_Transfer/WindowsTool/HIDTransferTest/stdafx.h -------------------------------------------------------------------------------- /SampleCode/USBD_HID_Transfer/main.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file main.c 3 | * @version V1.00 4 | * @brief Simulate an USB mouse and draws circle on the screen 5 | * 6 | * @copyright (C) 2016 Nuvoton Technology Corp. All rights reserved. 7 | ******************************************************************************/ 8 | #include 9 | #include "nuc970.h" 10 | #include "sys.h" 11 | #include "usbd.h" 12 | #include "hid_transfer.h" 13 | 14 | extern void USBD_IRQHandler(void); 15 | 16 | int32_t main (void) 17 | { 18 | sysInitializeUART(); 19 | sysprintf("\n"); 20 | sysprintf("=================================\n"); 21 | sysprintf(" NUC970 USB HID Transfer \n"); 22 | sysprintf("=================================\n"); 23 | 24 | sysDisableCache(); 25 | sysInvalidCache(); 26 | sysSetMMUMappingMethod(MMU_DIRECT_MAPPING); 27 | sysEnableCache(CACHE_WRITE_BACK); 28 | 29 | sysInstallISR(HIGH_LEVEL_SENSITIVE|IRQ_LEVEL_1, USBD_IRQn, (PVOID)USBD_IRQHandler); 30 | /* enable CPSR I bit */ 31 | sysSetLocalInterrupt(ENABLE_IRQ); 32 | 33 | USBD_Open(&gsInfo, HID_ClassRequest, NULL); 34 | USBD_SetVendorRequest(HID_VendorRequest); 35 | 36 | /* Endpoint configuration */ 37 | HID_Init(); 38 | 39 | sysEnableInterrupt(USBD_IRQn); 40 | 41 | while(1) 42 | { 43 | } 44 | } 45 | 46 | 47 | 48 | /*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/ 49 | 50 | -------------------------------------------------------------------------------- /SampleCode/USBD_Mass_Storage_SRAM/main.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file main.c 3 | * @version V1.00 4 | * $Date: 15/05/11 10:06a $ 5 | * @brief Use internal SRAM as back end storage media to simulate a 6 | * 30 KB USB pen drive 7 | * 8 | * @note 9 | * Copyright (C) 2015 Nuvoton Technology Corp. All rights reserved. 10 | ******************************************************************************/ 11 | #include 12 | #include "nuc970.h" 13 | #include "sys.h" 14 | #include "usbd.h" 15 | #include "massstorage.h" 16 | 17 | 18 | /*--------------------------------------------------------------------------*/ 19 | extern uint8_t volatile g_u8MscStart; 20 | extern void USBD_IRQHandler(void); 21 | 22 | /*---------------------------------------------------------------------------------------------------------*/ 23 | /* Main Function */ 24 | /*---------------------------------------------------------------------------------------------------------*/ 25 | int32_t main (void) 26 | { 27 | sysInitializeUART(); 28 | sysprintf("\n"); 29 | sysprintf("=================================\n"); 30 | sysprintf(" NUC970 USB Mass Storage \n"); 31 | sysprintf("=================================\n"); 32 | 33 | sysDisableCache(); 34 | sysInvalidCache(); 35 | sysSetMMUMappingMethod(MMU_DIRECT_MAPPING); 36 | sysEnableCache(CACHE_WRITE_BACK); 37 | 38 | sysInstallISR(HIGH_LEVEL_SENSITIVE|IRQ_LEVEL_1, USBD_IRQn, (PVOID)USBD_IRQHandler); 39 | /* enable CPSR I bit */ 40 | sysSetLocalInterrupt(ENABLE_IRQ); 41 | 42 | USBD_Open(&gsInfo, MSC_ClassRequest, NULL); 43 | 44 | /* Endpoint configuration */ 45 | MSC_Init(); 46 | sysEnableInterrupt(USBD_IRQn); 47 | 48 | while(1) 49 | { 50 | if (g_usbd_Configured) 51 | MSC_ProcessCmd(); 52 | } 53 | } 54 | 55 | 56 | 57 | /*** (C) COPYRIGHT 2015 Nuvoton Technology Corp. ***/ 58 | 59 | -------------------------------------------------------------------------------- /SampleCode/USBD_VCOM_SerialEmulator/Windows Driver/nuvotoncdc.cat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/SampleCode/USBD_VCOM_SerialEmulator/Windows Driver/nuvotoncdc.cat -------------------------------------------------------------------------------- /SampleCode/USBD_VCOM_SerialEmulator/Windows Driver/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | usbser.sys is required for USB Virtual COM device. 3 | It is included by windows operation system and could be found at \WINDOWS\system32\drivers 4 | or \i386\driver.cab 5 | 6 | To install the VCOM driver, user must find usbser.sys on their OS first and copy it to the same directory with Nuvoton CDC INF file. Finally install the driver manually when windows request to install the VCOM device driver. -------------------------------------------------------------------------------- /SampleCode/USBH_HID_KEYBOARD/usbh_hid_kbd.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * @file usbh_hid_kbd.h 3 | * @brief NUC472/NUC442 USB Host HID keyboard driver header file 4 | * @version V1.00 5 | * $Revision: 1 $ 6 | * $Date: 15/05/18 4:03p $ 7 | * 8 | * @note 9 | * Copyright (C) 2014 Nuvoton Technology Corp. All rights reserved. 10 | ******************************************************************************/ 11 | #ifndef __USBD_MASS_H__ 12 | #define __USBD_MASS_H__ 13 | 14 | 15 | /* Keyboard Modifiers */ 16 | enum kbd_mod 17 | { 18 | LeftCtrl = 0x01, 19 | LeftShift = 0x02, 20 | Alt = 0x04, 21 | LeftCmd = 0x08, 22 | RightCtrl = 0x10, 23 | RightShift = 0x20, 24 | AltGr = 0x40, 25 | RightCmd = 0x80 26 | }; 27 | 28 | 29 | #define LED_NumLock 0x01 30 | #define LED_CapsLoock 0x02 31 | #define LED_ScrollLock 0x04 32 | 33 | 34 | #define KEY_SPACE 0x2c 35 | #define KEY_ZERO 0x27 36 | #define KEY_ZERO2 0x62 37 | #define KEY_ENTER 0x28 38 | #define KEY_PERIOD 0x63 39 | 40 | #define KEY_CAPS_LOCK 0x39 41 | #define KEY_SCROLL_LOCK 0x47 42 | #define KEY_NUM_LOCK 0x53 43 | 44 | 45 | struct hid_kbd_dev 46 | { 47 | uint8_t pre_data[8]; /* previous recevied report */ 48 | uint8_t bLED; 49 | }; 50 | 51 | 52 | 53 | 54 | #endif /* __USBH_HID_KBD_H_ */ 55 | 56 | /*** (C) COPYRIGHT 2014 Nuvoton Technology Corp. ***/ 57 | -------------------------------------------------------------------------------- /SampleCode/WDT/main.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file main.c 3 | * @version V1.00 4 | * $Date: 15/05/08 5:46p $ 5 | * @brief NUC970 WDT Sample Code 6 | * 7 | * @note 8 | * Copyright (C) 2015 Nuvoton Technology Corp. All rights reserved. 9 | ******************************************************************************/ 10 | #include "nuc970.h" 11 | #include "sys.h" 12 | 13 | 14 | void WDT_IRQHandler(void) 15 | { 16 | // Reload WWDT counter and clear WWDT interrupt flag 17 | sysClearWatchDogTimerCount(); 18 | sysClearWatchDogTimerInterruptStatus(); 19 | sysprintf("Reset WDT counter\n"); 20 | 21 | } 22 | 23 | int main(void) 24 | { 25 | sysDisableCache(); 26 | sysFlushCache(I_D_CACHE); 27 | sysEnableCache(CACHE_WRITE_BACK); 28 | sysInitializeUART(); 29 | 30 | sysprintf("\nThis sample code demonstrate reset WDT function\n"); 31 | 32 | // Disable write protect mode to control WDT register 33 | outpw(REG_SYS_REGWPCTL,0x59); 34 | outpw(REG_SYS_REGWPCTL,0x16); 35 | outpw(REG_SYS_REGWPCTL,0x88); 36 | while(!(inpw(REG_SYS_REGWPCTL)&(1<<0))); 37 | 38 | outpw(REG_CLK_PCLKEN0, inpw(REG_CLK_PCLKEN0) | 1); // Enable WDT engine clock 39 | 40 | sysSetWatchDogTimerInterval(6); // Set WDT time out interval to 2^16 Twdt = 0.7 sec. Where Twdt = 12MHZ / 128 41 | sysInstallWatchDogTimerISR(HIGH_LEVEL_SENSITIVE | IRQ_LEVEL_1, WDT_IRQHandler); 42 | sysEnableWatchDogTimerReset(); 43 | sysEnableWatchDogTimer(); 44 | 45 | while(1); 46 | } 47 | -------------------------------------------------------------------------------- /SampleCode/WWDT/main.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file main.c 3 | * @version V1.00 4 | * $Date: 15/05/08 5:40p $ 5 | * @brief NUC970 WWDT Sample Code 6 | * 7 | * @note 8 | * Copyright (C) 2015 Nuvoton Technology Corp. All rights reserved. 9 | ******************************************************************************/ 10 | #include "nuc970.h" 11 | #include "sys.h" 12 | #include "wwdt.h" 13 | 14 | void WWDT_IRQHandler(void) 15 | { 16 | 17 | // Reload WWDT counter and clear WWDT interrupt flag 18 | WWDT_RELOAD_COUNTER(); 19 | WWDT_CLEAR_INT_FLAG(); 20 | sysprintf("WWDT counter reload\n"); 21 | 22 | } 23 | 24 | int main(void) 25 | { 26 | 27 | sysDisableCache(); 28 | sysFlushCache(I_D_CACHE); 29 | sysEnableCache(CACHE_WRITE_BACK); 30 | sysInitializeUART(); 31 | 32 | sysprintf("\nThis sample code demonstrate WWDT reload function\n"); 33 | 34 | 35 | sysInstallISR(HIGH_LEVEL_SENSITIVE | IRQ_LEVEL_1, WWDT_IRQn, (PVOID)WWDT_IRQHandler); 36 | sysSetLocalInterrupt(ENABLE_IRQ); 37 | sysEnableInterrupt(WWDT_IRQn); 38 | 39 | outpw(REG_CLK_PCLKEN0, inpw(REG_CLK_PCLKEN0) | 2); // Enable WWDT engine clock 40 | 41 | // WWDT timeout every 2048 * 64 WWDT clock, compare interrupt trigger at 2048 * 32 WWDT clock. About every 0.7 sec 42 | // enable WWDT counter compare interrupt. Default WWDT clock source is 12MHz / 128. 43 | WWDT_Open(WWDT_PRESCALER_2048, 0x20, TRUE); 44 | 45 | while(1); 46 | } 47 | -------------------------------------------------------------------------------- /SampleCode/eMMC_FATFS/eMMCGlue.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * @file eMMCGlue.c 3 | * @version V1.00 4 | * $Revision: 2 $ 5 | * $Date: 15/06/12 9:56a $ 6 | * @brief FMI eMMC glue functions for FATFS 7 | * 8 | * @note 9 | * Copyright (C) 2015 Nuvoton Technology Corp. All rights reserved. 10 | *****************************************************************************/ 11 | #include 12 | #include 13 | #include 14 | #include "nuc970.h" 15 | #include "fmi.h" 16 | #include "ff.h" 17 | #include "diskio.h" 18 | 19 | extern int emmc_ok; 20 | 21 | FATFS _FatfsVoleMMC; 22 | static TCHAR _Path[3] = { '2', ':', 0 }; 23 | 24 | void eMMC_Open_Disk(void) 25 | { 26 | eMMC_Open(); 27 | eMMC_Probe(); 28 | f_mount(&_FatfsVoleMMC, _Path, 1); 29 | } 30 | 31 | void eMMC_Close_Disk(void) 32 | { 33 | emmc_ok = 0; 34 | memset(&eMMC, 0, sizeof(EMMC_INFO_T)); 35 | f_mount(NULL, _Path, 1); 36 | memset(&_FatfsVoleMMC, 0, sizeof(FATFS)); 37 | } 38 | 39 | -------------------------------------------------------------------------------- /SampleCode/hello/main.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file main.c 3 | * @version V1.00 4 | * $Date: 15/05/07 5:38p $ 5 | * @brief NUC970 Driver Sample Code 6 | * 7 | * @note 8 | * Copyright (C) 2015 Nuvoton Technology Corp. All rights reserved. 9 | ******************************************************************************/ 10 | #include "nuc970.h" 11 | #include "sys.h" 12 | 13 | /*-----------------------------------------------------------------------------*/ 14 | int main(void) 15 | { 16 | sysDisableCache(); 17 | sysFlushCache(I_D_CACHE); 18 | sysEnableCache(CACHE_WRITE_BACK); 19 | sysInitializeUART(); 20 | sysprintf("\n\n Hello NUC970 !!!\n"); 21 | 22 | sysprintf("APLL clock %d MHz\n", sysGetClock(SYS_APLL)); 23 | sysprintf("UPLL clock %d MHz\n", sysGetClock(SYS_UPLL)); 24 | sysprintf("CPU clock %d MHz\n", sysGetClock(SYS_CPU)); 25 | sysprintf("System clock %d MHz\n", sysGetClock(SYS_SYSTEM)); 26 | sysprintf("HCLK1 clock %d MHz\n", sysGetClock(SYS_HCLK1)); 27 | sysprintf("HCLK234 clock %d MHz\n", sysGetClock(SYS_HCLK234)); 28 | sysprintf("PCLK clock %d MHz\n", sysGetClock(SYS_PCLK)); 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /Script/InitDDR2.ini: -------------------------------------------------------------------------------- 1 | LOAD %L INCREMENTAL 2 | $ = 0 -------------------------------------------------------------------------------- /Script/nuc970.sct: -------------------------------------------------------------------------------- 1 | 2 | 3 | LR_IROM1 0x00000000 { ; load region size_region 4 | ER_IROM1 0x00000000 { ; load address = execution address 5 | *.o (NUC_INIT, +First) 6 | *(InRoot$$Sections) 7 | .ANY (+RO) 8 | } 9 | RW_RAM1 +0 { ; RW_RAM1 start address is after ER_ROM1 10 | .ANY (+RW +ZI) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/css_j.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/ThirdParty/FATFS/doc/css_j.css -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/css_p.css: -------------------------------------------------------------------------------- 1 | body {margin: 8px; background-color: #ffecf0; font-color: black; font-family: serif; line-height: 133%; max-width: 1024px;} 2 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/en/chdrive.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - f_chdrive 10 | 11 | 12 | 13 | 14 |
15 |

f_chdrive

16 |

The f_chdrive function changes the current drive.

17 |
18 | FRESULT f_chdrive (
19 |   const TCHAR* path  /* [IN] Logical drive number */
20 | );
21 | 
22 |
23 | 24 |
25 |

Parameters

26 |
27 |
path
28 |
Specifies the logical drive number to be set as the current drive.
29 |
30 |
31 | 32 | 33 |
34 |

Return Values

35 |

36 | FR_OK, 37 | FR_INVALID_DRIVE 38 |

39 |
40 | 41 | 42 |
43 |

Description

44 |

The f_chdrive function changes the current drive. The initial value of the current drive number is 0. Note that the current drive is retained in a static variable so that it also affects other tasks that using the file functions.

45 |
46 | 47 |
48 |

QuickInfo

49 |

Available when _FS_RPATH >= 1 and _VOLUMES >= 2.

50 |
51 | 52 | 53 |
54 |

See Also

55 |

f_chdir, f_getcwd

56 |
57 | 58 |

Return

59 | 60 | 61 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/en/dinit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - disk_initialize 10 | 11 | 12 | 13 | 14 |
15 |

disk_initialize

16 |

The disk_initialize function initializes the storage device.

17 |
18 | DSTATUS disk_initialize (
19 |   BYTE pdrv           /* [IN] Physical drive number */
20 | );
21 | 
22 |
23 | 24 |
25 |

Parameter

26 |
27 |
pdrv
28 |
Physical drive number to identify the target device. Always zero at single drive system.
29 |
30 |
31 | 32 | 33 |
34 |

Return Values

35 |

This function returns the current drive status flags as the result. For details of the drive status, refer to the disk_status function.

36 |
37 | 38 |
39 |

Description

40 |

This function initializes the storage device and put it ready to generic read/write. When the function succeeded, STA_NOINIT flag in the return value is cleared.

41 |

This function is under control of FatFs module. Application program MUST NOT call this function, or FAT structure on the volume can be broken. To re-initialize the file system, use f_mount function instead.

42 |
43 | 44 |

Return

45 | 46 | 47 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/en/eof.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - f_eof 10 | 11 | 12 | 13 | 14 |
15 |

f_eof

16 |

The f_eof function tests for end-of-file on a file.

17 |
18 | int f_eof (
19 |   FIL* fp   /* [IN] File object */
20 | );
21 | 
22 |
23 | 24 | 25 |
26 |

Parameters

27 |
28 |
fp
29 |
Pointer to the open file object structure.
30 |
31 |
32 | 33 | 34 |
35 |

Return Values

36 |

The f_eof function returns a non-zero value if the read/write pointer has reached end of the file; otherwise it returns a zero.

37 |
38 | 39 | 40 |
41 |

Description

42 |

In this revision, this function is implemented as a macro.

43 |
44 | #define f_eof(fp) ((int)((fp)->fptr == (fp)->fsize))
45 | 
46 |
47 | 48 | 49 |
50 |

QuickInfo

51 |

Always available.

52 |
53 | 54 | 55 |
56 |

See Also

57 |

f_open, f_lseek, FIL

58 |
59 | 60 |

Return

61 | 62 | 63 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/en/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - f_error 10 | 11 | 12 | 13 | 14 |
15 |

f_error

16 |

The f_error tests for an error on a file.

17 |
18 | int f_error (
19 |   FIL* fp   /* [IN] File object */
20 | );
21 | 
22 |
23 | 24 | 25 |
26 |

Parameters

27 |
28 |
fp
29 |
Pointer to the open file object structure.
30 |
31 |
32 | 33 | 34 |
35 |

Return Values

36 |

Returns a non-zero value if a hard error has occured; otherwise it returns a zero.

37 |
38 | 39 | 40 |
41 |

Description

42 |

In this revision, this function is implemented as a macro.

43 |
44 | #define f_error(fp) ((fp)->flag)
45 | 
46 |
47 | 48 | 49 |
50 |

QuickInfo

51 |

Always available.

52 |
53 | 54 | 55 |
56 |

See Also

57 |

f_open, FIL

58 |
59 | 60 |

Return

61 | 62 | 63 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/en/fattime.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - get_fattime 10 | 11 | 12 | 13 | 14 |
15 |

get_fattime

16 |

The get_fattime function gets current time.

17 |
18 | DWORD get_fattime (void);
19 | 
20 |
21 | 22 | 23 |
24 |

Return Value

25 |

Currnet local time is returned with packed into a DWORD value. The bit field is as follows:

26 |
27 |
bit31:25
28 |
Year origin from the 1980 (0..127)
29 |
bit24:21
30 |
Month (1..12)
31 |
bit20:16
32 |
Day of the month(1..31)
33 |
bit15:11
34 |
Hour (0..23)
35 |
bit10:5
36 |
Minute (0..59)
37 |
bit4:0
38 |
Second / 2 (0..29)
39 |
40 |
41 | 42 | 43 |
44 |

Description

45 |

The get_fattime function shall return any valid time even if the system does not support a real time clock. If a zero is returned, the file will not have a valid timestamp.

46 |
47 | 48 | 49 |
50 |

QuickInfo

51 |

This function is not needed when _FS_READONLY == 1 or _FS_NORTC == 1.

52 |
53 | 54 | 55 |

Return

56 | 57 | 58 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/en/size.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - f_size 10 | 11 | 12 | 13 | 14 |
15 |

f_size

16 |

The f_size function gets the size of a file.

17 |
18 | DWORD f_size (
19 |   FIL* fp   /* [IN] File object */
20 | );
21 | 
22 |
23 | 24 | 25 |
26 |

Parameters

27 |
28 |
fp
29 |
Pointer to the open file object structure.
30 |
31 |
32 | 33 | 34 |
35 |

Return Values

36 |

Returns the size of the file in unit of byte.

37 |
38 | 39 | 40 |
41 |

Description

42 |

In this revision, the f_size function is implemented as a macro.

43 |
44 | #define f_size(fp) ((fp)->fsize)
45 | 
46 |
47 | 48 | 49 |
50 |

QuickInfo

51 |

Always available.

52 |
53 | 54 | 55 |
56 |

See Also

57 |

f_open, f_lseek, FIL

58 |
59 | 60 |

Return

61 | 62 | 63 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/en/tell.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - f_tell 10 | 11 | 12 | 13 | 14 |
15 |

f_tell

16 |

The f_tell function gets the current read/write pointer of a file.

17 |
18 | DWORD f_tell (
19 |   FIL* fp   /* [IN] File object */
20 | );
21 | 
22 |
23 | 24 | 25 |
26 |

Parameters

27 |
28 |
fp
29 |
Pointer to the open file object structure.
30 |
31 |
32 | 33 | 34 |
35 |

Return Values

36 |

Returns current read/write pointer of the file.

37 |
38 | 39 | 40 |
41 |

Description

42 |

In this revision, the f_tell function is implemented as a macro.

43 |
44 | #define f_tell(fp) ((fp)->fptr)
45 | 
46 |
47 | 48 | 49 |
50 |

QuickInfo

51 |

Always available.

52 |
53 | 54 | 55 |
56 |

See Also

57 |

f_open, f_lseek, FIL

58 |
59 | 60 |

Return

61 | 62 | 63 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/en/truncate.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - f_truncate 10 | 11 | 12 | 13 | 14 |
15 |

f_truncate

16 |

The f_truncate function truncates the file size.

17 |
18 | FRESULT f_truncate (
19 |   FIL* fp     /* [IN] File object */
20 | );
21 | 
22 |
23 | 24 |
25 |

Parameter

26 |
27 |
fp
28 |
Pointer to the open file object to be truncated.
29 |
30 |
31 | 32 | 33 |
34 |

Return Values

35 |

36 | FR_OK, 37 | FR_DISK_ERR, 38 | FR_INT_ERR, 39 | FR_INVALID_OBJECT, 40 | FR_TIMEOUT 41 |

42 |
43 | 44 | 45 |
46 |

Description

47 |

The f_truncate function truncates the file size to the current file read/write pointer. This function has no effect if the file read/write pointer is already pointing end of the file.

48 |
49 | 50 | 51 |
52 |

QuickInfo

53 |

Available when _FS_READONLY == 0 and _FS_MINIMIZE == 0.

54 |
55 | 56 | 57 |
58 |

See Also

59 |

f_open, f_lseek, FIL

60 |
61 | 62 | 63 |

Return

64 | 65 | 66 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/img/app1.c: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------/ 2 | / Open or create a file in append mode 3 | /------------------------------------------------------------*/ 4 | 5 | FRESULT open_append ( 6 | FIL* fp, /* [OUT] File object to create */ 7 | const char* path /* [IN] File name to be opened */ 8 | ) 9 | { 10 | FRESULT fr; 11 | 12 | /* Opens an existing file. If not exist, creates a new file. */ 13 | fr = f_open(fp, path, FA_WRITE | FA_OPEN_ALWAYS); 14 | if (fr == FR_OK) { 15 | /* Seek to end of the file to append data */ 16 | fr = f_lseek(fp, f_size(fp)); 17 | if (fr != FR_OK) 18 | f_close(fp); 19 | } 20 | return fr; 21 | } 22 | 23 | 24 | int main (void) 25 | { 26 | FRESULT fr; 27 | FATFS fs; 28 | FIL fil; 29 | 30 | /* Open or create a log file and ready to append */ 31 | f_mount(&fs, "", 0); 32 | fr = open_append(&fil, "logfile.txt"); 33 | if (fr != FR_OK) return 1; 34 | 35 | /* Append a line */ 36 | f_printf(&fil, "%02u/%02u/%u, %2u:%02u\n", Mday, Mon, Year, Hour, Min); 37 | 38 | /* Close the file */ 39 | f_close(&fil); 40 | 41 | return 0; 42 | } 43 | 44 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/img/app2.c: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------/ 2 | / Remove all contents of a directory 3 | / This function works regardless of _FS_RPATH. 4 | /------------------------------------------------------------*/ 5 | 6 | 7 | FRESULT empty_directory ( 8 | char* path /* Working buffer filled with start directory */ 9 | ) 10 | { 11 | UINT i, j; 12 | FRESULT fr; 13 | DIR dir; 14 | FILINFO fno; 15 | 16 | #if _USE_LFN 17 | fno.lfname = 0; /* Disable LFN output */ 18 | #endif 19 | fr = f_opendir(&dir, path); 20 | if (fr == FR_OK) { 21 | for (i = 0; path[i]; i++) ; 22 | path[i++] = '/'; 23 | for (;;) { 24 | fr = f_readdir(&dir, &fno); 25 | if (fr != FR_OK || !fno.fname[0]) break; 26 | if (_FS_RPATH && fno.fname[0] == '.') continue; 27 | j = 0; 28 | do 29 | path[i+j] = fno.fname[j]; 30 | while (fno.fname[j++]); 31 | if (fno.fattrib & AM_DIR) { 32 | fr = empty_directory(path); 33 | if (fr != FR_OK) break; 34 | } 35 | fr = f_unlink(path); 36 | if (fr != FR_OK) break; 37 | } 38 | path[--i] = '\0'; 39 | closedir(&dir); 40 | } 41 | 42 | return fr; 43 | } 44 | 45 | 46 | 47 | int main (void) 48 | { 49 | FRESULT fr; 50 | FATFS fs; 51 | char buff[64]; /* Working buffer */ 52 | 53 | 54 | 55 | f_mount(&fs, "", 0); 56 | 57 | strcpy(buff, "/"); /* Directory to be emptied */ 58 | fr = empty_directory(buff); 59 | 60 | if (fr) { 61 | printf("Function failed. (%u)\n", fr); 62 | return fr; 63 | } else { 64 | printf("All contents in the %s are successfully removed.\n", buff); 65 | return 0; 66 | } 67 | } 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/img/f1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/ThirdParty/FATFS/doc/img/f1.png -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/img/f2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/ThirdParty/FATFS/doc/img/f2.png -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/img/f3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/ThirdParty/FATFS/doc/img/f3.png -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/img/f4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/ThirdParty/FATFS/doc/img/f4.png -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/img/f5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/ThirdParty/FATFS/doc/img/f5.png -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/img/f6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/ThirdParty/FATFS/doc/img/f6.png -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/img/f7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/ThirdParty/FATFS/doc/img/f7.png -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/img/funcs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/ThirdParty/FATFS/doc/img/funcs.png -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/img/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/ThirdParty/FATFS/doc/img/layers.png -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/img/layers1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/ThirdParty/FATFS/doc/img/layers1.png -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/img/layers2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/ThirdParty/FATFS/doc/img/layers2.png -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/img/layers3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/ThirdParty/FATFS/doc/img/layers3.png -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/img/mkfatimg.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/ThirdParty/FATFS/doc/img/mkfatimg.zip -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/img/modules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/ThirdParty/FATFS/doc/img/modules.png -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/img/rwtest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/ThirdParty/FATFS/doc/img/rwtest.png -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/img/rwtest2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/ThirdParty/FATFS/doc/img/rwtest2.png -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/img/rwtest3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/ThirdParty/FATFS/doc/img/rwtest3.png -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/ja/chdrive.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - f_chdrive 10 | 11 | 12 | 13 | 14 |
15 |

f_chdrive

16 |

カレント ドライブを変更します。

17 |
18 | FRESULT f_chdrive (
19 |   const TCHAR* path  /* [IN] 対象ドライブを指定します */
20 | );
21 | 
22 |
23 | 24 |
25 |

引数

26 |
27 |
path
28 |
カレント ドライブに設定する論理ドライブ番号を指定するパス名を指定します。
29 |
30 |
31 | 32 | 33 |
34 |

戻り値

35 |

36 | FR_OK, 37 | FR_INVALID_DRIVE 38 |

39 |
40 | 41 | 42 |
43 |

解説

44 |

カレント ドライブを変更します。システム起動時の初期値はドライブ0です。この設定はFatFsモジュールの静的変数に記録されるため、全てのタスクに対して影響を与えます。

45 |
46 | 47 | 48 |
49 |

対応情報

50 |

_FS_RPATH == 1で、且つ_VOLUMES > 1のときに使用可能となります。

51 |
52 | 53 | 54 |
55 |

参照

56 |

f_chdir

57 |
58 | 59 |

Return

60 | 61 | 62 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/ja/close.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - f_close 10 | 11 | 12 | 13 | 14 |
15 |

f_close

16 |

ファイルを閉じます。

17 |
18 | FRESULT f_close (
19 |   FIL* fp     /* [IN] ファイル オブジェクトへのポインタ */
20 | );
21 | 
22 |
23 | 24 |
25 |

引数

26 |
27 |
fp
28 |
閉じようとするファイルのファイル オブジェクト構造体へのポインタを指定します。
29 |
30 |
31 | 32 | 33 |
34 |

戻り値

35 |

36 | FR_OK, 37 | FR_DISK_ERR, 38 | FR_INT_ERR, 39 | FR_INVALID_OBJECT, 40 | FR_TIMEOUT 41 |

42 |
43 | 44 | 45 |
46 |

解説

47 |

ファイルを閉じます。何らかの書き込みの行われたファイルの場合、キャッシュされた状態(リード/ライト バッファ上のデータ、変更されたFATやディレクトリ項目)はディスクに書き戻されます。関数が正常終了すると、そのファイル オブジェクトは無効になり、そのメモリも解放できます。

48 |

ファイル オブジェクトが読み出し専用モードで、_FS_LOCKオプションが選択されていない場合は、ファイルを閉じずにファイル オブジェクトを破棄することもできます。しかし、これは将来の互換性の点で推奨はされません。

49 |
50 | 51 | 52 |
53 |

対応情報

54 |

全ての構成で使用可能です。

55 |
56 | 57 | 58 |
59 |

参照

60 | f_open, f_read, f_write, f_sync, FIL, FATFS 61 |
62 | 63 |

戻る

64 | 65 | 66 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/ja/closedir.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - f_closedir 10 | 11 | 12 | 13 | 14 |
15 |

f_closedir

16 |

ディレクトリを閉じます。

17 |
18 | FRESULT f_closedir (
19 |   DIR* dp     /* [IN] ディレクトリ オブジェクトへのポインタ */
20 | );
21 | 
22 |
23 | 24 |
25 |

引数

26 |
27 |
dp
28 |
閉じようとするディレクトリのディレクトリ オブジェクト構造体へのポインタを指定します。
29 |
30 |
31 | 32 | 33 |
34 |

戻り値

35 |

36 | FR_OK, 37 | FR_INT_ERR, 38 | FR_INVALID_OBJECT, 39 | FR_TIMEOUT 40 |

41 |
42 | 43 | 44 |
45 |

解説

46 |

ディレクトリを閉じます。関数が正常終了すると、そのディレクトリ オブジェクトは無効になり、そのメモリも解放できます。

47 |

_FS_LOCKオプションが選択されていない場合は、この処理を行わずにディレクトリ オブジェクトを破棄することもできます。しかし、これは将来の互換性の点で推奨はされません。

48 |
49 | 50 | 51 |
52 |

対応情報

53 |

_FS_MINIMIZE <= 1のとき使用可能になります。

54 |
55 | 56 | 57 |
58 |

参照

59 | f_opendir, f_readdir, DIR 60 |
61 | 62 |

戻る

63 | 64 | 65 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/ja/dinit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - disk_initialize 10 | 11 | 12 | 13 | 14 |
15 |

disk_initialize

16 |

ストレージ デバイスを初期化します。

17 |
18 | DSTATUS disk_initialize (
19 |   BYTE pdrv      /* [IN] 物理ドライブ番号 */
20 | );
21 | 
22 |
23 | 24 |
25 |

引数

26 |
27 |
pdrv
28 |
対象のデバイスを識別する物理ドライブ番号(0-9)が指定されます。
29 |
30 |
31 | 32 | 33 |
34 |

戻り値

35 |

この関数は戻り値としてディスク ステータスを返します。ディスク ステータスの詳細に関してはdisk_status関数を参照してください。

36 |
37 | 38 |
39 |

解説

40 |

ストレージ デバイスを初期化し、データの読み書きなど全ての動作が可能な状態にします。関数が成功すると、戻り値のSTA_NOINITフラグがクリアされます。

41 |

この関数はFatFsの管理下にあり、自動マウント動作により必要に応じて呼び出されます。アプリケーションからはこの関数を呼び出してはなりません。さもないと、FATボリュームが破壊される可能性があります。再初期化が必要なときは、f_mount関数を使用してください。

42 |
43 | 44 |

戻る

45 | 46 | 47 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/ja/dstat.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - disk_status 10 | 11 | 12 | 13 | 14 |
15 |

disk_status

16 |

ストレージ デバイスの状態を取得します。

17 |
18 | DSTATUS disk_status (
19 |   BYTE pdrv           /* [IN] 物理ドライブ番号 */
20 | );
21 | 
22 |
23 | 24 |
25 |

引数

26 |
27 |
pdrv
28 |
対象のデバイスを識別する物理ドライブ番号(0-9)が指定されます。物理ドライブが1台のときは、常に0になります。
29 |
30 |
31 | 32 | 33 |
34 |

戻り値

35 |

現在のストレージ デバイスの状態を次のフラグの組み合わせ値で返します。

36 |
37 |
STA_NOINIT
38 |
デバイスが初期化されていないことを示すフラグ。システム リセットやメディアの取り外し等でセットされ、disk_initialize関数の正常終了でクリア、失敗でセットされます。メディア交換は非同期に発生するイベントなので、過去にメディア交換があった場合もこのフラグに反映させる必要があります。FatFsモジュールは、このフラグを参照してマウント動作が必要かどうかを判断します。
39 |
STA_NODISK
40 |
メディアが存在しないことを示すフラグ。メディアが取り外されている間はセットされ、セットされている間はクリアされます。固定ディスクでは常にクリアします。なお、このフラグはFatFsモジュールでは参照されません。
41 |
STA_PROTECT
42 |
メディアがライト プロテクトされていることを示すフラグ。ライト プロテクト機能をサポートしないときは、常にクリアします。リード オンリ構成では参照されません。
43 |
44 |
45 | 46 |

戻る

47 | 48 | 49 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/ja/eof.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - f_eof 10 | 11 | 12 | 13 | 14 |
15 |

f_eof

16 |

リード/ライト ポインタがファイル終端に達しているかどうか調べます。.

17 |
18 | int f_eof (
19 |   FIL* fp   /* [IN] ファイル オブジェクト */
20 | );
21 | 
22 |
23 | 24 | 25 |
26 |

引数

27 |
28 |
fp
29 |
ファイル オブジェクト構造体へのポインタを指定します。
30 |
31 |
32 | 33 | 34 |
35 |

戻り値

36 |

リード/ライト ポインタがファイル終端にあり読み出すデータがない場合は、0以外の値を返します。それ以外のときは0を返します。

37 |
38 | 39 | 40 |
41 |

解説

42 |

この関数は、現リビジョンではマクロとして実装されています。

43 |
44 | #define f_eof(fp) ((int)((fp)->fptr == (fp)->fsize))
45 | 
46 |
47 | 48 | 49 |
50 |

対応情報

51 |

常に使用可能。

52 |
53 | 54 | 55 |
56 |

参照

57 |

f_open, f_lseek, FIL

58 |
59 | 60 |

戻る

61 | 62 | 63 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/ja/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - f_error 10 | 11 | 12 | 13 | 14 |
15 |

f_error

16 |

エラー発生の有無を調べます。

17 |
18 | int f_error (
19 |   FIL* fp   /* [IN] ファイル オブジェクト */
20 | );
21 | 
22 |
23 | 24 | 25 |
26 |

引数

27 |
28 |
fp
29 |
ファイル オブジェクト構造体へのポインタを指定します。
30 |
31 |
32 | 33 | 34 |
35 |

戻り値

36 |

そのファイルにおいてハード エラーによって処理が中断されている場合は、0以外の値を返します。それ以外の時は0を返します。

37 |
38 | 39 | 40 |
41 |

解説

42 |

この関数は、現リビジョンではマクロとして実装されています。

43 |
44 | #define f_error(fp) ((fp)->err)
45 | 
46 |
47 | 48 | 49 |
50 |

対応情報

51 |

常に使用可能。

52 |
53 | 54 | 55 |
56 |

参照

57 |

f_open, FIL

58 |
59 | 60 |

戻る

61 | 62 | 63 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/ja/fattime.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - get_fattime 10 | 11 | 12 | 13 | 14 |
15 |

get_fattime

16 |

現在時刻を取得します。

17 |
18 | DWORD get_fattime (void);
19 | 
20 |
21 | 22 | 23 |
24 |

戻り値

25 |

現在のローカル タイムをDWORD値にパックして返します。ビット フィールドは次に示すようになります。

26 |
27 |
bit31:25
28 |
1980年を起点とした年を 0..127 でセット。
29 |
bit24:21
30 |
月を 1..12 の値でセット。
31 |
bit20:16
32 |
日を 1..31 の値でセット。
33 |
bit15:11
34 |
時を 0..23 の値でセット。
35 |
bit10:5
36 |
分を 0..59 の値でセット。
37 |
bit4:0
38 |
秒/2を 0..29 の値でセット
39 |
40 |
41 | 42 | 43 |
44 |

解説

45 |

RTCをサポートしないシステムでも、ダミーとして何らかの日付として有効な値を返すべきです。0などを返した場合、そのファイルのタイムスタンプは無効になります。

46 |
47 | 48 | 49 |
50 |

対応情報

51 |

リード オンリー構成(_FS_READONLY == 1)または、非RTCサポート構成(_RTC_NOUSE == 1)ではこの関数は必要とされません。

52 |
53 | 54 | 55 |

戻る

56 | 57 | 58 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/ja/getcwd.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - f_getcwd 10 | 11 | 12 | 13 | 14 |
15 |

f_getcwd

16 |

カレント ディレクトリを得ます。

17 |
18 | FRESULT f_getcwd (
19 |   TCHAR* buff, /* [OUT] バッファ */
20 |   UINT len     /* [IN] バッファ サイズ */
21 | );
22 | 
23 |
24 | 25 |
26 |

引数

27 |
28 |
buff
29 |
カレント ディレクトリのパス名文字列を格納するバッファ
30 |
len
31 |
TCHAR単位のバッファ サイズ
32 |
33 |
34 | 35 | 36 |
37 |

戻り値

38 |

39 | FR_OK, 40 | FR_DISK_ERR, 41 | FR_INT_ERR, 42 | FR_NOT_READY, 43 | FR_NOT_ENABLED, 44 | FR_NO_FILESYSTEM, 45 | FR_TIMEOUT, 46 | FR_NOT_ENOUGH_CORE 47 |

48 |
49 | 50 | 51 |
52 |

解説

53 |

カレント ドライブのカレント ディレクトリのフル パス文字列を取得します。_VOLUMESが2以上のときは、論理ドライブ番号の付加されたパス名となります。

54 |
55 | 56 | 57 |
58 |

対応情報

59 |

_FS_RPATH == 2のとき使用可能です。

60 |
61 | 62 | 63 |
64 |

参照

65 |

f_chdrive, f_chdir

66 |
67 | 68 |

戻る

69 | 70 | 71 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/ja/putc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - f_putc 10 | 11 | 12 | 13 | 14 |
15 |

f_putc

16 |

ファイルに文字を書き込みます。

17 |
18 | int f_putc (
19 |   TCHAR chr,  /* [IN] 書き込む文字 */
20 |   FIL* fp     /* [IN] ファイル オブジェクト */
21 | );
22 | 
23 |
24 | 25 |
26 |

引数

27 |
28 |
chr
29 |
書き込む文字を指定します。
30 |
fp
31 |
ファイル オブジェクト構造体へのポインタを指定します。
32 |
33 |
34 | 35 | 36 |
37 |

戻り値

38 |

文字が正常に書き込まれると書き込んだ文字数が返されます。ディスクが満杯またはエラーにより書き込まれなかったときはEOF (-1)が返されます。

39 |

APIにUnicodeが選択(_LFN_UNICODEが1)されているときは、chrはUTF-16文字になりますが、ファイル上のエンコードは、_STRF_ENCODEオプションで選択できます。それ以外の時は無変換(1バイト/1文字)で書き込みます。

40 |
41 | 42 | 43 |
44 |

解説

45 |

1文字をファイルに書き込みます。

46 |
47 | 48 | 49 |
50 |

対応情報

51 |

この関数はf_write関数のラッパー関数です。_FS_READONLY == 0で、且つ_USE_STRFUNCが 1または 2のとき使用可能です。2を指定すると、'\n''\r'+'\n'に展開されてファイルに書き込まれます。

52 |
53 | 54 | 55 |
56 |

参照

57 |

f_open, f_puts, f_printf, f_gets, f_close, FIL

58 |
59 | 60 |

戻る

61 | 62 | 63 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/ja/sdir.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - DIR 10 | 11 | 12 | 13 | 14 |
15 |

DIR

16 |

DIR構造体は、f_opendir/f_readdir/f_findfirst/f_findnext関数のワーク エリアとして使用されます。アプリケーションは、この構造体のメンバを書き換えてはなりません。

17 |
18 | typedef struct {
19 |     FATFS*  fs;        /* 親ファイル システム オブジェクトへのポインタ */
20 |     WORD    id;        /* 親ファイル システム オブジェクトのマウントID */
21 |     WORD    index;     /* 次に検索開始するディレクトリ インデックス番号 */
22 |     DWORD   sclust;    /* テーブル開始クラスタ (0:ルート) */
23 |     DWORD   clust;     /* 現在のクラスタ番号 */
24 |     DWORD   sect;      /* 現在のセクタ番号 */
25 |     BYTE*   dir;       /* 現在のSFNエントリ(Win[]内)へのポインタ */
26 |     BYTE*   fn;        /* SFNバッファへのポインタ (in/out) {file[8],ext[3],status[1]} */
27 | #if _FS_LOCK
28 |     UINT    lockid;    /* サブ ディレクトリ ロックID (0:ルート) */
29 | #endif
30 | #if _USE_LFN
31 |     WCHAR*  lfn;       /* LFNバッファへのポインタ (in/out) */
32 |     WORD    lfn_idx;   /* LFNエントリの先頭インデックス (0xFFFF:無効) */
33 | #endif
34 | #if _USE_FIND
35 |     const TCHAR*  pat; /* マッチング パターンへのポインタ */
36 | #endif
37 | } DIR;
38 | 
39 |
40 | 41 |

戻る

42 | 43 | 44 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/ja/size.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - f_size 10 | 11 | 12 | 13 | 14 |
15 |

f_size

16 |

ファイルのサイズを取得します。

17 |
18 | DWORD f_size (
19 |   FIL* fp   /* [IN] ファイル オブジェクト */
20 | );
21 | 
22 |
23 | 24 | 25 |
26 |

引数

27 |
28 |
fp
29 |
ファイル オブジェクト構造体へのポインタを指定します。
30 |
31 |
32 | 33 | 34 |
35 |

戻り値

36 |

バイト単位のファイル サイズが返ります。

37 |
38 | 39 | 40 |
41 |

解説

42 |

この関数は、現リビジョンではマクロとして実装されています。

43 |
44 | #define f_size(fp) ((fp)->fsize)
45 | 
46 |
47 | 48 | 49 |
50 |

対応情報

51 |

常に使用可能。

52 |
53 | 54 | 55 |
56 |

参照

57 |

f_open, f_lseek, FIL

58 |
59 | 60 |

戻る

61 | 62 | 63 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/ja/sync.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - f_sync 10 | 11 | 12 | 13 | 14 |
15 |

f_sync

16 |

書き込み中のファイルのキャッシュされた情報をフラッシュします。

17 |
18 | FRESULT f_sync (
19 |   FIL* fp     /* [IN] ファイル オブジェクト構造体へのポインタ */
20 | );
21 | 
22 |
23 | 24 |
25 |

引数

26 |
27 |
fp
28 |
syncするファイルのファイル オブジェクト構造体へのポインタを指定します。
29 |
30 |
31 | 32 | 33 |
34 |

戻り値

35 |

36 | FR_OK, 37 | FR_DISK_ERR, 38 | FR_INT_ERR, 39 | FR_INVALID_OBJECT, 40 | FR_TIMEOUT 41 |

42 |
43 | 44 | 45 |
46 |

解説

47 |

この関数はf_close関数と同じ処理を実行しますが、ファイルは引き続き開かれたままになり、読み書きを続行できます。ロギングなど、書き込みモードで長時間ファイルが開かれているアプリケーションにおいて、定期的または区切りの良いところでこの関数を使用することにより、不意の電源断やメディアの取り外しにより失われるデータを最小にすることができます。この背景については、アプリケーション ノートも参照してください。

48 |

実際のところ、f_close関数内ではこの関数を呼び出した後ファイル オブジェクトを無効化しているだけなので、f_close関数の直前にf_sync関数を置くことは無意味です。

49 |
50 | 51 | 52 |
53 |

対応情報

54 |

_FS_READONLY == 0のときに使用可能です。

55 |
56 | 57 | 58 |
59 |

参照

60 |

f_close

61 |
62 | 63 |

戻る

64 | 65 | 66 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/ja/tell.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - f_tell 10 | 11 | 12 | 13 | 14 |
15 |

f_tell

16 |

現在のリード/ライト ポインタを取得します。

17 |
18 | DWORD f_tell (
19 |   FIL* fp   /* [IN] ファイル オブジェクト */
20 | );
21 | 
22 |
23 | 24 | 25 |
26 |

引数

27 |
28 |
fp
29 |
ファイル オブジェクト構造体へのポインタを指定します。
30 |
31 |
32 | 33 | 34 |
35 |

戻り値

36 |

現在のリード/ライト ポインタ(ファイル先頭からのバイト単位のオフセット)が返ります。

37 |
38 | 39 | 40 |
41 |

解説

42 |

f_tell関数は、現リビジョンではマクロとして実装されています。

43 |
44 | #define f_tell(fp) ((fp)->fptr)
45 | 
46 |
47 | 48 | 49 |
50 |

対応情報

51 |

常に使用可能。

52 |
53 | 54 | 55 |
56 |

参照

57 |

f_open, f_lseek, FIL

58 |
59 | 60 |

戻る

61 | 62 | 63 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/doc/ja/truncate.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - f_truncate 10 | 11 | 12 | 13 | 14 |
15 |

f_truncate

16 |

ファイル長を切り詰めます。

17 |
18 | FRESULT f_truncate (
19 |   FIL* fp     /* [IN] ファイル オブジェクトへのポインタ */
20 | );
21 | 
22 |
23 | 24 |
25 |

引数

26 |
27 |
fp
28 |
切り詰め対象ファイルのファイル オブジェクトへのポインタ
29 |
30 |
31 | 32 | 33 |
34 |

戻り値

35 |

36 | FR_OK, 37 | FR_DISK_ERR, 38 | FR_INT_ERR, 39 | FR_DENIED, 40 | FR_INVALID_OBJECT, 41 | FR_TIMEOUT 42 |

43 |
44 | 45 | 46 |
47 |

解説

48 |

ファイルの長さが現在のリード/ライト ポインタに切り詰められます。リード/ライト ポインタが既にファイルの終端を指しているときは、この関数は何の効果も持ちません。

49 |
50 | 51 | 52 |
53 |

対応情報

54 |

_FS_READONLY == 0で、且つ_FS_MINIMIZE == 0のときに使用可能です。

55 |
56 | 57 | 58 |
59 |

参照

60 |

f_open, f_lseek, FIL

61 |
62 | 63 | 64 |

Return

65 | 66 | 67 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/src/00readme.txt: -------------------------------------------------------------------------------- 1 | FatFs Module Source Files R0.11 2 | 3 | 4 | FILES 5 | 6 | 00readme.txt This file. 7 | history.txt Revision history. 8 | ffconf.h Configuration file for FatFs module. 9 | ff.h Common include file for FatFs and application module. 10 | ff.c FatFs module. 11 | diskio.h Common include file for FatFs and disk I/O module. 12 | diskio.c An example of glue function to attach existing disk I/O module to FatFs. 13 | integer.h Integer type definitions for FatFs. 14 | option Optional external functions. 15 | 16 | 17 | Low level disk I/O module is not included in this archive because the FatFs 18 | module is only a generic file system layer and not depend on any specific 19 | storage device. You have to provide a low level disk I/O module that written 20 | to control the target storage device. 21 | 22 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/src/integer.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------*/ 2 | /* Integer type definitions for FatFs module */ 3 | /*-------------------------------------------*/ 4 | 5 | #ifndef _FF_INTEGER 6 | #define _FF_INTEGER 7 | 8 | #ifdef _WIN32 /* FatFs development platform */ 9 | 10 | #include 11 | #include 12 | 13 | #else /* Embedded platform */ 14 | 15 | /* This type MUST be 8 bit */ 16 | typedef unsigned char BYTE; 17 | 18 | /* These types MUST be 16 bit */ 19 | typedef short SHORT; 20 | typedef unsigned short WORD; 21 | typedef unsigned short WCHAR; 22 | 23 | /* These types MUST be 16 bit or 32 bit */ 24 | typedef int INT; 25 | typedef unsigned int UINT; 26 | 27 | /* These types MUST be 32 bit */ 28 | typedef long LONG; 29 | typedef unsigned long DWORD; 30 | 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /ThirdParty/FATFS/src/option/unicode.c: -------------------------------------------------------------------------------- 1 | #include "../ff.h" 2 | 3 | #if _USE_LFN != 0 4 | 5 | #if _CODE_PAGE == 932 /* Japanese Shift_JIS */ 6 | #include "cc932.c" 7 | #elif _CODE_PAGE == 936 /* Simplified Chinese GBK */ 8 | #include "cc936.c" 9 | #elif _CODE_PAGE == 949 /* Korean */ 10 | #include "cc949.c" 11 | #elif _CODE_PAGE == 950 /* Traditional Chinese Big5 */ 12 | #include "cc950.c" 13 | #else /* Single Byte Character-Set */ 14 | #include "ccsbcs.c" 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /ThirdParty/FreeRTOSV9.0.0/FreeRTOS/Source/include/stdint.readme: -------------------------------------------------------------------------------- 1 | 2 | #ifndef FREERTOS_STDINT 3 | #define FREERTOS_STDINT 4 | 5 | /******************************************************************************* 6 | * THIS IS NOT A FULL stdint.h IMPLEMENTATION - It only contains the definitions 7 | * necessary to build the FreeRTOS code. It is provided to allow FreeRTOS to be 8 | * built using compilers that do not provide their own stdint.h definition. 9 | * 10 | * To use this file: 11 | * 12 | * 1) Copy this file into the directory that contains your FreeRTOSConfig.h 13 | * header file, as that directory will already be in the compilers include 14 | * path. 15 | * 16 | * 2) Rename the copied file stdint.h. 17 | * 18 | */ 19 | 20 | typedef signed char int8_t; 21 | typedef unsigned char uint8_t; 22 | typedef short int16_t; 23 | typedef unsigned short uint16_t; 24 | typedef long int32_t; 25 | typedef unsigned long uint32_t; 26 | 27 | #endif /* FREERTOS_STDINT */ 28 | -------------------------------------------------------------------------------- /ThirdParty/FreeRTOSV9.0.0/FreeRTOS/Source/portable/MemMang/ReadMe.url: -------------------------------------------------------------------------------- 1 | [{000214A0-0000-0000-C000-000000000046}] 2 | Prop3=19,2 3 | [InternetShortcut] 4 | URL=http://www.freertos.org/a00111.html 5 | IDList= 6 | -------------------------------------------------------------------------------- /ThirdParty/FreeRTOSV9.0.0/FreeRTOS/links_to_doc_pages_for_the_demo_projects.url: -------------------------------------------------------------------------------- 1 | [{000214A0-0000-0000-C000-000000000046}] 2 | Prop3=19,2 3 | [InternetShortcut] 4 | URL=http://www.freertos.org/a00090.html 5 | IDList= 6 | -------------------------------------------------------------------------------- /ThirdParty/LibMAD/inc/bit.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libmad - MPEG audio decoder library 3 | * Copyright (C) 2000-2004 Underbit Technologies, Inc. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | * 19 | * $Id: bit.h,v 1.12 2004/01/23 09:41:32 rob Exp $ 20 | */ 21 | 22 | # ifndef LIBMAD_BIT_H 23 | # define LIBMAD_BIT_H 24 | 25 | struct mad_bitptr { 26 | unsigned char const *byte; 27 | unsigned short cache; 28 | unsigned short left; 29 | }; 30 | 31 | void mad_bit_init(struct mad_bitptr *, unsigned char const *); 32 | 33 | # define mad_bit_finish(bitptr) /* nothing */ 34 | 35 | unsigned int mad_bit_length(struct mad_bitptr const *, 36 | struct mad_bitptr const *); 37 | 38 | # define mad_bit_bitsleft(bitptr) ((bitptr)->left) 39 | unsigned char const *mad_bit_nextbyte(struct mad_bitptr const *); 40 | 41 | void mad_bit_skip(struct mad_bitptr *, unsigned int); 42 | unsigned long mad_bit_read(struct mad_bitptr *, unsigned int); 43 | void mad_bit_write(struct mad_bitptr *, unsigned int, unsigned long); 44 | 45 | unsigned short mad_bit_crc(struct mad_bitptr, unsigned int, unsigned short); 46 | 47 | # endif 48 | -------------------------------------------------------------------------------- /ThirdParty/LibMAD/inc/global.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libmad - MPEG audio decoder library 3 | * Copyright (C) 2000-2004 Underbit Technologies, Inc. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | * 19 | * $Id: global.h,v 1.11 2004/01/23 09:41:32 rob Exp $ 20 | */ 21 | 22 | # ifndef LIBMAD_GLOBAL_H 23 | # define LIBMAD_GLOBAL_H 24 | 25 | /* conditional debugging */ 26 | 27 | # if defined(DEBUG) && defined(NDEBUG) 28 | # error "cannot define both DEBUG and NDEBUG" 29 | # endif 30 | 31 | # if defined(DEBUG) 32 | # include 33 | # endif 34 | 35 | /* conditional features */ 36 | 37 | # if defined(OPT_SPEED) && defined(OPT_ACCURACY) 38 | # error "cannot optimize for both speed and accuracy" 39 | # endif 40 | 41 | # if defined(OPT_SPEED) && !defined(OPT_SSO) 42 | # define OPT_SSO 43 | # endif 44 | 45 | # if defined(HAVE_UNISTD_H) && defined(HAVE_WAITPID) && \ 46 | defined(HAVE_FCNTL) && defined(HAVE_PIPE) && defined(HAVE_FORK) 47 | # define USE_ASYNC 48 | # endif 49 | 50 | # if !defined(HAVE_ASSERT_H) 51 | # if defined(NDEBUG) 52 | # define assert(x) /* nothing */ 53 | # else 54 | # define assert(x) //do { if (!(x)) abort(); } while (0) 55 | # endif 56 | # endif 57 | 58 | # endif 59 | -------------------------------------------------------------------------------- /ThirdParty/LibMAD/inc/layer12.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libmad - MPEG audio decoder library 3 | * Copyright (C) 2000-2004 Underbit Technologies, Inc. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | * 19 | * $Id: layer12.h,v 1.10 2004/01/23 09:41:32 rob Exp $ 20 | */ 21 | 22 | # ifndef LIBMAD_LAYER12_H 23 | # define LIBMAD_LAYER12_H 24 | 25 | # include "stream.h" 26 | # include "frame.h" 27 | 28 | int mad_layer_I(struct mad_stream *, struct mad_frame *); 29 | int mad_layer_II(struct mad_stream *, struct mad_frame *); 30 | 31 | # endif 32 | -------------------------------------------------------------------------------- /ThirdParty/LibMAD/inc/layer3.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libmad - MPEG audio decoder library 3 | * Copyright (C) 2000-2004 Underbit Technologies, Inc. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | * 19 | * $Id: layer3.h,v 1.10 2004/01/23 09:41:32 rob Exp $ 20 | */ 21 | 22 | # ifndef LIBMAD_LAYER3_H 23 | # define LIBMAD_LAYER3_H 24 | 25 | # include "stream.h" 26 | # include "frame.h" 27 | 28 | int mad_layer_III(struct mad_stream *, struct mad_frame *); 29 | 30 | # endif 31 | -------------------------------------------------------------------------------- /ThirdParty/LibMAD/inc/mad.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libmad - MPEG audio decoder library 3 | * Copyright (C) 2000-2004 Underbit Technologies, Inc. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | * 19 | * If you would like to negotiate alternate licensing terms, you may do 20 | * so by contacting: Underbit Technologies, Inc. 21 | */ 22 | 23 | # ifdef __cplusplus 24 | extern "C" { 25 | # endif 26 | 27 | // #define free free_dbg 28 | // #define malloc malloc_dbg 29 | // #define calloc calloc_dbg 30 | 31 | #ifndef __WINS__ // This only works on target machine 32 | # define FPM_ARM 33 | //# define OPT_SPEED 34 | //# define FPM_DEFAULT 35 | #else // working on emulator 36 | # define FPM_DEFAULT 37 | //# define FPM_INTEL 38 | #endif 39 | 40 | 41 | 42 | # define SIZEOF_INT 4 43 | # define SIZEOF_LONG 4 44 | # define SIZEOF_LONG_LONG 1 45 | 46 | #include "decoder.h" 47 | 48 | 49 | # ifdef __cplusplus 50 | } 51 | # endif 52 | -------------------------------------------------------------------------------- /ThirdParty/LibMAD/inc/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libmad - MPEG audio decoder library 3 | * Copyright (C) 2000-2004 Underbit Technologies, Inc. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | * 19 | * $Id: version.h,v 1.26 2004/01/23 09:41:33 rob Exp $ 20 | */ 21 | 22 | # ifndef LIBMAD_VERSION_H 23 | # define LIBMAD_VERSION_H 24 | 25 | # define MAD_VERSION_MAJOR 0 26 | # define MAD_VERSION_MINOR 15 27 | # define MAD_VERSION_PATCH 1 28 | # define MAD_VERSION_EXTRA " (beta)" 29 | 30 | # define MAD_VERSION_STRINGIZE(str) #str 31 | # define MAD_VERSION_STRING(num) MAD_VERSION_STRINGIZE(num) 32 | 33 | # define MAD_VERSION MAD_VERSION_STRING(MAD_VERSION_MAJOR) "." \ 34 | MAD_VERSION_STRING(MAD_VERSION_MINOR) "." \ 35 | MAD_VERSION_STRING(MAD_VERSION_PATCH) \ 36 | MAD_VERSION_EXTRA 37 | 38 | # define MAD_PUBLISHYEAR "2000-2004" 39 | # define MAD_AUTHOR "Underbit Technologies, Inc." 40 | # define MAD_EMAIL "info@underbit.com" 41 | 42 | extern char const mad_version[]; 43 | extern char const mad_copyright[]; 44 | extern char const mad_author[]; 45 | extern char const mad_build[]; 46 | 47 | # endif 48 | -------------------------------------------------------------------------------- /ThirdParty/LibMAD/src/MP3Func.c: -------------------------------------------------------------------------------- 1 | 2 | #include "fixed.h" 3 | 4 | //------------------------------------------------------------------------------ 5 | // Function Name : MP3FixedToShort 6 | // Description : MP3FixedToShort 7 | // Input : None 8 | // Output : None 9 | // Return : None 10 | //------------------------------------------------------------------------------ 11 | signed int MP3FixedToShort(mad_fixed_t sample) 12 | { 13 | /* round */ 14 | sample += (1L << (MAD_F_FRACBITS - 16)); 15 | 16 | /* clip */ 17 | if (sample >= MAD_F_ONE) 18 | sample = MAD_F_ONE - 1; 19 | else if (sample < -MAD_F_ONE) 20 | sample = -MAD_F_ONE; 21 | 22 | /* quantize */ 23 | return sample >> (MAD_F_FRACBITS + 1 - 16); 24 | } 25 | -------------------------------------------------------------------------------- /ThirdParty/lwip-1.4.1/CHANGELOG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NonOS_BSP/06781c680e62121cdd70e8857129204d61c65aae/ThirdParty/lwip-1.4.1/CHANGELOG -------------------------------------------------------------------------------- /ThirdParty/lwip-1.4.1/COPYING: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, 2002 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | 33 | 34 | -------------------------------------------------------------------------------- /ThirdParty/lwip-1.4.1/FILES: -------------------------------------------------------------------------------- 1 | src/ - The source code for the lwIP TCP/IP stack. 2 | doc/ - The documentation for lwIP. 3 | 4 | See also the FILES file in each subdirectory. 5 | -------------------------------------------------------------------------------- /ThirdParty/lwip-1.4.1/doc/FILES: -------------------------------------------------------------------------------- 1 | savannah.txt - How to obtain the current development source code. 2 | contrib.txt - How to contribute to lwIP as a developer. 3 | rawapi.txt - The documentation for the core API of lwIP. 4 | Also provides an overview about the other APIs and multithreading. 5 | snmp_agent.txt - The documentation for the lwIP SNMP agent. 6 | sys_arch.txt - The documentation for a system abstraction layer of lwIP. 7 | -------------------------------------------------------------------------------- /ThirdParty/lwip-1.4.1/src/FILES: -------------------------------------------------------------------------------- 1 | api/ - The code for the high-level wrapper API. Not needed if 2 | you use the lowel-level call-back/raw API. 3 | 4 | core/ - The core of the TPC/IP stack; protocol implementations, 5 | memory and buffer management, and the low-level raw API. 6 | 7 | include/ - lwIP include files. 8 | 9 | netif/ - Generic network interface device drivers are kept here, 10 | as well as the ARP module. 11 | 12 | For more information on the various subdirectories, check the FILES 13 | file in each directory. 14 | -------------------------------------------------------------------------------- /ThirdParty/lwip-1.4.1/src/core/ipv4/inet.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * Functions common to all TCP/IPv4 modules, such as the byte order functions. 4 | * 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Adam Dunkels 36 | * 37 | */ 38 | 39 | #include "lwip/opt.h" 40 | 41 | #include "lwip/inet.h" 42 | 43 | -------------------------------------------------------------------------------- /ThirdParty/lwip-1.4.1/src/core/ipv6/README: -------------------------------------------------------------------------------- 1 | IPv6 support in lwIP is very experimental. 2 | -------------------------------------------------------------------------------- /ThirdParty/lwip-1.4.1/src/include/posix/netdb.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * This file is a posix wrapper for lwip/netdb.h. 4 | */ 5 | 6 | /* 7 | * Redistribution and use in source and binary forms, with or without modification, 8 | * are permitted provided that the following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 3. The name of the author may not be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 21 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 23 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 26 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 27 | * OF SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | */ 32 | 33 | #include "lwip/netdb.h" 34 | -------------------------------------------------------------------------------- /ThirdParty/lwip-1.4.1/src/include/posix/sys/socket.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * This file is a posix wrapper for lwip/sockets.h. 4 | */ 5 | 6 | /* 7 | * Redistribution and use in source and binary forms, with or without modification, 8 | * are permitted provided that the following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 3. The name of the author may not be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 21 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 23 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 26 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 27 | * OF SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | */ 32 | 33 | #include "lwip/sockets.h" 34 | -------------------------------------------------------------------------------- /ThirdParty/lwip-1.4.1/src/netif/FILES: -------------------------------------------------------------------------------- 1 | This directory contains generic network interface device drivers that 2 | do not contain any hardware or architecture specific code. The files 3 | are: 4 | 5 | etharp.c 6 | Implements the ARP (Address Resolution Protocol) over 7 | Ethernet. The code in this file should be used together with 8 | Ethernet device drivers. Note that this module has been 9 | largely made Ethernet independent so you should be able to 10 | adapt this for other link layers (such as Firewire). 11 | 12 | ethernetif.c 13 | An example of how an Ethernet device driver could look. This 14 | file can be used as a "skeleton" for developing new Ethernet 15 | network device drivers. It uses the etharp.c ARP code. 16 | 17 | loopif.c 18 | A "loopback" network interface driver. It requires configuration 19 | through the define LWIP_LOOPIF_MULTITHREADING (see opt.h). 20 | 21 | slipif.c 22 | A generic implementation of the SLIP (Serial Line IP) 23 | protocol. It requires a sio (serial I/O) module to work. 24 | 25 | ppp/ Point-to-Point Protocol stack 26 | The PPP stack has been ported from ucip (http://ucip.sourceforge.net). 27 | It matches quite well to pppd 2.3.1 (http://ppp.samba.org), although 28 | compared to that, it has some modifications for embedded systems and 29 | the source code has been reordered a bit. -------------------------------------------------------------------------------- /ThirdParty/lwip-1.4.1/test/unit/core/test_mem.c: -------------------------------------------------------------------------------- 1 | #include "test_mem.h" 2 | 3 | #include "lwip/mem.h" 4 | #include "lwip/stats.h" 5 | 6 | #if !LWIP_STATS || !MEM_STATS 7 | #error "This tests needs MEM-statistics enabled" 8 | #endif 9 | #if LWIP_DNS 10 | #error "This test needs DNS turned off (as it mallocs on init)" 11 | #endif 12 | 13 | /* Setups/teardown functions */ 14 | 15 | static void 16 | mem_setup(void) 17 | { 18 | } 19 | 20 | static void 21 | mem_teardown(void) 22 | { 23 | } 24 | 25 | 26 | /* Test functions */ 27 | 28 | /** Call mem_malloc, mem_free and mem_trim and check stats */ 29 | START_TEST(test_mem_one) 30 | { 31 | #define SIZE1 16 32 | #define SIZE1_2 12 33 | #define SIZE2 16 34 | void *p1, *p2; 35 | mem_size_t s1, s2; 36 | LWIP_UNUSED_ARG(_i); 37 | 38 | #if LWIP_DNS 39 | fail("This test needs DNS turned off (as it mallocs on init)"); 40 | #endif 41 | 42 | fail_unless(lwip_stats.mem.used == 0); 43 | 44 | p1 = mem_malloc(SIZE1); 45 | fail_unless(p1 != NULL); 46 | fail_unless(lwip_stats.mem.used >= SIZE1); 47 | s1 = lwip_stats.mem.used; 48 | 49 | p2 = mem_malloc(SIZE2); 50 | fail_unless(p2 != NULL); 51 | fail_unless(lwip_stats.mem.used >= SIZE2 + s1); 52 | s2 = lwip_stats.mem.used; 53 | 54 | mem_trim(p1, SIZE1_2); 55 | 56 | mem_free(p2); 57 | fail_unless(lwip_stats.mem.used <= s2 - SIZE2); 58 | 59 | mem_free(p1); 60 | fail_unless(lwip_stats.mem.used == 0); 61 | } 62 | END_TEST 63 | 64 | 65 | /** Create the suite including all tests for this module */ 66 | Suite * 67 | mem_suite(void) 68 | { 69 | TFun tests[] = { 70 | test_mem_one 71 | }; 72 | return create_suite("MEM", tests, sizeof(tests)/sizeof(TFun), mem_setup, mem_teardown); 73 | } 74 | -------------------------------------------------------------------------------- /ThirdParty/lwip-1.4.1/test/unit/core/test_mem.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_MEM_H__ 2 | #define __TEST_MEM_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite *mem_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /ThirdParty/lwip-1.4.1/test/unit/etharp/test_etharp.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_ETHARP_H__ 2 | #define __TEST_ETHARP_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite* etharp_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /ThirdParty/lwip-1.4.1/test/unit/lwip_check.h: -------------------------------------------------------------------------------- 1 | #ifndef __LWIP_CHECK_H__ 2 | #define __LWIP_CHECK_H__ 3 | 4 | /* Common header file for lwIP unit tests using the check framework */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #define FAIL_RET() do { fail(); return; } while(0) 11 | #define EXPECT(x) fail_unless(x) 12 | #define EXPECT_RET(x) do { fail_unless(x); if(!(x)) { return; }} while(0) 13 | #define EXPECT_RETX(x, y) do { fail_unless(x); if(!(x)) { return y; }} while(0) 14 | #define EXPECT_RETNULL(x) EXPECT_RETX(x, NULL) 15 | 16 | /** typedef for a function returning a test suite */ 17 | typedef Suite* (suite_getter_fn)(void); 18 | 19 | /** Create a test suite */ 20 | static Suite* create_suite(const char* name, TFun *tests, size_t num_tests, SFun setup, SFun teardown) 21 | { 22 | size_t i; 23 | Suite *s = suite_create(name); 24 | 25 | for(i = 0; i < num_tests; i++) { 26 | /* Core test case */ 27 | TCase *tc_core = tcase_create("Core"); 28 | if ((setup != NULL) || (teardown != NULL)) { 29 | tcase_add_checked_fixture(tc_core, setup, teardown); 30 | } 31 | tcase_add_test(tc_core, tests[i]); 32 | suite_add_tcase(s, tc_core); 33 | } 34 | return s; 35 | } 36 | 37 | #endif /* __LWIP_CHECK_H__ */ 38 | -------------------------------------------------------------------------------- /ThirdParty/lwip-1.4.1/test/unit/lwip_unittests.c: -------------------------------------------------------------------------------- 1 | #include "lwip_check.h" 2 | 3 | #include "udp/test_udp.h" 4 | #include "tcp/test_tcp.h" 5 | #include "tcp/test_tcp_oos.h" 6 | #include "core/test_mem.h" 7 | #include "etharp/test_etharp.h" 8 | 9 | #include "lwip/init.h" 10 | 11 | 12 | int main() 13 | { 14 | int number_failed; 15 | SRunner *sr; 16 | size_t i; 17 | suite_getter_fn* suites[] = { 18 | udp_suite, 19 | tcp_suite, 20 | tcp_oos_suite, 21 | mem_suite, 22 | etharp_suite 23 | }; 24 | size_t num = sizeof(suites)/sizeof(void*); 25 | LWIP_ASSERT("No suites defined", num > 0); 26 | 27 | lwip_init(); 28 | 29 | sr = srunner_create((suites[0])()); 30 | for(i = 1; i < num; i++) { 31 | srunner_add_suite(sr, ((suite_getter_fn*)suites[i])()); 32 | } 33 | 34 | #ifdef LWIP_UNITTESTS_NOFORK 35 | srunner_set_fork_status(sr, CK_NOFORK); 36 | #endif 37 | #ifdef LWIP_UNITTESTS_FORK 38 | srunner_set_fork_status(sr, CK_FORK); 39 | #endif 40 | 41 | srunner_run_all(sr, CK_NORMAL); 42 | number_failed = srunner_ntests_failed(sr); 43 | srunner_free(sr); 44 | return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 45 | } 46 | -------------------------------------------------------------------------------- /ThirdParty/lwip-1.4.1/test/unit/tcp/tcp_helper.h: -------------------------------------------------------------------------------- 1 | #ifndef __TCP_HELPER_H__ 2 | #define __TCP_HELPER_H__ 3 | 4 | #include "../lwip_check.h" 5 | #include "lwip/arch.h" 6 | #include "lwip/tcp.h" 7 | #include "lwip/netif.h" 8 | 9 | /* counters used for test_tcp_counters_* callback functions */ 10 | struct test_tcp_counters { 11 | u32_t recv_calls; 12 | u32_t recved_bytes; 13 | u32_t recv_calls_after_close; 14 | u32_t recved_bytes_after_close; 15 | u32_t close_calls; 16 | u32_t err_calls; 17 | err_t last_err; 18 | char* expected_data; 19 | u32_t expected_data_len; 20 | }; 21 | 22 | struct test_tcp_txcounters { 23 | u32_t num_tx_calls; 24 | u32_t num_tx_bytes; 25 | u8_t copy_tx_packets; 26 | struct pbuf *tx_packets; 27 | }; 28 | 29 | /* Helper functions */ 30 | void tcp_remove_all(void); 31 | 32 | struct pbuf* tcp_create_segment(ip_addr_t* src_ip, ip_addr_t* dst_ip, 33 | u16_t src_port, u16_t dst_port, void* data, size_t data_len, 34 | u32_t seqno, u32_t ackno, u8_t headerflags); 35 | struct pbuf* tcp_create_rx_segment(struct tcp_pcb* pcb, void* data, size_t data_len, 36 | u32_t seqno_offset, u32_t ackno_offset, u8_t headerflags); 37 | struct pbuf* tcp_create_rx_segment_wnd(struct tcp_pcb* pcb, void* data, size_t data_len, 38 | u32_t seqno_offset, u32_t ackno_offset, u8_t headerflags, u16_t wnd); 39 | void tcp_set_state(struct tcp_pcb* pcb, enum tcp_state state, ip_addr_t* local_ip, 40 | ip_addr_t* remote_ip, u16_t local_port, u16_t remote_port); 41 | void test_tcp_counters_err(void* arg, err_t err); 42 | err_t test_tcp_counters_recv(void* arg, struct tcp_pcb* pcb, struct pbuf* p, err_t err); 43 | 44 | struct tcp_pcb* test_tcp_new_counters_pcb(struct test_tcp_counters* counters); 45 | 46 | void test_tcp_input(struct pbuf *p, struct netif *inp); 47 | 48 | void test_tcp_init_netif(struct netif *netif, struct test_tcp_txcounters *txcounters, 49 | ip_addr_t *ip_addr, ip_addr_t *netmask); 50 | 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /ThirdParty/lwip-1.4.1/test/unit/tcp/test_tcp.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_TCP_H__ 2 | #define __TEST_TCP_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite *tcp_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /ThirdParty/lwip-1.4.1/test/unit/tcp/test_tcp_oos.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_TCP_OOS_H__ 2 | #define __TEST_TCP_OOS_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite *tcp_oos_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /ThirdParty/lwip-1.4.1/test/unit/udp/test_udp.c: -------------------------------------------------------------------------------- 1 | #include "test_udp.h" 2 | 3 | #include "lwip/udp.h" 4 | #include "lwip/stats.h" 5 | 6 | #if !LWIP_STATS || !UDP_STATS || !MEMP_STATS 7 | #error "This tests needs UDP- and MEMP-statistics enabled" 8 | #endif 9 | 10 | /* Helper functions */ 11 | static void 12 | udp_remove_all(void) 13 | { 14 | struct udp_pcb *pcb = udp_pcbs; 15 | struct udp_pcb *pcb2; 16 | 17 | while(pcb != NULL) { 18 | pcb2 = pcb; 19 | pcb = pcb->next; 20 | udp_remove(pcb2); 21 | } 22 | fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 0); 23 | } 24 | 25 | /* Setups/teardown functions */ 26 | 27 | static void 28 | udp_setup(void) 29 | { 30 | udp_remove_all(); 31 | } 32 | 33 | static void 34 | udp_teardown(void) 35 | { 36 | udp_remove_all(); 37 | } 38 | 39 | 40 | /* Test functions */ 41 | 42 | START_TEST(test_udp_new_remove) 43 | { 44 | struct udp_pcb* pcb; 45 | LWIP_UNUSED_ARG(_i); 46 | 47 | fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 0); 48 | 49 | pcb = udp_new(); 50 | fail_unless(pcb != NULL); 51 | if (pcb != NULL) { 52 | fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 1); 53 | udp_remove(pcb); 54 | fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 0); 55 | } 56 | } 57 | END_TEST 58 | 59 | 60 | /** Create the suite including all tests for this module */ 61 | Suite * 62 | udp_suite(void) 63 | { 64 | TFun tests[] = { 65 | test_udp_new_remove, 66 | }; 67 | return create_suite("UDP", tests, sizeof(tests)/sizeof(TFun), udp_setup, udp_teardown); 68 | } 69 | -------------------------------------------------------------------------------- /ThirdParty/lwip-1.4.1/test/unit/udp/test_udp.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_UDP_H__ 2 | #define __TEST_UDP_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite* udp_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for YAFFS direct test 2 | # 3 | # 4 | # YAFFS: Yet another Flash File System. A NAND-flash specific file system. 5 | # 6 | # Copyright (C) 2003 Aleph One Ltd. 7 | # 8 | # 9 | # Created by Charles Manning 10 | # 11 | # SPDX-License-Identifier: GPL-2.0 12 | # 13 | 14 | obj-y := \ 15 | yaffs_allocator.o yaffs_attribs.o yaffs_bitmap.o yaffs_uboot_glue.o\ 16 | yaffs_checkptrw.o yaffs_ecc.o yaffs_error.o \ 17 | yaffsfs.o yaffs_guts.o yaffs_nameval.o yaffs_nand.o\ 18 | yaffs_packedtags1.o yaffs_packedtags2.o yaffs_qsort.o \ 19 | yaffs_summary.o yaffs_tagscompat.o yaffs_verify.o yaffs_yaffs1.o \ 20 | yaffs_yaffs2.o yaffs_mtdif.o yaffs_mtdif2.o 21 | 22 | ccflags-y = -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_SHORT_NAMES_IN_RAM \ 23 | -DCONFIG_YAFFS_YAFFS2 -DNO_Y_INLINE \ 24 | -DCONFIG_YAFFS_PROVIDE_DEFS -DCONFIG_YAFFSFS_PROVIDE_VALUES 25 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/ctype.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2000 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | * 5 | * SPDX-License-Identifier: GPL-2.0+ 6 | */ 7 | 8 | /* 9 | * linux/lib/ctype.c 10 | * 11 | * Copyright (C) 1991, 1992 Linus Torvalds 12 | */ 13 | 14 | #include 15 | 16 | const unsigned char _ctype[] = { 17 | _C,_C,_C,_C,_C,_C,_C,_C, /* 0-7 */ 18 | _C,_C|_S,_C|_S,_C|_S,_C|_S,_C|_S,_C,_C, /* 8-15 */ 19 | _C,_C,_C,_C,_C,_C,_C,_C, /* 16-23 */ 20 | _C,_C,_C,_C,_C,_C,_C,_C, /* 24-31 */ 21 | _S|_SP,_P,_P,_P,_P,_P,_P,_P, /* 32-39 */ 22 | _P,_P,_P,_P,_P,_P,_P,_P, /* 40-47 */ 23 | _D,_D,_D,_D,_D,_D,_D,_D, /* 48-55 */ 24 | _D,_D,_P,_P,_P,_P,_P,_P, /* 56-63 */ 25 | _P,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U, /* 64-71 */ 26 | _U,_U,_U,_U,_U,_U,_U,_U, /* 72-79 */ 27 | _U,_U,_U,_U,_U,_U,_U,_U, /* 80-87 */ 28 | _U,_U,_U,_P,_P,_P,_P,_P, /* 88-95 */ 29 | _P,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L, /* 96-103 */ 30 | _L,_L,_L,_L,_L,_L,_L,_L, /* 104-111 */ 31 | _L,_L,_L,_L,_L,_L,_L,_L, /* 112-119 */ 32 | _L,_L,_L,_P,_P,_P,_P,_C, /* 120-127 */ 33 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 128-143 */ 34 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 144-159 */ 35 | _S|_SP,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P, /* 160-175 */ 36 | _P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P, /* 176-191 */ 37 | _U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U, /* 192-207 */ 38 | _U,_U,_U,_U,_U,_U,_U,_P,_U,_U,_U,_U,_U,_U,_U,_L, /* 208-223 */ 39 | _L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L, /* 224-239 */ 40 | _L,_L,_L,_L,_L,_L,_L,_P,_L,_L,_L,_L,_L,_L,_L,_L}; /* 240-255 */ 41 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/asm-generic/bitops/__ffs.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_GENERIC_BITOPS___FFS_H_ 2 | #define _ASM_GENERIC_BITOPS___FFS_H_ 3 | 4 | #include 5 | 6 | /** 7 | * __ffs - find first bit in word. 8 | * @word: The word to search 9 | * 10 | * Undefined if no bit exists, so code should check against 0 first. 11 | */ 12 | static __inline unsigned long __ffs(unsigned long word) 13 | { 14 | int num = 0; 15 | 16 | #if BITS_PER_LONG == 64 17 | if ((word & 0xffffffff) == 0) { 18 | num += 32; 19 | word >>= 32; 20 | } 21 | #endif 22 | if ((word & 0xffff) == 0) { 23 | num += 16; 24 | word >>= 16; 25 | } 26 | if ((word & 0xff) == 0) { 27 | num += 8; 28 | word >>= 8; 29 | } 30 | if ((word & 0xf) == 0) { 31 | num += 4; 32 | word >>= 4; 33 | } 34 | if ((word & 0x3) == 0) { 35 | num += 2; 36 | word >>= 2; 37 | } 38 | if ((word & 0x1) == 0) 39 | num += 1; 40 | return num; 41 | } 42 | 43 | #endif /* _ASM_GENERIC_BITOPS___FFS_H_ */ 44 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/asm-generic/bitops/__fls.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_GENERIC_BITOPS___FLS_H_ 2 | #define _ASM_GENERIC_BITOPS___FLS_H_ 3 | 4 | #include 5 | 6 | /** 7 | * __fls - find last (most-significant) set bit in a long word 8 | * @word: the word to search 9 | * 10 | * Undefined if no set bit exists, so code should check against 0 first. 11 | */ 12 | static __inline unsigned long __fls(unsigned long word) 13 | { 14 | int num = BITS_PER_LONG - 1; 15 | 16 | #if BITS_PER_LONG == 64 17 | if (!(word & (~0ul << 32))) { 18 | num -= 32; 19 | word <<= 32; 20 | } 21 | #endif 22 | if (!(word & (~0ul << (BITS_PER_LONG-16)))) { 23 | num -= 16; 24 | word <<= 16; 25 | } 26 | if (!(word & (~0ul << (BITS_PER_LONG-8)))) { 27 | num -= 8; 28 | word <<= 8; 29 | } 30 | if (!(word & (~0ul << (BITS_PER_LONG-4)))) { 31 | num -= 4; 32 | word <<= 4; 33 | } 34 | if (!(word & (~0ul << (BITS_PER_LONG-2)))) { 35 | num -= 2; 36 | word <<= 2; 37 | } 38 | if (!(word & (~0ul << (BITS_PER_LONG-1)))) 39 | num -= 1; 40 | return num; 41 | } 42 | 43 | #endif /* _ASM_GENERIC_BITOPS___FLS_H_ */ 44 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/asm-generic/bitops/fls.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_GENERIC_BITOPS_FLS_H_ 2 | #define _ASM_GENERIC_BITOPS_FLS_H_ 3 | 4 | /** 5 | * fls - find last (most-significant) bit set 6 | * @x: the word to search 7 | * 8 | * This is defined the same way as ffs. 9 | * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32. 10 | */ 11 | 12 | static __inline int fls(int x) 13 | { 14 | int r = 32; 15 | 16 | if (!x) 17 | return 0; 18 | if (!(x & 0xffff0000u)) { 19 | x <<= 16; 20 | r -= 16; 21 | } 22 | if (!(x & 0xff000000u)) { 23 | x <<= 8; 24 | r -= 8; 25 | } 26 | if (!(x & 0xf0000000u)) { 27 | x <<= 4; 28 | r -= 4; 29 | } 30 | if (!(x & 0xc0000000u)) { 31 | x <<= 2; 32 | r -= 2; 33 | } 34 | if (!(x & 0x80000000u)) { 35 | x <<= 1; 36 | r -= 1; 37 | } 38 | return r; 39 | } 40 | 41 | #endif /* _ASM_GENERIC_BITOPS_FLS_H_ */ 42 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/asm-generic/bitops/fls64.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_GENERIC_BITOPS_FLS64_H_ 2 | #define _ASM_GENERIC_BITOPS_FLS64_H_ 3 | 4 | #include 5 | 6 | /** 7 | * fls64 - find last set bit in a 64-bit word 8 | * @x: the word to search 9 | * 10 | * This is defined in a similar way as the libc and compiler builtin 11 | * ffsll, but returns the position of the most significant set bit. 12 | * 13 | * fls64(value) returns 0 if value is 0 or the position of the last 14 | * set bit if value is nonzero. The last (most significant) bit is 15 | * at position 64. 16 | */ 17 | #if BITS_PER_LONG == 32 18 | static __inline int fls64(__u64 x) 19 | { 20 | __u32 h = x >> 32; 21 | if (h) 22 | return fls(h) + 32; 23 | return fls(x); 24 | } 25 | #elif BITS_PER_LONG == 64 26 | static __always_inline int fls64(__u64 x) 27 | { 28 | if (x == 0) 29 | return 0; 30 | return __fls(x) + 1; 31 | } 32 | #else 33 | #error BITS_PER_LONG not 32 or 64 34 | #endif 35 | 36 | #endif /* _ASM_GENERIC_BITOPS_FLS64_H_ */ 37 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/asm-offsets.h: -------------------------------------------------------------------------------- 1 | #ifndef DO_DEPS_ONLY 2 | 3 | #include 4 | /* #include */ 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/asm/barriers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 ARM Ltd. 3 | * 4 | * ARM and ARM64 barrier instructions 5 | * split from armv7.h to allow sharing between ARM and ARM64 6 | * 7 | * Original copyright in armv7.h was: 8 | * (C) Copyright 2010 Texas Instruments, Aneesh V 9 | * 10 | * Much of the original barrier code was contributed by: 11 | * Valentine Barshak 12 | * 13 | * SPDX-License-Identifier: GPL-2.0+ 14 | */ 15 | #ifndef __BARRIERS_H__ 16 | #define __BARRIERS_H__ 17 | 18 | #ifndef __ASSEMBLY__ 19 | 20 | #ifndef CONFIG_ARM64 21 | /* 22 | * CP15 Barrier instructions 23 | * Please note that we have separate barrier instructions in ARMv7 24 | * However, we use the CP15 based instructtions because we use 25 | * -march=armv5 in U-Boot 26 | */ 27 | #define CP15ISB asm volatile ("mcr p15, 0, %0, c7, c5, 4" : : "r" (0)) 28 | #define CP15DSB asm volatile ("mcr p15, 0, %0, c7, c10, 4" : : "r" (0)) 29 | #define CP15DMB asm volatile ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0)) 30 | 31 | #endif /* !CONFIG_ARM64 */ 32 | 33 | #if __LINUX_ARM_ARCH__ >= 7 34 | #define ISB asm volatile ("isb sy" : : : "memory") 35 | #define DSB asm volatile ("dsb sy" : : : "memory") 36 | #define DMB asm volatile ("dmb sy" : : : "memory") 37 | #elif __LINUX_ARM_ARCH__ == 6 38 | #define ISB CP15ISB 39 | #define DSB CP15DSB 40 | #define DMB CP15DMB 41 | #else 42 | #define ISB asm volatile ("" : : : "memory") 43 | #define DSB CP15DSB 44 | #define DMB asm volatile ("" : : : "memory") 45 | #endif 46 | 47 | #define isb() ISB 48 | #define dsb() DSB 49 | #define dmb() DMB 50 | #endif /* __ASSEMBLY__ */ 51 | #endif /* __BARRIERS_H__ */ 52 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/asm/byteorder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * linux/include/asm-arm/byteorder.h 3 | * 4 | * ARM Endian-ness. In little endian mode, the data bus is connected such 5 | * that byte accesses appear as: 6 | * 0 = d0...d7, 1 = d8...d15, 2 = d16...d23, 3 = d24...d31 7 | * and word accesses (data or instruction) appear as: 8 | * d0...d31 9 | * 10 | * When in big endian mode, byte accesses appear as: 11 | * 0 = d24...d31, 1 = d16...d23, 2 = d8...d15, 3 = d0...d7 12 | * and word accesses (data or instruction) appear as: 13 | * d0...d31 14 | */ 15 | #ifndef __ASM_ARM_BYTEORDER_H 16 | #define __ASM_ARM_BYTEORDER_H 17 | 18 | 19 | #include 20 | 21 | #if !defined(__STRICT_ANSI__) || defined(__KERNEL__) 22 | # define __BYTEORDER_HAS_U64__ 23 | # define __SWAB_64_THRU_32__ 24 | #endif 25 | 26 | #if defined(__ARMEB__) || defined(__AARCH64EB__) 27 | #include 28 | #else 29 | #include 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/asm/cache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2009 3 | * Marvell Semiconductor 4 | * Written-by: Prafulla Wadaskar 5 | * 6 | * SPDX-License-Identifier: GPL-2.0+ 7 | */ 8 | 9 | #ifndef _ASM_CACHE_H 10 | #define _ASM_CACHE_H 11 | 12 | #include 13 | 14 | #ifndef CONFIG_ARM64 15 | 16 | /* 17 | * Invalidate L2 Cache using co-proc instruction 18 | */ 19 | #ifdef CONFIG_SYS_THUMB_BUILD 20 | void invalidate_l2_cache(void); 21 | #else 22 | static __inline void invalidate_l2_cache(void) 23 | { 24 | // unsigned int val=0; 25 | 26 | // asm volatile("mcr p15, 1, %0, c15, c11, 0 @ invl l2 cache" 27 | // : : "r" (val) : "cc"); 28 | // isb(); 29 | } 30 | #endif 31 | 32 | int check_cache_range(unsigned long start, unsigned long stop); 33 | 34 | void l2_cache_enable(void); 35 | void l2_cache_disable(void); 36 | void set_section_dcache(int section, enum dcache_option option); 37 | 38 | void arm_init_before_mmu(void); 39 | void arm_init_domains(void); 40 | void cpu_cache_initialization(void); 41 | void dram_bank_mmu_setup(int bank); 42 | 43 | #endif 44 | 45 | /* 46 | * The value of the largest data cache relevant to DMA operations shall be set 47 | * for us in CONFIG_SYS_CACHELINE_SIZE. In some cases this may be a larger 48 | * value than found in the L1 cache but this is OK to use in terms of 49 | * alignment. 50 | */ 51 | #define ARCH_DMA_MINALIGN 32 /* CONFIG_SYS_CACHELINE_SIZE */ 52 | 53 | #endif /* _ASM_CACHE_H */ 54 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/asm/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Freescale Semiconductor, Inc. 3 | * 4 | * SPDX-License-Identifier: GPL-2.0+ 5 | */ 6 | 7 | #ifndef _ASM_CONFIG_H_ 8 | #define _ASM_CONFIG_H_ 9 | 10 | #define CONFIG_LMB 11 | #define CONFIG_SYS_BOOT_RAMDISK_HIGH 12 | 13 | #ifdef CONFIG_ARM64 14 | #define CONFIG_STATIC_RELA 15 | #endif 16 | 17 | #if defined(CONFIG_LS102XA) || \ 18 | defined(CONFIG_CPU_PXA27X) || \ 19 | defined(CONFIG_CPU_MONAHANS) || \ 20 | defined(CONFIG_CPU_PXA25X) || \ 21 | defined(CONFIG_FSL_LAYERSCAPE) 22 | #include 23 | #endif 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/asm/errno.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/asm/string.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_ARM_STRING_H 2 | #define __ASM_ARM_STRING_H 3 | 4 | #include 5 | 6 | /* 7 | * We don't do inline string functions, since the 8 | * optimised inline asm versions are not small. 9 | */ 10 | 11 | #undef __HAVE_ARCH_STRRCHR 12 | extern char * strrchr(const char * s, int c); 13 | 14 | #undef __HAVE_ARCH_STRCHR 15 | extern char * strchr(const char * s, int c); 16 | 17 | #ifdef CONFIG_USE_ARCH_MEMCPY 18 | #define __HAVE_ARCH_MEMCPY 19 | #endif 20 | extern void * memcpy(void *, const void *, __kernel_size_t); 21 | 22 | #undef __HAVE_ARCH_MEMMOVE 23 | extern void * memmove(void *, const void *, __kernel_size_t); 24 | 25 | #undef __HAVE_ARCH_MEMCHR 26 | extern void * memchr(const void *, int, __kernel_size_t); 27 | 28 | #undef __HAVE_ARCH_MEMZERO 29 | #ifdef CONFIG_USE_ARCH_MEMSET 30 | #define __HAVE_ARCH_MEMSET 31 | #endif 32 | extern void * memset(void *, int, __kernel_size_t); 33 | 34 | #if 0 35 | extern void __memzero(void *ptr, __kernel_size_t n); 36 | 37 | #define memset(p,v,n) \ 38 | ({ \ 39 | if ((n) != 0) { \ 40 | if (__builtin_constant_p((v)) && (v) == 0) \ 41 | __memzero((p),(n)); \ 42 | else \ 43 | memset((p),(v),(n)); \ 44 | } \ 45 | (p); \ 46 | }) 47 | 48 | #define memzero(p,n) ({ if ((n) != 0) __memzero((p),(n)); (p); }) 49 | #else 50 | extern void memzero(void *ptr, __kernel_size_t n); 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/asm/types.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_ARM_TYPES_H 2 | #define __ASM_ARM_TYPES_H 3 | 4 | typedef unsigned short umode_t; 5 | 6 | /* 7 | * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the 8 | * header files exported to user space 9 | */ 10 | 11 | typedef char __s8; 12 | typedef unsigned char __u8; 13 | 14 | typedef short __s16; 15 | typedef unsigned short __u16; 16 | 17 | typedef int __s32; 18 | typedef unsigned int __u32; 19 | 20 | typedef long long __s64; 21 | typedef unsigned long long __u64; 22 | 23 | #if defined(__GNUC__) 24 | __extension__ typedef __signed__ long long __s64; 25 | __extension__ typedef unsigned long long __u64; 26 | #endif 27 | 28 | /* 29 | * These aren't exported outside the kernel to avoid name space clashes 30 | */ 31 | // #ifdef __KERNEL__ 32 | 33 | typedef signed char s8; 34 | typedef unsigned char u8; 35 | 36 | typedef signed short s16; 37 | typedef unsigned short u16; 38 | 39 | typedef signed int s32; 40 | typedef unsigned int u32; 41 | 42 | typedef signed long long s64; 43 | typedef unsigned long long u64; 44 | 45 | #ifdef CONFIG_ARM64 46 | #define BITS_PER_LONG 64 47 | #else /* CONFIG_ARM64 */ 48 | #define BITS_PER_LONG 32 49 | #endif /* CONFIG_ARM64 */ 50 | 51 | #ifdef CONFIG_PHYS_64BIT 52 | typedef unsigned long long phys_addr_t; 53 | typedef unsigned long long phys_size_t; 54 | #else 55 | /* DMA addresses are 32-bits wide */ 56 | typedef unsigned long phys_addr_t; 57 | typedef unsigned long phys_size_t; 58 | #endif 59 | 60 | /* 61 | * A dma_addr_t can hold any valid DMA address, i.e., any address returned 62 | * by the DMA API. 63 | * 64 | * If the DMA API only uses 32-bit addresses, dma_addr_t need only be 32 65 | * bits wide. Bus addresses, e.g., PCI BARs, may be wider than 32 bits, 66 | * but drivers do memory-mapped I/O to ioremapped kernel virtual addresses, 67 | * so they don't care about the size of the actual bus addresses. 68 | */ 69 | #ifdef CONFIG_DMA_ADDR_T_64BIT 70 | typedef unsigned long long dma_addr_t; 71 | #else 72 | typedef u32 dma_addr_t; 73 | #endif 74 | 75 | //#endif /* __KERNEL__ */ 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/div64.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_GENERIC_DIV64_H 2 | #define _ASM_GENERIC_DIV64_H 3 | /* 4 | * Copyright (C) 2003 Bernardo Innocenti 5 | * Based on former asm-ppc/div64.h and asm-m68knommu/div64.h 6 | * 7 | * The semantics of do_div() are: 8 | * 9 | * uint32_t do_div(uint64_t *n, uint32_t base) 10 | * { 11 | * uint32_t remainder = *n % base; 12 | * *n = *n / base; 13 | * return remainder; 14 | * } 15 | * 16 | * NOTE: macro parameter n is evaluated multiple times, 17 | * beware of side effects! 18 | */ 19 | #include 20 | #include "linux/types.h" 21 | 22 | extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor); 23 | 24 | /* The unnecessary pointer compare is there 25 | * to check for type safety (n must be 64bit) 26 | */ 27 | #define do_div(n,base) (n = n/base) 28 | 29 | #if 0 30 | # define do_div(n,base) ({ \ 31 | uint32_t __base = (base); \ 32 | uint32_t __rem; \ 33 | (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \ 34 | if (((n) >> 32) == 0) { \ 35 | __rem = (uint32_t)(n) % __base; \ 36 | (n) = (uint32_t)(n) / __base; \ 37 | } else \ 38 | __rem = __div64_32(&(n), __base); \ 39 | __rem; \ 40 | }) 41 | #endif 42 | 43 | /* Wrapper for do_div(). Doesn't modify dividend and returns 44 | * the result, not reminder. 45 | */ 46 | static __inline uint64_t lldiv(uint64_t dividend, uint32_t divisor) 47 | { 48 | uint64_t __res = dividend; 49 | do_div(__res, divisor); 50 | return(__res); 51 | } 52 | #endif /* _ASM_GENERIC_DIV64_H */ 53 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/errno.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Samsung Electronics 3 | * Przemyslaw Marczak 4 | * 5 | * SPDX-License-Identifier: GPL-2.0+ 6 | */ 7 | #ifndef _ERRNO_H 8 | #define _ERRNO_H 9 | 10 | #include 11 | 12 | extern int errno; 13 | 14 | #define __set_errno(val) do { errno = val; } while (0) 15 | 16 | #ifdef CONFIG_ERRNO_STR 17 | const char *errno_str(int errno); 18 | #else 19 | static inline const char *errno_str(int errno) 20 | { 21 | return 0; 22 | } 23 | #endif 24 | #endif /* _ERRNO_H */ 25 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/linux/crc32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * crc32.h 3 | * See linux/lib/crc32.c for license and changes 4 | */ 5 | #ifndef _LINUX_CRC32_H 6 | #define _LINUX_CRC32_H 7 | 8 | #include 9 | /* #include */ 10 | 11 | extern u32 crc32_le(u32 crc, unsigned char const *p, size_t len); 12 | /* extern u32 crc32_be(u32 crc, unsigned char const *p, size_t len); */ 13 | 14 | #define crc32(seed, data, length) crc32_le(seed, (unsigned char const *)data, length) 15 | 16 | /* 17 | * Helpers for hash table generation of ethernet nics: 18 | * 19 | * Ethernet sends the least significant bit of a byte first, thus crc32_le 20 | * is used. The output of crc32_le is bit reversed [most significant bit 21 | * is in bit nr 0], thus it must be reversed before use. Except for 22 | * nics that bit swap the result internally... 23 | */ 24 | /* #define ether_crc(length, data) bitrev32(crc32_le(~0, data, length)) */ 25 | /* #define ether_crc_le(length, data) crc32_le(~0, data, length) */ 26 | 27 | #endif /* _LINUX_CRC32_H */ 28 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/linux/ctype.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_CTYPE_H 2 | #define _LINUX_CTYPE_H 3 | 4 | /* 5 | * NOTE! This ctype does not handle EOF like the standard C 6 | * library is required to. 7 | */ 8 | 9 | #define _U 0x01 /* upper */ 10 | #define _L 0x02 /* lower */ 11 | #define _D 0x04 /* digit */ 12 | #define _C 0x08 /* cntrl */ 13 | #define _P 0x10 /* punct */ 14 | #define _S 0x20 /* white space (space/lf/tab) */ 15 | #define _X 0x40 /* hex digit */ 16 | #define _SP 0x80 /* hard space (0x20) */ 17 | 18 | extern const unsigned char _ctype[]; 19 | 20 | #define __ismask(x) (_ctype[(int)(unsigned char)(x)]) 21 | 22 | #define isalnum(c) ((__ismask(c)&(_U|_L|_D)) != 0) 23 | #define isalpha(c) ((__ismask(c)&(_U|_L)) != 0) 24 | #define iscntrl(c) ((__ismask(c)&(_C)) != 0) 25 | #define isdigit(c) ((__ismask(c)&(_D)) != 0) 26 | #define isgraph(c) ((__ismask(c)&(_P|_U|_L|_D)) != 0) 27 | #define islower(c) ((__ismask(c)&(_L)) != 0) 28 | #define isprint(c) ((__ismask(c)&(_P|_U|_L|_D|_SP)) != 0) 29 | #define ispunct(c) ((__ismask(c)&(_P)) != 0) 30 | #define isspace(c) ((__ismask(c)&(_S)) != 0) 31 | #define isupper(c) ((__ismask(c)&(_U)) != 0) 32 | #define isxdigit(c) ((__ismask(c)&(_D|_X)) != 0) 33 | 34 | /* 35 | * Rather than doubling the size of the _ctype lookup table to hold a 'blank' 36 | * flag, just check for space or tab. 37 | */ 38 | #define isblank(c) (c == ' ' || c == '\t') 39 | 40 | #define isascii(c) (((unsigned char)(c))<=0x7f) 41 | #define toascii(c) (((unsigned char)(c))&0x7f) 42 | 43 | static __inline unsigned char __tolower(unsigned char c) 44 | { 45 | if (isupper(c)) 46 | c -= 'A'-'a'; 47 | return c; 48 | } 49 | 50 | static __inline unsigned char __toupper(unsigned char c) 51 | { 52 | if (islower(c)) 53 | c -= 'a'-'A'; 54 | return c; 55 | } 56 | 57 | #define tolower(c) __tolower(c) 58 | #define toupper(c) __toupper(c) 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/linux/err.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_ERR_H 2 | #define _LINUX_ERR_H 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | 10 | /* 11 | * Kernel pointers have redundant information, so we can use a 12 | * scheme where we can return either an error code or a dentry 13 | * pointer with the same return value. 14 | * 15 | * This should be a per-architecture thing, to allow different 16 | * error and pointer decisions. 17 | */ 18 | #define MAX_ERRNO 4095 19 | 20 | #ifndef __ASSEMBLY__ 21 | 22 | #define IS_ERR_VALUE(x) ((x) >= (unsigned long)-MAX_ERRNO) 23 | 24 | static __inline void *ERR_PTR(long error) 25 | { 26 | return (void *) error; 27 | } 28 | 29 | static __inline long PTR_ERR(const void *ptr) 30 | { 31 | return (long) ptr; 32 | } 33 | 34 | static __inline long IS_ERR(const void *ptr) 35 | { 36 | return IS_ERR_VALUE((unsigned long)ptr); 37 | } 38 | 39 | /** 40 | * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type 41 | * @ptr: The pointer to cast. 42 | * 43 | * Explicitly cast an error-valued pointer to another pointer type in such a 44 | * way as to make it clear that's what's going on. 45 | */ 46 | //static inline void * __must_check ERR_CAST(__force const void *ptr) 47 | //{ 48 | // /* cast away the const */ 49 | // return (void *) ptr; 50 | //} 51 | 52 | #endif 53 | 54 | #endif /* _LINUX_ERR_H */ 55 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/linux/linux_string.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_LINUX_STRING_H_ 2 | #define _LINUX_LINUX_STRING_H_ 3 | 4 | extern char * skip_spaces(const char *); 5 | 6 | extern char *strim(char *); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/linux/mtd/concat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MTD device concatenation layer definitions 3 | * 4 | * Copyright © 2002 Robert Kaiser 5 | * 6 | * SPDX-License-Identifier: GPL-2.0+ 7 | * 8 | */ 9 | 10 | #ifndef MTD_CONCAT_H 11 | #define MTD_CONCAT_H 12 | 13 | struct mtd_info *mtd_concat_create( 14 | struct mtd_info *subdev[], /* subdevices to concatenate */ 15 | int num_devs, /* number of subdevices */ 16 | #ifndef __UBOOT__ 17 | const char *name); /* name for the new device */ 18 | #else 19 | char *name); /* name for the new device */ 20 | #endif 21 | 22 | void mtd_concat_destroy(struct mtd_info *mtd); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/linux/mtd/nand_bch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2011 Ivan Djelic 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License version 2 as 6 | * published by the Free Software Foundation. 7 | * 8 | * This file is the header for the NAND BCH ECC implementation. 9 | */ 10 | 11 | #ifndef __MTD_NAND_BCH_H__ 12 | #define __MTD_NAND_BCH_H__ 13 | 14 | struct mtd_info; 15 | struct nand_bch_control; 16 | 17 | #if defined(CONFIG_NAND_ECC_BCH) 18 | 19 | static inline int mtd_nand_has_bch(void) { return 1; } 20 | 21 | /* 22 | * Calculate BCH ecc code 23 | */ 24 | int nand_bch_calculate_ecc(struct mtd_info *mtd, const u_char *dat, 25 | u_char *ecc_code); 26 | 27 | /* 28 | * Detect and correct bit errors 29 | */ 30 | int nand_bch_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, 31 | u_char *calc_ecc); 32 | /* 33 | * Initialize BCH encoder/decoder 34 | */ 35 | struct nand_bch_control *nand_bch_init(struct mtd_info *mtd); 36 | /* 37 | * Release BCH encoder/decoder resources 38 | */ 39 | void nand_bch_free(struct nand_bch_control *nbc); 40 | 41 | #else /* !CONFIG_NAND_ECC_BCH */ 42 | 43 | static __inline int mtd_nand_has_bch(void) { return 0; } 44 | 45 | static __inline int 46 | nand_bch_calculate_ecc(struct mtd_info *mtd, const u_char *dat, 47 | u_char *ecc_code) 48 | { 49 | return -1; 50 | } 51 | 52 | static __inline int 53 | nand_bch_correct_data(struct mtd_info *mtd, unsigned char *buf, 54 | unsigned char *read_ecc, unsigned char *calc_ecc) 55 | { 56 | return -ENOTSUPP; 57 | } 58 | 59 | static __inline struct nand_bch_control *nand_bch_init(struct mtd_info *mtd) 60 | { 61 | return NULL; 62 | } 63 | 64 | static __inline void nand_bch_free(struct nand_bch_control *nbc) {} 65 | 66 | #endif /* CONFIG_NAND_ECC_BCH */ 67 | 68 | #endif /* __MTD_NAND_BCH_H__ */ 69 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/linux/mtd/nand_ecc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * drivers/mtd/nand_ecc.h 3 | * 4 | * Copyright (C) 2000-2010 Steven J. Hill 5 | * David Woodhouse 6 | * Thomas Gleixner 7 | * 8 | * SPDX-License-Identifier: GPL-2.0 9 | * 10 | * This file is the header for the ECC algorithm. 11 | */ 12 | 13 | #ifndef __MTD_NAND_ECC_H__ 14 | #define __MTD_NAND_ECC_H__ 15 | 16 | struct mtd_info; 17 | 18 | /* 19 | * Calculate 3 byte ECC code for 256 byte block 20 | */ 21 | int nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code); 22 | 23 | /* 24 | * Detect and correct a 1 bit error for 256 byte block 25 | */ 26 | int nand_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc); 27 | 28 | #endif /* __MTD_NAND_ECC_H__ */ 29 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/linux/poison.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_POISON_H 2 | #define _LINUX_POISON_H 3 | 4 | /********** include/linux/list.h **********/ 5 | /* 6 | * used to verify that nobody uses non-initialized list entries. 7 | */ 8 | #define LIST_POISON1 ((void *) 0x0) 9 | #define LIST_POISON2 ((void *) 0x0) 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/linux/posix_types.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_POSIX_TYPES_H 2 | #define _LINUX_POSIX_TYPES_H 3 | 4 | #include 5 | 6 | /* 7 | * This allows for 1024 file descriptors: if NR_OPEN is ever grown 8 | * beyond that you'll have to change this too. But 1024 fd's seem to be 9 | * enough even for such "real" unices like OSF/1, so hopefully this is 10 | * one limit that doesn't have to be changed [again]. 11 | * 12 | * Note that POSIX wants the FD_CLEAR(fd,fdsetp) defines to be in 13 | * (and thus ) - but this is a more logical 14 | * place for them. Solved by having dummy defines in . 15 | */ 16 | 17 | /* 18 | * Those macros may have been defined in . But we always 19 | * use the ones here. 20 | */ 21 | #undef __NFDBITS 22 | #define __NFDBITS (8 * sizeof(unsigned long)) 23 | 24 | #undef __FD_SETSIZE 25 | #define __FD_SETSIZE 1024 26 | 27 | #undef __FDSET_LONGS 28 | #define __FDSET_LONGS (__FD_SETSIZE/__NFDBITS) 29 | 30 | #undef __FDELT 31 | #define __FDELT(d) ((d) / __NFDBITS) 32 | 33 | #undef __FDMASK 34 | #define __FDMASK(d) (1UL << ((d) % __NFDBITS)) 35 | 36 | typedef struct { 37 | unsigned long fds_bits [__FDSET_LONGS]; 38 | } __kernel_fd_set; 39 | 40 | /* Type of a signal handler. */ 41 | typedef void (*__kernel_sighandler_t)(int); 42 | 43 | /* Type of a SYSV IPC key. */ 44 | typedef int __kernel_key_t; 45 | 46 | #include 47 | 48 | #endif /* _LINUX_POSIX_TYPES_H */ 49 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/linux/sizes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * include/linux/sizes.h 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License version 2 as 6 | * published by the Free Software Foundation. 7 | */ 8 | #ifndef __LINUX_SIZES_H__ 9 | #define __LINUX_SIZES_H__ 10 | 11 | #define SZ_1 0x00000001 12 | #define SZ_2 0x00000002 13 | #define SZ_4 0x00000004 14 | #define SZ_8 0x00000008 15 | #define SZ_16 0x00000010 16 | #define SZ_32 0x00000020 17 | #define SZ_64 0x00000040 18 | #define SZ_128 0x00000080 19 | #define SZ_256 0x00000100 20 | #define SZ_512 0x00000200 21 | 22 | #define SZ_1K 0x00000400 23 | #define SZ_2K 0x00000800 24 | #define SZ_4K 0x00001000 25 | #define SZ_8K 0x00002000 26 | #define SZ_16K 0x00004000 27 | #define SZ_32K 0x00008000 28 | #define SZ_64K 0x00010000 29 | #define SZ_128K 0x00020000 30 | #define SZ_256K 0x00040000 31 | #define SZ_512K 0x00080000 32 | 33 | #define SZ_1M 0x00100000 34 | #define SZ_2M 0x00200000 35 | #define SZ_4M 0x00400000 36 | #define SZ_8M 0x00800000 37 | #define SZ_16M 0x01000000 38 | #define SZ_32M 0x02000000 39 | #define SZ_64M 0x04000000 40 | #define SZ_128M 0x08000000 41 | #define SZ_256M 0x10000000 42 | #define SZ_512M 0x20000000 43 | 44 | #define SZ_1G 0x40000000 45 | #define SZ_2G 0x80000000 46 | 47 | #endif /* __LINUX_SIZES_H__ */ 48 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/include/linux/stddef.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_STDDEF_H 2 | #define _LINUX_STDDEF_H 3 | 4 | #undef NULL 5 | #if defined(__cplusplus) 6 | #define NULL 0 7 | #else 8 | #define NULL ((void *)0) 9 | #endif 10 | 11 | #ifndef _SIZE_T 12 | #include 13 | #endif 14 | 15 | #ifndef __CHECKER__ 16 | #undef offsetof 17 | #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/linux_string.c: -------------------------------------------------------------------------------- 1 | /* 2 | * linux/lib/string.c 3 | * 4 | * Copyright (C) 1991, 1992 Linus Torvalds 5 | */ 6 | 7 | #ifdef USE_HOSTCC 8 | #include 9 | #endif 10 | 11 | #include 12 | #include 13 | 14 | /** 15 | * skip_spaces - Removes leading whitespace from @str. 16 | * @str: The string to be stripped. 17 | * 18 | * Returns a pointer to the first non-whitespace character in @str. 19 | */ 20 | char *skip_spaces(const char *str) 21 | { 22 | while (isspace(*str)) 23 | ++str; 24 | return (char *)str; 25 | } 26 | 27 | /** 28 | * strim - Removes leading and trailing whitespace from @s. 29 | * @s: The string to be stripped. 30 | * 31 | * Note that the first trailing whitespace is replaced with a %NUL-terminator 32 | * in the given string @s. Returns a pointer to the first non-whitespace 33 | * character in @s. 34 | */ 35 | char *strim(char *s) 36 | { 37 | size_t size; 38 | char *end; 39 | 40 | s = skip_spaces(s); 41 | size = strlen(s); 42 | if (!size) 43 | return s; 44 | 45 | end = s + size - 1; 46 | while (end >= s && isspace(*end)) 47 | end--; 48 | *(end + 1) = '\0'; 49 | 50 | return s; 51 | } 52 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/mtdcore.h: -------------------------------------------------------------------------------- 1 | /* 2 | * These are exported solely for the purpose of mtd_blkdevs.c and mtdchar.c. 3 | * You should not use them for _anything_ else. 4 | */ 5 | 6 | extern struct mutex mtd_table_mutex; 7 | 8 | struct mtd_info *__mtd_next_device(int i); 9 | int add_mtd_device(struct mtd_info *mtd); 10 | int del_mtd_device(struct mtd_info *mtd); 11 | int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int); 12 | int del_mtd_partitions(struct mtd_info *); 13 | int parse_mtd_partitions(struct mtd_info *master, const char * const *types, 14 | struct mtd_partition **pparts, 15 | struct mtd_part_parser_data *data); 16 | 17 | int __init init_mtdchar(void); 18 | void __exit cleanup_mtdchar(void); 19 | 20 | #define mtd_for_each_device(mtd) \ 21 | for ((mtd) = __mtd_next_device(0); \ 22 | (mtd) != NULL; \ 23 | (mtd) = __mtd_next_device(mtd->index + 1)) 24 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/stdio.h: -------------------------------------------------------------------------------- 1 | /* Dummy header for u-boot */ 2 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/stdlib.h: -------------------------------------------------------------------------------- 1 | /* Dummy header for u-boot */ 2 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/string.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | 7 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_allocator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2011 Aleph One Ltd. 5 | * for Toby Churchill Ltd and Brightstar Engineering 6 | * 7 | * Created by Charles Manning 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License version 2.1 as 11 | * published by the Free Software Foundation. 12 | * 13 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 14 | */ 15 | 16 | #ifndef __YAFFS_ALLOCATOR_H__ 17 | #define __YAFFS_ALLOCATOR_H__ 18 | 19 | #include "yaffs_guts.h" 20 | 21 | void yaffs_init_raw_tnodes_and_objs(struct yaffs_dev *dev); 22 | void yaffs_deinit_raw_tnodes_and_objs(struct yaffs_dev *dev); 23 | 24 | struct yaffs_tnode *yaffs_alloc_raw_tnode(struct yaffs_dev *dev); 25 | void yaffs_free_raw_tnode(struct yaffs_dev *dev, struct yaffs_tnode *tn); 26 | 27 | struct yaffs_obj *yaffs_alloc_raw_obj(struct yaffs_dev *dev); 28 | void yaffs_free_raw_obj(struct yaffs_dev *dev, struct yaffs_obj *obj); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_attribs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2011 Aleph One Ltd. 5 | * for Toby Churchill Ltd and Brightstar Engineering 6 | * 7 | * Created by Charles Manning 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License version 2.1 as 11 | * published by the Free Software Foundation. 12 | * 13 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 14 | */ 15 | 16 | #ifndef __YAFFS_ATTRIBS_H__ 17 | #define __YAFFS_ATTRIBS_H__ 18 | 19 | #include "yaffs_guts.h" 20 | 21 | void yaffs_load_attribs(struct yaffs_obj *obj, struct yaffs_obj_hdr *oh); 22 | void yaffs_load_attribs_oh(struct yaffs_obj_hdr *oh, struct yaffs_obj *obj); 23 | void yaffs_attribs_init(struct yaffs_obj *obj, u32 gid, u32 uid, u32 rdev); 24 | void yaffs_load_current_time(struct yaffs_obj *obj, int do_a, int do_c); 25 | int yaffs_set_attribs(struct yaffs_obj *obj, struct iattr *attr); 26 | int yaffs_get_attribs(struct yaffs_obj *obj, struct iattr *attr); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_bitmap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2011 Aleph One Ltd. 5 | * for Toby Churchill Ltd and Brightstar Engineering 6 | * 7 | * Created by Charles Manning 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License version 2.1 as 11 | * published by the Free Software Foundation. 12 | * 13 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 14 | */ 15 | 16 | /* 17 | * Chunk bitmap manipulations 18 | */ 19 | 20 | #ifndef __YAFFS_BITMAP_H__ 21 | #define __YAFFS_BITMAP_H__ 22 | 23 | #include "yaffs_guts.h" 24 | 25 | void yaffs_verify_chunk_bit_id(struct yaffs_dev *dev, int blk, int chunk); 26 | void yaffs_clear_chunk_bits(struct yaffs_dev *dev, int blk); 27 | void yaffs_clear_chunk_bit(struct yaffs_dev *dev, int blk, int chunk); 28 | void yaffs_set_chunk_bit(struct yaffs_dev *dev, int blk, int chunk); 29 | int yaffs_check_chunk_bit(struct yaffs_dev *dev, int blk, int chunk); 30 | int yaffs_still_some_chunks(struct yaffs_dev *dev, int blk); 31 | int yaffs_count_chunk_bits(struct yaffs_dev *dev, int blk); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_checkptrw.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2011 Aleph One Ltd. 5 | * for Toby Churchill Ltd and Brightstar Engineering 6 | * 7 | * Created by Charles Manning 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License version 2.1 as 11 | * published by the Free Software Foundation. 12 | * 13 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 14 | */ 15 | 16 | #ifndef __YAFFS_CHECKPTRW_H__ 17 | #define __YAFFS_CHECKPTRW_H__ 18 | 19 | #include "yaffs_guts.h" 20 | 21 | int yaffs2_checkpt_open(struct yaffs_dev *dev, int writing); 22 | 23 | int yaffs2_checkpt_wr(struct yaffs_dev *dev, const void *data, int n_bytes); 24 | 25 | int yaffs2_checkpt_rd(struct yaffs_dev *dev, void *data, int n_bytes); 26 | 27 | int yaffs2_get_checkpt_sum(struct yaffs_dev *dev, u32 * sum); 28 | 29 | int yaffs_checkpt_close(struct yaffs_dev *dev); 30 | 31 | int yaffs2_checkpt_invalidate_stream(struct yaffs_dev *dev); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_ecc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2011 Aleph One Ltd. 5 | * for Toby Churchill Ltd and Brightstar Engineering 6 | * 7 | * Created by Charles Manning 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License version 2.1 as 11 | * published by the Free Software Foundation. 12 | * 13 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 14 | */ 15 | 16 | /* 17 | * This code implements the ECC algorithm used in SmartMedia. 18 | * 19 | * The ECC comprises 22 bits of parity information and is stuffed into 3 bytes. 20 | * The two unused bit are set to 1. 21 | * The ECC can correct single bit errors in a 256-byte page of data. 22 | * Thus, two such ECC blocks are used on a 512-byte NAND page. 23 | * 24 | */ 25 | 26 | #ifndef __YAFFS_ECC_H__ 27 | #define __YAFFS_ECC_H__ 28 | 29 | struct yaffs_ecc_other { 30 | unsigned char col_parity; 31 | unsigned line_parity; 32 | unsigned line_parity_prime; 33 | }; 34 | 35 | void yaffs_ecc_calc(const unsigned char *data, unsigned char *ecc); 36 | int yaffs_ecc_correct(unsigned char *data, unsigned char *read_ecc, 37 | const unsigned char *test_ecc); 38 | 39 | void yaffs_ecc_calc_other(const unsigned char *data, unsigned n_bytes, 40 | struct yaffs_ecc_other *ecc); 41 | int yaffs_ecc_correct_other(unsigned char *data, unsigned n_bytes, 42 | struct yaffs_ecc_other *read_ecc, 43 | const struct yaffs_ecc_other *test_ecc); 44 | #endif 45 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_error.c: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another FFS. A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2018 Aleph One Ltd. 5 | * 6 | * Created by Timothy Manning 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License version 2 as 10 | * published by the Free Software Foundation. 11 | */ 12 | 13 | #include "yaffsfs.h" 14 | 15 | struct error_entry { 16 | int code; 17 | const char *text; 18 | }; 19 | 20 | static const struct error_entry error_list[] = { 21 | { ENOMEM , "ENOMEM" }, 22 | { EBUSY , "EBUSY"}, 23 | { ENODEV , "ENODEV"}, 24 | { EINVAL , "EINVAL"}, 25 | { EBADF , "EBADF"}, 26 | { EACCES , "EACCES"}, 27 | { EXDEV , "EXDEV" }, 28 | { ENOENT , "ENOENT"}, 29 | { ENOSPC , "ENOSPC"}, 30 | { ERANGE , "ERANGE"}, 31 | { ENODATA, "ENODATA"}, 32 | { ENOTEMPTY, "ENOTEMPTY"}, 33 | { ENAMETOOLONG, "ENAMETOOLONG"}, 34 | { ENOMEM , "ENOMEM"}, 35 | { EEXIST , "EEXIST"}, 36 | { ENOTDIR , "ENOTDIR"}, 37 | { EISDIR , "EISDIR"}, 38 | { ENFILE, "ENFILE"}, 39 | { EROFS, "EROFS"}, 40 | { EFAULT, "EFAULT"}, 41 | { 0, NULL } 42 | }; 43 | 44 | const char *yaffs_error_to_str(int err) 45 | { 46 | const struct error_entry *e = error_list; 47 | 48 | if (err < 0) 49 | err = -err; 50 | 51 | while (e->code && e->text) { 52 | if (err == e->code) 53 | return e->text; 54 | e++; 55 | } 56 | return "Unknown error code"; 57 | } 58 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_flashif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2018 Aleph One Ltd. 5 | * 6 | * Created by Charles Manning 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License version 2.1 as 10 | * published by the Free Software Foundation. 11 | * 12 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 13 | */ 14 | 15 | #ifndef __YAFFS_FLASH_H__ 16 | #define __YAFFS_FLASH_H__ 17 | 18 | 19 | #include "yaffs_guts.h" 20 | int yflash_EraseBlockInNAND(struct yaffs_dev *dev, int blockNumber); 21 | int yflash_WriteChunkToNAND(struct yaffs_dev *dev, int nand_chunk, 22 | const u8 *data, const struct yaffs_spare *spare); 23 | int yflash_WriteChunkWithTagsToNAND(struct yaffs_dev *dev, int nand_chunk, 24 | const u8 *data, const struct yaffs_ext_tags *tags); 25 | int yflash_ReadChunkFromNAND(struct yaffs_dev *dev, int nand_chunk, 26 | u8 *data, struct yaffs_spare *spare); 27 | int yflash_ReadChunkWithTagsFromNAND(struct yaffs_dev *dev, int nand_chunk, 28 | u8 *data, struct yaffs_ext_tags *tags); 29 | int yflash_InitialiseNAND(struct yaffs_dev *dev); 30 | int yflash_MarkNANDBlockBad(struct yaffs_dev *dev, int block_no); 31 | int yflash_QueryNANDBlock(struct yaffs_dev *dev, int block_no, 32 | enum yaffs_block_state *state, u32 *seq_number); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_flashif2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2018 Aleph One Ltd. 5 | * 6 | * Created by Charles Manning 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License version 2.1 as 10 | * published by the Free Software Foundation. 11 | * 12 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 13 | */ 14 | 15 | #ifndef __YAFFS_FLASH2_H__ 16 | #define __YAFFS_FLASH2_H__ 17 | 18 | 19 | #include "yaffs_guts.h" 20 | int yflash2_EraseBlockInNAND(struct yaffs_dev *dev, int blockNumber); 21 | int yflash2_WriteChunkToNAND(struct yaffs_dev *dev, int nand_chunk, 22 | const u8 *data, const struct yaffs_spare *spare); 23 | int yflash2_WriteChunkWithTagsToNAND(struct yaffs_dev *dev, int nand_chunk, 24 | const u8 *data, const struct yaffs_ext_tags *tags); 25 | int yflash2_ReadChunkFromNAND(struct yaffs_dev *dev, int nand_chunk, 26 | u8 *data, struct yaffs_spare *spare); 27 | int yflash2_ReadChunkWithTagsFromNAND(struct yaffs_dev *dev, int nand_chunk, 28 | u8 *data, struct yaffs_ext_tags *tags); 29 | int yflash2_InitialiseNAND(struct yaffs_dev *dev); 30 | int yflash2_MarkNANDBlockBad(struct yaffs_dev *dev, int block_no); 31 | int yflash2_QueryNANDBlock(struct yaffs_dev *dev, int block_no, 32 | enum yaffs_block_state *state, u32 *seq_number); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_getblockinfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2011 Aleph One Ltd. 5 | * for Toby Churchill Ltd and Brightstar Engineering 6 | * 7 | * Created by Charles Manning 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License version 2.1 as 11 | * published by the Free Software Foundation. 12 | * 13 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 14 | */ 15 | 16 | #ifndef __YAFFS_GETBLOCKINFO_H__ 17 | #define __YAFFS_GETBLOCKINFO_H__ 18 | 19 | #include "yaffs_guts.h" 20 | #include "yaffs_trace.h" 21 | 22 | /* Function to manipulate block info */ 23 | static inline struct yaffs_block_info *yaffs_get_block_info(struct yaffs_dev 24 | *dev, int blk) 25 | { 26 | if (blk < dev->internal_start_block || blk > dev->internal_end_block) { 27 | yaffs_trace(YAFFS_TRACE_ERROR, 28 | "**>> yaffs: get_block_info block %d is not valid", 29 | blk); 30 | BUG(); 31 | } 32 | return &dev->block_info[blk - dev->internal_start_block]; 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_hweight.c: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet Another Flash File System. A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2018 Aleph One Ltd. 5 | * 6 | * Created by Charles Manning 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License version 2 as 10 | * published by the Free Software Foundation. 11 | */ 12 | 13 | /* These functions have been renamed to hweightxx to match the 14 | * equivaqlent functions in the Linux kernel. 15 | */ 16 | 17 | #include "yaffs_hweight.h" 18 | 19 | static const char yaffs_count_bits_table[256] = { 20 | 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 21 | 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 22 | 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 23 | 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 24 | 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 25 | 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 26 | 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 27 | 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 28 | 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 29 | 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 30 | 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 31 | 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 32 | 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 33 | 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 34 | 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 35 | 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 36 | }; 37 | 38 | int yaffs_hweight8(u8 x) 39 | { 40 | int ret_val; 41 | ret_val = yaffs_count_bits_table[x]; 42 | return ret_val; 43 | } 44 | 45 | int yaffs_hweight32(u32 x) 46 | { 47 | return yaffs_hweight8(x & 0xff) + 48 | yaffs_hweight8((x >> 8) & 0xff) + 49 | yaffs_hweight8((x >> 16) & 0xff) + 50 | yaffs_hweight8((x >> 24) & 0xff); 51 | } 52 | 53 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_hweight.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2018 Aleph One Ltd. 5 | * 6 | * Created by Charles Manning 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License version 2.1 as 10 | * published by the Free Software Foundation. 11 | * 12 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 13 | */ 14 | 15 | #ifndef __YAFFS_HWEIGHT_H__ 16 | #define __YAFFS_HWEIGHT_H__ 17 | 18 | #include "yportenv.h" 19 | 20 | int yaffs_hweight8(u8 x); 21 | int yaffs_hweight32(u32 x); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_malloc.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | void *yaffs_malloc(size_t size); 4 | void yaffs_free(void *ptr); 5 | void YAFFS_InitializeMemoryPool(void); 6 | int yaffsfs_GetError(void); 7 | 8 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_mtdif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2018 Aleph One Ltd. 5 | * 6 | * Created by Charles Manning 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License version 2.1 as 10 | * published by the Free Software Foundation. 11 | * 12 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 13 | */ 14 | 15 | #ifndef __YAFFS_MTDIF_H__ 16 | #define __YAFFS_MTDIF_H__ 17 | 18 | #include "yaffs_guts.h" 19 | 20 | int nandmtd_WriteChunkToNAND(struct yaffs_dev *dev, int chunkInNAND, 21 | const u8 *data, const struct yaffs_spare *spare); 22 | int nandmtd_ReadChunkFromNAND(struct yaffs_dev *dev, int chunkInNAND, u8 *data, 23 | struct yaffs_spare *spare); 24 | int nandmtd_EraseBlockInNAND(struct yaffs_dev *dev, int blockNumber); 25 | int nandmtd_InitialiseNAND(struct yaffs_dev *dev); 26 | #endif 27 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_mtdif2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2018 Aleph One Ltd. 5 | * 6 | * Created by Charles Manning 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License version 2.1 as 10 | * published by the Free Software Foundation. 11 | * 12 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 13 | */ 14 | 15 | #ifndef __YAFFS_MTDIF2_H__ 16 | #define __YAFFS_MTDIF2_H__ 17 | 18 | #include "yaffs_guts.h" 19 | 20 | int nandmtd2_write_chunk_tags(struct yaffs_dev *dev, int chunkInNAND, 21 | const u8 *data, 22 | const struct yaffs_ext_tags *tags); 23 | int nandmtd2_read_chunk_tags(struct yaffs_dev *dev, int chunkInNAND, 24 | u8 *data, struct yaffs_ext_tags *tags); 25 | int nandmtd2_MarkNANDBlockBad(struct yaffs_dev *dev, int blockNo); 26 | int nandmtd2_QueryNANDBlock(struct yaffs_dev *dev, int blockNo, 27 | enum yaffs_block_state *state, u32 *sequenceNumber); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_nameval.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2011 Aleph One Ltd. 5 | * for Toby Churchill Ltd and Brightstar Engineering 6 | * 7 | * Created by Charles Manning 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License version 2.1 as 11 | * published by the Free Software Foundation. 12 | * 13 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 14 | */ 15 | 16 | #ifndef __NAMEVAL_H__ 17 | #define __NAMEVAL_H__ 18 | 19 | #include "yportenv.h" 20 | 21 | int nval_del(char *xb, int xb_size, const YCHAR * name); 22 | int nval_set(char *xb, int xb_size, const YCHAR * name, const char *buf, 23 | int bsize, int flags); 24 | int nval_get(const char *xb, int xb_size, const YCHAR * name, char *buf, 25 | int bsize); 26 | int nval_list(const char *xb, int xb_size, char *buf, int bsize); 27 | int nval_hasvalues(const char *xb, int xb_size); 28 | #endif 29 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_nand.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2011 Aleph One Ltd. 5 | * for Toby Churchill Ltd and Brightstar Engineering 6 | * 7 | * Created by Charles Manning 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License version 2.1 as 11 | * published by the Free Software Foundation. 12 | * 13 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 14 | */ 15 | 16 | #ifndef __YAFFS_NAND_H__ 17 | #define __YAFFS_NAND_H__ 18 | #include "yaffs_guts.h" 19 | 20 | int yaffs_rd_chunk_tags_nand(struct yaffs_dev *dev, int nand_chunk, 21 | u8 *buffer, struct yaffs_ext_tags *tags); 22 | 23 | int yaffs_wr_chunk_tags_nand(struct yaffs_dev *dev, 24 | int nand_chunk, 25 | const u8 *buffer, struct yaffs_ext_tags *tags); 26 | 27 | int yaffs_mark_bad(struct yaffs_dev *dev, int block_no); 28 | 29 | int yaffs_query_init_block_state(struct yaffs_dev *dev, 30 | int block_no, 31 | enum yaffs_block_state *state, 32 | unsigned *seq_number); 33 | 34 | int yaffs_erase_block(struct yaffs_dev *dev, int flash_block); 35 | 36 | int yaffs_init_nand(struct yaffs_dev *dev); 37 | int yaffs_deinit_nand(struct yaffs_dev *dev); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_nandemul2k.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2018 Aleph One Ltd. 5 | * 6 | * Created by Charles Manning 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License version 2.1 as 10 | * published by the Free Software Foundation. 11 | * 12 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 13 | */ 14 | 15 | /* Interface to emulated NAND functions (2k page size) */ 16 | 17 | #ifndef __YAFFS_NANDEMUL2K_H__ 18 | #define __YAFFS_NANDEMUL2K_H__ 19 | 20 | #include "yaffs_guts.h" 21 | 22 | int nandemul2k_WriteChunkWithTagsToNAND(struct yaffs_dev *dev, 23 | int nand_chunk, const u8 *data, 24 | const struct yaffs_ext_tags *tags); 25 | int nandemul2k_ReadChunkWithTagsFromNAND(struct yaffs_dev *dev, 26 | int nand_chunk, u8 *data, 27 | struct yaffs_ext_tags *tags); 28 | int nandemul2k_MarkNANDBlockBad(struct yaffs_dev *dev, int block_no); 29 | int nandemul2k_QueryNANDBlock(struct yaffs_dev *dev, int block_no, 30 | enum yaffs_block_state *state, u32 *seq_number); 31 | int nandemul2k_EraseBlockInNAND(struct yaffs_dev *dev, 32 | int flash_block); 33 | int nandemul2k_InitialiseNAND(struct yaffs_dev *dev); 34 | int nandemul2k_GetBytesPerChunk(void); 35 | int nandemul2k_GetChunksPerBlock(void); 36 | int nandemul2k_GetNumberOfBlocks(void); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_nandif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2011 Aleph One Ltd. 5 | * for Toby Churchill Ltd and Brightstar Engineering 6 | * 7 | * Created by Charles Manning 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License version 2.1 as 11 | * published by the Free Software Foundation. 12 | * 13 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 14 | */ 15 | 16 | 17 | #ifndef __YNANDIF_H__ 18 | #define __YNANDIF_H__ 19 | 20 | #include "yaffs_guts.h" 21 | 22 | struct ynandif_Geometry { 23 | unsigned start_block; 24 | unsigned end_block; 25 | unsigned dataSize; 26 | unsigned spareSize; 27 | unsigned pagesPerBlock; 28 | unsigned hasECC; 29 | unsigned inband_tags; 30 | unsigned useYaffs2; 31 | 32 | int (*initialise)(struct yaffs_dev *dev); 33 | int (*deinitialise)(struct yaffs_dev *dev); 34 | 35 | int (*readChunk) (struct yaffs_dev *dev, 36 | unsigned pageId, 37 | unsigned char *data, 38 | unsigned dataLength, 39 | unsigned char *spare, 40 | unsigned spareLength, 41 | int *eccStatus); 42 | /* ECC status is set to 0 for OK, 1 for fixed, -1 for unfixed. */ 43 | 44 | int (*writeChunk)(struct yaffs_dev *dev, 45 | unsigned pageId, 46 | const unsigned char *data, 47 | unsigned dataLength, 48 | const unsigned char *spare, 49 | unsigned spareLength); 50 | 51 | int (*eraseBlock)(struct yaffs_dev *dev, unsigned blockId); 52 | 53 | int (*checkBlockOk)(struct yaffs_dev *dev, unsigned blockId); 54 | int (*markBlockBad)(struct yaffs_dev *dev, unsigned blockId); 55 | 56 | void *privateData; 57 | 58 | }; 59 | 60 | struct yaffs_dev * 61 | yaffs_add_dev_from_geometry(const YCHAR *name, 62 | const struct ynandif_Geometry *geometry); 63 | 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_osglue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2018 Aleph One Ltd. 5 | * 6 | * Created by Charles Manning 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License version 2.1 as 10 | * published by the Free Software Foundation. 11 | * 12 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 13 | */ 14 | 15 | /* 16 | * Header file for using yaffs in an application via 17 | * a direct interface. 18 | */ 19 | 20 | 21 | #ifndef __YAFFS_OSGLUE_H__ 22 | #define __YAFFS_OSGLUE_H__ 23 | 24 | 25 | #include "yportenv.h" 26 | 27 | void yaffsfs_Lock(void); 28 | void yaffsfs_Unlock(void); 29 | 30 | u32 yaffsfs_CurrentTime(void); 31 | 32 | void yaffsfs_SetError(int err); 33 | 34 | void *yaffsfs_malloc(size_t size); 35 | void yaffsfs_free(void *ptr); 36 | 37 | int yaffsfs_CheckMemRegion(const void *addr, size_t size, int write_request); 38 | 39 | void yaffsfs_OSInitialisation(void); 40 | 41 | 42 | #endif 43 | 44 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_packedtags1.c: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet Another Flash File System. A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2011 Aleph One Ltd. 5 | * for Toby Churchill Ltd and Brightstar Engineering 6 | * 7 | * Created by Charles Manning 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License version 2 as 11 | * published by the Free Software Foundation. 12 | */ 13 | 14 | #include "yaffs_packedtags1.h" 15 | #include "yportenv.h" 16 | 17 | static const u8 all_ff[20] = { 18 | 0xff, 0xff, 0xff, 0xff, 19 | 0xff, 0xff, 0xff, 0xff, 20 | 0xff, 0xff, 0xff, 0xff, 21 | 0xff, 0xff, 0xff, 0xff, 22 | 0xff, 0xff, 0xff, 0xff 23 | }; 24 | 25 | void yaffs_pack_tags1(struct yaffs_packed_tags1 *pt, 26 | const struct yaffs_ext_tags *t) 27 | { 28 | pt->chunk_id = t->chunk_id; 29 | pt->serial_number = t->serial_number; 30 | pt->n_bytes = t->n_bytes; 31 | pt->obj_id = t->obj_id; 32 | pt->ecc = 0; 33 | pt->deleted = (t->is_deleted) ? 0 : 1; 34 | pt->unused_stuff = 0; 35 | pt->should_be_ff = 0xffffffff; 36 | } 37 | 38 | void yaffs_unpack_tags1(struct yaffs_ext_tags *t, 39 | const struct yaffs_packed_tags1 *pt) 40 | { 41 | 42 | if (memcmp(all_ff, pt, sizeof(struct yaffs_packed_tags1))) { 43 | t->block_bad = 0; 44 | if (pt->should_be_ff != 0xffffffff) 45 | t->block_bad = 1; 46 | t->chunk_used = 1; 47 | t->obj_id = pt->obj_id; 48 | t->chunk_id = pt->chunk_id; 49 | t->n_bytes = pt->n_bytes; 50 | t->ecc_result = YAFFS_ECC_RESULT_NO_ERROR; 51 | t->is_deleted = (pt->deleted) ? 0 : 1; 52 | t->serial_number = pt->serial_number; 53 | } else { 54 | memset(t, 0, sizeof(struct yaffs_ext_tags)); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_packedtags1.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2011 Aleph One Ltd. 5 | * for Toby Churchill Ltd and Brightstar Engineering 6 | * 7 | * Created by Charles Manning 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License version 2.1 as 11 | * published by the Free Software Foundation. 12 | * 13 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 14 | */ 15 | 16 | /* This is used to pack YAFFS1 tags, not YAFFS2 tags. */ 17 | 18 | #ifndef __YAFFS_PACKEDTAGS1_H__ 19 | #define __YAFFS_PACKEDTAGS1_H__ 20 | 21 | #include "yaffs_guts.h" 22 | 23 | struct yaffs_packed_tags1 { 24 | unsigned chunk_id:20; 25 | unsigned serial_number:2; 26 | unsigned n_bytes:10; 27 | unsigned obj_id:18; 28 | unsigned ecc:12; 29 | unsigned deleted:1; 30 | unsigned unused_stuff:1; 31 | unsigned should_be_ff; 32 | 33 | }; 34 | 35 | void yaffs_pack_tags1(struct yaffs_packed_tags1 *pt, 36 | const struct yaffs_ext_tags *t); 37 | void yaffs_unpack_tags1(struct yaffs_ext_tags *t, 38 | const struct yaffs_packed_tags1 *pt); 39 | #endif 40 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_packedtags2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2011 Aleph One Ltd. 5 | * for Toby Churchill Ltd and Brightstar Engineering 6 | * 7 | * Created by Charles Manning 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License version 2.1 as 11 | * published by the Free Software Foundation. 12 | * 13 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 14 | */ 15 | 16 | /* This is used to pack YAFFS2 tags, not YAFFS1tags. */ 17 | 18 | #ifndef __YAFFS_PACKEDTAGS2_H__ 19 | #define __YAFFS_PACKEDTAGS2_H__ 20 | 21 | #include "yaffs_guts.h" 22 | #include "yaffs_ecc.h" 23 | 24 | struct yaffs_packed_tags2_tags_only { 25 | unsigned seq_number; 26 | unsigned obj_id; 27 | unsigned chunk_id; 28 | unsigned n_bytes; 29 | }; 30 | 31 | struct yaffs_packed_tags2 { 32 | struct yaffs_packed_tags2_tags_only t; 33 | struct yaffs_ecc_other ecc; 34 | }; 35 | 36 | /* Full packed tags with ECC, used for oob tags */ 37 | void yaffs_pack_tags2(struct yaffs_packed_tags2 *pt, 38 | const struct yaffs_ext_tags *t, int tags_ecc); 39 | void yaffs_unpack_tags2(struct yaffs_ext_tags *t, struct yaffs_packed_tags2 *pt, 40 | int tags_ecc); 41 | 42 | /* Only the tags part (no ECC for use with inband tags */ 43 | void yaffs_pack_tags2_tags_only(struct yaffs_packed_tags2_tags_only *pt, 44 | const struct yaffs_ext_tags *t); 45 | void yaffs_unpack_tags2_tags_only(struct yaffs_ext_tags *t, 46 | struct yaffs_packed_tags2_tags_only *pt); 47 | #endif 48 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_summary.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2011 Aleph One Ltd. 5 | * for Toby Churchill Ltd and Brightstar Engineering 6 | * 7 | * Created by Charles Manning 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License version 2.1 as 11 | * published by the Free Software Foundation. 12 | * 13 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 14 | */ 15 | 16 | #ifndef __YAFFS_SUMMARY_H__ 17 | #define __YAFFS_SUMMARY_H__ 18 | 19 | #include "yaffs_packedtags2.h" 20 | 21 | 22 | int yaffs_summary_init(struct yaffs_dev *dev); 23 | void yaffs_summary_deinit(struct yaffs_dev *dev); 24 | 25 | int yaffs_summary_add(struct yaffs_dev *dev, 26 | struct yaffs_ext_tags *tags, 27 | int chunk_in_block); 28 | int yaffs_summary_fetch(struct yaffs_dev *dev, 29 | struct yaffs_ext_tags *tags, 30 | int chunk_in_block); 31 | int yaffs_summary_read(struct yaffs_dev *dev, 32 | struct yaffs_summary_tags *st, 33 | int blk); 34 | void yaffs_summary_gc(struct yaffs_dev *dev, int blk); 35 | 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_tagscompat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2011 Aleph One Ltd. 5 | * for Toby Churchill Ltd and Brightstar Engineering 6 | * 7 | * Created by Charles Manning 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License version 2.1 as 11 | * published by the Free Software Foundation. 12 | * 13 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 14 | */ 15 | 16 | #ifndef __YAFFS_TAGSCOMPAT_H__ 17 | #define __YAFFS_TAGSCOMPAT_H__ 18 | 19 | #include "yaffs_guts.h" 20 | int yaffs_tags_compat_wr(struct yaffs_dev *dev, 21 | int nand_chunk, 22 | const u8 *data, const struct yaffs_ext_tags *tags); 23 | int yaffs_tags_compat_rd(struct yaffs_dev *dev, 24 | int nand_chunk, 25 | u8 *data, struct yaffs_ext_tags *tags); 26 | int yaffs_tags_compat_mark_bad(struct yaffs_dev *dev, int block_no); 27 | int yaffs_tags_compat_query_block(struct yaffs_dev *dev, 28 | int block_no, 29 | enum yaffs_block_state *state, 30 | u32 *seq_number); 31 | 32 | void yaffs_calc_tags_ecc(struct yaffs_tags *tags); 33 | int yaffs_check_tags_ecc(struct yaffs_tags *tags); 34 | int yaffs_count_bits(u8 byte); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_trace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2011 Aleph One Ltd. 5 | * for Toby Churchill Ltd and Brightstar Engineering 6 | * 7 | * Created by Charles Manning 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License version 2.1 as 11 | * published by the Free Software Foundation. 12 | * 13 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 14 | */ 15 | 16 | #ifndef __YTRACE_H__ 17 | #define __YTRACE_H__ 18 | 19 | extern unsigned int yaffs_trace_mask; 20 | extern unsigned int yaffs_wr_attempts; 21 | 22 | /* 23 | * Tracing flags. 24 | * The flags masked in YAFFS_TRACE_ALWAYS are always traced. 25 | */ 26 | 27 | #define YAFFS_TRACE_OS 0x00000002 28 | #define YAFFS_TRACE_ALLOCATE 0x00000004 29 | #define YAFFS_TRACE_SCAN 0x00000008 30 | #define YAFFS_TRACE_BAD_BLOCKS 0x00000010 31 | #define YAFFS_TRACE_ERASE 0x00000020 32 | #define YAFFS_TRACE_GC 0x00000040 33 | #define YAFFS_TRACE_WRITE 0x00000080 34 | #define YAFFS_TRACE_TRACING 0x00000100 35 | #define YAFFS_TRACE_DELETION 0x00000200 36 | #define YAFFS_TRACE_BUFFERS 0x00000400 37 | #define YAFFS_TRACE_NANDACCESS 0x00000800 38 | #define YAFFS_TRACE_GC_DETAIL 0x00001000 39 | #define YAFFS_TRACE_SCAN_DEBUG 0x00002000 40 | #define YAFFS_TRACE_MTD 0x00004000 41 | #define YAFFS_TRACE_CHECKPOINT 0x00008000 42 | 43 | #define YAFFS_TRACE_VERIFY 0x00010000 44 | #define YAFFS_TRACE_VERIFY_NAND 0x00020000 45 | #define YAFFS_TRACE_VERIFY_FULL 0x00040000 46 | #define YAFFS_TRACE_VERIFY_ALL 0x000f0000 47 | 48 | #define YAFFS_TRACE_SYNC 0x00100000 49 | #define YAFFS_TRACE_BACKGROUND 0x00200000 50 | #define YAFFS_TRACE_LOCK 0x00400000 51 | #define YAFFS_TRACE_MOUNT 0x00800000 52 | 53 | #define YAFFS_TRACE_ERROR 0x40000000 54 | #define YAFFS_TRACE_BUG 0x80000000 55 | #define YAFFS_TRACE_ALWAYS 0xf0000000 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_verify.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2011 Aleph One Ltd. 5 | * for Toby Churchill Ltd and Brightstar Engineering 6 | * 7 | * Created by Charles Manning 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License version 2.1 as 11 | * published by the Free Software Foundation. 12 | * 13 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 14 | */ 15 | 16 | #ifndef __YAFFS_VERIFY_H__ 17 | #define __YAFFS_VERIFY_H__ 18 | 19 | #include "yaffs_guts.h" 20 | 21 | void yaffs_verify_blk(struct yaffs_dev *dev, struct yaffs_block_info *bi, 22 | int n); 23 | void yaffs_verify_collected_blk(struct yaffs_dev *dev, 24 | struct yaffs_block_info *bi, int n); 25 | void yaffs_verify_blocks(struct yaffs_dev *dev); 26 | 27 | void yaffs_verify_oh(struct yaffs_obj *obj, struct yaffs_obj_hdr *oh, 28 | struct yaffs_ext_tags *tags, int parent_check); 29 | void yaffs_verify_file(struct yaffs_obj *obj); 30 | void yaffs_verify_link(struct yaffs_obj *obj); 31 | void yaffs_verify_symlink(struct yaffs_obj *obj); 32 | void yaffs_verify_special(struct yaffs_obj *obj); 33 | void yaffs_verify_obj(struct yaffs_obj *obj); 34 | void yaffs_verify_objects(struct yaffs_dev *dev); 35 | void yaffs_verify_obj_in_dir(struct yaffs_obj *obj); 36 | void yaffs_verify_dir(struct yaffs_obj *directory); 37 | void yaffs_verify_free_chunks(struct yaffs_dev *dev); 38 | 39 | int yaffs_verify_file_sane(struct yaffs_obj *obj); 40 | 41 | int yaffs_skip_verification(struct yaffs_dev *dev); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_yaffs1.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2011 Aleph One Ltd. 5 | * for Toby Churchill Ltd and Brightstar Engineering 6 | * 7 | * Created by Charles Manning 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License version 2.1 as 11 | * published by the Free Software Foundation. 12 | * 13 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 14 | */ 15 | 16 | #ifndef __YAFFS_YAFFS1_H__ 17 | #define __YAFFS_YAFFS1_H__ 18 | 19 | #include "yaffs_guts.h" 20 | int yaffs1_scan(struct yaffs_dev *dev); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffs_yaffs2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2011 Aleph One Ltd. 5 | * for Toby Churchill Ltd and Brightstar Engineering 6 | * 7 | * Created by Charles Manning 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License version 2.1 as 11 | * published by the Free Software Foundation. 12 | * 13 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 14 | */ 15 | 16 | #ifndef __YAFFS_YAFFS2_H__ 17 | #define __YAFFS_YAFFS2_H__ 18 | 19 | #include "yaffs_guts.h" 20 | 21 | void yaffs_calc_oldest_dirty_seq(struct yaffs_dev *dev); 22 | void yaffs2_find_oldest_dirty_seq(struct yaffs_dev *dev); 23 | void yaffs2_clear_oldest_dirty_seq(struct yaffs_dev *dev, 24 | struct yaffs_block_info *bi); 25 | void yaffs2_update_oldest_dirty_seq(struct yaffs_dev *dev, unsigned block_no, 26 | struct yaffs_block_info *bi); 27 | int yaffs_block_ok_for_gc(struct yaffs_dev *dev, struct yaffs_block_info *bi); 28 | u32 yaffs2_find_refresh_block(struct yaffs_dev *dev); 29 | int yaffs2_checkpt_required(struct yaffs_dev *dev); 30 | int yaffs_calc_checkpt_blocks_required(struct yaffs_dev *dev); 31 | 32 | void yaffs2_checkpt_invalidate(struct yaffs_dev *dev); 33 | int yaffs2_checkpt_save(struct yaffs_dev *dev); 34 | int yaffs2_checkpt_restore(struct yaffs_dev *dev); 35 | 36 | int yaffs2_handle_hole(struct yaffs_obj *obj, loff_t new_size); 37 | int yaffs2_scan_backwards(struct yaffs_dev *dev); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /ThirdParty/yaffs2/yaffscfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 3 | * 4 | * Copyright (C) 2002-2018 Aleph One Ltd. 5 | * 6 | * Created by Charles Manning 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License version 2.1 as 10 | * published by the Free Software Foundation. 11 | * 12 | * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. 13 | */ 14 | 15 | /* 16 | * Header file for using yaffs in an application via 17 | * a direct interface. 18 | */ 19 | 20 | 21 | #ifndef __YAFFSCFG_H__ 22 | #define __YAFFSCFG_H__ 23 | 24 | 25 | #include "yportenv.h" 26 | 27 | #define YAFFSFS_N_HANDLES 100 28 | 29 | #define YAFFSFS_N_DSC 20 30 | 31 | 32 | struct yaffsfs_DeviceConfiguration { 33 | const YCHAR *prefix; 34 | struct yaffs_dev *dev; 35 | }; 36 | 37 | 38 | #endif 39 | 40 | --------------------------------------------------------------------------------