├── .gitignore
├── CMakeLists.txt
├── LICENSE
├── README
├── README_RU
├── TODO
├── bsp
├── 3rd_party
│ └── STM32_USB-Host-Device_Lib_V2.1.0
│ │ ├── Libraries
│ │ ├── CMSIS
│ │ │ ├── CMSIS END USER LICENCE AGREEMENT.pdf
│ │ │ ├── Device
│ │ │ │ └── ST
│ │ │ │ │ └── STM32F4xx
│ │ │ │ │ ├── Include
│ │ │ │ │ ├── stm32f4xx.h
│ │ │ │ │ └── system_stm32f4xx.h
│ │ │ │ │ ├── Release_Notes.html
│ │ │ │ │ └── Source
│ │ │ │ │ └── Templates
│ │ │ │ │ ├── TASKING
│ │ │ │ │ └── cstart_thumb2.asm
│ │ │ │ │ ├── TrueSTUDIO
│ │ │ │ │ └── startup_stm32f4xx.s
│ │ │ │ │ ├── arm
│ │ │ │ │ └── startup_stm32f4xx.s
│ │ │ │ │ ├── gcc_ride7
│ │ │ │ │ └── startup_stm32f4xx.s
│ │ │ │ │ ├── iar
│ │ │ │ │ └── startup_stm32f4xx.s
│ │ │ │ │ └── system_stm32f4xx.c
│ │ │ ├── Documentation
│ │ │ │ ├── CMSIS-SVD_Schema_1_0.xsd
│ │ │ │ ├── CMSIS_CM4_SIMD.htm
│ │ │ │ ├── CMSIS_Core.htm
│ │ │ │ ├── CMSIS_DebugSupport.htm
│ │ │ │ ├── CMSIS_History.htm
│ │ │ │ ├── CMSIS_Logo_Final.jpg
│ │ │ │ └── CMSIS_System_View_Description.htm
│ │ │ ├── Include
│ │ │ │ ├── arm_common_tables.h
│ │ │ │ ├── arm_math.h
│ │ │ │ ├── core_cm0.h
│ │ │ │ ├── core_cm3.h
│ │ │ │ ├── core_cm4.h
│ │ │ │ ├── core_cm4_simd.h
│ │ │ │ ├── core_cmFunc.h
│ │ │ │ └── core_cmInstr.h
│ │ │ ├── README.txt
│ │ │ └── index.htm
│ │ ├── STM32F4xx_StdPeriph_Driver
│ │ │ ├── Release_Notes.html
│ │ │ ├── inc
│ │ │ │ ├── misc.h
│ │ │ │ ├── stm32f4xx_adc.h
│ │ │ │ ├── stm32f4xx_can.h
│ │ │ │ ├── stm32f4xx_crc.h
│ │ │ │ ├── stm32f4xx_cryp.h
│ │ │ │ ├── stm32f4xx_dac.h
│ │ │ │ ├── stm32f4xx_dbgmcu.h
│ │ │ │ ├── stm32f4xx_dcmi.h
│ │ │ │ ├── stm32f4xx_dma.h
│ │ │ │ ├── stm32f4xx_exti.h
│ │ │ │ ├── stm32f4xx_flash.h
│ │ │ │ ├── stm32f4xx_fsmc.h
│ │ │ │ ├── stm32f4xx_gpio.h
│ │ │ │ ├── stm32f4xx_hash.h
│ │ │ │ ├── stm32f4xx_i2c.h
│ │ │ │ ├── stm32f4xx_iwdg.h
│ │ │ │ ├── stm32f4xx_pwr.h
│ │ │ │ ├── stm32f4xx_rcc.h
│ │ │ │ ├── stm32f4xx_rng.h
│ │ │ │ ├── stm32f4xx_rtc.h
│ │ │ │ ├── stm32f4xx_sdio.h
│ │ │ │ ├── stm32f4xx_spi.h
│ │ │ │ ├── stm32f4xx_syscfg.h
│ │ │ │ ├── stm32f4xx_tim.h
│ │ │ │ ├── stm32f4xx_usart.h
│ │ │ │ └── stm32f4xx_wwdg.h
│ │ │ └── src
│ │ │ │ ├── misc.c
│ │ │ │ ├── stm32f4xx_adc.c
│ │ │ │ ├── stm32f4xx_can.c
│ │ │ │ ├── stm32f4xx_crc.c
│ │ │ │ ├── stm32f4xx_cryp.c
│ │ │ │ ├── stm32f4xx_cryp_aes.c
│ │ │ │ ├── stm32f4xx_cryp_des.c
│ │ │ │ ├── stm32f4xx_cryp_tdes.c
│ │ │ │ ├── stm32f4xx_dac.c
│ │ │ │ ├── stm32f4xx_dbgmcu.c
│ │ │ │ ├── stm32f4xx_dcmi.c
│ │ │ │ ├── stm32f4xx_dma.c
│ │ │ │ ├── stm32f4xx_exti.c
│ │ │ │ ├── stm32f4xx_flash.c
│ │ │ │ ├── stm32f4xx_fsmc.c
│ │ │ │ ├── stm32f4xx_gpio.c
│ │ │ │ ├── stm32f4xx_hash.c
│ │ │ │ ├── stm32f4xx_hash_md5.c
│ │ │ │ ├── stm32f4xx_hash_sha1.c
│ │ │ │ ├── stm32f4xx_i2c.c
│ │ │ │ ├── stm32f4xx_iwdg.c
│ │ │ │ ├── stm32f4xx_pwr.c
│ │ │ │ ├── stm32f4xx_rcc.c
│ │ │ │ ├── stm32f4xx_rng.c
│ │ │ │ ├── stm32f4xx_rtc.c
│ │ │ │ ├── stm32f4xx_sdio.c
│ │ │ │ ├── stm32f4xx_spi.c
│ │ │ │ ├── stm32f4xx_syscfg.c
│ │ │ │ ├── stm32f4xx_tim.c
│ │ │ │ ├── stm32f4xx_usart.c
│ │ │ │ └── stm32f4xx_wwdg.c
│ │ ├── STM32_USB_Device_Library
│ │ │ ├── Class
│ │ │ │ ├── audio
│ │ │ │ │ ├── inc
│ │ │ │ │ │ ├── usbd_audio_core.h
│ │ │ │ │ │ └── usbd_audio_out_if.h
│ │ │ │ │ └── src
│ │ │ │ │ │ ├── usbd_audio_core.c
│ │ │ │ │ │ └── usbd_audio_out_if.c
│ │ │ │ ├── cdc
│ │ │ │ │ ├── inc
│ │ │ │ │ │ ├── usbd_cdc_core.h
│ │ │ │ │ │ └── usbd_cdc_if_template.h
│ │ │ │ │ └── src
│ │ │ │ │ │ ├── usbd_cdc_core.c
│ │ │ │ │ │ └── usbd_cdc_if_template.c
│ │ │ │ ├── dfu
│ │ │ │ │ ├── inc
│ │ │ │ │ │ ├── usbd_dfu_core.h
│ │ │ │ │ │ ├── usbd_dfu_mal.h
│ │ │ │ │ │ ├── usbd_flash_if.h
│ │ │ │ │ │ ├── usbd_mem_if_template.h
│ │ │ │ │ │ └── usbd_otp_if.h
│ │ │ │ │ └── src
│ │ │ │ │ │ ├── usbd_dfu_core.c
│ │ │ │ │ │ ├── usbd_dfu_mal.c
│ │ │ │ │ │ ├── usbd_flash_if.c
│ │ │ │ │ │ ├── usbd_mem_if_template.c
│ │ │ │ │ │ └── usbd_otp_if.c
│ │ │ │ ├── hid
│ │ │ │ │ ├── inc
│ │ │ │ │ │ └── usbd_hid_core.h
│ │ │ │ │ └── src
│ │ │ │ │ │ └── usbd_hid_core.c
│ │ │ │ └── msc
│ │ │ │ │ ├── inc
│ │ │ │ │ ├── usbd_msc_bot.h
│ │ │ │ │ ├── usbd_msc_core.h
│ │ │ │ │ ├── usbd_msc_data.h
│ │ │ │ │ ├── usbd_msc_mem.h
│ │ │ │ │ └── usbd_msc_scsi.h
│ │ │ │ │ └── src
│ │ │ │ │ ├── usbd_msc_bot.c
│ │ │ │ │ ├── usbd_msc_core.c
│ │ │ │ │ ├── usbd_msc_data.c
│ │ │ │ │ ├── usbd_msc_scsi.c
│ │ │ │ │ └── usbd_storage_template.c
│ │ │ ├── Core
│ │ │ │ ├── inc
│ │ │ │ │ ├── usbd_conf_template.h
│ │ │ │ │ ├── usbd_core.h
│ │ │ │ │ ├── usbd_def.h
│ │ │ │ │ ├── usbd_ioreq.h
│ │ │ │ │ ├── usbd_req.h
│ │ │ │ │ └── usbd_usr.h
│ │ │ │ └── src
│ │ │ │ │ ├── usbd_core.c
│ │ │ │ │ ├── usbd_ioreq.c
│ │ │ │ │ └── usbd_req.c
│ │ │ └── Release_Notes.html
│ │ ├── STM32_USB_HOST_Library
│ │ │ ├── Class
│ │ │ │ ├── HID
│ │ │ │ │ ├── inc
│ │ │ │ │ │ ├── usbh_hid_core.h
│ │ │ │ │ │ ├── usbh_hid_keybd.h
│ │ │ │ │ │ └── usbh_hid_mouse.h
│ │ │ │ │ └── src
│ │ │ │ │ │ ├── usbh_hid_core.c
│ │ │ │ │ │ ├── usbh_hid_keybd.c
│ │ │ │ │ │ └── usbh_hid_mouse.c
│ │ │ │ └── MSC
│ │ │ │ │ ├── inc
│ │ │ │ │ ├── usbh_msc_bot.h
│ │ │ │ │ ├── usbh_msc_core.h
│ │ │ │ │ └── usbh_msc_scsi.h
│ │ │ │ │ └── src
│ │ │ │ │ ├── usbh_msc_bot.c
│ │ │ │ │ ├── usbh_msc_core.c
│ │ │ │ │ ├── usbh_msc_fatfs.c
│ │ │ │ │ └── usbh_msc_scsi.c
│ │ │ ├── Core
│ │ │ │ ├── inc
│ │ │ │ │ ├── usbh_conf_template.h
│ │ │ │ │ ├── usbh_core.h
│ │ │ │ │ ├── usbh_def.h
│ │ │ │ │ ├── usbh_hcs.h
│ │ │ │ │ ├── usbh_ioreq.h
│ │ │ │ │ └── usbh_stdreq.h
│ │ │ │ └── src
│ │ │ │ │ ├── usbh_core.c
│ │ │ │ │ ├── usbh_hcs.c
│ │ │ │ │ ├── usbh_ioreq.c
│ │ │ │ │ └── usbh_stdreq.c
│ │ │ └── Release_Notes.html
│ │ └── STM32_USB_OTG_Driver
│ │ │ ├── Release_Notes.html
│ │ │ ├── inc
│ │ │ ├── usb_bsp.h
│ │ │ ├── usb_conf_template.h
│ │ │ ├── usb_core.h
│ │ │ ├── usb_dcd.h
│ │ │ ├── usb_dcd_int.h
│ │ │ ├── usb_defines.h
│ │ │ ├── usb_hcd.h
│ │ │ ├── usb_hcd_int.h
│ │ │ ├── usb_otg.h
│ │ │ └── usb_regs.h
│ │ │ └── src
│ │ │ ├── usb_bsp_template.c
│ │ │ ├── usb_core.c
│ │ │ ├── usb_dcd.c
│ │ │ ├── usb_dcd_int.c
│ │ │ ├── usb_hcd.c
│ │ │ ├── usb_hcd_int.c
│ │ │ └── usb_otg.c
│ │ ├── MCD-ST Liberty SW License Agreement V2.pdf
│ │ ├── Release_Notes.html
│ │ └── _htmresc
│ │ └── logo.bmp
├── bsp.cmake
├── freertos
│ └── GCC
│ │ └── ARM_CM4F
│ │ ├── port.c
│ │ └── portmacro.h
├── keypad.c
├── stm32f4_discovery
│ ├── audio_if.c
│ ├── bsp.c
│ ├── bsp_config.h
│ ├── diskio_sdio.c
│ ├── disp_1100.c
│ ├── disp_1100.h
│ ├── fattime.c
│ ├── fattime.h
│ ├── stm324xg_eval_sdio_sd.c
│ ├── stm324xg_eval_sdio_sd.h
│ ├── stm32f4_discovery.c
│ ├── stm32f4_discovery.h
│ ├── stm32f4_discovery_audio_codec.c
│ ├── stm32f4_discovery_audio_codec.h
│ ├── stm32f4_discovery_lis302dl.c
│ ├── stm32f4_discovery_lis302dl.h
│ └── syscalls.c
└── stm32f4xx
│ ├── cmsis.cmake
│ ├── cpu.cmake
│ ├── inc
│ ├── FreeRTOSConfig.h
│ ├── cpu_config.h
│ ├── stm32f4xx_conf.h
│ ├── stm32f4xx_it.h
│ ├── types.h
│ ├── usb_conf.h
│ ├── usbd_cdc_core.h
│ ├── usbd_cdc_vcp.h
│ ├── usbd_conf.h
│ ├── usbd_desc.h
│ ├── usbd_desc_msc.h
│ ├── usbd_storage_msd.h
│ ├── usbh_conf.h
│ └── usbh_usr.h
│ ├── src
│ ├── cpu.c
│ ├── stm32f4xx_it.c
│ ├── syscalls.c
│ ├── system_stm32f4xx.c
│ ├── usbd_bsp.c
│ ├── usbd_cdc_core.c
│ ├── usbd_cdc_vcp.c
│ ├── usbd_desc_cdc.c
│ ├── usbd_desc_msc.c
│ ├── usbd_storage_msd.c
│ ├── usbd_usr.c
│ ├── usbh_bsp.c
│ └── usbh_usr.c
│ ├── stdperiph.cmake
│ ├── stm32_flash.ld.in
│ ├── usblib.cmake
│ ├── usblib_device.cmake
│ └── usblib_host.cmake
├── cmake_patch_arm_none_eabi.diff
├── cmake_patch_linaro.diff
├── crlf_to_lf.sh
├── debug-simulator.gdb
├── debug.gdb.origin
├── debug_msc.gdb
├── flags.cmake
├── gnu_toolchain.cmake
├── include
├── assert.h
├── audio_buffer.h
├── audio_if.h
├── bsp.h
├── circ_buffer.h
├── common.h
├── cpu.h
├── custom_support.h
├── display.h
├── ffconf.h
├── keypad.h
├── metadata.h
├── navigator.h
├── nestedfilter.h
├── nuttx
│ ├── compiler.h
│ ├── config.h
│ ├── mm.h
│ └── streams.h
├── ogg
│ ├── ogg.h
│ └── os_types.h
├── player.h
├── powermanager.h
├── profile.h
├── semaphore.h
├── software_conf.h
├── system.h
├── trace.h
└── ui.h
├── lib
├── CMakeLists.txt
├── fat_fs
│ ├── 00readme.txt
│ ├── diskio.h
│ ├── ff.c
│ ├── ff.h
│ ├── integer.h
│ └── option
│ │ ├── ccsbcs.c
│ │ └── syscall.c
├── freertos
│ ├── croutine.c
│ ├── include
│ │ ├── FreeRTOS.h
│ │ ├── StackMacros.h
│ │ ├── croutine.h
│ │ ├── list.h
│ │ ├── mpu_wrappers.h
│ │ ├── portable.h
│ │ ├── projdefs.h
│ │ ├── queue.h
│ │ ├── semphr.h
│ │ ├── task.h
│ │ └── timers.h
│ ├── license.txt
│ ├── list.c
│ ├── portable
│ │ ├── MemMang
│ │ │ ├── heap_1.c
│ │ │ ├── heap_2.c
│ │ │ ├── heap_3.c
│ │ │ └── heap_4.c
│ │ └── readme.txt
│ ├── queue.c
│ ├── readme.txt
│ ├── tasks.c
│ └── timers.c
├── minIni
│ ├── LICENSE
│ ├── NOTICE
│ ├── minGlue-FatFs.h
│ ├── minGlue-stdio.h
│ ├── minGlue.h
│ ├── minIni.c
│ ├── minIni.h
│ ├── minIni.pdf
│ ├── test.c
│ ├── test.ini
│ └── testplain.ini
├── mm
│ ├── mm_addfreechunk.c
│ ├── mm_calloc.c
│ ├── mm_free.c
│ ├── mm_initialize.c
│ ├── mm_mallinfo.c
│ ├── mm_malloc.c
│ ├── mm_memalign.c
│ ├── mm_realloc.c
│ ├── mm_sem.c
│ ├── mm_shrinkchunk.c
│ ├── mm_size2ndx.c
│ ├── mm_user.c
│ └── mm_zalloc.c
├── mp3-fixpt-helix
│ ├── LICENSE.txt
│ ├── RCSL.txt
│ ├── RPSL.txt
│ ├── mp3dec.c
│ ├── mp3tabs.c
│ ├── pub
│ │ ├── LICENSE.txt
│ │ ├── RCSL.txt
│ │ ├── RPSL.txt
│ │ ├── mp3common.h
│ │ ├── mp3dec.h
│ │ ├── mpadecobjfixpt.h
│ │ └── statname.h
│ ├── readme.txt
│ └── real
│ │ ├── LICENSE.txt
│ │ ├── RCSL.txt
│ │ ├── RPSL.txt
│ │ ├── assembly.h
│ │ ├── bitstream.c
│ │ ├── buffers.c
│ │ ├── coder.h
│ │ ├── dct32.c
│ │ ├── dequant.c
│ │ ├── dqchan.c
│ │ ├── huffman.c
│ │ ├── hufftabs.c
│ │ ├── imdct.c
│ │ ├── polyphase.c
│ │ ├── scalfact.c
│ │ ├── stproc.c
│ │ ├── subband.c
│ │ └── trigtabs_fixpt.c
├── ogg
│ └── framing.c
└── opus
│ ├── celt
│ ├── _kiss_fft_guts.h
│ ├── arch.h
│ ├── bands.c
│ ├── bands.h
│ ├── celt.c
│ ├── celt.h
│ ├── celt_lpc.c
│ ├── celt_lpc.h
│ ├── cwrs.c
│ ├── cwrs.h
│ ├── ecintrin.h
│ ├── entcode.c
│ ├── entcode.h
│ ├── entdec.c
│ ├── entdec.h
│ ├── entenc.c
│ ├── entenc.h
│ ├── fixed_arm5e.h
│ ├── fixed_debug.h
│ ├── fixed_generic.h
│ ├── float_cast.h
│ ├── kiss_fft.c
│ ├── kiss_fft.h
│ ├── laplace.c
│ ├── laplace.h
│ ├── mathops.c
│ ├── mathops.h
│ ├── mdct.c
│ ├── mdct.h
│ ├── mfrngcod.h
│ ├── modes.c
│ ├── modes.h
│ ├── os_support.h
│ ├── pitch.c
│ ├── pitch.h
│ ├── quant_bands.c
│ ├── quant_bands.h
│ ├── rate.c
│ ├── rate.h
│ ├── stack_alloc.h
│ ├── static_modes_fixed.h
│ ├── static_modes_float.h
│ ├── tests
│ │ ├── test_unit_cwrs32.c
│ │ ├── test_unit_dft.c
│ │ ├── test_unit_entropy.c
│ │ ├── test_unit_laplace.c
│ │ ├── test_unit_mathops.c
│ │ ├── test_unit_mdct.c
│ │ ├── test_unit_rotation.c
│ │ └── test_unit_types.c
│ ├── vq.c
│ └── vq.h
│ ├── config.h
│ ├── include
│ ├── opus.h
│ ├── opus_custom.h
│ ├── opus_defines.h
│ ├── opus_header.h
│ ├── opus_multistream.h
│ └── opus_types.h
│ ├── silk
│ ├── A2NLSF.c
│ ├── API.h
│ ├── CNG.c
│ ├── HP_variable_cutoff.c
│ ├── Inlines.h
│ ├── LPC_analysis_filter.c
│ ├── LPC_inv_pred_gain.c
│ ├── LP_variable_cutoff.c
│ ├── MacroCount.h
│ ├── MacroDebug.h
│ ├── NLSF2A.c
│ ├── NLSF_VQ.c
│ ├── NLSF_VQ_weights_laroia.c
│ ├── NLSF_decode.c
│ ├── NLSF_del_dec_quant.c
│ ├── NLSF_encode.c
│ ├── NLSF_stabilize.c
│ ├── NLSF_unpack.c
│ ├── NSQ.c
│ ├── NSQ_del_dec.c
│ ├── PLC.c
│ ├── PLC.h
│ ├── SigProc_FIX.h
│ ├── VAD.c
│ ├── VQ_WMat_EC.c
│ ├── ana_filt_bank_1.c
│ ├── biquad_alt.c
│ ├── bwexpander.c
│ ├── bwexpander_32.c
│ ├── check_control_input.c
│ ├── code_signs.c
│ ├── control.h
│ ├── control_SNR.c
│ ├── control_audio_bandwidth.c
│ ├── control_codec.c
│ ├── debug.c
│ ├── debug.h
│ ├── dec_API.c
│ ├── decode_core.c
│ ├── decode_frame.c
│ ├── decode_indices.c
│ ├── decode_parameters.c
│ ├── decode_pitch.c
│ ├── decode_pulses.c
│ ├── decoder_set_fs.c
│ ├── define.h
│ ├── enc_API.c
│ ├── encode_indices.c
│ ├── encode_pulses.c
│ ├── errors.h
│ ├── fixed
│ │ ├── LTP_analysis_filter_FIX.c
│ │ ├── LTP_scale_ctrl_FIX.c
│ │ ├── apply_sine_window_FIX.c
│ │ ├── autocorr_FIX.c
│ │ ├── burg_modified_FIX.c
│ │ ├── corrMatrix_FIX.c
│ │ ├── encode_frame_FIX.c
│ │ ├── find_LPC_FIX.c
│ │ ├── find_LTP_FIX.c
│ │ ├── find_pitch_lags_FIX.c
│ │ ├── find_pred_coefs_FIX.c
│ │ ├── k2a_FIX.c
│ │ ├── k2a_Q16_FIX.c
│ │ ├── main_FIX.h
│ │ ├── noise_shape_analysis_FIX.c
│ │ ├── pitch_analysis_core_FIX.c
│ │ ├── prefilter_FIX.c
│ │ ├── process_gains_FIX.c
│ │ ├── regularize_correlations_FIX.c
│ │ ├── residual_energy16_FIX.c
│ │ ├── residual_energy_FIX.c
│ │ ├── schur64_FIX.c
│ │ ├── schur_FIX.c
│ │ ├── solve_LS_FIX.c
│ │ ├── structs_FIX.h
│ │ ├── vector_ops_FIX.c
│ │ └── warped_autocorrelation_FIX.c
│ ├── float
│ │ ├── LPC_analysis_filter_FLP.c
│ │ ├── LPC_inv_pred_gain_FLP.c
│ │ ├── LTP_analysis_filter_FLP.c
│ │ ├── LTP_scale_ctrl_FLP.c
│ │ ├── SigProc_FLP.h
│ │ ├── apply_sine_window_FLP.c
│ │ ├── autocorrelation_FLP.c
│ │ ├── burg_modified_FLP.c
│ │ ├── bwexpander_FLP.c
│ │ ├── corrMatrix_FLP.c
│ │ ├── encode_frame_FLP.c
│ │ ├── energy_FLP.c
│ │ ├── find_LPC_FLP.c
│ │ ├── find_LTP_FLP.c
│ │ ├── find_pitch_lags_FLP.c
│ │ ├── find_pred_coefs_FLP.c
│ │ ├── inner_product_FLP.c
│ │ ├── k2a_FLP.c
│ │ ├── levinsondurbin_FLP.c
│ │ ├── main_FLP.h
│ │ ├── noise_shape_analysis_FLP.c
│ │ ├── pitch_analysis_core_FLP.c
│ │ ├── prefilter_FLP.c
│ │ ├── process_gains_FLP.c
│ │ ├── regularize_correlations_FLP.c
│ │ ├── residual_energy_FLP.c
│ │ ├── scale_copy_vector_FLP.c
│ │ ├── scale_vector_FLP.c
│ │ ├── schur_FLP.c
│ │ ├── solve_LS_FLP.c
│ │ ├── sort_FLP.c
│ │ ├── structs_FLP.h
│ │ ├── warped_autocorrelation_FLP.c
│ │ └── wrappers_FLP.c
│ ├── gain_quant.c
│ ├── init_decoder.c
│ ├── init_encoder.c
│ ├── inner_prod_aligned.c
│ ├── interpolate.c
│ ├── lin2log.c
│ ├── log2lin.c
│ ├── macros.h
│ ├── main.h
│ ├── pitch_est_defines.h
│ ├── pitch_est_tables.c
│ ├── process_NLSFs.c
│ ├── quant_LTP_gains.c
│ ├── resampler.c
│ ├── resampler_down2.c
│ ├── resampler_down2_3.c
│ ├── resampler_private.h
│ ├── resampler_private_AR2.c
│ ├── resampler_private_IIR_FIR.c
│ ├── resampler_private_down_FIR.c
│ ├── resampler_private_up2_HQ.c
│ ├── resampler_rom.c
│ ├── resampler_rom.h
│ ├── resampler_structs.h
│ ├── shell_coder.c
│ ├── sigm_Q15.c
│ ├── sort.c
│ ├── stereo_LR_to_MS.c
│ ├── stereo_MS_to_LR.c
│ ├── stereo_decode_pred.c
│ ├── stereo_encode_pred.c
│ ├── stereo_find_predictor.c
│ ├── stereo_quant_pred.c
│ ├── structs.h
│ ├── sum_sqr_shift.c
│ ├── table_LSF_cos.c
│ ├── tables.h
│ ├── tables_LTP.c
│ ├── tables_NLSF_CB_NB_MB.c
│ ├── tables_NLSF_CB_WB.c
│ ├── tables_gain.c
│ ├── tables_other.c
│ ├── tables_pitch_lag.c
│ ├── tables_pulses_per_block.c
│ ├── tuning_parameters.h
│ └── typedef.h
│ └── src
│ ├── opus.c
│ ├── opus_decoder.c
│ ├── opus_header.c
│ ├── opus_private.h
│ └── repacketizer.c
├── main.c
├── mkindex.sh
├── openocd_stlinkv2.cfg
├── patch_cmake.sh
├── pcb
├── .gitignore
├── gerber-txt-info.sh
├── gerber
│ ├── info
│ │ ├── walkgeek_board_edge.txt
│ │ ├── walkgeek_bottom.txt
│ │ ├── walkgeek_bottom_components.pdf
│ │ ├── walkgeek_bottom_copper.pdf
│ │ ├── walkgeek_bottom_stop.pdf
│ │ ├── walkgeek_bottommask.txt
│ │ ├── walkgeek_drill.txt
│ │ ├── walkgeek_top.txt
│ │ ├── walkgeek_top_components.pdf
│ │ ├── walkgeek_top_copper.pdf
│ │ ├── walkgeek_top_stop.pdf
│ │ ├── walkgeek_topmask.txt
│ │ └── walkgeek_topsilk.txt
│ ├── walkgeek_board_edge.gbr
│ ├── walkgeek_bottom.gbr
│ ├── walkgeek_bottommask.gbr
│ ├── walkgeek_drill.xln
│ ├── walkgeek_top.gbr
│ ├── walkgeek_topmask.gbr
│ └── walkgeek_topsilk.gbr
├── sfe-gerb274x.cam
├── walkgeek-eagle.lbr
├── walkgeek.brd
└── walkgeek.sch
├── src
├── audio_buffer.c
├── navigator.c
├── nestedfilter.c
├── player
│ ├── mediafile.c
│ ├── mediafile.h
│ ├── mp3_decoder.c
│ ├── mp3_decoder.h
│ ├── opus_decoder.c
│ ├── opus_decoder.h
│ ├── player.c
│ ├── wav_decoder.c
│ └── wav_decoder.h
├── powermanager.c
├── ui
│ ├── display.c
│ ├── player_ui.c
│ ├── ui.c
│ └── usb_ui.c
└── usbd.c
└── stm32f4x.cfg
/.gitignore:
--------------------------------------------------------------------------------
1 | .cproject
2 | .project
3 | _todo
4 | /Build
5 |
6 | *.bin
7 | *.o
8 | *.a
9 | *.d
10 | *.i
11 | *~
12 | core
13 | debug.gdb
14 | *.orig
15 |
16 | Literature/
17 |
18 | .DS_Store
19 |
20 |
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.8.4)
2 |
3 | if(NOT PLATFORM STREQUAL "SIMULATOR")
4 | include(gnu_toolchain.cmake)
5 | endif()
6 |
7 | PROJECT(walkgeek C ASM)
8 |
9 | include(flags.cmake)
10 |
11 | include_directories(
12 | include
13 | lib
14 | lib/fat_fs
15 | lib/mp3-fixpt-helix/pub
16 | lib/minIni
17 | lib/opus/include
18 | lib/freertos/include
19 | )
20 |
21 | add_definitions(-DUSE_FULL_ASSERT)
22 |
23 | if(PROFILING)
24 | add_definitions(-DPROFILING)
25 | set(ENABLE_TRACE 1)
26 | endif()
27 |
28 | if(ENABLE_TRACE)
29 | add_definitions(-DENABLE_TRACE)
30 | endif()
31 |
32 | if(USE_MP3)
33 | add_definitions(-DUSE_MP3)
34 | endif()
35 |
36 | include(bsp/bsp.cmake)
37 |
38 | add_subdirectory(lib)
39 |
40 | set (SOURCES
41 | src/audio_buffer.c
42 | # src/player/wav_decoder.c
43 | src/player/opus_decoder.c
44 | src/player/player.c
45 | src/player/mediafile.c
46 | src/navigator.c
47 | src/nestedfilter.c
48 | src/ui/ui.c
49 | src/ui/display.c
50 | src/ui/player_ui.c
51 | src/ui/usb_ui.c
52 | src/usbd.c
53 |
54 | main.c
55 | )
56 |
57 | if(HAS_BATTERY)
58 | set (SOURCES ${SOURCES}
59 | src/powermanager.c
60 | )
61 | endif()
62 |
63 | IF(USE_MP3)
64 | set (SOURCES ${SOURCES}
65 | src/player/mp3_decoder.c
66 | )
67 | endif()
68 |
69 | add_executable(${CMAKE_PROJECT_NAME}.elf ${SOURCES} ${CSP_SOURCES} ${BSP_SOURCES})
70 |
71 | target_link_libraries(${CMAKE_PROJECT_NAME}.elf lib ${LIBRARIES})
72 |
73 | add_custom_target(${CMAKE_PROJECT_NAME}.hex DEPENDS ${CMAKE_PROJECT_NAME}.elf COMMAND ${CMAKE_OBJCOPY} -Oihex ${CMAKE_PROJECT_NAME}.elf ${CMAKE_PROJECT_NAME}.hex)
74 | add_custom_target(${CMAKE_PROJECT_NAME}.bin DEPENDS ${CMAKE_PROJECT_NAME}.elf COMMAND ${CMAKE_OBJCOPY} -Obinary ${CMAKE_PROJECT_NAME}.elf ${CMAKE_PROJECT_NAME}.bin)
75 | add_custom_target(${CMAKE_PROJECT_NAME}.dis DEPENDS ${CMAKE_PROJECT_NAME}.elf COMMAND ${CMAKE_OBJDUMP} -dDsS ${CMAKE_PROJECT_NAME}.elf > ${CMAKE_PROJECT_NAME}.dis)
76 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015, Oleg Tsaregorodtsev
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | * Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 |
10 | * 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 |
14 | * Neither the name of walkgeek nor the names of its
15 | contributors may be used to endorse or promote products derived from
16 | this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 |
--------------------------------------------------------------------------------
/TODO:
--------------------------------------------------------------------------------
1 | FIXME:
2 | - test OGG seeking
3 | - USB removal handling
4 | - display sometimes adds some bytes after row/col is set, probably problem is
5 | with ISR timeouts
6 | - trace via CDC goes insane after some amount of data
7 | - limit min audio file size
8 |
9 | TODO:
10 | - usb audio
11 | - handle additional cases: no sd card in
12 |
13 | - shutdown ADC threshold
14 | - assert/hard fault -> software irq-less DISP + ability to shut down the player
15 | - Centralized IRQ management
16 | - I2S frequency is inaccurate
17 | - sd card double buffering bug -> temp. workaround -> reduce size
18 | - SD card DMA timeouts
19 | - memzero when de-init Player
20 | - Audio DMA Circular Mode
21 | - pause when headset is removed
22 | - when power-on by USB, go to USB mode, do not apply power???
23 | - when detached from USB, shutdown USB
24 | - FreeRTOS Simulator
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/CMSIS/CMSIS END USER LICENCE AGREEMENT.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/CMSIS/CMSIS END USER LICENCE AGREEMENT.pdf
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file system_stm32f4xx.h
4 | * @author MCD Application Team
5 | * @version V1.0.2
6 | * @date 05-March-2012
7 | * @brief CMSIS Cortex-M4 Device System Source File for STM32F4xx devices.
8 | ******************************************************************************
9 | * @attention
10 | *
11 | *
© COPYRIGHT 2012 STMicroelectronics
12 | *
13 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
14 | * You may not use this file except in compliance with the License.
15 | * You may obtain a copy of the License at:
16 | *
17 | * http://www.st.com/software_license_agreement_liberty_v2
18 | *
19 | * Unless required by applicable law or agreed to in writing, software
20 | * distributed under the License is distributed on an "AS IS" BASIS,
21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 | * See the License for the specific language governing permissions and
23 | * limitations under the License.
24 | *
25 | ******************************************************************************
26 | */
27 |
28 | /** @addtogroup CMSIS
29 | * @{
30 | */
31 |
32 | /** @addtogroup stm32f4xx_system
33 | * @{
34 | */
35 |
36 | /**
37 | * @brief Define to prevent recursive inclusion
38 | */
39 | #ifndef __SYSTEM_STM32F4XX_H
40 | #define __SYSTEM_STM32F4XX_H
41 |
42 | #ifdef __cplusplus
43 | extern "C" {
44 | #endif
45 |
46 | /** @addtogroup STM32F4xx_System_Includes
47 | * @{
48 | */
49 |
50 | /**
51 | * @}
52 | */
53 |
54 |
55 | /** @addtogroup STM32F4xx_System_Exported_types
56 | * @{
57 | */
58 |
59 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
60 |
61 |
62 | /**
63 | * @}
64 | */
65 |
66 | /** @addtogroup STM32F4xx_System_Exported_Constants
67 | * @{
68 | */
69 |
70 | /**
71 | * @}
72 | */
73 |
74 | /** @addtogroup STM32F4xx_System_Exported_Macros
75 | * @{
76 | */
77 |
78 | /**
79 | * @}
80 | */
81 |
82 | /** @addtogroup STM32F4xx_System_Exported_Functions
83 | * @{
84 | */
85 |
86 | extern void SystemInit(void);
87 | extern void SystemCoreClockUpdate(void);
88 | /**
89 | * @}
90 | */
91 |
92 | #ifdef __cplusplus
93 | }
94 | #endif
95 |
96 | #endif /*__SYSTEM_STM32F4XX_H */
97 |
98 | /**
99 | * @}
100 | */
101 |
102 | /**
103 | * @}
104 | */
105 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
106 |
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/CMSIS/Documentation/CMSIS_CM4_SIMD.htm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/CMSIS/Documentation/CMSIS_CM4_SIMD.htm
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/CMSIS/Documentation/CMSIS_Core.htm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/CMSIS/Documentation/CMSIS_Core.htm
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/CMSIS/Documentation/CMSIS_DebugSupport.htm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/CMSIS/Documentation/CMSIS_DebugSupport.htm
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/CMSIS/Documentation/CMSIS_History.htm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/CMSIS/Documentation/CMSIS_History.htm
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/CMSIS/Documentation/CMSIS_Logo_Final.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/CMSIS/Documentation/CMSIS_Logo_Final.jpg
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/CMSIS/Documentation/CMSIS_System_View_Description.htm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/CMSIS/Documentation/CMSIS_System_View_Description.htm
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/CMSIS/Include/arm_common_tables.h:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 11. November 2010
5 | * $Revision: V1.0.2
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_common_tables.h
9 | *
10 | * Description: This file has extern declaration for common tables like Bitreverse, reciprocal etc which are used across different functions
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3
13 | *
14 | * Version 1.0.2 2010/11/11
15 | * Documentation updated.
16 | *
17 | * Version 1.0.1 2010/10/05
18 | * Production release and review comments incorporated.
19 | *
20 | * Version 1.0.0 2010/09/20
21 | * Production release and review comments incorporated.
22 | * -------------------------------------------------------------------- */
23 |
24 | #ifndef _ARM_COMMON_TABLES_H
25 | #define _ARM_COMMON_TABLES_H
26 |
27 | #include "arm_math.h"
28 |
29 | extern uint16_t armBitRevTable[256];
30 | extern q15_t armRecipTableQ15[64];
31 | extern q31_t armRecipTableQ31[64];
32 | extern const q31_t realCoefAQ31[1024];
33 | extern const q31_t realCoefBQ31[1024];
34 |
35 | #endif /* ARM_COMMON_TABLES_H */
36 |
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/CMSIS/README.txt:
--------------------------------------------------------------------------------
1 | * -------------------------------------------------------------------
2 | * Copyright (C) 2011 ARM Limited. All rights reserved.
3 | *
4 | * Date: 25 July 2011
5 | * Revision: V2.10
6 | *
7 | * Project: Cortex Microcontroller Software Interface Standard (CMSIS)
8 | * Title: Release Note for CMSIS
9 | *
10 | * -------------------------------------------------------------------
11 |
12 |
13 | NOTE - Open the index.html file to access CMSIS documentation
14 |
15 |
16 | The Cortex Microcontroller Software Interface Standard (CMSIS) provides a single standard across all
17 | Cortex-Mx processor series vendors. It enables code re-use and code sharing across software projects
18 | and reduces time-to-market for new embedded applications.
19 |
20 | CMSIS is released under the terms of the end user license agreement ("CMSIS END USER LICENCE AGREEMENT.pdf").
21 | Any user of the software package is bound to the terms and conditions of the end user license agreement.
22 |
23 |
24 | You will find the following sub-directories:
25 |
26 | Documentation - Contains CMSIS documentation.
27 |
28 | DSP_Lib - MDK project files, Examples and source files etc.. to build the
29 | CMSIS DSP Software Library for Cortex-M0, Cortex-M3, Cortex-M4 processors.
30 |
31 | Include - CMSIS Core Support and CMSIS DSP Include Files.
32 |
33 | Lib - CMSIS DSP Binaries
34 | ---
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/CMSIS/index.htm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/CMSIS/index.htm
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32F4xx_StdPeriph_Driver/Release_Notes.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32F4xx_StdPeriph_Driver/Release_Notes.html
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_crc.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f4xx_crc.h
4 | * @author MCD Application Team
5 | * @version V1.0.2
6 | * @date 05-March-2012
7 | * @brief This file contains all the functions prototypes for the CRC firmware
8 | * library.
9 | ******************************************************************************
10 | * @attention
11 | *
12 | * © COPYRIGHT 2012 STMicroelectronics
13 | *
14 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
15 | * You may not use this file except in compliance with the License.
16 | * You may obtain a copy of the License at:
17 | *
18 | * http://www.st.com/software_license_agreement_liberty_v2
19 | *
20 | * Unless required by applicable law or agreed to in writing, software
21 | * distributed under the License is distributed on an "AS IS" BASIS,
22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 | * See the License for the specific language governing permissions and
24 | * limitations under the License.
25 | *
26 | ******************************************************************************
27 | */
28 |
29 | /* Define to prevent recursive inclusion -------------------------------------*/
30 | #ifndef __STM32F4xx_CRC_H
31 | #define __STM32F4xx_CRC_H
32 |
33 | #ifdef __cplusplus
34 | extern "C" {
35 | #endif
36 |
37 | /* Includes ------------------------------------------------------------------*/
38 | #include "stm32f4xx.h"
39 |
40 | /** @addtogroup STM32F4xx_StdPeriph_Driver
41 | * @{
42 | */
43 |
44 | /** @addtogroup CRC
45 | * @{
46 | */
47 |
48 | /* Exported types ------------------------------------------------------------*/
49 | /* Exported constants --------------------------------------------------------*/
50 |
51 | /** @defgroup CRC_Exported_Constants
52 | * @{
53 | */
54 |
55 | /**
56 | * @}
57 | */
58 |
59 | /* Exported macro ------------------------------------------------------------*/
60 | /* Exported functions --------------------------------------------------------*/
61 |
62 | void CRC_ResetDR(void);
63 | uint32_t CRC_CalcCRC(uint32_t Data);
64 | uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength);
65 | uint32_t CRC_GetCRC(void);
66 | void CRC_SetIDRegister(uint8_t IDValue);
67 | uint8_t CRC_GetIDRegister(void);
68 |
69 | #ifdef __cplusplus
70 | }
71 | #endif
72 |
73 | #endif /* __STM32F4xx_CRC_H */
74 |
75 | /**
76 | * @}
77 | */
78 |
79 | /**
80 | * @}
81 | */
82 |
83 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
84 |
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_flash.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_flash.c
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/cdc/inc/usbd_cdc_if_template.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file usbd_cdc_if_template.h
4 | * @author MCD Application Team
5 | * @version V1.0.0
6 | * @date 22-July-2011
7 | * @brief Header for dfu_mal.c file.
8 | ******************************************************************************
9 | * @attention
10 | *
11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
17 | *
18 | * © COPYRIGHT 2011 STMicroelectronics
19 | ******************************************************************************
20 | */
21 |
22 | /* Define to prevent recursive inclusion -------------------------------------*/
23 | #ifndef __USBD_CDC_IF_TEMPLATE_H
24 | #define __USBD_CDC_IF_TEMPLATE_H
25 |
26 | /* Includes ------------------------------------------------------------------*/
27 | #ifdef STM32F2XX
28 | #include "stm32f2xx.h"
29 | #elif defined(STM32F10X_CL)
30 | #include "stm32f10x.h"
31 | #endif /* STM32F2XX */
32 |
33 | #include "usbd_conf.h"
34 | #include "usbd_cdc_core.h"
35 |
36 | /* Exported types ------------------------------------------------------------*/
37 | /* Exported constants --------------------------------------------------------*/
38 |
39 | extern CDC_IF_Prop_TypeDef TEMPLATE_fops;
40 |
41 | /* Exported macro ------------------------------------------------------------*/
42 | /* Exported functions ------------------------------------------------------- */
43 | #endif /* __USBD_CDC_IF_TEMPLATE_H */
44 |
45 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
46 |
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_flash_if.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file usbd_flash_if.h
4 | * @author MCD Application Team
5 | * @version V1.0.0RC1
6 | * @date 18-March-2011
7 | * @brief Header for usbd_flash_if.c file.
8 | ******************************************************************************
9 | * @attention
10 | *
11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
17 | *
18 | * © COPYRIGHT 2011 STMicroelectronics
19 | ******************************************************************************
20 | */
21 |
22 | /* Define to prevent recursive inclusion -------------------------------------*/
23 | #ifndef __FLASH_IF_MAL_H
24 | #define __FLASH_IF_MAL_H
25 |
26 | /* Includes ------------------------------------------------------------------*/
27 | #include "usbd_dfu_mal.h"
28 |
29 | /* Exported types ------------------------------------------------------------*/
30 | /* Exported constants --------------------------------------------------------*/
31 | #define FLASH_START_ADD 0x08000000
32 |
33 | #ifdef STM32F2XX
34 | #define FLASH_END_ADD 0x08100000
35 | #define FLASH_IF_STRING "@Internal Flash /0x08000000/03*016Ka,01*016Kg,01*064Kg,07*128Kg"
36 | #elif defined(STM32F10X_CL)
37 | #define FLASH_END_ADD 0x08040000
38 | #define FLASH_IF_STRING "@Internal Flash /0x08000000/06*002Ka,122*002Kg"
39 | #endif /* STM32F2XX */
40 |
41 |
42 | extern DFU_MAL_Prop_TypeDef DFU_Flash_cb;
43 |
44 | /* Exported macro ------------------------------------------------------------*/
45 | /* Exported functions ------------------------------------------------------- */
46 |
47 | #endif /* __FLASH_IF_MAL_H */
48 |
49 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
50 |
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_mem_if_template.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file usbd_mem_if_template.h
4 | * @author MCD Application Team
5 | * @version V1.0.0
6 | * @date 22-July-2011
7 | * @brief Header for usbd_mem_if_template.c file.
8 | ******************************************************************************
9 | * @attention
10 | *
11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
17 | *
18 | * © COPYRIGHT 2011 STMicroelectronics
19 | ******************************************************************************
20 | */
21 |
22 | /* Define to prevent recursive inclusion -------------------------------------*/
23 | #ifndef __MEM_IF_MAL_H
24 | #define __MEM_IF_MAL_H
25 |
26 | /* Includes ------------------------------------------------------------------*/
27 | #ifdef STM32F2XX
28 | #include "stm32f2xx.h"
29 | #endif /* STM32F2XX */
30 | #include "usbd_dfu_mal.h"
31 |
32 | /* Exported types ------------------------------------------------------------*/
33 | /* Exported constants --------------------------------------------------------*/
34 | #define MEM_START_ADD 0x00000000 /* Dummy start address */
35 | #define MEM_END_ADD (uint32_t)(MEM_START_ADD + (5 * 1024)) /* Dummy Size = 5KB */
36 |
37 | #define MEM_IF_STRING "@Dummy Memory /0x00000000/01*002Kg,03*001Kg"
38 |
39 | extern DFU_MAL_Prop_TypeDef DFU_Mem_cb;
40 |
41 | /* Exported macro ------------------------------------------------------------*/
42 | /* Exported functions ------------------------------------------------------- */
43 |
44 | #endif /* __MEM_IF_MAL_H */
45 |
46 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
47 |
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_otp_if.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file usbd_otp_if.h
4 | * @author MCD Application Team
5 | * @version V1.0.0
6 | * @date 22-July-2011
7 | * @brief Header for usbd_otp_if.c file.
8 | ******************************************************************************
9 | * @attention
10 | *
11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
17 | *
18 | * © COPYRIGHT 2011 STMicroelectronics
19 | ******************************************************************************
20 | */
21 |
22 | /* Define to prevent recursive inclusion -------------------------------------*/
23 | #ifndef __OTP_IF_MAL_H
24 | #define __OTP_IF_MAL_H
25 |
26 | /* Includes ------------------------------------------------------------------*/
27 | #include "usbd_dfu_mal.h"
28 |
29 | /* Exported types ------------------------------------------------------------*/
30 | /* Exported constants --------------------------------------------------------*/
31 | #define OTP_START_ADD 0x1FFF7800
32 | #define OTP_END_ADD (uint32_t)(OTP_START_ADD + 528)
33 |
34 | #define OTP_IF_STRING "@OTP Area /0x1FFF7800/01*512 g,01*016 g"
35 |
36 | extern DFU_MAL_Prop_TypeDef DFU_Otp_cb;
37 |
38 | /* Exported macro ------------------------------------------------------------*/
39 | /* Exported functions ------------------------------------------------------- */
40 |
41 | #endif /* __OTP_IF_MAL_H */
42 |
43 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
44 |
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_core.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file usbd_msc_core.h
4 | * @author MCD Application Team
5 | * @version V1.0.0
6 | * @date 22-July-2011
7 | * @brief header for the usbd_msc_core.c file
8 | ******************************************************************************
9 | * @attention
10 | *
11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
17 | *
18 | * © COPYRIGHT 2011 STMicroelectronics
19 | ******************************************************************************
20 | */
21 |
22 | /* Define to prevent recursive inclusion -------------------------------------*/
23 | #ifndef _USB_MSC_CORE_H_
24 | #define _USB_MSC_CORE_H_
25 |
26 | #include "usbd_ioreq.h"
27 |
28 | /** @addtogroup USBD_MSC_BOT
29 | * @{
30 | */
31 |
32 | /** @defgroup USBD_MSC
33 | * @brief This file is the Header file for USBD_msc.c
34 | * @{
35 | */
36 |
37 |
38 | /** @defgroup USBD_BOT_Exported_Defines
39 | * @{
40 | */
41 |
42 |
43 | #define BOT_GET_MAX_LUN 0xFE
44 | #define BOT_RESET 0xFF
45 | #define USB_MSC_CONFIG_DESC_SIZ 32
46 |
47 | #define MSC_EPIN_SIZE *(uint16_t *)(((USB_OTG_CORE_HANDLE *)pdev)->dev.pConfig_descriptor + 22)
48 |
49 | #define MSC_EPOUT_SIZE *(uint16_t *)(((USB_OTG_CORE_HANDLE *)pdev)->dev.pConfig_descriptor + 29)
50 |
51 | /**
52 | * @}
53 | */
54 |
55 | /** @defgroup USB_CORE_Exported_Types
56 | * @{
57 | */
58 |
59 | extern USBD_Class_cb_TypeDef USBD_MSC_cb;
60 | /**
61 | * @}
62 | */
63 |
64 | /**
65 | * @}
66 | */
67 | #endif // _USB_MSC_CORE_H_
68 | /**
69 | * @}
70 | */
71 |
72 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
73 |
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_data.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file usbd_msc_data.h
4 | * @author MCD Application Team
5 | * @version V1.0.0
6 | * @date 22-July-2011
7 | * @brief header for the usbd_msc_data.c file
8 | ******************************************************************************
9 | * @attention
10 | *
11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
17 | *
18 | * © COPYRIGHT 2011 STMicroelectronics
19 | ******************************************************************************
20 | */
21 |
22 | /* Define to prevent recursive inclusion -------------------------------------*/
23 |
24 | #ifndef _USBD_MSC_DATA_H_
25 | #define _USBD_MSC_DATA_H_
26 |
27 | /* Includes ------------------------------------------------------------------*/
28 | #include "usbd_conf.h"
29 |
30 | /** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY
31 | * @{
32 | */
33 |
34 | /** @defgroup USB_INFO
35 | * @brief general defines for the usb device library file
36 | * @{
37 | */
38 |
39 | /** @defgroup USB_INFO_Exported_Defines
40 | * @{
41 | */
42 | #define MODE_SENSE6_LEN 8
43 | #define MODE_SENSE10_LEN 8
44 | #define LENGTH_INQUIRY_PAGE00 7
45 | #define LENGTH_FORMAT_CAPACITIES 20
46 |
47 | /**
48 | * @}
49 | */
50 |
51 |
52 | /** @defgroup USBD_INFO_Exported_TypesDefinitions
53 | * @{
54 | */
55 | /**
56 | * @}
57 | */
58 |
59 |
60 |
61 | /** @defgroup USBD_INFO_Exported_Macros
62 | * @{
63 | */
64 |
65 | /**
66 | * @}
67 | */
68 |
69 | /** @defgroup USBD_INFO_Exported_Variables
70 | * @{
71 | */
72 | extern const uint8_t MSC_Page00_Inquiry_Data[];
73 | extern const uint8_t MSC_Mode_Sense6_data[];
74 | extern const uint8_t MSC_Mode_Sense10_data[] ;
75 |
76 | /**
77 | * @}
78 | */
79 |
80 | /** @defgroup USBD_INFO_Exported_FunctionsPrototype
81 | * @{
82 | */
83 |
84 | /**
85 | * @}
86 | */
87 |
88 | #endif /* _USBD_MSC_DATA_H_ */
89 |
90 | /**
91 | * @}
92 | */
93 |
94 | /**
95 | * @}
96 | */
97 |
98 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
99 |
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_conf_template.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file usbd_conf_template.h
4 | * @author MCD Application Team
5 | * @version V1.0.0
6 | * @date 22-July-2011
7 | * @brief usb device configuration template file
8 | ******************************************************************************
9 | * @attention
10 | *
11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
17 | *
18 | * © COPYRIGHT 2011 STMicroelectronics
19 | ******************************************************************************
20 | */
21 |
22 | /* Define to prevent recursive inclusion -------------------------------------*/
23 | #ifndef __USBD_CONF__H__
24 | #define __USBD_CONF__H__
25 |
26 | /* Includes ------------------------------------------------------------------*/
27 | #include "stm32f2xx.h"
28 |
29 |
30 |
31 | /** @defgroup USB_CONF_Exported_Defines
32 | * @{
33 | */
34 | #define USE_USB_OTG_HS
35 |
36 | #define USBD_CFG_MAX_NUM 1
37 | #define USB_MAX_STR_DESC_SIZ 64
38 | #define USBD_EP0_MAX_PACKET_SIZE 64
39 |
40 | /**
41 | * @}
42 | */
43 |
44 |
45 | /** @defgroup USB_CONF_Exported_Types
46 | * @{
47 | */
48 | /**
49 | * @}
50 | */
51 |
52 |
53 | /** @defgroup USB_CONF_Exported_Macros
54 | * @{
55 | */
56 | /**
57 | * @}
58 | */
59 |
60 | /** @defgroup USB_CONF_Exported_Variables
61 | * @{
62 | */
63 | /**
64 | * @}
65 | */
66 |
67 | /** @defgroup USB_CONF_Exported_FunctionsPrototype
68 | * @{
69 | */
70 | /**
71 | * @}
72 | */
73 |
74 |
75 | #endif //__USBD_CONF__H__
76 |
77 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
78 |
79 |
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_HOST_Library/Core/inc/usbh_conf_template.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file usbh_conf_template
4 | * @author MCD Application Team
5 | * @version V2.0.0
6 | * @date 22-July-2011
7 | * @brief General USB Host library configuration
8 | ******************************************************************************
9 | * @attention
10 | *
11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
17 | *
18 | * © COPYRIGHT 2011 STMicroelectronics
19 | ******************************************************************************
20 | */
21 |
22 | /* Define to prevent recursive inclusion -------------------------------------*/
23 | #ifndef __USBH_CONF__H__
24 | #define __USBH_CONF__H__
25 |
26 | /* Includes ------------------------------------------------------------------*/
27 | /** @addtogroup USBH_OTG_DRIVER
28 | * @{
29 | */
30 |
31 | /** @defgroup USBH_CONF
32 | * @brief usb otg low level driver configuration file
33 | * @{
34 | */
35 |
36 | /** @defgroup USBH_CONF_Exported_Defines
37 | * @{
38 | */
39 |
40 | #define USBH_MAX_NUM_ENDPOINTS 2
41 | #define USBH_MAX_NUM_INTERFACES 2
42 | #ifdef USE_USB_OTG_FS
43 | #define USBH_MSC_MPS_SIZE 0x40
44 | #else
45 | #define USBH_MSC_MPS_SIZE 0x200
46 | #endif
47 |
48 | /**
49 | * @}
50 | */
51 |
52 |
53 | /** @defgroup USBH_CONF_Exported_Types
54 | * @{
55 | */
56 | /**
57 | * @}
58 | */
59 |
60 |
61 | /** @defgroup USBH_CONF_Exported_Macros
62 | * @{
63 | */
64 | /**
65 | * @}
66 | */
67 |
68 | /** @defgroup USBH_CONF_Exported_Variables
69 | * @{
70 | */
71 | /**
72 | * @}
73 | */
74 |
75 | /** @defgroup USBH_CONF_Exported_FunctionsPrototype
76 | * @{
77 | */
78 | /**
79 | * @}
80 | */
81 |
82 |
83 | #endif //__USBH_CONF__H__
84 |
85 |
86 | /**
87 | * @}
88 | */
89 |
90 | /**
91 | * @}
92 | */
93 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
94 |
95 |
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_bsp.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file usb_bsp.h
4 | * @author MCD Application Team
5 | * @version V2.0.0
6 | * @date 22-July-2011
7 | * @brief Specific api's relative to the used hardware platform
8 | ******************************************************************************
9 | * @attention
10 | *
11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
17 | *
18 | * © COPYRIGHT 2011 STMicroelectronics
19 | ******************************************************************************
20 | */
21 |
22 | /* Define to prevent recursive inclusion -------------------------------------*/
23 | #ifndef __USB_BSP__H__
24 | #define __USB_BSP__H__
25 |
26 | /* Includes ------------------------------------------------------------------*/
27 | #include "usb_core.h"
28 |
29 | /** @addtogroup USB_OTG_DRIVER
30 | * @{
31 | */
32 |
33 | /** @defgroup USB_BSP
34 | * @brief This file is the
35 | * @{
36 | */
37 |
38 |
39 | /** @defgroup USB_BSP_Exported_Defines
40 | * @{
41 | */
42 | /**
43 | * @}
44 | */
45 |
46 |
47 | /** @defgroup USB_BSP_Exported_Types
48 | * @{
49 | */
50 | /**
51 | * @}
52 | */
53 |
54 |
55 | /** @defgroup USB_BSP_Exported_Macros
56 | * @{
57 | */
58 | /**
59 | * @}
60 | */
61 |
62 | /** @defgroup USB_BSP_Exported_Variables
63 | * @{
64 | */
65 | /**
66 | * @}
67 | */
68 |
69 | /** @defgroup USB_BSP_Exported_FunctionsPrototype
70 | * @{
71 | */
72 | void BSP_Init(void);
73 |
74 | void USB_OTG_BSP_Init (USB_OTG_CORE_HANDLE *pdev);
75 | void USB_OTG_BSP_uDelay (const uint32_t usec);
76 | void USB_OTG_BSP_mDelay (const uint32_t msec);
77 | void USB_OTG_BSP_EnableInterrupt (USB_OTG_CORE_HANDLE *pdev);
78 | #ifdef USE_HOST_MODE
79 | void USB_OTG_BSP_ConfigVBUS(USB_OTG_CORE_HANDLE *pdev);
80 | void USB_OTG_BSP_DriveVBUS(USB_OTG_CORE_HANDLE *pdev,uint8_t state);
81 | #endif
82 | /**
83 | * @}
84 | */
85 |
86 | #endif //__USB_BSP__H__
87 |
88 | /**
89 | * @}
90 | */
91 |
92 | /**
93 | * @}
94 | */
95 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
96 |
97 |
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_otg.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file usb_otg.h
4 | * @author MCD Application Team
5 | * @version V2.0.0
6 | * @date 22-July-2011
7 | * @brief OTG Core Header
8 | ******************************************************************************
9 | * @attention
10 | *
11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
17 | *
18 | * © COPYRIGHT 2011 STMicroelectronics
19 | ******************************************************************************
20 | */
21 |
22 | /* Define to prevent recursive inclusion -------------------------------------*/
23 | #ifndef __USB_OTG__
24 | #define __USB_OTG__
25 |
26 |
27 | /** @addtogroup USB_OTG_DRIVER
28 | * @{
29 | */
30 |
31 | /** @defgroup USB_OTG
32 | * @brief This file is the
33 | * @{
34 | */
35 |
36 |
37 | /** @defgroup USB_OTG_Exported_Defines
38 | * @{
39 | */
40 |
41 |
42 | void USB_OTG_InitiateSRP(void);
43 | void USB_OTG_InitiateHNP(uint8_t state , uint8_t mode);
44 | void USB_OTG_Switchback (USB_OTG_CORE_HANDLE *pdev);
45 | uint32_t USB_OTG_GetCurrentState (USB_OTG_CORE_HANDLE *pdev);
46 |
47 | uint32_t STM32_USBO_OTG_ISR_Handler(USB_OTG_CORE_HANDLE *pdev);
48 | /**
49 | * @}
50 | */
51 |
52 |
53 | /** @defgroup USB_OTG_Exported_Types
54 | * @{
55 | */
56 | /**
57 | * @}
58 | */
59 |
60 |
61 | /** @defgroup USB_OTG_Exported_Macros
62 | * @{
63 | */
64 | /**
65 | * @}
66 | */
67 |
68 | /** @defgroup USB_OTG_Exported_Variables
69 | * @{
70 | */
71 | /**
72 | * @}
73 | */
74 |
75 | /** @defgroup USB_OTG_Exported_FunctionsPrototype
76 | * @{
77 | */
78 | /**
79 | * @}
80 | */
81 |
82 |
83 | #endif //__USB_OTG__
84 |
85 |
86 | /**
87 | * @}
88 | */
89 |
90 | /**
91 | * @}
92 | */
93 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
94 |
95 |
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/MCD-ST Liberty SW License Agreement V2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/MCD-ST Liberty SW License Agreement V2.pdf
--------------------------------------------------------------------------------
/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/_htmresc/logo.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/bsp/3rd_party/STM32_USB-Host-Device_Lib_V2.1.0/_htmresc/logo.bmp
--------------------------------------------------------------------------------
/bsp/stm32f4_discovery/disp_1100.h:
--------------------------------------------------------------------------------
1 | /*
2 | * disp_1100.h
3 | *
4 | * Copyright (c) 2012, 2013, 2014, Oleg Tsaregorodtsev
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions are met:
9 | * - Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | * - Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | * 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)
24 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25 | * THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | /* Define to prevent recursive inclusion -------------------------------------*/
29 | #ifndef DISP_1100_H_
30 | #define DISP_1100_H_
31 |
32 | /* Includes ------------------------------------------------------------------*/
33 | #include "bsp.h"
34 |
35 | /* Exported constants --------------------------------------------------------*/
36 | #define DISP_X_COUNT 96
37 | #define DISP_Y_COUNT 65
38 | #define DISP_Y_PER_ROW 8
39 |
40 | /* Exported types ------------------------------------------------------------*/
41 | /* Exported macro ------------------------------------------------------------*/
42 | #define DISP_ROW_COUNT ((DISP_Y_COUNT+DISP_Y_PER_ROW)/DISP_Y_PER_ROW)
43 | #define DISP_COL_COUNT ((DISP_X_COUNT)/(5+1))
44 |
45 | #define CTRL_COL(code) (code % 8)
46 | #define CTRL_ROW(code) (code / 8)
47 | #define CTRL(row, col) (row*8 + col)
48 | #define SYS_MATRIX_SIZE ((CTRL_MAX / 8) + 1)
49 |
50 | /* Exported functions ------------------------------------------------------- */
51 | void Disp1100_Init(FunctionalState irq_enabled);
52 |
53 | void Disp1100_SetXRow(u8 x, u8 row);
54 |
55 | void Disp1100_SendData(u8 byte);
56 |
57 | #endif /* DISP_1100_H_ */
58 |
--------------------------------------------------------------------------------
/bsp/stm32f4_discovery/fattime.c:
--------------------------------------------------------------------------------
1 |
2 |
3 | #include "integer.h"
4 | #include "fattime.h"
5 | //#include "rtc.h" //RPi
6 |
7 | DWORD get_fattime (void)
8 | {
9 | return 0;
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/bsp/stm32f4_discovery/fattime.h:
--------------------------------------------------------------------------------
1 | #ifndef FATTIME_H_
2 |
3 | #include "integer.h"
4 |
5 | DWORD get_fattime (void);
6 |
7 | #endif
8 |
--------------------------------------------------------------------------------
/bsp/stm32f4xx/cmsis.cmake:
--------------------------------------------------------------------------------
1 | INCLUDE_DIRECTORIES(
2 | ${STM32_USBSTDLib_DIR}/Libraries/CMSIS/Device/ST/STM32F4xx/Include
3 | ${STM32_USBSTDLib_DIR}/Libraries/CMSIS/Include/
4 | )
5 |
6 | SET(ASM_SOURCES
7 | ${STM32_USBSTDLib_DIR}/Libraries/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc_ride7/startup_stm32f4xx.s
8 | )
9 |
10 | SET(CMSIS_LINKER_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/stm32_flash.ld.in)
11 |
12 | FUNCTION(STM32F4XX_SET_PARAMS FLASH_SIZE RAM_SIZE MIN_STACK_SIZE MIN_HEAP_SIZE EXT_RAM_SIZE FLASH_ORIGIN RAM_ORIGIN EXT_RAM_ORIGIN)
13 | CONFIGURE_FILE(${CMSIS_LINKER_SCRIPT} ${CMAKE_CURRENT_BINARY_DIR}/stm32_flash.ld)
14 | ENDFUNCTION(STM32F4XX_SET_PARAMS)
15 |
16 | FUNCTION(STM32F4XX_SET_PARAMS FLASH_SIZE RAM_SIZE)
17 | SET(FLASH_SIZE ${FLASH_SIZE})
18 | SET(RAM_SIZE ${RAM_SIZE})
19 | SET(MIN_STACK_SIZE "0x200")
20 | SET(MIN_HEAP_SIZE "0")
21 | SET(EXT_RAM_SIZE "0K")
22 | SET(FLASH_ORIGIN "0x08000000")
23 | SET(RAM_ORIGIN "0x20000000")
24 | SET(EXT_RAM_ORIGIN "0x60000000")
25 | CONFIGURE_FILE(${CMSIS_LINKER_SCRIPT} ${CMAKE_CURRENT_BINARY_DIR}/stm32_flash.ld)
26 | ENDFUNCTION(STM32F4XX_SET_PARAMS)
27 |
28 | set_source_files_properties(${ASM_SOURCES} PROPERTIES COMPILE_FLAGS "-x assembler-with-cpp")
29 |
30 | SET(CSP_SOURCES ${CSP_SOURCES} ${ASM_SOURCES})
--------------------------------------------------------------------------------
/bsp/stm32f4xx/cpu.cmake:
--------------------------------------------------------------------------------
1 | add_definitions(-DSTM32F4XX)
2 | add_definitions(-DARM)
3 | add_definitions(-DEMBEDDED_ARM)
4 | add_definitions(-DARM5E_ASM)
5 | add_definitions(-DARM7M_ASM)
6 |
7 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=softfp")
8 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=softfp")
9 | SET(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -mcpu=cortex-m4 -mthumb")
10 |
--------------------------------------------------------------------------------
/bsp/stm32f4xx/inc/stm32f4xx_it.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file Audio_playback_and_record/inc/stm32f40x_it.h
4 | * @author MCD Application Team
5 | * @version V1.0.0
6 | * @date 28-October-2011
7 | * @brief This file contains the headers of the interrupt handlers.
8 | ******************************************************************************
9 | * @attention
10 | *
11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
17 | *
18 | * © COPYRIGHT 2011 STMicroelectronics
19 | ******************************************************************************
20 | */
21 |
22 | /* Define to prevent recursive inclusion -------------------------------------*/
23 | #ifndef __STM32F40x_IT_H
24 | #define __STM32F40x_IT_H
25 |
26 | #ifdef __cplusplus
27 | extern "C" {
28 | #endif
29 |
30 | /* Includes ------------------------------------------------------------------*/
31 | #include "stm32f4xx.h"
32 |
33 | /* Exported types ------------------------------------------------------------*/
34 | /* Exported constants --------------------------------------------------------*/
35 | /* Exported macro ------------------------------------------------------------*/
36 | /* Exported functions ------------------------------------------------------- */
37 |
38 | void NMI_Handler(void);
39 | void HardFault_Handler(void);
40 | void MemManage_Handler(void);
41 | void BusFault_Handler(void);
42 | void UsageFault_Handler(void);
43 | void SVC_Handler(void);
44 | void DebugMon_Handler(void);
45 | void PendSV_Handler(void);
46 | void SysTick_Handler(void);
47 | void EXTI0_IRQHandler(void);
48 | void EXTI1_IRQHandler(void);
49 | void RTC_Alarm_IRQHandler(void);
50 | void TIM2_IRQHandler(void);
51 | extern void USB_OTG_BSP_TimerIRQ(void);
52 |
53 | #ifdef __cplusplus
54 | }
55 | #endif
56 |
57 | #endif /* __STM32F40x_IT_H */
58 |
59 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
60 |
--------------------------------------------------------------------------------
/bsp/stm32f4xx/inc/types.h:
--------------------------------------------------------------------------------
1 | /*
2 | * types.h
3 | *
4 | * Copyright (c) 2012, Oleg Tsaregorodtsev
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions are met:
9 | * - Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | * - Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | * 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)
24 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25 | * THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | /* Define to prevent recursive inclusion ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
29 | #ifndef TYPES_H_
30 | #define TYPES_H_
31 |
32 | /* Includes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
33 | #include "stm32f4xx.h"
34 |
35 | /* Exported defines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
36 | /* Exported macro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
37 | /* Exported types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
38 | /* Exported functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
39 | /* Exported variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
40 | /* Exported static inline functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
41 |
42 |
43 | #endif /* TYPES_H_ */
44 |
--------------------------------------------------------------------------------
/bsp/stm32f4xx/inc/usbd_cdc_vcp.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file usbd_cdc_vcp.h
4 | * @author MCD Application Team
5 | * @version V1.1.0
6 | * @date 19-March-2012
7 | * @brief Header for usbd_cdc_vcp.c file.
8 | ******************************************************************************
9 | * @attention
10 | *
11 | * © COPYRIGHT 2012 STMicroelectronics
12 | *
13 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
14 | * You may not use this file except in compliance with the License.
15 | * You may obtain a copy of the License at:
16 | *
17 | * http://www.st.com/software_license_agreement_liberty_v2
18 | *
19 | * Unless required by applicable law or agreed to in writing, software
20 | * distributed under the License is distributed on an "AS IS" BASIS,
21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 | * See the License for the specific language governing permissions and
23 | * limitations under the License.
24 | *
25 | ******************************************************************************
26 | */
27 |
28 | /* Define to prevent recursive inclusion -------------------------------------*/
29 | #ifndef __USBD_CDC_VCP_H
30 | #define __USBD_CDC_VCP_H
31 |
32 | /* Includes ------------------------------------------------------------------*/
33 | #include "usbd_cdc_core.h"
34 | #include "usbd_conf.h"
35 |
36 | /* Exported typef ------------------------------------------------------------*/
37 | /* The following structures groups all needed parameters to be configured for the
38 | ComPort. These parameters can modified on the fly by the host through CDC class
39 | command class requests. */
40 | typedef struct
41 | {
42 | uint32_t bitrate;
43 | uint8_t format;
44 | uint8_t paritytype;
45 | uint8_t datatype;
46 | }LINE_CODING;
47 |
48 | /* Exported constants --------------------------------------------------------*/
49 | #define DEFAULT_CONFIG 0
50 | #define OTHER_CONFIG 1
51 |
52 | /* Exported macro ------------------------------------------------------------*/
53 | /* Exported functions ------------------------------------------------------- */
54 |
55 | #endif /* __USBD_CDC_VCP_H */
56 |
57 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
58 |
--------------------------------------------------------------------------------
/bsp/stm32f4xx/inc/usbd_storage_msd.h:
--------------------------------------------------------------------------------
1 | /* Define to prevent recursive inclusion -------------------------------------*/
2 | #ifndef USBD_STORAGE_MSD_H_
3 | #define USBD_STORAGE_MSD_H_
4 |
5 | /* Includes ------------------------------------------------------------------*/
6 | #include "system.h"
7 |
8 | /* Exported constants --------------------------------------------------------*/
9 | /* Exported types ------------------------------------------------------------*/
10 | /* Exported macro ------------------------------------------------------------*/
11 | /* Exported functions ------------------------------------------------------- */
12 | int8_t STORAGE_Init(uint8_t lun);
13 | int8_t STORAGE_GetCapacity(uint8_t lun, uint32_t *block_num,
14 | uint32_t *block_size);
15 | int8_t STORAGE_IsReady(uint8_t lun);
16 | int8_t STORAGE_IsWriteProtected(uint8_t lun);
17 | int8_t STORAGE_Read(uint8_t lun, uint8_t *buf, uint32_t blk_addr,
18 | uint16_t blk_len);
19 | int8_t STORAGE_Write(uint8_t lun, uint8_t *buf, uint32_t blk_addr,
20 | uint16_t blk_len);
21 | int8_t STORAGE_GetMaxLun(void);
22 |
23 | void STORAGE_DeInit(uint8_t lun);
24 |
25 | extern u32 MSC_DataIn;
26 | extern u32 MSC_DataOut;
27 |
28 | #endif /* USBD_STORAGE_MSD_H_ */
29 |
--------------------------------------------------------------------------------
/bsp/stm32f4xx/inc/usbh_conf.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file Audio_playback_and_record/inc/USBH_conf.h
4 | * @author MCD Application Team
5 | * @version V1.0.0
6 | * @date 28-October-2011
7 | * @brief General low level driver configuration
8 | ******************************************************************************
9 | * @attention
10 | *
11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
17 | *
18 | * © COPYRIGHT 2011 STMicroelectronics
19 | ******************************************************************************
20 | */
21 |
22 | /* Define to prevent recursive inclusion -------------------------------------*/
23 | #ifndef __USBH_CONF__H__
24 | #define __USBH_CONF__H__
25 |
26 | /* Includes ------------------------------------------------------------------*/
27 | /** @addtogroup USBH_OTG_DRIVER
28 | * @{
29 | */
30 |
31 | /** @defgroup USBH_CONF
32 | * @brief usb otg low level driver configuration file
33 | * @{
34 | */
35 |
36 | /** @defgroup USBH_CONF_Exported_Defines
37 | * @{
38 | */
39 |
40 | #define USBH_MAX_NUM_ENDPOINTS 2
41 | #define USBH_MAX_NUM_INTERFACES 2
42 | #ifdef USE_USB_OTG_FS
43 | #define USBH_MSC_MPS_SIZE 0x40
44 | #else
45 | #define USBH_MSC_MPS_SIZE 0x200
46 | #endif
47 |
48 | /**
49 | * @}
50 | */
51 |
52 |
53 | /** @defgroup USBH_CONF_Exported_Types
54 | * @{
55 | */
56 | /**
57 | * @}
58 | */
59 |
60 |
61 | /** @defgroup USBH_CONF_Exported_Macros
62 | * @{
63 | */
64 | /**
65 | * @}
66 | */
67 |
68 | /** @defgroup USBH_CONF_Exported_Variables
69 | * @{
70 | */
71 | /**
72 | * @}
73 | */
74 |
75 | /** @defgroup USBH_CONF_Exported_FunctionsPrototype
76 | * @{
77 | */
78 | /**
79 | * @}
80 | */
81 |
82 |
83 | #endif //__USBH_CONF__H__
84 |
85 |
86 | /**
87 | * @}
88 | */
89 |
90 | /**
91 | * @}
92 | */
93 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
94 |
95 |
--------------------------------------------------------------------------------
/bsp/stm32f4xx/stdperiph.cmake:
--------------------------------------------------------------------------------
1 | SET(STM32F4XX_StdPeriph_DriverSrc_DIR ${STM32_USBSTDLib_DIR}/Libraries/STM32F4xx_StdPeriph_Driver/src)
2 | SET(STM32F4XX_StdPeriph_DriverInc_DIR )
3 |
4 | INCLUDE_DIRECTORIES(
5 | ${STM32_USBSTDLib_DIR}/Libraries/STM32F4xx_StdPeriph_Driver/inc
6 | )
7 |
8 | add_definitions(-DUSE_STDPERIPH_DRIVER)
9 |
10 | SET(CSP_SOURCES ${CSP_SOURCES}
11 | ${STM32F4XX_StdPeriph_DriverSrc_DIR}/misc.c
12 | ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_adc.c
13 | # ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_can.c
14 | # ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_crc.c
15 | # ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_cryp.c
16 | ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_dac.c
17 | # ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_dbgmcu.c
18 | # ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_dcmi.c
19 | ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_dma.c
20 | ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_exti.c
21 | # ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_flash.c
22 | # ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_fsmc.c
23 | ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_gpio.c
24 | # ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_hash.c
25 | ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_i2c.c
26 | # ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_iwdg.c
27 | ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_pwr.c
28 | ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_rcc.c
29 | # ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_rng.c
30 | # ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_rtc.c
31 | ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_sdio.c
32 | ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_spi.c
33 | ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_syscfg.c
34 | ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_tim.c
35 | # ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_usart.c
36 | # ${STM32F4XX_StdPeriph_DriverSrc_DIR}/stm32f4xx_wwdg.c
37 | )
38 |
--------------------------------------------------------------------------------
/bsp/stm32f4xx/usblib.cmake:
--------------------------------------------------------------------------------
1 | add_definitions(-DUSE_USB_OTG_FS)
2 |
3 | # STM32_USB_OTG_Driver #########################################################
4 | SET(USB_LibraryOtgInc_DIR
5 | ${STM32_USBSTDLib_DIR}/Libraries/STM32_USB_OTG_Driver/inc
6 | )
7 |
8 | INCLUDE_DIRECTORIES(
9 | ${USB_LibraryOtgInc_DIR}
10 | )
11 | SET(USB_LibraryOtgSrc_DIR
12 | ${STM32_USBSTDLib_DIR}/Libraries/STM32_USB_OTG_Driver/src
13 | )
14 |
15 | if(USE_DEVICE_MODE)
16 | SET(CSP_SOURCES ${CSP_SOURCES}
17 | ${USB_LibraryOtgSrc_DIR}/usb_core.c
18 | ${USB_LibraryOtgSrc_DIR}/usb_dcd.c
19 | ${USB_LibraryOtgSrc_DIR}/usb_dcd_int.c
20 | )
21 | elseif(USE_HOST_MODE)
22 | SET(CSP_SOURCES ${CSP_SOURCES}
23 | ${USB_LibraryOtgSrc_DIR}/usb_core.c
24 | ${USB_LibraryOtgSrc_DIR}/usb_hcd.c
25 | ${USB_LibraryOtgSrc_DIR}/usb_hcd_int.c
26 | )
27 | endif()
28 |
29 | ################################################################################
30 |
31 | if(USE_DEVICE_MODE)
32 | include(bsp/stm32f4xx/usblib_device.cmake)
33 | endif()
34 |
35 | if(USE_HOST_MODE)
36 | include(bsp/stm32f4xx/usblib_host.cmake)
37 | endif()
38 |
--------------------------------------------------------------------------------
/bsp/stm32f4xx/usblib_device.cmake:
--------------------------------------------------------------------------------
1 | add_definitions(-DUSE_DEVICE_MODE)
2 |
3 | # CORE #########################################################################
4 |
5 | INCLUDE_DIRECTORIES(
6 | ${STM32_USBSTDLib_DIR}/Libraries/STM32_USB_Device_Library/Core/inc
7 | )
8 |
9 | SET(USB_LibraryCoreSrc_DIR
10 | ${STM32_USBSTDLib_DIR}/Libraries/STM32_USB_Device_Library/Core/src
11 | )
12 |
13 | SET(USBLIB_DEVICE_SOURCES ${USBLIB_DEVICE_SOURCES}
14 | ${USB_LibraryCoreSrc_DIR}/usbd_core.c
15 | ${USB_LibraryCoreSrc_DIR}/usbd_ioreq.c
16 | ${USB_LibraryCoreSrc_DIR}/usbd_req.c
17 | )
18 |
19 | # MSC ##########################################################################
20 |
21 | INCLUDE_DIRECTORIES(
22 | ${STM32_USBSTDLib_DIR}/Libraries/STM32_USB_Device_Library/Class/msc/inc
23 | )
24 |
25 | SET(USB_LibraryMscSrc_DIR
26 | ${STM32_USBSTDLib_DIR}/Libraries/STM32_USB_Device_Library/Class/msc/src
27 | )
28 |
29 | SET(USBLIB_DEVICE_SOURCES ${USBLIB_DEVICE_SOURCES}
30 | ${USB_LibraryMscSrc_DIR}/usbd_msc_core.c
31 | ${USB_LibraryMscSrc_DIR}/usbd_msc_scsi.c
32 | ${USB_LibraryMscSrc_DIR}/usbd_msc_bot.c
33 | ${USB_LibraryMscSrc_DIR}/usbd_msc_data.c
34 | )
35 |
36 | ################################################################################
37 |
38 | set_source_files_properties(${USBLIB_DEVICE_SOURCES} PROPERTIES COMPILE_FLAGS "-Wno-parentheses -Wno-missing-field-initializers")
39 |
40 | SET(CSP_SOURCES ${CSP_SOURCES} ${USBLIB_DEVICE_SOURCES})
--------------------------------------------------------------------------------
/bsp/stm32f4xx/usblib_host.cmake:
--------------------------------------------------------------------------------
1 | add_definitions(-DUSE_HOST_MODE)
2 |
3 | # CORE #########################################################################
4 |
5 | INCLUDE_DIRECTORIES(
6 | ${STM32_USBSTDLib_DIR}/Libraries/STM32_USB_HOST_Library/Core/inc
7 | )
8 |
9 | SET(USB_LibraryCoreSrc_DIR
10 | ${STM32_USBSTDLib_DIR}/Libraries/STM32_USB_HOST_Library/Core/src
11 | )
12 |
13 | SET(CSP_SOURCES ${CSP_SOURCES}
14 | ${USB_LibraryCoreSrc_DIR}/usbh_core.c
15 | ${USB_LibraryCoreSrc_DIR}/usbh_hcs.c
16 | ${USB_LibraryCoreSrc_DIR}/usbh_ioreq.c
17 | ${USB_LibraryCoreSrc_DIR}/usbh_stdreq.c
18 | )
19 |
20 | # MSC ##########################################################################
21 |
22 | INCLUDE_DIRECTORIES(
23 | ${STM32_USBSTDLib_DIR}/Libraries/STM32_USB_HOST_Library/Class/MSC/inc
24 | )
25 |
26 | SET(USB_LibraryMscSrc_DIR
27 | ${STM32_USBSTDLib_DIR}/Libraries/STM32_USB_HOST_Library/Class/MSC/src
28 | )
29 |
30 | SET(CSP_SOURCES ${CSP_SOURCES}
31 | ${USB_LibraryMscSrc_DIR}/usbh_msc_bot.c
32 | ${USB_LibraryMscSrc_DIR}/usbh_msc_core.c
33 | ${USB_LibraryMscSrc_DIR}/usbh_msc_fatfs.c
34 | ${USB_LibraryMscSrc_DIR}/usbh_msc_scsi.c
35 | )
36 |
37 | ################################################################################
38 |
--------------------------------------------------------------------------------
/cmake_patch_arm_none_eabi.diff:
--------------------------------------------------------------------------------
1 | --- Linux-GNU.cmake 2013-06-03 14:24:05.850206868 +0600
2 | +++ Linux-GNU.cmake.new 2013-06-03 14:22:08.000000000 +0600
3 | @@ -21,5 +21,5 @@
4 | macro(__linux_compiler_gnu lang)
5 | # We pass this for historical reasons. Projects may have
6 | # executables that use dlopen but do not set ENABLE_EXPORTS.
7 | - set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-rdynamic")
8 | + #set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-rdynamic")
9 | endmacro()
10 |
--------------------------------------------------------------------------------
/cmake_patch_linaro.diff:
--------------------------------------------------------------------------------
1 | --- CMakeTestCXXCompiler.cmake.new 2013-05-05 16:07:18.369718547 +0600
2 | +++ CMakeTestCXXCompiler.cmake 2013-05-05 16:03:26.000000000 +0600
3 | @@ -25,6 +25,11 @@
4 | "#ifndef __cplusplus\n"
5 | "# error \"The CMAKE_CXX_COMPILER is set to a C compiler\"\n"
6 | "#endif\n"
7 | + "void _exit(int rc)\n"
8 | + "{\n"
9 | + " while(1)\n"
10 | + " ;\n"
11 | + "}\n"
12 | "int main(){return 0;}\n")
13 | TRY_COMPILE(CMAKE_CXX_COMPILER_WORKS ${CMAKE_BINARY_DIR}
14 | ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
15 | --- CMakeTestCCompiler.cmake.new 2013-05-05 16:07:15.149702656 +0600
16 | +++ CMakeTestCCompiler.cmake 2013-05-05 16:03:10.000000000 +0600
17 | @@ -25,6 +25,11 @@
18 | "#ifdef __cplusplus\n"
19 | "# error \"The CMAKE_C_COMPILER is set to a C++ compiler\"\n"
20 | "#endif\n"
21 | + "void _exit(int rc)\n"
22 | + "{\n"
23 | + " while(1)\n"
24 | + " ;\n"
25 | + "}\n"
26 | "#if defined(__CLASSIC_C__)\n"
27 | "int main(argc, argv)\n"
28 | " int argc;\n"
29 |
--------------------------------------------------------------------------------
/crlf_to_lf.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | find . -type f | xargs file | sed -nr 's/^([^:]*).*CRLF.*/\1/p' | xargs -I {} dos2unix {}
--------------------------------------------------------------------------------
/debug-simulator.gdb:
--------------------------------------------------------------------------------
1 | cd Build/
2 |
3 | set confirm off
4 | set pagination off
5 |
6 | file walkgeek.elf
7 |
8 | b main
9 |
10 | run
11 |
--------------------------------------------------------------------------------
/debug.gdb.origin:
--------------------------------------------------------------------------------
1 | set confirm off
2 | set pagination off
3 |
4 | target remote localhost:10000
5 | set remote hardware-watchpoint-limit 4
6 | set remote hardware-breakpoint-limit 6
7 |
8 | load Build/walkgeek.elf
9 | #mon reset halt
10 | symbol-file Build/walkgeek.elf
11 |
12 | # Enable CPU Clock when in WFI state, which is needed for JTAG/SWD
13 |
14 | b System_Init
15 | c
16 |
17 | set debug_mode=1
18 |
19 | #put your breakpoints here
20 |
21 | c
22 |
--------------------------------------------------------------------------------
/debug_msc.gdb:
--------------------------------------------------------------------------------
1 | cd Build/
2 |
3 | set confirm off
4 | set pagination off
5 |
6 | target remote localhost:10000
7 | symbol-file walkgeek.elf
8 | load walkgeek.elf
9 |
10 | set remote hardware-watchpoint-limit 4
11 | set remote hardware-breakpoint-limit 6
12 |
13 | tb System_Init
14 | c
15 |
16 | set debug_mode=1
17 | set msc=1
18 |
19 | c
20 |
--------------------------------------------------------------------------------
/flags.cmake:
--------------------------------------------------------------------------------
1 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -isystem ${TOOLCHAIN_INC_DIR} -fno-builtin -Wall -Wextra -std=gnu99 -fdata-sections -ffunction-sections")
2 |
3 | SET(CMAKE_ASM_FLAGS "")
4 | IF(NOT CMAKE_BUILD_TYPE)
5 | SET(CMAKE_BUILD_TYPE DEBUG)
6 | MESSAGE(STATUS "No CMAKE_BUILD_TYPE specified, using default DEBUG")
7 | ENDIF()
8 |
9 | SET(CMAKE_C_FLAGS_DEBUG " -ggdb -O0 -Wno-unused-variable -Wno-unused-parameter -Wno-unused-function -Wno-attributes")
10 | SET(CMAKE_CXX_FLAGS_DEBUG " -ggdb -O0")
11 | SET(CMAKE_ASM_FLAGS_DEBUG " -ggdb")
12 |
13 | SET(CMAKE_C_FLAGS_RELEASE " -ggdb -O2 -Wno-unused-variable -Wno-unused-parameter -Wno-attributes -Wno-unused-function")
14 | SET(CMAKE_CXX_FLAGS_RELEASE " -ggdb -O2")
15 | SET(CMAKE_ASM_FLAGS_RELEASE " -ggdb")
16 |
17 | IF(CMAKE_COMPILER_IS_GNUCC)
18 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0")
19 | ENDIF(CMAKE_COMPILER_IS_GNUCC)
20 | IF(CMAKE_COMPILER_IS_GNUCXX)
21 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0")
22 | ENDIF(CMAKE_COMPILER_IS_GNUCXX)
--------------------------------------------------------------------------------
/gnu_toolchain.cmake:
--------------------------------------------------------------------------------
1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.8.4)
2 |
3 | # GCC toolchain prefix
4 | IF(NOT TOOLCHAIN_PREFIX)
5 | SET(TOOLCHAIN_PREFIX "$ENV{HOME}/Local/gcc-arm-none-eabi-4_6-2012q2")
6 | MESSAGE(STATUS "No TOOLCHAIN_PREFIX specified, using default: " ${TOOLCHAIN_PREFIX})
7 | ENDIF()
8 |
9 | IF(NOT TARGET_TRIPLET)
10 | SET(TARGET_TRIPLET "arm-none-eabi")
11 | MESSAGE(STATUS "No TARGET_TRIPLET specified, using default: " ${TARGET_TRIPLET})
12 | ENDIF()
13 |
14 | SET(TOOLCHAIN_BIN_DIR ${TOOLCHAIN_PREFIX}/bin)
15 | SET(TOOLCHAIN_INC_DIR ${TOOLCHAIN_PREFIX}/${TARGET_TRIPLET}/include)
16 | SET(TOOLCHAIN_LIB_DIR ${TOOLCHAIN_PREFIX}/${TARGET_TRIPLET}/lib)
17 |
18 | SET(CMAKE_SYSTEM_NAME Generic CACHE INTERNAL "system name")
19 | SET(CMAKE_SYSTEM_PROCESSOR arm CACHE INTERNAL "processor")
20 |
21 | SET(CMAKE_C_COMPILER ${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-gcc CACHE INTERNAL "c compiler")
22 | SET(CMAKE_CXX_COMPILER ${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-g++ CACHE INTERNAL "cxx compiler")
23 | #SET(CMAKE_ASM_COMPILER ${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-as CACHE INTERNAL "asm compiler")
24 |
25 | SET(CMAKE_OBJCOPY ${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-objcopy CACHE INTERNAL "objcopy")
26 | SET(CMAKE_OBJDUMP ${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-objdump CACHE INTERNAL "objdump")
27 |
28 | SET(CMAKE_MODULE_LINKER_FLAGS "-L${TOOLCHAIN_LIB_DIR}" CACHE INTERNAL "module link flags")
29 | SET(CMAKE_SHARED_LINKER_FLAGS "-L${TOOLCHAIN_LIB_DIR}" CACHE INTERNAL "shared link flags")
30 |
31 | SET(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_PREFIX}/${TARGET_TRIPLET} CACHE INTERNAL "cross root directory")
32 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH CACHE INTERNAL "")
33 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY CACHE INTERNAL "")
34 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY CACHE INTERNAL "")
35 |
36 |
--------------------------------------------------------------------------------
/include/audio_buffer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * audio_buffer.h
3 | *
4 | * Copyright (c) 2012, Oleg Tsaregorodtsev
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions are met:
9 | * - Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | * - Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | * 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)
24 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25 | * THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | /* Define to prevent recursive inclusion ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
29 | #ifndef AUDIO_BUFFER_H_
30 | #define AUDIO_BUFFER_H_
31 |
32 | /* Includes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
33 | #include "system.h"
34 |
35 | /* Exported defines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
36 | /* Exported macro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
37 | /* Exported types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
38 | typedef struct
39 | {
40 | s16 data[AUDIO_BUFFER_MAX_SIZE];
41 | u16 size;
42 | u8 channel_count;
43 | uint32_t sampling_freq;
44 | } AudioBuffer_Typedef;
45 |
46 | /* Exported functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
47 | void AudioBuffer_Init(void);
48 | AudioBuffer_Typedef *AudioBuffer_TryGetProducer() RAM_FUNC;
49 | void AudioBuffer_MoveProducer(void) RAM_FUNC;
50 |
51 | /* Exported variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
52 | /* Exported static inline functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
53 |
54 |
55 | #endif /* AUDIO_BUFFER_H_ */
56 |
--------------------------------------------------------------------------------
/include/audio_if.h:
--------------------------------------------------------------------------------
1 | /*
2 | * audio_if.h
3 | *
4 | * Copyright (c) 2012, Oleg Tsaregorodtsev
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions are met:
9 | * - Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | * - Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | * 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)
24 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25 | * THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | /* Define to prevent recursive inclusion ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
29 | #ifndef AUDIO_IF_H_
30 | #define AUDIO_IF_H_
31 |
32 | /* Includes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
33 | #include "common.h"
34 |
35 | /* Exported defines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
36 | /* Exported macro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
37 | /* Exported types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
38 | typedef enum {
39 | AS_STOPPED,
40 | AS_PLAYING,
41 | AS_PAUSED,
42 | AS_ERROR
43 | } AudioState_Typedef;
44 |
45 | typedef enum
46 | {
47 | AC_RESET_BUFFERS,
48 | AC_PLAY,
49 | AC_PAUSE,
50 | AC_PLAY_PAUSE,
51 | AC_SUSPEND,
52 | AC_STOP
53 | } AudioCommand_Typedef;
54 |
55 | /* Exported functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
56 | void Audio_DeInit(void);
57 |
58 | FuncResult Audio_CommandSync(AudioCommand_Typedef cmd);
59 | FuncResult Audio_SetVolume(int NewVolume);
60 | FuncResult Audio_ChangeVolume(int delta);
61 |
62 | FuncResult Audio_PeriodicKick(void);
63 |
64 | AudioState_Typedef Audio_GetState(void);
65 | int Audio_GetSampleRate(void);
66 | int Audio_GetVolume(void);
67 | /* Exported variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
68 | /* Exported static inline functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
69 |
70 | #endif /* AUDIO_IF_H_ */
71 |
--------------------------------------------------------------------------------
/include/cpu.h:
--------------------------------------------------------------------------------
1 | /*
2 | * cpu.h
3 | *
4 | * Copyright (c) 2012, Oleg Tsaregorodtsev
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions are met:
9 | * - Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | * - Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | * 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)
24 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25 | * THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifndef CPU_H_
29 | #define CPU_H_
30 |
31 | /* Includes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
32 | #include "common.h"
33 |
34 | /* Public defines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
35 | /* Public types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
36 | /* Public constants ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
37 | /* Public variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
38 | /* Public macro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
39 | /* Public functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
40 | void CPU_PreInit(void);
41 |
42 | void CPU_EnterLowPowerState(void);
43 | void CPU_InitUserHeap(void);
44 |
45 | void *CPU_GetUserHeapStart(void);
46 | size_t CPU_GetUserHeapSize(void);
47 |
48 | /* Public static inline functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
49 |
50 | #endif /* CPU_H_ */
51 |
--------------------------------------------------------------------------------
/include/custom_support.h:
--------------------------------------------------------------------------------
1 | #include "bsp.h"
2 |
--------------------------------------------------------------------------------
/include/display.h:
--------------------------------------------------------------------------------
1 | /*
2 | * display.h
3 | *
4 | * Copyright (c) 2014, Oleg Tsaregorodtsev
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions are met:
9 | * - Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | * - Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | * 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)
24 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25 | * THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifndef DISPLAY_H_
29 | #define DISPLAY_H_
30 |
31 | /* Includes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
32 | #include "FreeRTOSConfig.h"
33 | #include "disp_1100.h"
34 |
35 | /* Public defines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
36 | #define display_TASK_STACK_SIZE ( configMINIMAL_STACK_SIZE * 5 )
37 | #define display_TASK_PRIORITY ( mainPLAYER_TASK_PRIORITY )
38 | #define configDISPLAY_NEXT_SYMBOL_TIMEOUT_MS ( 1000 / portTICK_RATE_MS )
39 |
40 | /* Public types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
41 | /* Public constants ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
42 | /* Public variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
43 | /* Public macro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
44 | /* Public functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
45 | void Display_Init(FunctionalState irq_enabled);
46 | void Display_SetBacklightEnabled(FunctionalState enabled);
47 |
48 | void Display_MainCycle(void);
49 |
50 | void Display_NextWord_FromISR(void);
51 | void Display_SetData(u8 x, u8 row, u8 byte);
52 | void Display_String(uint8_t col, uint8_t row, const char *ptr, bool new_line);
53 |
54 | void Display_Clear(void);
55 | void Display_ClearRow(uint8_t row);
56 |
57 | /* Public static inline functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
58 |
59 | #endif /* DISPLAY_H_ */
60 |
--------------------------------------------------------------------------------
/include/keypad.h:
--------------------------------------------------------------------------------
1 | /*
2 | * keypad.h
3 | *
4 | * Copyright (c) 2013, Oleg Tsaregorodtsev
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions are met:
9 | * - Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | * - Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | * 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)
24 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25 | * THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | /* Define to prevent recursive inclusion ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
29 | #ifndef KEYPAD_H_
30 | #define KEYPAD_H_
31 |
32 | /* Includes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
33 | #include "common.h"
34 |
35 | /* Exported defines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
36 | /* Exported macro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
37 | /* Exported types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
38 | typedef enum
39 | {
40 | KEY_PPP,
41 | KEY_C,
42 |
43 | KEY_SEL,
44 |
45 | KEY_UP,
46 | KEY_DOWN,
47 |
48 | KEY_1,
49 | KEY_2,
50 | KEY_3,
51 | KEY_4,
52 | KEY_5,
53 | KEY_6,
54 | KEY_7,
55 | KEY_8,
56 | KEY_9,
57 |
58 | KEY_ASTERICK,
59 | KEY_0,
60 | KEY_POUND,
61 |
62 | KEY_MAX_GPIO,
63 |
64 | KEY_BTN = KEY_MAX_GPIO,
65 |
66 | KEY_MAX,
67 | _KEY_DUMMY = KEY_MAX
68 | } KEY_Typedef;
69 |
70 | /* Exported functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
71 | void Keypad_Init(void);
72 | void Keypad_1msScan(void);
73 |
74 | /* Exported variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
75 | /* Exported static inline functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
76 |
77 |
78 | #endif /* KEYPAD_H_ */
79 |
--------------------------------------------------------------------------------
/include/metadata.h:
--------------------------------------------------------------------------------
1 | /*
2 | * metadata.h
3 | *
4 | * Copyright (c) 2012, Oleg Tsaregorodtsev
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions are met:
9 | * - Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | * - Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | * 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)
24 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25 | * THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | /* Define to prevent recursive inclusion ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
29 | #ifndef METADATA_H_
30 | #define METADATA_H_
31 |
32 | /* Includes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
33 | #include "system.h"
34 |
35 | /* Exported defines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
36 | /* Exported macro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
37 | /* Exported types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
38 | typedef struct
39 | {
40 | u8 channel_count;
41 | int bitrate;
42 | //
43 | u32 mstime_max, mstime_curr, time_curr;
44 | //
45 | char title[40];
46 | char artist[40];
47 | char album[40];
48 | char notes[128];
49 | char year[5];
50 | //
51 | char error_string[128];
52 | //
53 | char *file_path;
54 | } sMetadata;
55 |
56 | /* Exported functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
57 | /* Exported variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
58 | /* Exported static inline functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
59 |
60 |
61 | #endif /* METADATA_H_ */
62 |
--------------------------------------------------------------------------------
/include/nestedfilter.h:
--------------------------------------------------------------------------------
1 | /*
2 | * nestedfilter.h
3 | *
4 | * Copyright (c) 2012, Oleg Tsaregorodtsev
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions are met:
9 | * - Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | * - Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | * 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)
24 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25 | * THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | /* Define to prevent recursive inclusion ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
29 | #ifndef NESTEDFILTER_H_
30 | #define NESTEDFILTER_H_
31 |
32 | /* Includes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
33 | #include "common.h"
34 | #include "ui.h"
35 |
36 | /* Exported defines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
37 | /* Exported macro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
38 | /* Exported types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
39 | typedef u16 nfpoint_t;
40 | typedef float nfpoint_aggregate_t;
41 |
42 | typedef struct
43 | {
44 | nfpoint_t *buf;
45 | u8 size;
46 | u8 pos;
47 | } NestedFilter_Typedef;
48 |
49 | typedef struct
50 | {
51 | NestedFilter_Typedef *filters;
52 | u8 count;
53 | nfpoint_t value;
54 | } NestedFilterSet_Typedef;
55 |
56 | /* Exported functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
57 | NestedFilterSet_Typedef *NestedFilter_Init(u8 filter_count,
58 | u8 filter_buffer_size);
59 |
60 | void NestedFilter_AddMeasure(NestedFilterSet_Typedef *nfs, nfpoint_t p, VAR_Index var_ix);
61 | nfpoint_t NestedFilter_GetValue(NestedFilterSet_Typedef *nfs);
62 |
63 | /* Exported variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
64 | /* Exported static inline functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
65 |
66 | #endif /* NESTEDFILTER_H_ */
67 |
--------------------------------------------------------------------------------
/include/nuttx/config.h:
--------------------------------------------------------------------------------
1 | /*
2 | * config.h
3 | *
4 | * Created on: Apr 29, 2013
5 | * Author: otsaregorodtsev
6 | */
7 |
8 | #ifndef CONFIG_H_
9 | #define CONFIG_H_
10 |
11 | #include
12 | #include
13 | #include
14 |
15 | #define CONFIG_MM_REGIONS 1
16 | #define CONFIG_MM_MULTIHEAP 1
17 | #define __KERNEL__ 1
18 | #define CONFIG_NUTTX_KERNEL 1
19 |
20 | #define CONFIG_LIBC_FLOATINGPOINT 1
21 |
22 | #undef OK
23 | #define OK 0
24 |
25 | typedef signed int intptr_t;
26 | typedef unsigned int uintptr_t;
27 |
28 | //#define DEBUGASSERT assert_param
29 | #define DEBUGASSERT(...)
30 |
31 | /* Memory Management */
32 |
33 | #define mlldbg(...)
34 | #define mvdbg(...)
35 |
36 | struct mallinfo
37 | {
38 | int arena; /* This is the total size of memory allocated
39 | * for use by malloc in bytes. */
40 | int ordblks; /* This is the number of free (not in use) chunks */
41 | int mxordblk; /* Size of the largest free (not in use) chunk */
42 | int uordblks; /* This is the total size of memory occupied by
43 | * chunks handed out by malloc. */
44 | int fordblks; /* This is the total size of memory occupied
45 | * by free (not in use) chunks.*/
46 | };
47 |
48 | #endif /* CONFIG_H_ */
49 |
--------------------------------------------------------------------------------
/include/ogg/os_types.h:
--------------------------------------------------------------------------------
1 | #ifndef _OGG_OS_TYPES_H
2 | #define _OGG_OS_TYPES_H
3 |
4 | //#include "config.h"
5 | #include
6 |
7 | #include "bsp.h"
8 |
9 | #define _ogg_malloc user_malloc
10 | #define _ogg_calloc user_calloc
11 | #define _ogg_realloc user_realloc
12 | #define _ogg_free user_free
13 |
14 | typedef int16_t ogg_int16_t;
15 | typedef uint16_t ogg_uint16_t;
16 | typedef int32_t ogg_int32_t;
17 | typedef uint32_t ogg_uint32_t;
18 | typedef int64_t ogg_int64_t;
19 |
20 | #endif //_OGG_OS_TYPES_H
21 |
--------------------------------------------------------------------------------
/include/powermanager.h:
--------------------------------------------------------------------------------
1 | /*
2 | * powermanager.h
3 | *
4 | * Copyright (c) 2012, Oleg Tsaregorodtsev
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions are met:
9 | * - Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | * - Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | * 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)
24 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25 | * THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | /* Define to prevent recursive inclusion ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
29 | #ifndef POWERMANAGER_H_
30 | #define POWERMANAGER_H_
31 |
32 | /* Includes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
33 | #include "common.h"
34 |
35 | /* Exported defines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
36 | /* Exported types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
37 | typedef enum
38 | {
39 | PM_OFFLINE,
40 | PM_ONLINE
41 | } PowerManagerState_Typedef;
42 |
43 | typedef enum
44 | {
45 | ADCS_BATTERY_VOLTAGE,
46 | ADCS_CHARGE_CURRENT,
47 | ADCS_HEADSET_STATE,
48 | ADCS_MAX
49 | } ADC_Source_Typedef;
50 |
51 | /* Exported macro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
52 | /* Exported functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
53 | void PowerManager_Init(void);
54 | void PowerManager_MainThread(void);
55 | PowerManagerState_Typedef PowerManager_GetState(void);
56 | float PowerManager_GetBatteryVoltage(void);
57 | float PowerManager_GetChargingCurrent(void);
58 |
59 | void PowerManager_ValuesReady(void);
60 |
61 | /* Exported variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
62 | /* Exported static inline functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
63 |
64 | #endif /* POWERMANAGER_H_ */
65 |
--------------------------------------------------------------------------------
/include/semaphore.h:
--------------------------------------------------------------------------------
1 | #ifndef SEMAPHORE_H_
2 | #define SEMAPHORE_H_
3 |
4 | /* Includes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
5 | /* Public defines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
6 | /* Public types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
7 | typedef int sem_t;
8 |
9 | /* Public constants ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
10 | /* Public variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
11 | /* Public macro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
12 | /* Public functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
13 | /* Public static inline functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
14 |
15 | #endif /* SEMAPHORE_H_ */
16 |
--------------------------------------------------------------------------------
/include/software_conf.h:
--------------------------------------------------------------------------------
1 | /*
2 | * software_conf.h
3 | *
4 | * Copyright (c) 2012, Oleg Tsaregorodtsev
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions are met:
9 | * - Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | * - Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | * 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)
24 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25 | * THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | /* Define to prevent recursive inclusion -------------------------------------*/
29 | #ifndef SOFTWARE_CONF_H_
30 | #define SOFTWARE_CONF_H_
31 |
32 | /* Software features */
33 | #define PLAYER_DEFAULT_VOLUME 20
34 | #define PLAYER_INI_FILE "0:/player.ini"
35 |
36 | #define NAVIGATOR_MAX_NESTING_LEVEL 10
37 |
38 | #define SD_BLOCK_SIZE 512
39 |
40 | #define USBD_MSC_SPEED_MPS 4
41 |
42 | /* Memory */
43 | #define FILE_BUFFER_SIZE 2048
44 | #define AUDIO_BUFFER_MAX_SIZE 2500
45 | #define AUDIO_BUFFER_COUNT 4
46 |
47 | /* CDC buf size */
48 | #define APP_RX_DATA_SIZE 8192
49 |
50 | #ifdef SIMULATOR
51 | # undef ENABLE_TRACE
52 | # define ENABLE_TRACE 1
53 | #endif
54 |
55 | #define MAX_FILE_PATH 256
56 |
57 | #endif /* SOFTWARE_CONF_H_ */
58 |
--------------------------------------------------------------------------------
/include/trace.h:
--------------------------------------------------------------------------------
1 | /*
2 | * trace.h
3 | *
4 | * Copyright (c) 2013, Oleg Tsaregorodtsev
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions are met:
9 | * - Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | * - Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | * 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)
24 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25 | * THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | /* Define to prevent recursive inclusion ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
29 | #ifndef TRACE_H_
30 | #define TRACE_H_
31 |
32 | /* Includes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
33 | #include "software_conf.h"
34 |
35 | /* Exported defines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
36 | /* Exported macro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
37 | #ifdef ENABLE_TRACE
38 | # define trace(...) printf(__VA_ARGS__)
39 | #else
40 | # define trace(...)
41 | #endif
42 |
43 | /* Exported types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
44 | /* Exported functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
45 | /* Exported variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
46 | /* Exported static inline functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
47 |
48 |
49 | #endif /* TRACE_H_ */
50 |
--------------------------------------------------------------------------------
/lib/fat_fs/diskio.h:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------
2 | / Low level disk interface modlue include file
3 | /-----------------------------------------------------------------------*/
4 |
5 | #ifndef _DISKIO
6 |
7 | #include "ffconf.h"
8 |
9 | #define _READONLY _FS_READONLY /* 1: Remove write functions */
10 | #define _USE_IOCTL 1 /* 1: Use disk_ioctl fucntion */
11 |
12 | #include "integer.h"
13 |
14 |
15 | /* Status of Disk Functions */
16 | typedef BYTE DSTATUS;
17 |
18 | /* Results of Disk Functions */
19 | typedef enum {
20 | RES_OK = 0, /* 0: Successful */
21 | RES_ERROR, /* 1: R/W Error */
22 | RES_WRPRT, /* 2: Write Protected */
23 | RES_NOTRDY, /* 3: Not Ready */
24 | RES_PARERR /* 4: Invalid Parameter */
25 | } DRESULT;
26 |
27 |
28 | /*---------------------------------------*/
29 | /* Prototypes for disk control functions */
30 |
31 | int assign_drives (int, int);
32 | DSTATUS disk_initialize (BYTE);
33 | DSTATUS disk_status (BYTE);
34 | DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE);
35 | #if _READONLY == 0
36 | DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE);
37 | #endif
38 | DRESULT disk_ioctl (BYTE, BYTE, void*);
39 |
40 |
41 |
42 | /* Disk Status Bits (DSTATUS) */
43 |
44 | #define STA_NOINIT 0x01 /* Drive not initialized */
45 | #define STA_NODISK 0x02 /* No medium in the drive */
46 | #define STA_PROTECT 0x04 /* Write protected */
47 |
48 |
49 | /* Command code for disk_ioctrl fucntion */
50 |
51 | /* Generic command (defined for FatFs) */
52 | #define CTRL_SYNC 0 /* Flush disk cache (for write functions) */
53 | #define GET_SECTOR_COUNT 1 /* Get media size (for only f_mkfs()) */
54 | #define GET_SECTOR_SIZE 2 /* Get sector size (for multiple sector size (_MAX_SS >= 1024)) */
55 | #define GET_BLOCK_SIZE 3 /* Get erase block size (for only f_mkfs()) */
56 | #define CTRL_ERASE_SECTOR 4 /* Force erased a block of sectors (for only _USE_ERASE) */
57 |
58 | /* Generic command */
59 | #define CTRL_POWER 5 /* Get/Set power status */
60 | #define CTRL_LOCK 6 /* Lock/Unlock media removal */
61 | #define CTRL_EJECT 7 /* Eject media */
62 |
63 | /* MMC/SDC specific ioctl command */
64 | #define MMC_GET_TYPE 10 /* Get card type */
65 | #define MMC_GET_CSD 11 /* Get CSD */
66 | #define MMC_GET_CID 12 /* Get CID */
67 | #define MMC_GET_OCR 13 /* Get OCR */
68 | #define MMC_GET_SDSTAT 14 /* Get SD status */
69 |
70 | /* ATA/CF specific ioctl command */
71 | #define ATA_GET_REV 20 /* Get F/W revision */
72 | #define ATA_GET_MODEL 21 /* Get model name */
73 | #define ATA_GET_SN 22 /* Get serial number */
74 |
75 | /* NAND specific ioctl command */
76 | #define NAND_FORMAT 30 /* Create physical format */
77 |
78 |
79 | #define _DISKIO
80 | #endif
81 |
--------------------------------------------------------------------------------
/lib/fat_fs/integer.h:
--------------------------------------------------------------------------------
1 | /*-------------------------------------------*/
2 | /* Integer type definitions for FatFs module */
3 | /*-------------------------------------------*/
4 |
5 | #ifndef _INTEGER
6 | #define _INTEGER
7 |
8 | #ifdef _WIN32 /* FatFs development platform */
9 |
10 | #include
11 | #include
12 |
13 | #else /* Embedded platform */
14 |
15 | #include "FreeRTOS.h"
16 | #include "semphr.h"
17 |
18 | /* These types must be 16-bit, 32-bit or larger integer */
19 | typedef int INT;
20 | typedef unsigned int UINT;
21 |
22 | /* These types must be 8-bit integer */
23 | typedef char CHAR;
24 | typedef unsigned char UCHAR;
25 | typedef unsigned char BYTE;
26 |
27 | /* These types must be 16-bit integer */
28 | typedef short SHORT;
29 | typedef unsigned short USHORT;
30 | typedef unsigned short WORD;
31 | typedef unsigned short WCHAR;
32 |
33 | /* These types must be 32-bit integer */
34 | typedef long LONG;
35 | typedef unsigned long ULONG;
36 | typedef unsigned long DWORD;
37 |
38 | #endif
39 |
40 | #endif
41 |
--------------------------------------------------------------------------------
/lib/freertos/portable/readme.txt:
--------------------------------------------------------------------------------
1 | Each real time kernel port consists of three files that contain the core kernel
2 | components and are common to every port, and one or more files that are
3 | specific to a particular microcontroller and/or compiler.
4 |
5 |
6 | + The FreeRTOS/Source/Portable/MemMang directory contains the three sample
7 | memory allocators as described on the http://www.FreeRTOS.org WEB site.
8 |
9 | + The other directories each contain files specific to a particular
10 | microcontroller or compiler.
11 |
12 |
13 |
14 | For example, if you are interested in the GCC port for the ATMega323
15 | microcontroller then the port specific files are contained in
16 | FreeRTOS/Source/Portable/GCC/ATMega323 directory. If this is the only
17 | port you are interested in then all the other directories can be
18 | ignored.
19 |
20 |
--------------------------------------------------------------------------------
/lib/freertos/readme.txt:
--------------------------------------------------------------------------------
1 | Each real time kernel port consists of three files that contain the core kernel
2 | components and are common to every port, and one or more files that are
3 | specific to a particular microcontroller and or compiler.
4 |
5 | + The FreeRTOS/Source directory contains the three files that are common to
6 | every port - list.c, queue.c and tasks.c. The kernel is contained within these
7 | three files. croutine.c implements the optional co-routine functionality - which
8 | is normally only used on very memory limited systems.
9 |
10 | + The FreeRTOS/Source/Portable directory contains the files that are specific to
11 | a particular microcontroller and or compiler.
12 |
13 | + The FreeRTOS/Source/include directory contains the real time kernel header
14 | files.
15 |
16 | See the readme file in the FreeRTOS/Source/Portable directory for more
17 | information.
--------------------------------------------------------------------------------
/lib/minIni/NOTICE:
--------------------------------------------------------------------------------
1 | minIni is a programmer's library to read and write "INI" files in embedded
2 | systems. The library takes little resources and can be configured for various
3 | kinds of file I/O libraries.
4 |
5 | The method for portable INI file management in minIni is, in part based, on the
6 | article "Multiplatform .INI Files" by Joseph J. Graf in the March 1994 issue of
7 | Dr. Dobb's Journal.
8 |
9 | The C++ class in minIni.h was contributed by Steven Van Ingelgem.
10 |
11 | The option to compile minIni as a read-only library was contributed by Luca
12 | Bassanello.
13 |
--------------------------------------------------------------------------------
/lib/minIni/minGlue-FatFs.h:
--------------------------------------------------------------------------------
1 | /* Glue functions for the minIni library, based on the FatFs and Petit-FatFs
2 | * libraries, see http://elm-chan.org/fsw/ff/00index_e.html
3 | *
4 | * By CompuPhase, 2008-2012
5 | * This "glue file" is in the public domain. It is distributed without
6 | * warranties or conditions of any kind, either express or implied.
7 | *
8 | * (The FatFs and Petit-FatFs libraries are copyright by ChaN and licensed at
9 | * its own terms.)
10 | */
11 |
12 | #define INI_BUFFERSIZE 256 /* maximum line length, maximum path length */
13 |
14 | /* You must set _USE_STRFUNC to 1 or 2 in the include file ff.h (or tff.h)
15 | * to enable the "string functions" fgets() and fputs().
16 | */
17 | #include "ff.h" /* include tff.h for Tiny-FatFs */
18 | #include
19 | #include
20 |
21 | #define INI_FILETYPE FIL
22 | #define ini_openread(filename,file) (f_open((file), (filename), FA_READ+FA_OPEN_EXISTING) == FR_OK)
23 | #define ini_openwrite(filename,file) (f_open((file), (filename), FA_WRITE+FA_CREATE_ALWAYS) == FR_OK)
24 | #define ini_close(file) (f_close(file) == FR_OK)
25 | #define ini_read(buffer,size,file) f_gets((buffer), (size),(file))
26 | #define ini_write(buffer,file) f_puts((buffer), (file))
27 | #define ini_remove(filename) (f_unlink(filename) == FR_OK)
28 |
29 | #define INI_FILEPOS DWORD
30 | #define ini_tell(file,pos) (*(pos) = f_tell((file)))
31 | #define ini_seek(file,pos) (f_lseek((file), *(pos)) == FR_OK)
32 |
33 | static inline int ini_rename(TCHAR *source, TCHAR *dest)
34 | {
35 | /* Function f_rename() does not allow drive letters in the destination file */
36 | char *drive = strchr(dest, ':');
37 | drive = (drive == NULL) ? dest : drive + 1;
38 | return (f_rename(source, drive) == FR_OK);
39 | }
40 |
--------------------------------------------------------------------------------
/lib/minIni/minGlue-stdio.h:
--------------------------------------------------------------------------------
1 | /* Glue functions for the minIni library, based on the C/C++ stdio library
2 | *
3 | * Or better said: this file contains macros that maps the function interface
4 | * used by minIni to the standard C/C++ file I/O functions.
5 | *
6 | * By CompuPhase, 2008-2012
7 | * This "glue file" is in the public domain. It is distributed without
8 | * warranties or conditions of any kind, either express or implied.
9 | */
10 |
11 | /* map required file I/O types and functions to the standard C library */
12 | #include
13 |
14 | #define INI_FILETYPE FILE*
15 | #define ini_openread(filename,file) ((*(file) = fopen((filename),"rb")) != NULL)
16 | #define ini_openwrite(filename,file) ((*(file) = fopen((filename),"wb")) != NULL)
17 | #define ini_close(file) (fclose(*(file)) == 0)
18 | #define ini_read(buffer,size,file) (fgets((buffer),(size),*(file)) != NULL)
19 | #define ini_write(buffer,file) (fputs((buffer),*(file)) >= 0)
20 | #define ini_rename(source,dest) (rename((source), (dest)) == 0)
21 | #define ini_remove(filename) (remove(filename) == 0)
22 |
23 | #define INI_FILEPOS fpos_t
24 | #define ini_tell(file,pos) (fgetpos(*(file), (pos)) == 0)
25 | #define ini_seek(file,pos) (fsetpos(*(file), (pos)) == 0)
26 |
27 | /* for floating-point support, define additional types and functions */
28 | #define INI_REAL float
29 | #define ini_ftoa(string,value) sprintf((string),"%f",(value))
30 | #define ini_atof(string) (INI_REAL)strtod((string),NULL)
31 |
--------------------------------------------------------------------------------
/lib/minIni/minGlue.h:
--------------------------------------------------------------------------------
1 | /* Glue functions for the minIni library, based on the C/C++ stdio library
2 | *
3 | * Or better said: this file contains macros that maps the function interface
4 | * used by minIni to the standard C/C++ file I/O functions.
5 | *
6 | * By CompuPhase, 2008-2012
7 | * This "glue file" is in the public domain. It is distributed without
8 | * warranties or conditions of any kind, either express or implied.
9 | */
10 |
11 | /* map required file I/O types and functions to the standard C library */
12 | #include
13 |
14 | #define INI_FILETYPE FILE*
15 | #define ini_openread(filename,file) ((*(file) = fopen((filename),"rb")) != NULL)
16 | #define ini_openwrite(filename,file) ((*(file) = fopen((filename),"wb")) != NULL)
17 | #define ini_close(file) (fclose(*(file)) == 0)
18 | #define ini_read(buffer,size,file) (fgets((buffer),(size),*(file)) != NULL)
19 | #define ini_write(buffer,file) (fputs((buffer),*(file)) >= 0)
20 | #define ini_rename(source,dest) (rename((source), (dest)) == 0)
21 | #define ini_remove(filename) (remove(filename) == 0)
22 |
23 | #define INI_FILEPOS fpos_t
24 | #define ini_tell(file,pos) (fgetpos(*(file), (pos)) == 0)
25 | #define ini_seek(file,pos) (fsetpos(*(file), (pos)) == 0)
26 |
27 | /* for floating-point support, define additional types and functions */
28 | #define INI_REAL float
29 | #define ini_ftoa(string,value) sprintf((string),"%f",(value))
30 | #define ini_atof(string) (INI_REAL)strtod((string),NULL)
31 |
--------------------------------------------------------------------------------
/lib/minIni/minIni.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/lib/minIni/minIni.pdf
--------------------------------------------------------------------------------
/lib/minIni/test.ini:
--------------------------------------------------------------------------------
1 | [First]
2 | String=noot # trailing commment
3 | Val=1
4 |
5 | [Second]
6 | Val = 2
7 | #comment=3
8 | String = mies
9 |
--------------------------------------------------------------------------------
/lib/minIni/testplain.ini:
--------------------------------------------------------------------------------
1 | String=noot # trailing commment
2 | #comment=3
3 | Val=1
4 |
--------------------------------------------------------------------------------
/lib/mm/mm_sem.c:
--------------------------------------------------------------------------------
1 | /*
2 | * mm_sem.c
3 | *
4 | * Created on: Apr 29, 2013
5 | * Author: otsaregorodtsev
6 | */
7 |
8 | /* Includes ------------------------------------------------------------------*/
9 | #include
10 | #include
11 |
12 | #include "nuttx/config.h"
13 | #include "nuttx/mm.h"
14 | #include "common.h"
15 |
16 | /* Private defines -----------------------------------------------------------*/
17 | /* Private types -------------------------------------------------------------*/
18 | /* Private constants ---------------------------------------------------------*/
19 | /* Private variables ---------------------------------------------------------*/
20 | /* Private macro -------------------------------------------------------------*/
21 | /* Private function prototypes -----------------------------------------------*/
22 | /* Private functions -------------------------------------------------------- */
23 |
24 | void mm_seminitialize(FAR struct mm_heap_s *heap)
25 | {
26 | UNUSED(heap);
27 | }
28 |
29 | void mm_takesemaphore(FAR struct mm_heap_s *heap)
30 | {
31 | UNUSED(heap);
32 | vTaskSuspendAll();
33 | }
34 |
35 | void mm_givesemaphore(FAR struct mm_heap_s *heap)
36 | {
37 | UNUSED(heap);
38 | xTaskResumeAll();
39 | }
40 |
--------------------------------------------------------------------------------
/lib/mp3-fixpt-helix/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
2 |
3 | The contents of this directory, and (except where otherwise
4 | indicated) the directories included within this directory, are
5 | subject to the current version of the RealNetworks Public Source
6 | License (the "RPSL") available at RPSL.txt in this directory, unless
7 | you have licensed the directory under the current version of the
8 | RealNetworks Community Source License (the "RCSL") available at
9 | RCSL.txt in this directory, in which case the RCSL will apply. You
10 | may also obtain the license terms directly from RealNetworks. You
11 | may not use the files in this directory except in compliance with the
12 | RPSL or, if you have a valid RCSL with RealNetworks applicable to
13 | this directory, the RCSL. Please see the applicable RPSL or RCSL for
14 | the rights, obligations and limitations governing use of the contents
15 | of the directory.
16 |
17 | This directory is part of the Helix DNA Technology. RealNetworks is
18 | the developer of the Original Code and owns the copyrights in the
19 | portions it created.
20 |
21 | This directory, and the directories included with this directory, are
22 | distributed and made available on an 'AS IS' basis, WITHOUT WARRANTY
23 | OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY
24 | DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY
25 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
26 | QUIET ENJOYMENT OR NON-INFRINGEMENT.
27 |
28 | Technology Compatibility Kit Test Suite(s) Location:
29 | http://www.helixcommunity.org/content/tck
30 |
31 |
--------------------------------------------------------------------------------
/lib/mp3-fixpt-helix/RCSL.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/lib/mp3-fixpt-helix/RCSL.txt
--------------------------------------------------------------------------------
/lib/mp3-fixpt-helix/pub/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
2 |
3 | The contents of this directory, and (except where otherwise
4 | indicated) the directories included within this directory, are
5 | subject to the current version of the RealNetworks Public Source
6 | License (the "RPSL") available at RPSL.txt in this directory, unless
7 | you have licensed the directory under the current version of the
8 | RealNetworks Community Source License (the "RCSL") available at
9 | RCSL.txt in this directory, in which case the RCSL will apply. You
10 | may also obtain the license terms directly from RealNetworks. You
11 | may not use the files in this directory except in compliance with the
12 | RPSL or, if you have a valid RCSL with RealNetworks applicable to
13 | this directory, the RCSL. Please see the applicable RPSL or RCSL for
14 | the rights, obligations and limitations governing use of the contents
15 | of the directory.
16 |
17 | This directory is part of the Helix DNA Technology. RealNetworks is
18 | the developer of the Original Code and owns the copyrights in the
19 | portions it created.
20 |
21 | This directory, and the directories included with this directory, are
22 | distributed and made available on an 'AS IS' basis, WITHOUT WARRANTY
23 | OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY
24 | DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY
25 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
26 | QUIET ENJOYMENT OR NON-INFRINGEMENT.
27 |
28 | Technology Compatibility Kit Test Suite(s) Location:
29 | http://www.helixcommunity.org/content/tck
30 |
31 |
--------------------------------------------------------------------------------
/lib/mp3-fixpt-helix/pub/RCSL.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/lib/mp3-fixpt-helix/pub/RCSL.txt
--------------------------------------------------------------------------------
/lib/mp3-fixpt-helix/readme.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/lib/mp3-fixpt-helix/readme.txt
--------------------------------------------------------------------------------
/lib/mp3-fixpt-helix/real/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
2 |
3 | The contents of this directory, and (except where otherwise
4 | indicated) the directories included within this directory, are
5 | subject to the current version of the RealNetworks Public Source
6 | License (the "RPSL") available at RPSL.txt in this directory, unless
7 | you have licensed the directory under the current version of the
8 | RealNetworks Community Source License (the "RCSL") available at
9 | RCSL.txt in this directory, in which case the RCSL will apply. You
10 | may also obtain the license terms directly from RealNetworks. You
11 | may not use the files in this directory except in compliance with the
12 | RPSL or, if you have a valid RCSL with RealNetworks applicable to
13 | this directory, the RCSL. Please see the applicable RPSL or RCSL for
14 | the rights, obligations and limitations governing use of the contents
15 | of the directory.
16 |
17 | This directory is part of the Helix DNA Technology. RealNetworks is
18 | the developer of the Original Code and owns the copyrights in the
19 | portions it created.
20 |
21 | This directory, and the directories included with this directory, are
22 | distributed and made available on an 'AS IS' basis, WITHOUT WARRANTY
23 | OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY
24 | DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY
25 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
26 | QUIET ENJOYMENT OR NON-INFRINGEMENT.
27 |
28 | Technology Compatibility Kit Test Suite(s) Location:
29 | http://www.helixcommunity.org/content/tck
30 |
31 |
--------------------------------------------------------------------------------
/lib/mp3-fixpt-helix/real/RCSL.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/lib/mp3-fixpt-helix/real/RCSL.txt
--------------------------------------------------------------------------------
/lib/opus/celt/celt_lpc.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2009-2010 Xiph.Org Foundation
2 | Written by Jean-Marc Valin */
3 | /*
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions
6 | are met:
7 |
8 | - Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 |
11 | - Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in the
13 | documentation and/or other materials provided with the distribution.
14 |
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
19 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifndef PLC_H
29 | #define PLC_H
30 |
31 | #include "arch.h"
32 |
33 | #define LPC_ORDER 24
34 |
35 | void _celt_lpc(opus_val16 *_lpc, const opus_val32 *ac, int p);
36 |
37 | void celt_fir(const opus_val16 *x,
38 | const opus_val16 *num,
39 | opus_val16 *y,
40 | int N,
41 | int ord,
42 | opus_val16 *mem);
43 |
44 | void celt_iir(const opus_val32 *x,
45 | const opus_val16 *den,
46 | opus_val32 *y,
47 | int N,
48 | int ord,
49 | opus_val16 *mem);
50 |
51 | void _celt_autocorr(const opus_val16 *x, opus_val32 *ac, const opus_val16 *window, int overlap, int lag, int n);
52 |
53 | #endif /* PLC_H */
54 |
--------------------------------------------------------------------------------
/lib/opus/celt/cwrs.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2007-2008 CSIRO
2 | Copyright (c) 2007-2009 Xiph.Org Foundation
3 | Copyright (c) 2007-2009 Timothy B. Terriberry
4 | Written by Timothy B. Terriberry and Jean-Marc Valin */
5 | /*
6 | Redistribution and use in source and binary forms, with or without
7 | modification, are permitted provided that the following conditions
8 | are met:
9 |
10 | - Redistributions of source code must retain the above copyright
11 | notice, this list of conditions and the following disclaimer.
12 |
13 | - Redistributions in binary form must reproduce the above copyright
14 | notice, this list of conditions and the following disclaimer in the
15 | documentation and/or other materials provided with the distribution.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
21 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #ifndef CWRS_H
31 | #define CWRS_H
32 |
33 | #include "arch.h"
34 | #include "stack_alloc.h"
35 | #include "entenc.h"
36 | #include "entdec.h"
37 |
38 | #ifdef CUSTOM_MODES
39 | int log2_frac(opus_uint32 val, int frac);
40 | #endif
41 |
42 | void get_required_bits(opus_int16 *bits, int N, int K, int frac);
43 |
44 | void encode_pulses(const int *_y, int N, int K, ec_enc *enc);
45 |
46 | void decode_pulses(int *_y, int N, int K, ec_dec *dec);
47 |
48 | #endif /* CWRS_H */
49 |
--------------------------------------------------------------------------------
/lib/opus/celt/laplace.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2007 CSIRO
2 | Copyright (c) 2007-2009 Xiph.Org Foundation
3 | Written by Jean-Marc Valin */
4 | /*
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions
7 | are met:
8 |
9 | - Redistributions of source code must retain the above copyright
10 | notice, this list of conditions and the following disclaimer.
11 |
12 | - Redistributions in binary form must reproduce the above copyright
13 | notice, this list of conditions and the following disclaimer in the
14 | documentation and/or other materials provided with the distribution.
15 |
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
20 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | #include "entenc.h"
30 | #include "entdec.h"
31 |
32 | /** Encode a value that is assumed to be the realisation of a
33 | Laplace-distributed random process
34 | @param enc Entropy encoder state
35 | @param value Value to encode
36 | @param fs Probability of 0, multiplied by 32768
37 | @param decay Probability of the value +/- 1, multiplied by 16384
38 | */
39 | void ec_laplace_encode(ec_enc *enc, int *value, unsigned fs, int decay);
40 |
41 | /** Decode a value that is assumed to be the realisation of a
42 | Laplace-distributed random process
43 | @param dec Entropy decoder state
44 | @param fs Probability of 0, multiplied by 32768
45 | @param decay Probability of the value +/- 1, multiplied by 16384
46 | @return Value decoded
47 | */
48 | int ec_laplace_decode(ec_dec *dec, unsigned fs, int decay);
49 |
--------------------------------------------------------------------------------
/lib/opus/celt/mfrngcod.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2001-2008 Timothy B. Terriberry
2 | Copyright (c) 2008-2009 Xiph.Org Foundation */
3 | /*
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions
6 | are met:
7 |
8 | - Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 |
11 | - Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in the
13 | documentation and/or other materials provided with the distribution.
14 |
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
19 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #if !defined(_mfrngcode_H)
29 | # define _mfrngcode_H (1)
30 | # include "entcode.h"
31 |
32 | /*Constants used by the entropy encoder/decoder.*/
33 |
34 | /*The number of bits to output at a time.*/
35 | # define EC_SYM_BITS (8)
36 | /*The total number of bits in each of the state registers.*/
37 | # define EC_CODE_BITS (32)
38 | /*The maximum symbol value.*/
39 | # define EC_SYM_MAX ((1U<>EC_SYM_BITS)
46 | /*The number of bits available for the last, partial symbol in the code field.*/
47 | # define EC_CODE_EXTRA ((EC_CODE_BITS-2)%EC_SYM_BITS+1)
48 | #endif
49 |
--------------------------------------------------------------------------------
/lib/opus/celt/modes.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2007-2008 CSIRO
2 | Copyright (c) 2007-2009 Xiph.Org Foundation
3 | Copyright (c) 2008 Gregory Maxwell
4 | Written by Jean-Marc Valin and Gregory Maxwell */
5 | /*
6 | Redistribution and use in source and binary forms, with or without
7 | modification, are permitted provided that the following conditions
8 | are met:
9 |
10 | - Redistributions of source code must retain the above copyright
11 | notice, this list of conditions and the following disclaimer.
12 |
13 | - Redistributions in binary form must reproduce the above copyright
14 | notice, this list of conditions and the following disclaimer in the
15 | documentation and/or other materials provided with the distribution.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
21 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #ifndef MODES_H
31 | #define MODES_H
32 |
33 | #include "opus_types.h"
34 | #include "celt.h"
35 | #include "arch.h"
36 | #include "mdct.h"
37 | #include "entenc.h"
38 | #include "entdec.h"
39 |
40 | #define MAX_PERIOD 1024
41 |
42 | #ifndef OVERLAP
43 | #define OVERLAP(mode) ((mode)->overlap)
44 | #endif
45 |
46 | #ifndef FRAMESIZE
47 | #define FRAMESIZE(mode) ((mode)->mdctSize)
48 | #endif
49 |
50 | typedef struct {
51 | int size;
52 | const opus_int16 *index;
53 | const unsigned char *bits;
54 | const unsigned char *caps;
55 | } PulseCache;
56 |
57 | /** Mode definition (opaque)
58 | @brief Mode definition
59 | */
60 | struct OpusCustomMode {
61 | opus_int32 Fs;
62 | int overlap;
63 |
64 | int nbEBands;
65 | int effEBands;
66 | opus_val16 preemph[4];
67 | const opus_int16 *eBands; /**< Definition for each "pseudo-critical band" */
68 |
69 | int maxLM;
70 | int nbShortMdcts;
71 | int shortMdctSize;
72 |
73 | int nbAllocVectors; /**< Number of lines in the matrix below */
74 | const unsigned char *allocVectors; /**< Number of bits in each band for several rates */
75 | const opus_int16 *logN;
76 |
77 | const opus_val16 *window;
78 | mdct_lookup mdct;
79 | PulseCache cache;
80 | };
81 |
82 |
83 | #endif
84 |
--------------------------------------------------------------------------------
/lib/opus/celt/pitch.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2007-2008 CSIRO
2 | Copyright (c) 2007-2009 Xiph.Org Foundation
3 | Written by Jean-Marc Valin */
4 | /**
5 | @file pitch.h
6 | @brief Pitch analysis
7 | */
8 |
9 | /*
10 | Redistribution and use in source and binary forms, with or without
11 | modification, are permitted provided that the following conditions
12 | are met:
13 |
14 | - Redistributions of source code must retain the above copyright
15 | notice, this list of conditions and the following disclaimer.
16 |
17 | - Redistributions in binary form must reproduce the above copyright
18 | notice, this list of conditions and the following disclaimer in the
19 | documentation and/or other materials provided with the distribution.
20 |
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
25 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | #ifndef PITCH_H
35 | #define PITCH_H
36 |
37 | #include "modes.h"
38 |
39 | void pitch_downsample(celt_sig * OPUS_RESTRICT x[], opus_val16 * OPUS_RESTRICT x_lp,
40 | int len, int C);
41 |
42 | void pitch_search(const opus_val16 * OPUS_RESTRICT x_lp, opus_val16 * OPUS_RESTRICT y,
43 | int len, int max_pitch, int *pitch);
44 |
45 | opus_val16 remove_doubling(opus_val16 *x, int maxperiod, int minperiod,
46 | int N, int *T0, int prev_period, opus_val16 prev_gain);
47 |
48 | #endif
49 |
--------------------------------------------------------------------------------
/lib/opus/celt/tests/test_unit_types.c:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2008-2011 Xiph.Org Foundation
2 | Written by Jean-Marc Valin */
3 | /*
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions
6 | are met:
7 |
8 | - Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 |
11 | - Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in the
13 | documentation and/or other materials provided with the distribution.
14 |
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
19 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "opus_types.h"
33 | #include
34 |
35 | int main(void)
36 | {
37 | opus_int16 i = 1;
38 | i <<= 14;
39 | if (i>>14 != 1)
40 | {
41 | fprintf(stderr, "opus_int16 isn't 16 bits\n");
42 | return 1;
43 | }
44 | if (sizeof(opus_int16)*2 != sizeof(opus_int32))
45 | {
46 | fprintf(stderr, "16*2 != 32\n");
47 | return 1;
48 | }
49 | return 0;
50 | }
51 |
--------------------------------------------------------------------------------
/lib/opus/include/opus_header.h:
--------------------------------------------------------------------------------
1 | /* Copyright (C)2012 Xiph.Org Foundation
2 | File: opus_header.h
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions
6 | are met:
7 |
8 | - Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 |
11 | - Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in the
13 | documentation and/or other materials provided with the distribution.
14 |
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
19 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifndef OPUS_HEADER_H
29 | #define OPUS_HEADER_H
30 |
31 | #include
32 |
33 | typedef struct {
34 | int version;
35 | int channels; /* Number of channels: 1..255 */
36 | int preskip;
37 | ogg_uint32_t input_sample_rate;
38 | int gain; /* in dB S7.8 should be zero whenever possible */
39 | int channel_mapping;
40 | /* The rest is only used if channel_mapping != 0 */
41 | int nb_streams;
42 | int nb_coupled;
43 | unsigned char stream_map[255];
44 | } OpusHeader;
45 |
46 | int opus_header_parse(const unsigned char *header, int len, OpusHeader *h);
47 | int opus_header_to_packet(const OpusHeader *h, unsigned char *packet, int len);
48 |
49 | extern const int wav_permute_matrix[8][8];
50 |
51 | #endif
52 |
--------------------------------------------------------------------------------
/lib/opus/silk/bwexpander.c:
--------------------------------------------------------------------------------
1 | /***********************************************************************
2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 | - Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 | - Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 | names of specific contributors, may be used to endorse or promote
13 | products derived from this software without specific prior written
14 | permission.
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | 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)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "SigProc_FIX.h"
33 |
34 | /* Chirp (bandwidth expand) LP AR filter */
35 | void silk_bwexpander(
36 | opus_int16 *ar, /* I/O AR filter to be expanded (without leading 1) */
37 | const opus_int d, /* I Length of ar */
38 | opus_int32 chirp_Q16 /* I Chirp factor (typically in the range 0 to 1) */
39 | )
40 | {
41 | opus_int i;
42 | opus_int32 chirp_minus_one_Q16 = chirp_Q16 - 65536;
43 |
44 | /* NB: Dont use silk_SMULWB, instead of silk_RSHIFT_ROUND( silk_MUL(), 16 ), below. */
45 | /* Bias in silk_SMULWB can lead to unstable filters */
46 | for( i = 0; i < d - 1; i++ ) {
47 | ar[ i ] = (opus_int16)silk_RSHIFT_ROUND( silk_MUL( chirp_Q16, ar[ i ] ), 16 );
48 | chirp_Q16 += silk_RSHIFT_ROUND( silk_MUL( chirp_Q16, chirp_minus_one_Q16 ), 16 );
49 | }
50 | ar[ d - 1 ] = (opus_int16)silk_RSHIFT_ROUND( silk_MUL( chirp_Q16, ar[ d - 1 ] ), 16 );
51 | }
52 |
--------------------------------------------------------------------------------
/lib/opus/silk/bwexpander_32.c:
--------------------------------------------------------------------------------
1 | /***********************************************************************
2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 | - Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 | - Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 | names of specific contributors, may be used to endorse or promote
13 | products derived from this software without specific prior written
14 | permission.
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | 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)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "SigProc_FIX.h"
33 |
34 | /* Chirp (bandwidth expand) LP AR filter */
35 | void silk_bwexpander_32(
36 | opus_int32 *ar, /* I/O AR filter to be expanded (without leading 1) */
37 | const opus_int d, /* I Length of ar */
38 | opus_int32 chirp_Q16 /* I Chirp factor in Q16 */
39 | )
40 | {
41 | opus_int i;
42 | opus_int32 chirp_minus_one_Q16 = chirp_Q16 - 65536;
43 |
44 | for( i = 0; i < d - 1; i++ ) {
45 | ar[ i ] = silk_SMULWW( chirp_Q16, ar[ i ] );
46 | chirp_Q16 += silk_RSHIFT_ROUND( silk_MUL( chirp_Q16, chirp_minus_one_Q16 ), 16 );
47 | }
48 | ar[ d - 1 ] = silk_SMULWW( chirp_Q16, ar[ d - 1 ] );
49 | }
50 |
51 |
--------------------------------------------------------------------------------
/lib/opus/silk/fixed/k2a_FIX.c:
--------------------------------------------------------------------------------
1 | /***********************************************************************
2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 | - Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 | - Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 | names of specific contributors, may be used to endorse or promote
13 | products derived from this software without specific prior written
14 | permission.
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | 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)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "SigProc_FIX.h"
33 |
34 | /* Step up function, converts reflection coefficients to prediction coefficients */
35 | void silk_k2a(
36 | opus_int32 *A_Q24, /* O Prediction coefficients [order] Q24 */
37 | const opus_int16 *rc_Q15, /* I Reflection coefficients [order] Q15 */
38 | const opus_int32 order /* I Prediction order */
39 | )
40 | {
41 | opus_int k, n;
42 | opus_int32 Atmp[ SILK_MAX_ORDER_LPC ];
43 |
44 | for( k = 0; k < order; k++ ) {
45 | for( n = 0; n < k; n++ ) {
46 | Atmp[ n ] = A_Q24[ n ];
47 | }
48 | for( n = 0; n < k; n++ ) {
49 | A_Q24[ n ] = silk_SMLAWB( A_Q24[ n ], silk_LSHIFT( Atmp[ k - n - 1 ], 1 ), rc_Q15[ k ] );
50 | }
51 | A_Q24[ k ] = -silk_LSHIFT( (opus_int32)rc_Q15[ k ], 9 );
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/lib/opus/silk/fixed/k2a_Q16_FIX.c:
--------------------------------------------------------------------------------
1 | /***********************************************************************
2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 | - Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 | - Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 | names of specific contributors, may be used to endorse or promote
13 | products derived from this software without specific prior written
14 | permission.
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | 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)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "SigProc_FIX.h"
33 |
34 | /* Step up function, converts reflection coefficients to prediction coefficients */
35 | void silk_k2a_Q16(
36 | opus_int32 *A_Q24, /* O Prediction coefficients [order] Q24 */
37 | const opus_int32 *rc_Q16, /* I Reflection coefficients [order] Q16 */
38 | const opus_int32 order /* I Prediction order */
39 | )
40 | {
41 | opus_int k, n;
42 | opus_int32 Atmp[ SILK_MAX_ORDER_LPC ];
43 |
44 | for( k = 0; k < order; k++ ) {
45 | for( n = 0; n < k; n++ ) {
46 | Atmp[ n ] = A_Q24[ n ];
47 | }
48 | for( n = 0; n < k; n++ ) {
49 | A_Q24[ n ] = silk_SMLAWW( A_Q24[ n ], Atmp[ k - n - 1 ], rc_Q16[ k ] );
50 | }
51 | A_Q24[ k ] = -silk_LSHIFT( rc_Q16[ k ], 8 );
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/lib/opus/silk/fixed/regularize_correlations_FIX.c:
--------------------------------------------------------------------------------
1 | /***********************************************************************
2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 | - Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 | - Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 | names of specific contributors, may be used to endorse or promote
13 | products derived from this software without specific prior written
14 | permission.
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | 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)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "main_FIX.h"
33 |
34 | /* Add noise to matrix diagonal */
35 | void silk_regularize_correlations_FIX(
36 | opus_int32 *XX, /* I/O Correlation matrices */
37 | opus_int32 *xx, /* I/O Correlation values */
38 | opus_int32 noise, /* I Noise to add */
39 | opus_int D /* I Dimension of XX */
40 | )
41 | {
42 | opus_int i;
43 | for( i = 0; i < D; i++ ) {
44 | matrix_ptr( &XX[ 0 ], i, i, D ) = silk_ADD32( matrix_ptr( &XX[ 0 ], i, i, D ), noise );
45 | }
46 | xx[ 0 ] += noise;
47 | }
48 |
--------------------------------------------------------------------------------
/lib/opus/silk/float/LTP_scale_ctrl_FLP.c:
--------------------------------------------------------------------------------
1 | /***********************************************************************
2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 | - Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 | - Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 | names of specific contributors, may be used to endorse or promote
13 | products derived from this software without specific prior written
14 | permission.
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | 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)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "main_FLP.h"
33 |
34 | void silk_LTP_scale_ctrl_FLP(
35 | silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
36 | silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */
37 | opus_int condCoding /* I The type of conditional coding to use */
38 | )
39 | {
40 | opus_int round_loss;
41 |
42 | if( condCoding == CODE_INDEPENDENTLY ) {
43 | /* Only scale if first frame in packet */
44 | round_loss = psEnc->sCmn.PacketLoss_perc + psEnc->sCmn.nFramesPerPacket;
45 | psEnc->sCmn.indices.LTP_scaleIndex = (opus_int8)silk_LIMIT( round_loss * psEncCtrl->LTPredCodGain * 0.1f, 0.0f, 2.0f );
46 | } else {
47 | /* Default is minimum scaling */
48 | psEnc->sCmn.indices.LTP_scaleIndex = 0;
49 | }
50 |
51 | psEncCtrl->LTP_scale = (silk_float)silk_LTPScales_table_Q14[ psEnc->sCmn.indices.LTP_scaleIndex ] / 16384.0f;
52 | }
53 |
--------------------------------------------------------------------------------
/lib/opus/silk/float/autocorrelation_FLP.c:
--------------------------------------------------------------------------------
1 | /***********************************************************************
2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 | - Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 | - Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 | names of specific contributors, may be used to endorse or promote
13 | products derived from this software without specific prior written
14 | permission.
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | 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)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "typedef.h"
33 | #include "SigProc_FLP.h"
34 |
35 | /* compute autocorrelation */
36 | void silk_autocorrelation_FLP(
37 | silk_float *results, /* O result (length correlationCount) */
38 | const silk_float *inputData, /* I input data to correlate */
39 | opus_int inputDataSize, /* I length of input */
40 | opus_int correlationCount /* I number of correlation taps to compute */
41 | )
42 | {
43 | opus_int i;
44 |
45 | if( correlationCount > inputDataSize ) {
46 | correlationCount = inputDataSize;
47 | }
48 |
49 | for( i = 0; i < correlationCount; i++ ) {
50 | results[ i ] = (silk_float)silk_inner_product_FLP( inputData, inputData + i, inputDataSize - i );
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/lib/opus/silk/float/bwexpander_FLP.c:
--------------------------------------------------------------------------------
1 | /***********************************************************************
2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 | - Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 | - Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 | names of specific contributors, may be used to endorse or promote
13 | products derived from this software without specific prior written
14 | permission.
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | 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)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "SigProc_FLP.h"
33 |
34 | /* Chirp (bw expand) LP AR filter */
35 | void silk_bwexpander_FLP(
36 | silk_float *ar, /* I/O AR filter to be expanded (without leading 1) */
37 | const opus_int d, /* I length of ar */
38 | const silk_float chirp /* I chirp factor (typically in range (0..1) ) */
39 | )
40 | {
41 | opus_int i;
42 | silk_float cfac = chirp;
43 |
44 | for( i = 0; i < d - 1; i++ ) {
45 | ar[ i ] *= cfac;
46 | cfac *= chirp;
47 | }
48 | ar[ d - 1 ] *= cfac;
49 | }
50 |
--------------------------------------------------------------------------------
/lib/opus/silk/float/energy_FLP.c:
--------------------------------------------------------------------------------
1 | /***********************************************************************
2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 | - Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 | - Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 | names of specific contributors, may be used to endorse or promote
13 | products derived from this software without specific prior written
14 | permission.
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | 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)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "SigProc_FLP.h"
33 |
34 | /* sum of squares of a silk_float array, with result as double */
35 | double silk_energy_FLP(
36 | const silk_float *data,
37 | opus_int dataSize
38 | )
39 | {
40 | opus_int i, dataSize4;
41 | double result;
42 |
43 | /* 4x unrolled loop */
44 | result = 0.0;
45 | dataSize4 = dataSize & 0xFFFC;
46 | for( i = 0; i < dataSize4; i += 4 ) {
47 | result += data[ i + 0 ] * (double)data[ i + 0 ] +
48 | data[ i + 1 ] * (double)data[ i + 1 ] +
49 | data[ i + 2 ] * (double)data[ i + 2 ] +
50 | data[ i + 3 ] * (double)data[ i + 3 ];
51 | }
52 |
53 | /* add any remaining products */
54 | for( ; i < dataSize; i++ ) {
55 | result += data[ i ] * (double)data[ i ];
56 | }
57 |
58 | silk_assert( result >= 0.0 );
59 | return result;
60 | }
61 |
--------------------------------------------------------------------------------
/lib/opus/silk/float/inner_product_FLP.c:
--------------------------------------------------------------------------------
1 | /***********************************************************************
2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 | - Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 | - Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 | names of specific contributors, may be used to endorse or promote
13 | products derived from this software without specific prior written
14 | permission.
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | 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)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "SigProc_FLP.h"
33 |
34 | /* inner product of two silk_float arrays, with result as double */
35 | double silk_inner_product_FLP(
36 | const silk_float *data1,
37 | const silk_float *data2,
38 | opus_int dataSize
39 | )
40 | {
41 | opus_int i, dataSize4;
42 | double result;
43 |
44 | /* 4x unrolled loop */
45 | result = 0.0;
46 | dataSize4 = dataSize & 0xFFFC;
47 | for( i = 0; i < dataSize4; i += 4 ) {
48 | result += data1[ i + 0 ] * (double)data2[ i + 0 ] +
49 | data1[ i + 1 ] * (double)data2[ i + 1 ] +
50 | data1[ i + 2 ] * (double)data2[ i + 2 ] +
51 | data1[ i + 3 ] * (double)data2[ i + 3 ];
52 | }
53 |
54 | /* add any remaining products */
55 | for( ; i < dataSize; i++ ) {
56 | result += data1[ i ] * (double)data2[ i ];
57 | }
58 |
59 | return result;
60 | }
61 |
--------------------------------------------------------------------------------
/lib/opus/silk/float/k2a_FLP.c:
--------------------------------------------------------------------------------
1 | /***********************************************************************
2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 | - Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 | - Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 | names of specific contributors, may be used to endorse or promote
13 | products derived from this software without specific prior written
14 | permission.
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | 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)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "SigProc_FLP.h"
33 |
34 | /* step up function, converts reflection coefficients to prediction coefficients */
35 | void silk_k2a_FLP(
36 | silk_float *A, /* O prediction coefficients [order] */
37 | const silk_float *rc, /* I reflection coefficients [order] */
38 | opus_int32 order /* I prediction order */
39 | )
40 | {
41 | opus_int k, n;
42 | silk_float Atmp[ SILK_MAX_ORDER_LPC ];
43 |
44 | for( k = 0; k < order; k++ ) {
45 | for( n = 0; n < k; n++ ) {
46 | Atmp[ n ] = A[ n ];
47 | }
48 | for( n = 0; n < k; n++ ) {
49 | A[ n ] += Atmp[ k - n - 1 ] * rc[ k ];
50 | }
51 | A[ k ] = -rc[ k ];
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/lib/opus/silk/float/regularize_correlations_FLP.c:
--------------------------------------------------------------------------------
1 | /***********************************************************************
2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 | - Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 | - Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 | names of specific contributors, may be used to endorse or promote
13 | products derived from this software without specific prior written
14 | permission.
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | 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)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "main_FLP.h"
33 |
34 | /* Add noise to matrix diagonal */
35 | void silk_regularize_correlations_FLP(
36 | silk_float *XX, /* I/O Correlation matrices */
37 | silk_float *xx, /* I/O Correlation values */
38 | const silk_float noise, /* I Noise energy to add */
39 | const opus_int D /* I Dimension of XX */
40 | )
41 | {
42 | opus_int i;
43 |
44 | for( i = 0; i < D; i++ ) {
45 | matrix_ptr( &XX[ 0 ], i, i, D ) += noise;
46 | }
47 | xx[ 0 ] += noise;
48 | }
49 |
--------------------------------------------------------------------------------
/lib/opus/silk/float/scale_copy_vector_FLP.c:
--------------------------------------------------------------------------------
1 | /***********************************************************************
2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 | - Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 | - Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 | names of specific contributors, may be used to endorse or promote
13 | products derived from this software without specific prior written
14 | permission.
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | 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)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "SigProc_FLP.h"
33 |
34 | /* copy and multiply a vector by a constant */
35 | void silk_scale_copy_vector_FLP(
36 | silk_float *data_out,
37 | const silk_float *data_in,
38 | silk_float gain,
39 | opus_int dataSize
40 | )
41 | {
42 | opus_int i, dataSize4;
43 |
44 | /* 4x unrolled loop */
45 | dataSize4 = dataSize & 0xFFFC;
46 | for( i = 0; i < dataSize4; i += 4 ) {
47 | data_out[ i + 0 ] = gain * data_in[ i + 0 ];
48 | data_out[ i + 1 ] = gain * data_in[ i + 1 ];
49 | data_out[ i + 2 ] = gain * data_in[ i + 2 ];
50 | data_out[ i + 3 ] = gain * data_in[ i + 3 ];
51 | }
52 |
53 | /* any remaining elements */
54 | for( ; i < dataSize; i++ ) {
55 | data_out[ i ] = gain * data_in[ i ];
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/lib/opus/silk/float/scale_vector_FLP.c:
--------------------------------------------------------------------------------
1 | /***********************************************************************
2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 | - Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 | - Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 | names of specific contributors, may be used to endorse or promote
13 | products derived from this software without specific prior written
14 | permission.
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | 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)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "SigProc_FLP.h"
33 |
34 | /* multiply a vector by a constant */
35 | void silk_scale_vector_FLP(
36 | silk_float *data1,
37 | silk_float gain,
38 | opus_int dataSize
39 | )
40 | {
41 | opus_int i, dataSize4;
42 |
43 | /* 4x unrolled loop */
44 | dataSize4 = dataSize & 0xFFFC;
45 | for( i = 0; i < dataSize4; i += 4 ) {
46 | data1[ i + 0 ] *= gain;
47 | data1[ i + 1 ] *= gain;
48 | data1[ i + 2 ] *= gain;
49 | data1[ i + 3 ] *= gain;
50 | }
51 |
52 | /* any remaining elements */
53 | for( ; i < dataSize; i++ ) {
54 | data1[ i ] *= gain;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/lib/opus/silk/init_decoder.c:
--------------------------------------------------------------------------------
1 | /***********************************************************************
2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 | - Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 | - Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 | names of specific contributors, may be used to endorse or promote
13 | products derived from this software without specific prior written
14 | permission.
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | 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)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "main.h"
33 |
34 | /************************/
35 | /* Init Decoder State */
36 | /************************/
37 | opus_int silk_init_decoder(
38 | silk_decoder_state *psDec /* I/O Decoder state pointer */
39 | )
40 | {
41 | /* Clear the entire encoder state, except anything copied */
42 | silk_memset( psDec, 0, sizeof( silk_decoder_state ) );
43 |
44 | /* Used to deactivate LSF interpolation */
45 | psDec->first_frame_after_reset = 1;
46 | psDec->prev_gain_Q16 = 65536;
47 |
48 | /* Reset CNG state */
49 | silk_CNG_Reset( psDec );
50 |
51 | /* Reset PLC state */
52 | silk_PLC_Reset( psDec );
53 |
54 | return(0);
55 | }
56 |
57 |
--------------------------------------------------------------------------------
/lib/opus/silk/init_encoder.c:
--------------------------------------------------------------------------------
1 | /***********************************************************************
2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 | - Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 | - Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 | names of specific contributors, may be used to endorse or promote
13 | products derived from this software without specific prior written
14 | permission.
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | 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)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 | #ifdef FIXED_POINT
32 | #include "main_FIX.h"
33 | #else
34 | #include "main_FLP.h"
35 | #endif
36 | #include "tuning_parameters.h"
37 |
38 | /*********************************/
39 | /* Initialize Silk Encoder state */
40 | /*********************************/
41 | opus_int silk_init_encoder(
42 | silk_encoder_state_Fxx *psEnc /* I/O Pointer to Silk FIX encoder state */
43 | )
44 | {
45 | opus_int ret = 0;
46 |
47 | /* Clear the entire encoder state */
48 | silk_memset( psEnc, 0, sizeof( silk_encoder_state_Fxx ) );
49 |
50 | psEnc->sCmn.variable_HP_smth1_Q15 = silk_LSHIFT( silk_lin2log( SILK_FIX_CONST( VARIABLE_HP_MIN_CUTOFF_HZ, 16 ) ) - ( 16 << 7 ), 8 );
51 | psEnc->sCmn.variable_HP_smth2_Q15 = psEnc->sCmn.variable_HP_smth1_Q15;
52 |
53 | /* Used to deactivate LSF interpolation, pitch prediction */
54 | psEnc->sCmn.first_frame_after_reset = 1;
55 |
56 | /* Initialize Silk VAD */
57 | ret += silk_VAD_Init( &psEnc->sCmn.sVAD );
58 |
59 | return ret;
60 | }
61 |
--------------------------------------------------------------------------------
/lib/opus/silk/inner_prod_aligned.c:
--------------------------------------------------------------------------------
1 | /***********************************************************************
2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 | - Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 | - Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 | names of specific contributors, may be used to endorse or promote
13 | products derived from this software without specific prior written
14 | permission.
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | 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)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "SigProc_FIX.h"
33 |
34 | opus_int32 silk_inner_prod_aligned_scale(
35 | const opus_int16 *const inVec1, /* I input vector 1 */
36 | const opus_int16 *const inVec2, /* I input vector 2 */
37 | const opus_int scale, /* I number of bits to shift */
38 | const opus_int len /* I vector lengths */
39 | )
40 | {
41 | opus_int i;
42 | opus_int32 sum = 0;
43 | for( i = 0; i < len; i++ ) {
44 | sum = silk_ADD_RSHIFT32( sum, silk_SMULBB( inVec1[ i ], inVec2[ i ] ), scale );
45 | }
46 | return sum;
47 | }
48 |
--------------------------------------------------------------------------------
/lib/opus/silk/interpolate.c:
--------------------------------------------------------------------------------
1 | /***********************************************************************
2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 | - Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 | - Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 | names of specific contributors, may be used to endorse or promote
13 | products derived from this software without specific prior written
14 | permission.
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | 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)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "main.h"
33 |
34 | /* Interpolate two vectors */
35 | void silk_interpolate(
36 | opus_int16 xi[ MAX_LPC_ORDER ], /* O interpolated vector */
37 | const opus_int16 x0[ MAX_LPC_ORDER ], /* I first vector */
38 | const opus_int16 x1[ MAX_LPC_ORDER ], /* I second vector */
39 | const opus_int ifact_Q2, /* I interp. factor, weight on 2nd vector */
40 | const opus_int d /* I number of parameters */
41 | )
42 | {
43 | opus_int i;
44 |
45 | silk_assert( ifact_Q2 >= 0 );
46 | silk_assert( ifact_Q2 <= 4 );
47 |
48 | for( i = 0; i < d; i++ ) {
49 | xi[ i ] = (opus_int16)silk_ADD_RSHIFT( x0[ i ], silk_SMULBB( x1[ i ] - x0[ i ], ifact_Q2 ), 2 );
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/lib/opus/silk/lin2log.c:
--------------------------------------------------------------------------------
1 | /***********************************************************************
2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 | - Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 | - Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 | names of specific contributors, may be used to endorse or promote
13 | products derived from this software without specific prior written
14 | permission.
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | 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)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "SigProc_FIX.h"
33 | /* Approximation of 128 * log2() (very close inverse of silk_log2lin()) */
34 | /* Convert input to a log scale */
35 | opus_int32 silk_lin2log(
36 | const opus_int32 inLin /* I input in linear scale */
37 | )
38 | {
39 | opus_int32 lz, frac_Q7;
40 |
41 | silk_CLZ_FRAC( inLin, &lz, &frac_Q7 );
42 |
43 | /* Piece-wise parabolic approximation */
44 | return silk_LSHIFT( 31 - lz, 7 ) + silk_SMLAWB( frac_Q7, silk_MUL( frac_Q7, 128 - frac_Q7 ), 179 );
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/lib/opus/silk/log2lin.c:
--------------------------------------------------------------------------------
1 | /***********************************************************************
2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 | - Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 | - Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 | names of specific contributors, may be used to endorse or promote
13 | products derived from this software without specific prior written
14 | permission.
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | 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)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "SigProc_FIX.h"
33 |
34 | /* Approximation of 2^() (very close inverse of silk_lin2log()) */
35 | /* Convert input to a linear scale */
36 | opus_int32 silk_log2lin(
37 | const opus_int32 inLog_Q7 /* I input on log scale */
38 | )
39 | {
40 | opus_int32 out, frac_Q7;
41 |
42 | if( inLog_Q7 < 0 ) {
43 | return 0;
44 | }
45 |
46 | out = silk_LSHIFT( 1, silk_RSHIFT( inLog_Q7, 7 ) );
47 | frac_Q7 = inLog_Q7 & 0x7F;
48 | if( inLog_Q7 < 2048 ) {
49 | /* Piece-wise parabolic approximation */
50 | out = silk_ADD_RSHIFT32( out, silk_MUL( out, silk_SMLAWB( frac_Q7, silk_SMULBB( frac_Q7, 128 - frac_Q7 ), -174 ) ), 7 );
51 | } else {
52 | /* Piece-wise parabolic approximation */
53 | out = silk_MLA( out, silk_RSHIFT( out, 7 ), silk_SMLAWB( frac_Q7, silk_SMULBB( frac_Q7, 128 - frac_Q7 ), -174 ) );
54 | }
55 | return out;
56 | }
57 |
--------------------------------------------------------------------------------
/lib/opus/silk/resampler_private_AR2.c:
--------------------------------------------------------------------------------
1 | /***********************************************************************
2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 | - Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 | - Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 | names of specific contributors, may be used to endorse or promote
13 | products derived from this software without specific prior written
14 | permission.
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | 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)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "SigProc_FIX.h"
33 | #include "resampler_private.h"
34 |
35 | /* Second order AR filter with single delay elements */
36 | void silk_resampler_private_AR2(
37 | opus_int32 S[], /* I/O State vector [ 2 ] */
38 | opus_int32 out_Q8[], /* O Output signal */
39 | const opus_int16 in[], /* I Input signal */
40 | const opus_int16 A_Q14[], /* I AR coefficients, Q14 */
41 | opus_int32 len /* I Signal length */
42 | )
43 | {
44 | opus_int32 k;
45 | opus_int32 out32;
46 |
47 | for( k = 0; k < len; k++ ) {
48 | out32 = silk_ADD_LSHIFT32( S[ 0 ], (opus_int32)in[ k ], 8 );
49 | out_Q8[ k ] = out32;
50 | out32 = silk_LSHIFT( out32, 2 );
51 | S[ 0 ] = silk_SMLAWB( S[ 1 ], out32, A_Q14[ 0 ] );
52 | S[ 1 ] = silk_SMULWB( out32, A_Q14[ 1 ] );
53 | }
54 | }
55 |
56 |
--------------------------------------------------------------------------------
/lib/opus/silk/resampler_structs.h:
--------------------------------------------------------------------------------
1 | /***********************************************************************
2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 | - Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 | - Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 | names of specific contributors, may be used to endorse or promote
13 | products derived from this software without specific prior written
14 | permission.
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | 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)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 |
28 | #ifndef SILK_RESAMPLER_STRUCTS_H
29 | #define SILK_RESAMPLER_STRUCTS_H
30 |
31 | #ifdef __cplusplus
32 | extern "C" {
33 | #endif
34 |
35 | #define SILK_RESAMPLER_MAX_FIR_ORDER 36
36 | #define SILK_RESAMPLER_MAX_IIR_ORDER 6
37 |
38 | typedef struct _silk_resampler_state_struct{
39 | opus_int32 sIIR[ SILK_RESAMPLER_MAX_IIR_ORDER ]; /* this must be the first element of this struct */
40 | opus_int32 sFIR[ SILK_RESAMPLER_MAX_FIR_ORDER ];
41 | opus_int16 delayBuf[ 48 ];
42 | opus_int resampler_function;
43 | opus_int batchSize;
44 | opus_int32 invRatio_Q16;
45 | opus_int FIR_Order;
46 | opus_int FIR_Fracs;
47 | opus_int Fs_in_kHz;
48 | opus_int Fs_out_kHz;
49 | opus_int inputDelay;
50 | const opus_int16 *Coefs;
51 | } silk_resampler_state_struct;
52 |
53 | #ifdef __cplusplus
54 | }
55 | #endif
56 | #endif /* SILK_RESAMPLER_STRUCTS_H */
57 |
58 |
--------------------------------------------------------------------------------
/lib/opus/silk/tables_gain.c:
--------------------------------------------------------------------------------
1 | /***********************************************************************
2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions
5 | are met:
6 | - Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 | - Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 | names of specific contributors, may be used to endorse or promote
13 | products derived from this software without specific prior written
14 | permission.
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | 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)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE.
26 | ***********************************************************************/
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "tables.h"
33 |
34 | #ifdef __cplusplus
35 | extern "C"
36 | {
37 | #endif
38 |
39 | const opus_uint8 silk_gain_iCDF[ 3 ][ N_LEVELS_QGAIN / 8 ] =
40 | {
41 | {
42 | 224, 112, 44, 15, 3, 2, 1, 0
43 | },
44 | {
45 | 254, 237, 192, 132, 70, 23, 4, 0
46 | },
47 | {
48 | 255, 252, 226, 155, 61, 11, 2, 0
49 | }
50 | };
51 |
52 | const opus_uint8 silk_delta_gain_iCDF[ MAX_DELTA_GAIN_QUANT - MIN_DELTA_GAIN_QUANT + 1 ] = {
53 | 250, 245, 234, 203, 71, 50, 42, 38,
54 | 35, 33, 31, 29, 28, 27, 26, 25,
55 | 24, 23, 22, 21, 20, 19, 18, 17,
56 | 16, 15, 14, 13, 12, 11, 10, 9,
57 | 8, 7, 6, 5, 4, 3, 2, 1,
58 | 0
59 | };
60 |
61 | #ifdef __cplusplus
62 | }
63 | #endif
64 |
--------------------------------------------------------------------------------
/lib/opus/src/opus.c:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2011 Xiph.Org Foundation, Skype Limited
2 | Written by Jean-Marc Valin and Koen Vos */
3 | /*
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions
6 | are met:
7 |
8 | - Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 |
11 | - Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in the
13 | documentation and/or other materials provided with the distribution.
14 |
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
19 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifdef HAVE_CONFIG_H
29 | #include "config.h"
30 | #endif
31 |
32 | #include "opus.h"
33 | #include "opus_private.h"
34 |
35 | int encode_size(int size, unsigned char *data)
36 | {
37 | if (size < 252)
38 | {
39 | data[0] = size;
40 | return 1;
41 | } else {
42 | data[0] = 252+(size&0x3);
43 | data[1] = (size-(int)data[0])>>2;
44 | return 2;
45 | }
46 | }
47 |
48 |
--------------------------------------------------------------------------------
/mkindex.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | find . -name '*.mp3' -o -name '*.wav' -o -name '*.opus' | sort >> index.txt
4 |
--------------------------------------------------------------------------------
/openocd_stlinkv2.cfg:
--------------------------------------------------------------------------------
1 | gdb_port 10000
2 |
3 | source [find interface/stlink-v2.cfg]
4 | source [find target/stm32f4x_stlink.cfg]
5 | # use hardware reset, connect under reset
6 | reset_config trst_only
7 |
8 | init
9 | halt
10 |
11 | stm32f4x.cpu configure -event gdb-attach {
12 | echo "GDB attached, resetting..."
13 | # To make flash probe and gdb load to flash work we need a reset init.
14 | reset init
15 | halt
16 | }
17 |
18 | stm32f4x.cpu configure -event gdb-flash-write-end {
19 | echo "FLASH programmed, resetting..."
20 | # To make flash probe and gdb load to flash work we need a reset init.
21 | reset init
22 | halt
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/patch_cmake.sh:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 |
3 | ROOT=$PWD
4 |
5 | cd /usr/share/cmake-2.8/Modules/
6 | patch < $ROOT/cmake_patch_linaro.diff
7 |
8 | cd /usr/share/cmake-2.8/Modules/Platform/
9 | patch < $ROOT/cmake_patch_arm_none_eabi.diff
10 |
--------------------------------------------------------------------------------
/pcb/.gitignore:
--------------------------------------------------------------------------------
1 | *.[bsl]#[1-9]
2 | eagle.epf
3 |
--------------------------------------------------------------------------------
/pcb/gerber-txt-info.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | cd gerber
4 |
5 | [ -d info ] || mkdir info
6 |
7 | for EXT in gpi dri
8 | do
9 | LIST=*.$EXT
10 | [ -z LIST ] && continue
11 | for FROM in $LIST
12 | do
13 | mv $FROM "info/${FROM/%.$EXT/.txt}";
14 | done
15 | done
16 |
17 |
--------------------------------------------------------------------------------
/pcb/gerber/info/walkgeek_board_edge.txt:
--------------------------------------------------------------------------------
1 | Generated by EAGLE CAM Processor 6.4.0
2 |
3 | Photoplotter Info File: /home/oleg/Documents/dev/workspace-embedded/walkgeek/pcb/gerber/walkgeek_board_edge.gpi
4 |
5 | Date : 4/22/13 12:47 AM
6 | Plotfile : /home/oleg/Documents/dev/workspace-embedded/walkgeek/pcb/gerber/walkgeek_board_edge.gbr
7 | Apertures : generated:
8 | Device : Gerber RS-274-X photoplotter, coordinate format 2.4 inch
9 |
10 | Parameter settings:
11 |
12 | Emulate Apertures : no
13 | Tolerance Draw + : 0.00 %
14 | Tolerance Draw - : 0.00 %
15 | Tolerance Flash + : 0.00 %
16 | Tolerance Flash - : 0.00 %
17 | Rotate : no
18 | Mirror : no
19 | Optimize : yes
20 | Auto fit : yes
21 | OffsetX : 0inch
22 | OffsetY : 0inch
23 |
24 | Plotfile Info:
25 |
26 | Coordinate Format : 2.4
27 | Coordinate Units : Inch
28 | Data Mode : Absolute
29 | Zero Suppression : None
30 | End Of Block : *
31 |
32 | Apertures used:
33 |
34 | Code Shape Size used
35 |
36 | D10 draw 0.0000inch 58
37 |
38 |
--------------------------------------------------------------------------------
/pcb/gerber/info/walkgeek_bottom.txt:
--------------------------------------------------------------------------------
1 | Generated by EAGLE CAM Processor 6.4.0
2 |
3 | Photoplotter Info File: /home/oleg/Documents/dev/workspace-embedded/walkgeek/pcb/gerber/walkgeek_bottom.gpi
4 |
5 | Date : 4/22/13 12:47 AM
6 | Plotfile : /home/oleg/Documents/dev/workspace-embedded/walkgeek/pcb/gerber/walkgeek_bottom.gbr
7 | Apertures : generated:
8 | Device : Gerber RS-274-X photoplotter, coordinate format 2.4 inch
9 |
10 | Parameter settings:
11 |
12 | Emulate Apertures : no
13 | Tolerance Draw + : 0.00 %
14 | Tolerance Draw - : 0.00 %
15 | Tolerance Flash + : 0.00 %
16 | Tolerance Flash - : 0.00 %
17 | Rotate : no
18 | Mirror : no
19 | Optimize : yes
20 | Auto fit : yes
21 | OffsetX : 0inch
22 | OffsetY : 0inch
23 |
24 | Plotfile Info:
25 |
26 | Coordinate Format : 2.4
27 | Coordinate Units : Inch
28 | Data Mode : Absolute
29 | Zero Suppression : None
30 | End Of Block : *
31 |
32 | Apertures used:
33 |
34 | Code Shape Size used
35 |
36 | D10 rectangle 0.1299inch x 0.0591inch 2
37 | D11 rectangle 0.1299inch x 0.0331inch 6
38 | D12 draw 0.0472inch 4
39 | D13 draw 0.0709inch 2
40 | D14 draw 0.0551inch 17
41 | D15 draw 0.0236inch 25
42 | D16 round 0.0472inch 30
43 | D17 round 0.0709inch 15
44 | D18 round 0.0394inch 184
45 | D19 rectangle 0.0591inch x 0.0433inch 2
46 | D20 round 0.0512inch 2
47 | D21 round 0.1181inch 6
48 | D22 draw 0.0102inch 147
49 | D23 draw 0.0118inch 174
50 | D24 draw 0.0079inch 4572
51 | D25 draw 0.0157inch 17
52 | D26 draw 0.0197inch 94
53 |
54 |
--------------------------------------------------------------------------------
/pcb/gerber/info/walkgeek_bottom_components.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/pcb/gerber/info/walkgeek_bottom_components.pdf
--------------------------------------------------------------------------------
/pcb/gerber/info/walkgeek_bottom_copper.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/pcb/gerber/info/walkgeek_bottom_copper.pdf
--------------------------------------------------------------------------------
/pcb/gerber/info/walkgeek_bottom_stop.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/pcb/gerber/info/walkgeek_bottom_stop.pdf
--------------------------------------------------------------------------------
/pcb/gerber/info/walkgeek_bottommask.txt:
--------------------------------------------------------------------------------
1 | Generated by EAGLE CAM Processor 6.4.0
2 |
3 | Photoplotter Info File: /home/oleg/Documents/dev/workspace-embedded/walkgeek/pcb/gerber/walkgeek_bottommask.gpi
4 |
5 | Date : 4/22/13 12:47 AM
6 | Plotfile : /home/oleg/Documents/dev/workspace-embedded/walkgeek/pcb/gerber/walkgeek_bottommask.gbr
7 | Apertures : generated:
8 | Device : Gerber RS-274-X photoplotter, coordinate format 2.4 inch
9 |
10 | Parameter settings:
11 |
12 | Emulate Apertures : no
13 | Tolerance Draw + : 0.00 %
14 | Tolerance Draw - : 0.00 %
15 | Tolerance Flash + : 0.00 %
16 | Tolerance Flash - : 0.00 %
17 | Rotate : no
18 | Mirror : no
19 | Optimize : yes
20 | Auto fit : yes
21 | OffsetX : 0inch
22 | OffsetY : 0inch
23 |
24 | Plotfile Info:
25 |
26 | Coordinate Format : 2.4
27 | Coordinate Units : Inch
28 | Data Mode : Absolute
29 | Zero Suppression : None
30 | End Of Block : *
31 |
32 | Apertures used:
33 |
34 | Code Shape Size used
35 |
36 | D10 round 0.0671inch 2
37 | D11 round 0.1969inch 5
38 | D12 round 0.1811inch 1
39 | D13 draw 0.0080inch 152
40 | D14 rectangle 0.1379inch x 0.0671inch 2
41 | D15 rectangle 0.1379inch x 0.0411inch 6
42 | D16 round 0.0907inch 1
43 | D17 draw 0.0394inch 17
44 | D18 draw 0.0630inch 17
45 | D19 draw 0.0197inch 17
46 | D20 round 0.0474inch 14
47 | D21 round 0.0867inch 1
48 | D22 rectangle 0.0671inch x 0.0513inch 2
49 | D23 round 0.0434inch 2
50 | D24 round 0.0592inch 2
51 | D25 round 0.1261inch 6
52 |
53 |
--------------------------------------------------------------------------------
/pcb/gerber/info/walkgeek_drill.txt:
--------------------------------------------------------------------------------
1 | Generated by EAGLE CAM Processor 6.4.0
2 |
3 | Drill Station Info File: /home/oleg/Documents/dev/workspace-embedded/walkgeek/pcb/gerber/walkgeek_drill.dri
4 |
5 | Date : 4/22/13 12:47 AM
6 | Drills : generated
7 | Device : Excellon drill station
8 |
9 | Parameter settings:
10 |
11 | Tolerance Drill + : 0.00 %
12 | Tolerance Drill - : 0.00 %
13 | Rotate : no
14 | Mirror : no
15 | Optimize : yes
16 | Auto fit : yes
17 | OffsetX : 0inch
18 | OffsetY : 0inch
19 | Layers : Drills Holes
20 |
21 | Drill File Info:
22 |
23 | Data Mode : Absolute
24 | Units : 1/10000 Inch
25 |
26 | Drills used:
27 |
28 | Code Size used
29 |
30 | T01 0.0157inch 184
31 | T02 0.0276inch 2
32 | T03 0.0354inch 2
33 | T04 0.0591inch 2
34 | T05 0.0787inch 7
35 | T06 0.0827inch 1
36 |
37 | Total number of drills: 198
38 |
39 | Plotfiles:
40 |
41 | /home/oleg/Documents/dev/workspace-embedded/walkgeek/pcb/gerber/walkgeek_drill.xln
42 |
--------------------------------------------------------------------------------
/pcb/gerber/info/walkgeek_top_components.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/pcb/gerber/info/walkgeek_top_components.pdf
--------------------------------------------------------------------------------
/pcb/gerber/info/walkgeek_top_copper.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/pcb/gerber/info/walkgeek_top_copper.pdf
--------------------------------------------------------------------------------
/pcb/gerber/info/walkgeek_top_stop.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oleg-it-com/walkgeek/413edb537e2b86c079feed54eb27689a0c6b4381/pcb/gerber/info/walkgeek_top_stop.pdf
--------------------------------------------------------------------------------
/pcb/gerber/info/walkgeek_topsilk.txt:
--------------------------------------------------------------------------------
1 | Generated by EAGLE CAM Processor 6.4.0
2 |
3 | Photoplotter Info File: /home/oleg/Documents/dev/workspace-embedded/walkgeek/pcb/gerber/walkgeek_topsilk.gpi
4 |
5 | Date : 4/22/13 12:47 AM
6 | Plotfile : /home/oleg/Documents/dev/workspace-embedded/walkgeek/pcb/gerber/walkgeek_topsilk.gbr
7 | Apertures : generated:
8 | Device : Gerber RS-274-X photoplotter, coordinate format 2.4 inch
9 |
10 | Parameter settings:
11 |
12 | Emulate Apertures : no
13 | Tolerance Draw + : 0.00 %
14 | Tolerance Draw - : 0.00 %
15 | Tolerance Flash + : 0.00 %
16 | Tolerance Flash - : 0.00 %
17 | Rotate : no
18 | Mirror : no
19 | Optimize : yes
20 | Auto fit : yes
21 | OffsetX : 0inch
22 | OffsetY : 0inch
23 |
24 | Plotfile Info:
25 |
26 | Coordinate Format : 2.4
27 | Coordinate Units : Inch
28 | Data Mode : Absolute
29 | Zero Suppression : None
30 | End Of Block : *
31 |
32 | Apertures used:
33 |
34 | Code Shape Size used
35 |
36 | D10 draw 0.0100inch 46
37 | D11 draw 0.0070inch 302
38 | D12 draw 0.0079inch 5
39 | D13 draw 0.0118inch 27
40 |
41 |
--------------------------------------------------------------------------------
/src/player/mp3_decoder.h:
--------------------------------------------------------------------------------
1 | /*
2 | * mp3_decoder.h
3 | *
4 | * Copyright (c) 2012, 2013, Oleg Tsaregorodtsev
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions are met:
9 | * - Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | * - Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | * 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)
24 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25 | * THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | /* Define to prevent recursive inclusion -------------------------------------*/
29 | #ifndef MP3_DECODER_H_
30 | #define MP3_DECODER_H_
31 |
32 | /* Includes ------------------------------------------------------------------*/
33 | #include "player.h"
34 | #include "mediafile.h"
35 |
36 | /* Exported constants --------------------------------------------------------*/
37 | #define MP3_BUFFER_SAMPLE_SIZE (AUDIO_BUFFER_SAMPLE_SIZE / 2)
38 |
39 | /* Exported types ------------------------------------------------------------*/
40 | /* Exported macro ------------------------------------------------------------*/
41 | /* Exported functions ------------------------------------------------------- */
42 | FuncResult MP3_LoadFile(sDecoderContext *psDecoderContext);
43 | FuncResult MP3_MainThread(sDecoderContext *psDecoderContext);
44 | FuncResult MP3_Seek(sDecoderContext *psDecoderContext, u32 ms_absolute_offset);
45 | void MP3_Destroy(sDecoderContext *psDecoderContext);
46 |
47 | #endif /* MP3_DECODER_H_ */
48 |
--------------------------------------------------------------------------------
/src/player/opus_decoder.h:
--------------------------------------------------------------------------------
1 | /*
2 | * opus_decoder.h
3 | *
4 | * Copyright (c) 2013, Oleg Tsaregorodtsev
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions are met:
9 | * - Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | * - Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | * 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)
24 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25 | * THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | /* Define to prevent recursive inclusion ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
29 | #ifndef OPUS_DECODER_H_
30 | #define OPUS_DECODER_H_
31 |
32 | /* Includes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
33 | #include "player.h"
34 |
35 | /* Exported defines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
36 | /* Exported macro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
37 | /* Exported types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
38 | /* Exported functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
39 | FuncResult OPUS_LoadFile(sDecoderContext *psDecoderContext);
40 | FuncResult OPUS_MainThread(sDecoderContext *psDecoderContext);
41 | FuncResult OPUS_Seek(sDecoderContext *psDecoderContext, u32 ms_absolute_offset);
42 | void OPUS_Destroy(sDecoderContext *psDecoderContext);
43 |
44 | /* Exported variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
45 | /* Exported static inline functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
46 |
47 |
48 | #endif /* OPUS_DECODER_H_ */
49 |
--------------------------------------------------------------------------------
/src/player/wav_decoder.h:
--------------------------------------------------------------------------------
1 | /*
2 | * wav_decoder.h
3 | *
4 | * Copyright (c) 2012, Oleg Tsaregorodtsev
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions are met:
9 | * - Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | * - Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | * 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)
24 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25 | * THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | /* Define to prevent recursive inclusion -------------------------------------*/
29 | #ifndef WAV_DECODER_H_
30 | #define WAV_DECODER_H_
31 |
32 | /* Includes ------------------------------------------------------------------*/
33 | #include "player.h"
34 |
35 | /* Exported types ------------------------------------------------------------*/
36 | /* Exported constants --------------------------------------------------------*/
37 | /* Exported macro ------------------------------------------------------------*/
38 | /* Exported functions ------------------------------------------------------- */
39 | FuncResult WAV_FastFileCheck(const char *fname);
40 | FuncResult WAV_TryFile(MediaFile_Typedef *mfile);
41 | FuncResult WAV_Decode(MediaFile_Typedef *mfile, AudioBuffer_Typedef *audio_buf);
42 | FuncResult WAV_Seek(MediaFile_Typedef *mfile, signed portBASE_TYPE msec);
43 |
44 | #endif /* WAV_DECODER_H_ */
45 |
--------------------------------------------------------------------------------
/stm32f4x.cfg:
--------------------------------------------------------------------------------
1 | # Modified stm32f2xxx script to work with the st32f4
2 | # run something like this to flash your board
3 | # flash write_image erase demo.hex 0 ihex
4 |
5 | if { [info exists CHIPNAME] } {
6 | set _CHIPNAME $CHIPNAME
7 | } else {
8 | set _CHIPNAME stm32f4xxx
9 | }
10 |
11 | if { [info exists ENDIAN] } {
12 | set _ENDIAN $ENDIAN
13 | } else {
14 | set _ENDIAN little
15 | }
16 |
17 | # Work-area is a space in RAM used for flash programming
18 | # By default use 64kB
19 | if { [info exists WORKAREASIZE] } {
20 | set _WORKAREASIZE $WORKAREASIZE
21 | } else {
22 | set _WORKAREASIZE 0x10000
23 | }
24 |
25 | # JTAG speed should be <= F_CPU/6. F_CPU after reset is 8MHz, so use F_JTAG = 1MHz
26 | #
27 | # Since we may be running of an RC oscilator, we crank down the speed a
28 | # bit more to be on the safe side. Perhaps superstition, but if are
29 | # running off a crystal, we can run closer to the limit. Note
30 | # that there can be a pretty wide band where things are more or less stable.
31 | adapter_khz 1000
32 |
33 | adapter_nsrst_delay 100
34 | #adapter_ntrst_delay 100
35 |
36 | #jtag scan chain
37 | if { [info exists CPUTAPID ] } {
38 | set _CPUTAPID $CPUTAPID
39 | } else {
40 | # See STM Document RM0033
41 | # Section 32.6.3 - corresponds to Cortex-M3 r2p0
42 | set _CPUTAPID 0x4ba00477
43 | }
44 | jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
45 |
46 | if { [info exists BSTAPID ] } {
47 | set _BSTAPID $BSTAPID
48 | } else {
49 | # See STM Document RM0033
50 | # Section 32.6.2
51 | #
52 | set _BSTAPID 0x06413041
53 | }
54 | jtag newtap $_CHIPNAME bs -irlen 5 -expected-id $_BSTAPID
55 |
56 | set _TARGETNAME $_CHIPNAME.cpu
57 | target create $_TARGETNAME cortex_m3 -endian $_ENDIAN -chain-position $_TARGETNAME
58 |
59 | $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
60 |
61 | set _FLASHNAME $_CHIPNAME.flash
62 | flash bank $_FLASHNAME stm32f2x 0 0 0 0 $_TARGETNAME
63 |
--------------------------------------------------------------------------------