├── .gitignore ├── CDC_serial ├── .gdbinit ├── .gitignore ├── ADIS1625x.c ├── ADIS1625x.h ├── Makefile ├── drv_lisxxx.c ├── drv_lisxxx.h ├── hw_config.c ├── hw_config.h ├── i2c.c ├── i2c.h ├── lisXXX.c ├── lisXXX.h ├── main.c ├── openocd.cfg ├── platform.h ├── stm32f10x_conf.h ├── usb_conf.h ├── usb_desc.c ├── usb_desc.h ├── usb_endp.c ├── usb_istr.c ├── usb_istr.h ├── usb_prop.c ├── usb_prop.h ├── usb_pwr.c └── usb_pwr.h ├── DFUBootloader ├── Makefile ├── dfu_mal.c ├── dfu_mal.h ├── flash_if.c ├── flash_if.h ├── fsmc_nor.c ├── fsmc_nor.h ├── hw_config.c ├── hw_config.h ├── main.c ├── nor_if.c ├── nor_if.h ├── platform.h ├── spi_flash.c ├── spi_flash.h ├── spi_if.c ├── spi_if.h ├── stm32f10x_conf.h ├── usb_conf.h ├── usb_desc.c ├── usb_desc.h ├── usb_istr.c ├── usb_istr.h ├── usb_prop.c ├── usb_prop.h ├── usb_pwr.c └── usb_pwr.h ├── GPSTracker ├── car │ ├── .gdbinit │ ├── .gitignore │ ├── Makefile │ ├── adc.c │ ├── adc.h │ ├── flash.c │ ├── flash.h │ ├── log.c │ ├── log.h │ ├── main.c │ ├── modem.c │ ├── modem.h │ ├── nmea.c │ ├── nmea.h │ ├── openocd.cfg │ ├── platform.h │ ├── rfm12.c │ ├── rfm12.h │ ├── rtc.c │ ├── rtc.h │ ├── spi.c │ ├── spi.h │ ├── spi_flash.c │ ├── spi_flash.h │ ├── stm32f10x_conf.h │ ├── uart.c │ └── uart.h ├── modem │ ├── .gdbinit │ ├── .gitignore │ ├── Makefile │ ├── STM32F103T6U6_flash.ld │ ├── adc.c │ ├── adc.h │ ├── buf.c │ ├── buf.h │ ├── hw_config.c │ ├── hw_config.h │ ├── kk.hex │ ├── main.c │ ├── modem.c │ ├── modem.h │ ├── openocd.cfg │ ├── platform.h │ ├── rfm12.c │ ├── rfm12.h │ ├── spi.c │ ├── spi.h │ ├── stm32f10x_conf.h │ ├── usb_conf.h │ ├── usb_desc.c │ ├── usb_desc.h │ ├── usb_endp.c │ ├── usb_istr.c │ ├── usb_istr.h │ ├── usb_prop.c │ ├── usb_prop.h │ ├── usb_pwr.c │ └── usb_pwr.h ├── modem_dfu │ ├── .gdbinit │ ├── .gitignore │ ├── Makefile │ ├── STM32F103T6U6_flash.ld │ ├── flash_if.c │ ├── flash_if.h │ ├── hw_config.c │ ├── hw_config.h │ ├── main.c │ ├── openocd.cfg │ ├── platform.h │ ├── stm32f10x_conf.h │ ├── usb_conf.h │ ├── usb_desc.c │ ├── usb_desc.h │ ├── usb_istr.c │ ├── usb_istr.h │ ├── usb_prop.c │ ├── usb_prop.h │ ├── usb_pwr.c │ └── usb_pwr.h └── pymodem │ ├── modem.py │ ├── modem_sniff.py │ └── serial │ ├── __init__.py │ ├── serialcli.py │ ├── serialjava.py │ ├── serialposix.py │ ├── serialutil.py │ ├── serialwin32.py │ └── sermsdos.py ├── README ├── accel_test_rtos ├── .gdbinit ├── .gitignore ├── ADIS1625x.c ├── ADIS1625x.h ├── FreeRTOSConfig.h ├── Makefile ├── STM32F103VB_flash.ld ├── adc.c ├── adc.h ├── drv_lisxxx.c ├── drv_lisxxx.h ├── fault_handlers.c ├── i2c.c ├── i2c.h ├── input.c ├── input.h ├── lcd.c ├── lcd.h ├── lisXXX.c ├── lisXXX.h ├── main.c ├── mems.c ├── mems.h ├── mems_buf.c ├── mems_buf.h ├── menu.c ├── menu.h ├── nRF24.c ├── nRF24.h ├── openocd.cfg ├── platform.h ├── rtc_bkp.c ├── rtc_bkp.h ├── spi.c ├── spi.h ├── startup_stm32f10x.c ├── stm32f10x_conf.h ├── timertest.c ├── usart.c └── usart.h ├── blink_rtc ├── Makefile ├── README ├── STM32F103VB_flash.ld ├── main.c ├── openocd.cfg ├── rtc.c ├── rtc.h ├── startup_stm32f10x.c └── stm32f10x_conf.h ├── can_boot ├── .gdbinit ├── .gitignore ├── Makefile ├── TODO ├── can.c ├── can.h ├── commands.h ├── main.c ├── openocd.cfg ├── platform.h └── stm32f10x_conf.h ├── can_encoders ├── .gdbinit ├── .gitignore ├── Makefile ├── STM32Encoders.c ├── STM32Encoders.h ├── STM32Encoders.od ├── can.c ├── can.h ├── enc1.c ├── enc1.h ├── enc2.c ├── enc2.h ├── main.c ├── openocd.cfg ├── platform.h └── stm32f10x_conf.h ├── dtmf ├── .gdbinit ├── Makefile ├── README ├── STM32F103T6U6_flash.ld ├── STM32F103VB_flash.ld ├── ad.c ├── ad.h ├── dtmf.c ├── dtmf.h ├── dtmf_det.c ├── dtmf_det.h ├── main.c ├── openocd.cfg ├── platform.h ├── rtc.c ├── rtc.h ├── startup_stm32f10x.c └── stm32f10x_conf.h └── lib ├── CMSIS ├── Core │ ├── CM3 │ │ ├── core_cm3.c │ │ ├── core_cm3.h │ │ ├── startup │ │ │ ├── arm │ │ │ │ ├── startup_stm32f10x_cl.s │ │ │ │ ├── startup_stm32f10x_hd.s │ │ │ │ ├── startup_stm32f10x_ld.s │ │ │ │ └── startup_stm32f10x_md.s │ │ │ ├── gcc │ │ │ │ ├── startup_stm32f10x_cl.s │ │ │ │ ├── startup_stm32f10x_hd.s │ │ │ │ ├── startup_stm32f10x_ld.s │ │ │ │ └── startup_stm32f10x_md.s │ │ │ └── iar │ │ │ │ ├── startup_stm32f10x_cl.s │ │ │ │ ├── startup_stm32f10x_hd.s │ │ │ │ ├── startup_stm32f10x_ld.s │ │ │ │ └── startup_stm32f10x_md.s │ │ ├── stm32f10x.h │ │ ├── system_stm32f10x.c │ │ └── system_stm32f10x.h │ └── Documentation │ │ └── CMSIS_Core.htm └── License.doc ├── CanFestival-3 ├── .hgignore ├── .hgtags ├── AUTHORS ├── CHANGES ├── CONTRIBUTORS ├── COPYING ├── LICENCE ├── Makefile ├── Makefile.in ├── configure ├── doc │ ├── CANOpen_memento │ │ ├── CANOpen_memento.odg │ │ └── CANOpen_memento.pdf │ ├── code_debug.txt │ ├── doxygen │ │ ├── .cvsignore │ │ ├── Doxyfile │ │ └── Makefile │ └── manual │ │ ├── Makefile │ │ └── en │ │ ├── .cvsignore │ │ ├── Pictures │ │ ├── 100000000000006D000000A31EC8CB54.png │ │ ├── 10000000000000AA0000006014F74635.png │ │ ├── 10000000000000AB000000C88F594413.png │ │ ├── 10000000000000AC000000C9C3F53FA6.png │ │ ├── 10000000000000B6000000DF1EDD1E73.png │ │ ├── 100000000000022C000000DEDAD2140C.png │ │ ├── 1000000000000396000000FFC42573DA.png │ │ ├── 10000201000000B7000000C66AF89CD5.png │ │ ├── 10000201000001C4000000DD129D4661.png │ │ ├── 10000201000001C40000010766961D7F.png │ │ ├── 10000201000001FC000001E5D65E8766.png │ │ ├── 1000020100000258000000832C6FFAB4.png │ │ ├── 10000201000002DE000001D82D89C224.png │ │ ├── 10000201000002F30000020B23ED7F67.png │ │ ├── 10000201000003440000025ACC3FD2F1.png │ │ ├── 10000201000003CA0000016604E6A5EF.png │ │ ├── 10000201000003E7000001C7B0296577.png │ │ ├── 10000201000003F9000002CF880931E7.png │ │ ├── 10000201000003F9000002CF8B0CDAEA.png │ │ ├── new_node.png │ │ └── node_info.png │ │ ├── canfestival_OS.svg │ │ ├── canfestival_OSless.svg │ │ ├── canfestival_overview.svg │ │ ├── canfestival_scheduling.svg │ │ └── manual.tex ├── drivers │ ├── .cvsignore │ ├── AT91 │ │ ├── can_AT91.c │ │ └── timer_AT91.c │ ├── AVR │ │ ├── can_AVR.c │ │ └── timer_AVR.c │ ├── Makefile │ ├── Makefile.in │ ├── can_anagate_linux │ │ ├── Makefile │ │ ├── Makefile.in │ │ └── can_anagate_linux.c │ ├── can_anagate_win32 │ │ ├── Makefile.in │ │ ├── can_anagate_win32.c │ │ ├── can_anagate_win32.def │ │ └── can_anagate_win32.vcproj │ ├── can_can4linux │ │ ├── .cvsignore │ │ ├── Makefile.in │ │ ├── can4linux.h │ │ └── can_can4linux.c │ ├── can_ixxat_win32 │ │ ├── async_access_que.h │ │ ├── autoreleasecs.h │ │ ├── can_ixxat_win32.vc8.vcproj │ │ ├── ixxat.cpp │ │ └── ixxat.def │ ├── can_kvaser │ │ ├── Makefile.in │ │ ├── README │ │ └── can_kvaser.c │ ├── can_lincan │ │ ├── .cvsignore │ │ ├── Makefile.in │ │ ├── can_lincan.c │ │ ├── canmsg.h │ │ └── lincan.h │ ├── can_peak_linux │ │ ├── .cvsignore │ │ ├── Makefile.in │ │ └── can_peak_linux.c │ ├── can_peak_win32 │ │ ├── .cvsignore │ │ ├── Makefile.in │ │ ├── can_peak_win32.c │ │ ├── can_peak_win32.def │ │ ├── can_peak_win32.vcproj │ │ ├── cancfg.h.head │ │ └── cancfg.h.tail │ ├── can_serial │ │ ├── Makefile.in │ │ ├── can_serial.c │ │ └── can_serial_hub.c │ ├── can_socket │ │ ├── .cvsignore │ │ ├── Makefile.in │ │ └── can_socket.c │ ├── can_tcp_win32 │ │ ├── .cvsignore │ │ ├── Makefile.in │ │ ├── Socket.cpp │ │ ├── Socket.h │ │ ├── can_tcp_win32.cpp │ │ └── can_tcp_win32_server.cpp │ ├── can_uvccm_win32 │ │ ├── .cvsignore │ │ ├── can_uvccm_win32.cpp │ │ ├── can_uvccm_win32.def │ │ └── can_uvccm_win32.vcproj │ ├── can_virtual │ │ ├── .cvsignore │ │ ├── Makefile │ │ ├── Makefile.in │ │ └── can_virtual.c │ ├── can_virtual_kernel │ │ ├── Makefile.in │ │ └── can_virtual_kernel.c │ ├── can_vscom │ │ ├── .cvsignore │ │ ├── Makefile.in │ │ └── can_vscom.c │ ├── hcs12 │ │ ├── Makefile.in │ │ ├── canOpenDriver.c │ │ ├── interrupt.c │ │ ├── ports.s │ │ └── ports.txt │ ├── timers_kernel │ │ ├── Makefile.in │ │ └── timers_kernel.c │ ├── timers_rtai │ │ ├── .cvsignore │ │ ├── Makefile.in │ │ └── timers_rtai.c │ ├── timers_unix │ │ ├── .cvsignore │ │ ├── Makefile │ │ ├── Makefile.in │ │ └── timers_unix.c │ ├── timers_win32 │ │ ├── .cvsignore │ │ ├── Makefile.in │ │ └── timers_win32.c │ ├── timers_xeno │ │ ├── .cvsignore │ │ ├── Makefile.in │ │ └── timers_xeno.c │ ├── unix │ │ ├── .cvsignore │ │ ├── Makefile │ │ ├── Makefile.in │ │ └── unix.c │ └── win32 │ │ ├── .cvsignore │ │ ├── Makefile.in │ │ └── win32.c ├── examples │ ├── .cvsignore │ ├── AT91 │ │ └── Master │ │ │ ├── AT91SAM7X-EK.h │ │ │ ├── Makefile │ │ │ ├── ObjDict.c │ │ │ ├── ObjDict.h │ │ │ ├── ObjDict.od │ │ │ ├── interrupt_timer.c │ │ │ ├── io_macro.h │ │ │ └── main.c │ ├── AVR │ │ └── Slave │ │ │ ├── AVR-Studio │ │ │ ├── SlaveAVR.aps │ │ │ ├── default │ │ │ │ └── Makefile │ │ │ └── slaveavr.aws │ │ │ ├── Makefile │ │ │ ├── ObjDict.c │ │ │ ├── ObjDict.h │ │ │ ├── ObjDict.od │ │ │ ├── ds401.c │ │ │ ├── ds401.h │ │ │ ├── hardware.h │ │ │ └── main.c │ ├── CANOpenShell │ │ ├── CANOpenShell.c │ │ ├── CANOpenShell.h │ │ ├── CANOpenShell.o │ │ ├── CANOpenShell.sln │ │ ├── CANOpenShell.vcproj │ │ ├── CANOpenShellMasterOD.c │ │ ├── CANOpenShellMasterOD.h │ │ ├── CANOpenShellMasterOD.o │ │ ├── CANOpenShellMasterOD.od │ │ ├── CANOpenShellSlaveOD.c │ │ ├── CANOpenShellSlaveOD.h │ │ ├── CANOpenShellSlaveOD.o │ │ ├── CANOpenShellSlaveOD.od │ │ ├── CANOpenShellsln │ │ ├── Makefile │ │ └── Makefile.in │ ├── DS401_Master │ │ ├── .cvsignore │ │ ├── Makefile │ │ ├── Makefile.in │ │ ├── TestMaster.c │ │ ├── TestMaster.h │ │ ├── TestMaster.od │ │ ├── TestMasterMicroMod.c │ │ ├── TestMasterMicroMod.h │ │ ├── TestMasterMicroMod.vcproj │ │ ├── getopt.c │ │ └── getopt.h │ ├── DS401_Slave_Gui │ │ ├── .cvsignore │ │ ├── CallBack.cpp │ │ ├── CallBack.h │ │ ├── DS401_Slave_Gui.eds │ │ ├── Makefile │ │ ├── Makefile.in │ │ ├── ObjDict.c │ │ ├── ObjDict.h │ │ ├── ObjDict.od │ │ ├── TestSlaveGui.cpp │ │ ├── TestSlaveGui.h │ │ ├── getopt.c │ │ ├── getopt.h │ │ ├── main.cpp │ │ └── main.h │ ├── Makefile │ ├── Makefile.in │ ├── SillySlave │ │ ├── .cvsignore │ │ ├── EDS2CSV.py │ │ ├── Makefile │ │ ├── Makefile.in │ │ ├── README │ │ ├── SillySlave.c │ │ ├── SillySlave.h │ │ ├── SillySlave.od │ │ ├── main.c │ │ ├── main.h │ │ ├── slave.c │ │ └── slave.h │ ├── TestMasterMicroMod │ │ ├── .cvsignore │ │ ├── Makefile │ │ ├── Makefile.in │ │ ├── TestMaster.c │ │ ├── TestMaster.h │ │ ├── TestMaster.od │ │ ├── TestMasterMicroMod.c │ │ ├── TestMasterMicroMod.h │ │ ├── TestMasterMicroMod.vcproj │ │ ├── getopt.c │ │ └── getopt.h │ ├── TestMasterSlave │ │ ├── .cvsignore │ │ ├── Makefile │ │ ├── Makefile.in │ │ ├── Master.c │ │ ├── Master.h │ │ ├── Slave.c │ │ ├── Slave.h │ │ ├── TestMaster.c │ │ ├── TestMaster.h │ │ ├── TestMaster.od │ │ ├── TestMasterSlave.c │ │ ├── TestMasterSlave.h │ │ ├── TestMasterSlave.vcproj │ │ ├── TestSlave.c │ │ ├── TestSlave.h │ │ ├── TestSlave.od │ │ ├── getopt.c │ │ └── getopt.h │ ├── TestMasterSlaveLSS │ │ ├── .cvsignore │ │ ├── Makefile │ │ ├── Makefile.in │ │ ├── Master.c │ │ ├── Master.h │ │ ├── SlaveA.c │ │ ├── SlaveA.h │ │ ├── SlaveB.c │ │ ├── SlaveB.h │ │ ├── TestMaster.od │ │ ├── TestMasterSlaveLSS.c │ │ ├── TestMasterSlaveLSS.h │ │ ├── TestMasterSlaveLSS.vcproj │ │ ├── TestSlaveA.od │ │ ├── TestSlaveB.od │ │ ├── getopt.c │ │ └── getopt.h │ ├── gene_SYNC_HCS12 │ │ ├── Makefile.in │ │ ├── appli.c │ │ ├── objdict.c │ │ ├── objdict.h │ │ ├── objdict.od │ │ ├── readme.txt │ │ ├── trace32_flash_debug.cmm │ │ ├── trace32_flash_debug_sans_init.cmm │ │ ├── trace32_flash_programmer.cmm │ │ └── vectors.s │ ├── kerneltest │ │ ├── Makefile.in │ │ ├── Master.c │ │ ├── Master.h │ │ ├── Slave.c │ │ ├── Slave.h │ │ ├── TestMaster.c │ │ ├── TestMaster.h │ │ ├── TestMaster.od │ │ ├── TestMasterSlave.c │ │ ├── TestMasterSlave.h │ │ ├── TestSlave.c │ │ ├── TestSlave.h │ │ ├── TestSlave.od │ │ ├── console │ │ │ ├── console.c │ │ │ └── console.h │ │ ├── insert.sh │ │ ├── kernel_module.c │ │ ├── remove.sh │ │ └── run.sh │ └── win32test │ │ ├── .cvsignore │ │ ├── main.c │ │ ├── win32test.c │ │ ├── win32test.h │ │ ├── win32test.od │ │ └── win32test.vcproj ├── include │ ├── STM32 │ │ ├── applicfg.h │ │ ├── canfestival.h │ │ └── timerscfg.h │ ├── can.h │ ├── can_driver.h │ ├── config.h │ ├── data.h │ ├── dcf.h │ ├── def.h │ ├── emcy.h │ ├── lifegrd.h │ ├── lss.h │ ├── nmtMaster.h │ ├── nmtSlave.h │ ├── none │ │ ├── applicfg.h │ │ ├── canfestival.h │ │ └── timerscfg.h │ ├── objacces.h │ ├── objdictdef.h │ ├── pdo.h │ ├── sdo.h │ ├── states.h │ ├── sync.h │ ├── sysdep.h │ ├── timer.h │ └── timers_driver.h ├── objdictgen │ ├── .cvsignore │ ├── Gnosis_Utils-current.tar.gz │ ├── Makefile │ ├── Makefile.in │ ├── canfestival_config.py │ ├── canfestival_config.py.in │ ├── commondialogs.py │ ├── commondialogs.pyc │ ├── config │ │ ├── DS-302.prf │ │ ├── DS-401.prf │ │ ├── DS-404.prf │ │ ├── DS-406.prf │ │ ├── DS-408.prf │ │ ├── DS-410.prf │ │ ├── DS-418.prf │ │ └── DS-419.prf │ ├── doc │ │ ├── 301_v04000201.pdf │ │ ├── 406_v03020000.pdf │ │ ├── about.html │ │ ├── canfestival.gif │ │ └── manual_en.pdf │ ├── doc_index │ │ ├── .cvsignore │ │ ├── DS301_index.py │ │ ├── DS301_index.pyc │ │ ├── __init__.py │ │ └── __init__.pyc │ ├── eds_utils.py │ ├── eds_utils.pyc │ ├── examples │ │ ├── example_objdict.c │ │ ├── example_objdict.h │ │ └── example_objdict.od │ ├── gen_cfile.py │ ├── gen_cfile.pyc │ ├── gnosis │ │ ├── README │ │ ├── __init__.py │ │ ├── __init__.pyc │ │ ├── anon │ │ │ ├── README │ │ │ ├── __init__.py │ │ │ ├── anon-forward.cgi │ │ │ ├── anonym.py │ │ │ ├── encode_address.cgi │ │ │ ├── encode_address.py │ │ │ ├── huffman │ │ │ ├── new_day_key.sh │ │ │ ├── new_month_key.sh │ │ │ └── new_week_key.sh │ │ ├── doc │ │ │ ├── GETTING_HELP │ │ │ ├── Gnosis_Utils.ANNOUNCE │ │ │ ├── LICENSE │ │ │ ├── __init__.py │ │ │ ├── charming_python_b11.txt │ │ │ ├── charming_python_b12.txt │ │ │ ├── filtering-spam.txt │ │ │ ├── metaclass.txt │ │ │ ├── oop_for_validity.txt │ │ │ ├── readme │ │ │ ├── xml_matters_1.txt │ │ │ ├── xml_matters_11.txt │ │ │ ├── xml_matters_16.txt │ │ │ ├── xml_matters_2.txt │ │ │ ├── xml_matters_20.txt │ │ │ └── xml_matters_39.txt │ │ ├── indexer.py │ │ ├── magic │ │ │ ├── __init__.py │ │ │ ├── dtdgenerator.py │ │ │ ├── metapickler.py │ │ │ └── multimethods.py │ │ ├── pyconfig.py │ │ ├── pyconfig.pyc │ │ ├── spam-test.py │ │ ├── trigramlib.py │ │ ├── trigrams-gen.py │ │ ├── util │ │ │ ├── XtoY.py │ │ │ ├── XtoY.pyc │ │ │ ├── __init__.py │ │ │ ├── __init__.pyc │ │ │ ├── combinators.py │ │ │ ├── combinators.pyc │ │ │ ├── convert │ │ │ │ ├── __init__.py │ │ │ │ ├── curses_txt2html.py │ │ │ │ ├── dmTxt2Html.py │ │ │ │ ├── dw_colorize.py │ │ │ │ ├── dyn_txt2html.py │ │ │ │ ├── fetch_txt2html.py │ │ │ │ ├── mxtypographify.py │ │ │ │ ├── pyfontify.py │ │ │ │ ├── t2h_textfuncs.py │ │ │ │ ├── tk_txt2html.py │ │ │ │ ├── txt2dw.py │ │ │ │ ├── txt2html.cgi │ │ │ │ ├── txt2html.txt │ │ │ │ ├── txt2html_dir.py │ │ │ │ ├── txt2html_todo.txt │ │ │ │ ├── txt2html_why.txt │ │ │ │ ├── typo_html.py │ │ │ │ ├── typographify.def │ │ │ │ └── typographify.py │ │ │ ├── dtd2sql.py │ │ │ ├── hashcash.py │ │ │ ├── introspect.py │ │ │ ├── introspect.pyc │ │ │ ├── sql2dtd.py │ │ │ ├── sql2xml_sample.xml.txt │ │ │ ├── test.xml │ │ │ ├── test │ │ │ │ ├── funcs.py │ │ │ │ ├── mixed.xml │ │ │ │ ├── test_data2attr.py │ │ │ │ ├── test_introspect.py │ │ │ │ ├── test_noinit.py │ │ │ │ └── test_variants_noinit.py │ │ │ ├── uusplit.py │ │ │ └── xml2sql.py │ │ ├── version.py │ │ └── xml │ │ │ ├── __init__.py │ │ │ ├── __init__.pyc │ │ │ ├── indexer.py │ │ │ ├── objectify │ │ │ ├── __init__.py │ │ │ ├── _objectify.py │ │ │ ├── doc │ │ │ │ ├── AUTHOR │ │ │ │ ├── COPYRIGHT │ │ │ │ ├── GOTCHAS │ │ │ │ ├── HISTORY │ │ │ │ ├── HOWTO │ │ │ │ ├── THANKS_TO │ │ │ │ ├── TODO │ │ │ │ ├── VERSION │ │ │ │ └── __init__.py │ │ │ ├── test.xml │ │ │ ├── test │ │ │ │ ├── __init__.py │ │ │ │ ├── test.xml │ │ │ │ ├── test_basic.py │ │ │ │ ├── test_expat.py │ │ │ │ ├── test_expat2.py │ │ │ │ ├── test_inject.py │ │ │ │ ├── test_xpath.py │ │ │ │ ├── testns.xml │ │ │ │ └── xpath.xml │ │ │ ├── utils.py │ │ │ └── xpath.xml │ │ │ ├── pickle │ │ │ ├── PyObject-0.48.dtd │ │ │ ├── PyObject.dtd │ │ │ ├── __init__.py │ │ │ ├── __init__.pyc │ │ │ ├── _pickle.py │ │ │ ├── _pickle.pyc │ │ │ ├── doc │ │ │ │ ├── AUTHOR │ │ │ │ ├── COPYRIGHT │ │ │ │ ├── HISTORY │ │ │ │ ├── HOWTO │ │ │ │ ├── HOWTO.extensions │ │ │ │ ├── SECURITY │ │ │ │ ├── THANKS_TO │ │ │ │ ├── TODO │ │ │ │ ├── VERSION │ │ │ │ └── __init__.py │ │ │ ├── ext │ │ │ │ ├── __init__.py │ │ │ │ ├── __init__.pyc │ │ │ │ ├── _mutate.py │ │ │ │ ├── _mutate.pyc │ │ │ │ ├── _mutators.py │ │ │ │ └── _mutators.pyc │ │ │ ├── parsers │ │ │ │ ├── __init__.py │ │ │ │ ├── __init__.pyc │ │ │ │ ├── _dom.py │ │ │ │ ├── _dom.pyc │ │ │ │ ├── _sax.py │ │ │ │ └── _sax.pyc │ │ │ ├── test │ │ │ │ ├── __init__.py │ │ │ │ ├── funcs.py │ │ │ │ ├── test_4list.py │ │ │ │ ├── test_all.py │ │ │ │ ├── test_all_all.py │ │ │ │ ├── test_badstring.py │ │ │ │ ├── test_basic.py │ │ │ │ ├── test_bltin.py │ │ │ │ ├── test_bools.py │ │ │ │ ├── test_bools_ro.py │ │ │ │ ├── test_circular.py │ │ │ │ ├── test_compat.py │ │ │ │ ├── test_fail_exit.py │ │ │ │ ├── test_fail_raise_1.py │ │ │ │ ├── test_fail_raise_2.py │ │ │ │ ├── test_fail_raise_3.py │ │ │ │ ├── test_ftypes.py │ │ │ │ ├── test_ftypes_i.py │ │ │ │ ├── test_getinitargs.py │ │ │ │ ├── test_getstate.py │ │ │ │ ├── test_gzfile.py │ │ │ │ ├── test_init.py │ │ │ │ ├── test_misc.py │ │ │ │ ├── test_mixin.py │ │ │ │ ├── test_modnames.py │ │ │ │ ├── test_mutators.py │ │ │ │ ├── test_mx.py │ │ │ │ ├── test_numpy.py │ │ │ │ ├── test_objectify.py │ │ │ │ ├── test_paranoia.py │ │ │ │ ├── test_pass_1.py │ │ │ │ ├── test_pass_2.py │ │ │ │ ├── test_pass_3.py │ │ │ │ ├── test_rawp_mx.py │ │ │ │ ├── test_rawp_sre.py │ │ │ │ ├── test_re.py │ │ │ │ ├── test_ref.py │ │ │ │ ├── test_selfref.py │ │ │ │ ├── test_setstate.py │ │ │ │ ├── test_slots.py │ │ │ │ ├── test_speed.py │ │ │ │ ├── test_subbltin.py │ │ │ │ ├── test_unicode.py │ │ │ │ └── test_zdump.py │ │ │ └── util │ │ │ │ ├── __init__.py │ │ │ │ ├── __init__.pyc │ │ │ │ ├── _flags.py │ │ │ │ ├── _flags.pyc │ │ │ │ ├── _util.py │ │ │ │ └── _util.pyc │ │ │ ├── relax │ │ │ ├── README │ │ │ ├── __init__.py │ │ │ ├── cardinality.rnc │ │ │ ├── cardinality.rng │ │ │ ├── clark.html │ │ │ ├── conv08.rnc │ │ │ ├── conv08.rng │ │ │ ├── conv09.rng │ │ │ ├── curious.dtd │ │ │ ├── curious.xml │ │ │ ├── lex.py │ │ │ ├── patron-2.rng │ │ │ ├── patron-i1.xml │ │ │ ├── patron-i2.xml │ │ │ ├── patron-i3.xml │ │ │ ├── patron-v1.xml │ │ │ ├── patron-v2.xml │ │ │ ├── patron.rnc │ │ │ ├── patron.rng │ │ │ ├── patron.xsd │ │ │ ├── regextest.rnc │ │ │ ├── regextest.xml │ │ │ ├── res08.rnc │ │ │ ├── res08.rng │ │ │ ├── res09.rng │ │ │ ├── rnc2rng │ │ │ ├── rnc_tokenize.py │ │ │ ├── rnctree.py │ │ │ ├── spectest.xml │ │ │ ├── split.xsl │ │ │ ├── testSuite.rng │ │ │ ├── xmlcat │ │ │ ├── xsdtest.rnc │ │ │ ├── xsdtest.rng │ │ │ ├── xsdtest.xml │ │ │ └── xsdtest.xsl │ │ │ ├── validity │ │ │ ├── __init__.py │ │ │ ├── _validity.py │ │ │ ├── dissertation.py │ │ │ ├── dtdgen.py │ │ │ └── simple_diss.py │ │ │ ├── xmlcat.py │ │ │ ├── xmlmap.py │ │ │ └── xmlmap.pyc │ ├── i18n │ │ ├── README │ │ ├── app.fil │ │ ├── messages.pot │ │ ├── mki18n.py │ │ ├── objdictgen_fr_FR.po │ │ └── objdictgen_zh_CN.po │ ├── locale │ │ ├── fr_FR │ │ │ └── LC_MESSAGES │ │ │ │ └── objdictgen.mo │ │ └── zh_CN │ │ │ └── LC_MESSAGES │ │ │ └── objdictgen.mo │ ├── networkedit.ico │ ├── networkedit.png │ ├── networkedit.py │ ├── node.py │ ├── node.pyc │ ├── nodelist.py │ ├── nodemanager.py │ ├── nodemanager.pyc │ ├── objdictedit.py │ ├── objdictgen.py │ ├── subindextable.py │ └── subindextable.pyc └── src │ ├── Makefile │ ├── Makefile.in │ ├── dcf.c │ ├── emcy.c │ ├── lifegrd.c │ ├── lss.c │ ├── nmtMaster.c │ ├── nmtSlave.c │ ├── objacces.c │ ├── pdo.c │ ├── sdo.c │ ├── states.c │ ├── sync.c │ └── timer.c ├── EEPROMEmulation_AN ├── 13718.pdf ├── include │ └── eeprom.h └── source │ ├── eeprom.c │ └── main_demo.txt ├── 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 ├── list.c ├── portable │ ├── GCC │ │ └── ARM_CM3 │ │ │ ├── port.c │ │ │ └── portmacro.h │ └── MemMang │ │ ├── alloc.c │ │ ├── heap_1.c │ │ ├── heap_2.c │ │ └── heap_3.c ├── queue.c └── tasks.c ├── MEMS ├── mems_accel.c ├── mems_accel.h ├── mems_gyro.c ├── mems_gyro.h ├── mems_kalman.c ├── mems_kalman.h ├── mems_math.c ├── mems_math.h ├── mems_matrix.c ├── mems_matrix.h ├── mems_norm.c ├── mems_norm.h ├── mems_pos.c ├── mems_pos.h ├── mems_quaternion.c ├── mems_quaternion.h ├── mems_vector.c └── mems_vector.h ├── STM32F10x_DSP_Lib ├── inc │ ├── stm32_dsp.h │ └── table_fft.h └── src │ ├── PID_C_stm32.c │ ├── asm │ ├── arm │ │ ├── PID_stm32.s │ │ ├── cr4_fft_1024_stm32.s │ │ ├── cr4_fft_256_stm32.s │ │ ├── cr4_fft_64_stm32.s │ │ ├── fir_stm32.s │ │ └── iirarma_stm32.s │ ├── gcc │ │ ├── PID_stm32.s │ │ ├── cr4_fft_1024_stm32.s │ │ ├── cr4_fft_256_stm32.s │ │ ├── cr4_fft_64_stm32.s │ │ ├── fir_stm32.s │ │ └── iirarma_stm32.s │ └── iar │ │ ├── PID_stm32.s │ │ ├── cr4_fft_1024_stm32.s │ │ ├── cr4_fft_256_stm32.s │ │ ├── cr4_fft_64_stm32.s │ │ ├── fir_stm32.s │ │ └── iirarma_stm32.s │ └── iir_stm32.c ├── STM32F10x_StdPeriph_Driver ├── inc │ ├── misc.h │ ├── stm32f10x_adc.h │ ├── stm32f10x_bkp.h │ ├── stm32f10x_can.h │ ├── stm32f10x_crc.h │ ├── stm32f10x_dac.h │ ├── stm32f10x_dbgmcu.h │ ├── stm32f10x_dma.h │ ├── stm32f10x_exti.h │ ├── stm32f10x_flash.h │ ├── stm32f10x_fsmc.h │ ├── stm32f10x_gpio.h │ ├── stm32f10x_i2c.h │ ├── stm32f10x_iwdg.h │ ├── stm32f10x_pwr.h │ ├── stm32f10x_rcc.h │ ├── stm32f10x_rtc.h │ ├── stm32f10x_sdio.h │ ├── stm32f10x_spi.h │ ├── stm32f10x_tim.h │ ├── stm32f10x_usart.h │ └── stm32f10x_wwdg.h └── src │ ├── misc.c │ ├── stm32f10x_adc.c │ ├── stm32f10x_bkp.c │ ├── stm32f10x_can.c │ ├── stm32f10x_crc.c │ ├── stm32f10x_dac.c │ ├── stm32f10x_dbgmcu.c │ ├── stm32f10x_dma.c │ ├── stm32f10x_exti.c │ ├── stm32f10x_flash.c │ ├── stm32f10x_fsmc.c │ ├── stm32f10x_gpio.c │ ├── stm32f10x_i2c.c │ ├── stm32f10x_iwdg.c │ ├── stm32f10x_pwr.c │ ├── stm32f10x_rcc.c │ ├── stm32f10x_rtc.c │ ├── stm32f10x_sdio.c │ ├── stm32f10x_spi.c │ ├── stm32f10x_tim.c │ ├── stm32f10x_usart.c │ └── stm32f10x_wwdg.c ├── STM32_USB-FS-Device_Driver ├── inc │ ├── otgd_fs_cal.h │ ├── otgd_fs_dev.h │ ├── otgd_fs_int.h │ ├── otgd_fs_pcd.h │ ├── otgd_fs_regs.h │ ├── usb_core.h │ ├── usb_def.h │ ├── usb_init.h │ ├── usb_int.h │ ├── usb_lib.h │ ├── usb_mem.h │ ├── usb_regs.h │ ├── usb_sil.h │ └── usb_type.h └── src │ ├── otgd_fs_cal.c │ ├── otgd_fs_dev.c │ ├── otgd_fs_int.c │ ├── otgd_fs_pcd.c │ ├── usb_core.c │ ├── usb_init.c │ ├── usb_int.c │ ├── usb_mem.c │ ├── usb_regs.c │ └── usb_sil.c └── gcc ├── STM32F103T6U6_flash.ld ├── STM32F103VB_flash.ld ├── fault_handlers.c ├── startup_stm32f10x_ld.c └── startup_stm32f10x_md.c /.gitignore: -------------------------------------------------------------------------------- 1 | /*/FLASH_RUN/ 2 | various/* 3 | -------------------------------------------------------------------------------- /CDC_serial/.gdbinit: -------------------------------------------------------------------------------- 1 | 2 | 3 | file FLASH_RUN/stm32_serial.elf 4 | 5 | target remote localhost:3333 6 | 7 | monitor soft_reset_halt 8 | 9 | -------------------------------------------------------------------------------- /CDC_serial/.gitignore: -------------------------------------------------------------------------------- 1 | FLASH_RUN/ -------------------------------------------------------------------------------- /CDC_serial/ADIS1625x.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ADIS gyro driver 3 | * 4 | * 2009-2010 Michal Demin 5 | * 6 | */ 7 | #ifndef ADIS1625X_H_ 8 | #define ADIS1625X_H_ 9 | 10 | #define ADIS_READ 0x0000 11 | #define ADIS_WRITE 0x8000 12 | 13 | #define ADIS_REG_MASK 0x3f 14 | 15 | /* flags valid for data out regs */ 16 | #define ADIS_ND_FLAG 0x8000 17 | #define ADIS_EA_FLAG 0x4000 18 | #define ADIS_DATA 0x3FFF 19 | 20 | /* DATA OUT regs */ 21 | #define ENDURANCE 0x00 22 | #define SUPPLY_OUT 0x02 23 | #define GYRO_OUT 0x04 24 | #define AUX_ADC 0x0a 25 | #define TEMP_OUT 0x0c 26 | #define ANGL_OUT 0x0e 27 | 28 | /* CONFIG REGS */ 29 | 30 | /* gyro cal data */ 31 | #define GYRO_OFF 0x14 32 | #define GYRO_SCALE 0x16 33 | 34 | /* alarm settings */ 35 | #define ALM_MAG1 0x20 36 | #define ALM_MAG2 0x22 37 | #define ALM_SMPL1 0x24 38 | #define ALM_SMPL2 0x26 39 | #define ALM_CTRL 0x28 40 | 41 | /* dac */ 42 | #define AUX_DAC 0x30 43 | 44 | #define GPIO_CTRL 0x32 45 | #define MSC_CTRL 0x34 46 | 47 | /* ADC setting */ 48 | #define SMPL_PRD 0x36 49 | #define SENS_AVG 0x38 50 | 51 | /* sleep setting */ 52 | #define SLP_CNT 0x3a 53 | 54 | /* controll registers */ 55 | #define STATUS 0x3c 56 | #define COMMAND 0x3e 57 | 58 | void ADIS_Init(); 59 | void ADIS_Reset(); 60 | uint16_t ADIS_ReadReg(uint8_t reg); 61 | void ADIS_WriteReg(uint8_t reg, uint16_t data); 62 | 63 | 64 | #endif 65 | 66 | -------------------------------------------------------------------------------- /CDC_serial/lisXXX.c: -------------------------------------------------------------------------------- 1 | 2 | #include "i2c.h" 3 | 4 | #include "lisXXX.h" 5 | 6 | void LisXXX_Init() { 7 | uint8_t val; 8 | Hrd_I2C_Init(); 9 | 10 | ReadReg(&val, WHO_AM_I); // have to be 0x3A 11 | 12 | // Set CTRL_REG1 13 | WriteReg(0xC7, CTRL_REG1); 14 | 15 | // Set CTRL_REG2 16 | WriteReg(0x55, CTRL_REG2); 17 | 18 | // Set CTRL_REG3 19 | WriteReg(0x00, CTRL_REG3); 20 | 21 | } 22 | 23 | void LisXXX_GetData(struct lisxxx_data_t *data) { 24 | uint8_t val_h; 25 | uint8_t val_l; 26 | 27 | // X 28 | ReadReg(&val_l, OUTX_L); 29 | ReadReg(&val_h, OUTX_H); 30 | data->ax = (val_h<<8)|val_l; 31 | 32 | // y 33 | ReadReg(&val_l, OUTY_L); 34 | ReadReg(&val_h, OUTY_H); 35 | data->ay = (val_h<<8)|val_l; 36 | 37 | // z 38 | ReadReg(&val_l, OUTZ_L); 39 | ReadReg(&val_h, OUTZ_H); 40 | data->az = (val_h<<8)|val_l; 41 | 42 | } 43 | 44 | -------------------------------------------------------------------------------- /CDC_serial/lisXXX.h: -------------------------------------------------------------------------------- 1 | #ifndef LISXXX_H_ 2 | #define LISXXX_H_ 3 | 4 | #define LIS_ADDRESS 0x3A 5 | 6 | #define WHO_AM_I 0x0F 7 | #define OFFSET_X 0x16 8 | #define OFFSET_Y 0x17 9 | #define OFFSET_Z 0x18 10 | #define GAIN_X 0x19 11 | #define GAIN_Y 0x1A 12 | #define GAIN_Z 0x1B 13 | #define CTRL_REG1 0x20 14 | #define CTRL_REG2 0x21 15 | #define CTRL_REG3 0x22 16 | #define HP_FILTER_RESET 0x23 17 | #define STATUS_REG 0x27 18 | #define OUTX_L 0x28 19 | #define OUTX_H 0x29 20 | #define OUTY_L 0x2A 21 | #define OUTY_H 0x2B 22 | #define OUTZ_L 0x2C 23 | #define OUTZ_H 0x2D 24 | #define FF_WU_CFG 0x30 25 | #define FF_WU_SRC 0x31 26 | #define FF_WU_ACK 0x32 27 | #define FF_WU_THS_L 0x34 28 | #define FF_WU_THS_H 0x35 29 | #define FF_WU_DURATION 0x36 30 | #define DD_CFG 0x38 31 | #define DD_SRC 0x39 32 | #define DD_ACK 0x3A 33 | #define DD_THSI_L 0x3C 34 | #define DD_THSI_H 0x3D 35 | #define DD_THSE_L 0x3E 36 | #define DD_THSE_H 0x3F 37 | 38 | struct lisxxx_data_t { 39 | int16_t ax; 40 | int16_t ay; 41 | int16_t az; 42 | }; 43 | 44 | void LisXXX_Init(); 45 | void LisXXX_GetData(struct lisxxx_data_t *); 46 | 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /CDC_serial/openocd.cfg: -------------------------------------------------------------------------------- 1 | #interface parport 2 | #parport_port 0 3 | #parport_cable wiggler 4 | #jtag_speed 0 5 | # 6 | 7 | #interface buspirate 8 | #buspirate_port /dev/ttyUSB0 9 | #buspirate_speed f #n # fast 10 | # 11 | #reset_config srst_only 12 | source [find interface/arm-usb-ocd.cfg] 13 | 14 | proc flash_load {} { 15 | halt 16 | poll off 17 | flash write_image erase FLASH_RUN/stm32_serial.elf 18 | poll on 19 | } 20 | 21 | set WORKAREASIZE 0x5000 22 | 23 | source [find target/stm32.cfg] 24 | -------------------------------------------------------------------------------- /DFUBootloader/platform.h: -------------------------------------------------------------------------------- 1 | #ifndef PLATFORM_H_ 2 | #define PLATFORM_H_ 3 | 4 | #define USB_DISCONNECT GPIOB 5 | #define USB_DISCONNECT_PIN GPIO_Pin_5 6 | 7 | #define RCC_APB2Periph_GPIO_DISCONNECT RCC_APB2Periph_GPIOB 8 | 9 | #define LED_WRITE(x) GPIO_WriteBit(LED_GPIO, LED_PIN, x) 10 | 11 | #define LCD_RESET_WRITE(x) GPIO_WriteBit(LCD_RESET_GPIO, LCD_RESET_PIN, x) 12 | 13 | #define JOY_CENTER_READ GPIO_ReadInputDataBit(JOY_CENTER_GPIO, JOY_CENTER_PIN) 14 | 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /GPSTracker/car/.gdbinit: -------------------------------------------------------------------------------- 1 | 2 | file FLASH_RUN/stm32_car.elf 3 | target remote localhost:3333 4 | 5 | # set the target-specific info 6 | set remote hardware-watchpoint-limit 4 7 | set remote hardware-breakpoint-limit 6 8 | monitor gdb_breakpoint_override hard 9 | 10 | monitor soft_reset_halt 11 | 12 | # enable debug mode 13 | break main 14 | continue 15 | #set variable DEBUG_ON = 1 16 | #del 1 17 | 18 | -------------------------------------------------------------------------------- /GPSTracker/car/.gitignore: -------------------------------------------------------------------------------- 1 | FLASH_RUN/ 2 | 3 | -------------------------------------------------------------------------------- /GPSTracker/car/adc.h: -------------------------------------------------------------------------------- 1 | #ifndef ADC_h_ 2 | #define ADC_h_ 3 | 4 | extern uint16_t AD_Data; 5 | 6 | enum { 7 | AD_DIS, // disable watchdog 8 | AD_LOW, // enable, interrupt on low 9 | AD_HIGH,// enable, interrupt on high 10 | }; 11 | 12 | void ADC_init(); 13 | void ADC_watch(uint8_t a); 14 | void ADC_start(); 15 | 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /GPSTracker/car/flash.c: -------------------------------------------------------------------------------- 1 | #include "platform.h" 2 | #include "stm32f10x.h" 3 | 4 | #include "flash.h" 5 | 6 | uint8_t FLSH_UpdateStorage(uint8_t *buf, uint16_t len) 7 | { 8 | uint32_t tmp; 9 | uint16_t i; 10 | 11 | CRC_ResetDR(); 12 | FLASH_Unlock(); 13 | FLASH_ErasePage(FLSH_StoreAddress); 14 | 15 | for (i = 0; i < (len + 3) / 4; i++ ) { 16 | memcpy(&tmp, &buf[4*i], 4); 17 | FLASH_ProgramWord(FLSH_StoreAddress + 4 + i * 4, tmp); 18 | CRC_CalcCRC(tmp); 19 | } 20 | tmp = CRC_ResetDR() & 0xffff0000 | len & 0x0000ffff; 21 | FLASH_ProgramWord(FLSH_StoreAddress, tmp); 22 | FLASH_Lock(); 23 | 24 | return 0; 25 | } 26 | 27 | uint8_t FLSH_ReadStorage(uint8_t *buf, uint16_t len) 28 | { 29 | uint8_t i; 30 | 31 | if ((*(volatile uint32_t *)FLSH_StoreAddress) & 0x0000ffff != len) { 32 | return 1; 33 | } 34 | 35 | CRC_ResetDR(); 36 | for (i = 0; i < (len + 3) / 4; i++) { 37 | CRC_CalcCRC(FLSH_StoreAddress + 4 + i * 4); 38 | } 39 | 40 | if ((*(volatile uint32_t *)FLSH_StoreAddress) & 0xffff0000 != CRC_GetCRC()) { 41 | return 1; 42 | } 43 | 44 | memcpy(&buf, FLSH_StoreAddress, len); 45 | return 0; 46 | } 47 | -------------------------------------------------------------------------------- /GPSTracker/car/flash.h: -------------------------------------------------------------------------------- 1 | #ifndef FLASH_h_ 2 | #define FLASH_h_ 3 | 4 | 5 | #define FLSH_StoreAddress 0x0800FC00 // end of 64kB flash 6 | //#define FLSH_StoreAddress8 0x08007C00 // end of 32kB flash 7 | 8 | struct flash_config_t { 9 | uint16_t dev_id; 10 | uint8_t log_inteval; 11 | uint16_t adc_warn_level; 12 | } __attribute__ ((packed)); 13 | 14 | 15 | uint8_t FLSH_UpdateStorage(uint8_t *buf, uint16_t len); 16 | uint8_t FLSH_ReadStorage(uint8_t *buf, uint16_t len); 17 | 18 | #endif 19 | 20 | -------------------------------------------------------------------------------- /GPSTracker/car/log.h: -------------------------------------------------------------------------------- 1 | #ifndef LOG_h_ 2 | #define LOG_h_ 3 | 4 | enum log_state { 5 | LOG_STOP, 6 | LOG_RUNNING, 7 | }; 8 | 9 | struct pos_delta { 10 | uint16_t dlat; 11 | uint16_t dlon; 12 | uint8_t dalt; 13 | uint8_t dspeed; 14 | }; 15 | 16 | struct rec_full_t { 17 | uint8_t id; 18 | uint8_t chksum; 19 | uint32_t lat; 20 | uint32_t lon; 21 | uint16_t alt; 22 | uint16_t speed; 23 | uint16_t heading; 24 | }; 25 | 26 | struct rec_delta_t { 27 | uint8_t id; 28 | uint8_t chksum; 29 | struct pos_delta[4]; 30 | }; 31 | 32 | void Log_Init(); 33 | void Log_CheckFlash(); 34 | void Log_Start(); 35 | void Log_Stop(); 36 | void Log_WriteError(); 37 | void Log_Timer(); 38 | 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /GPSTracker/car/modem.h: -------------------------------------------------------------------------------- 1 | #ifndef MODEM_h_ 2 | #define MODEM_h_ 3 | 4 | enum { 5 | MDM_STATE_CMD, 6 | MDM_STATE_ANALYZER, 7 | MDM_STATE_COMM, 8 | MDM_STATE_SNIFF 9 | }; 10 | 11 | extern uint16_t a_freq; 12 | extern uint16_t a_delta; 13 | extern uint16_t a_start; 14 | extern uint16_t a_stop; 15 | extern uint16_t timer; 16 | 17 | extern uint16_t Mdm_SniffTimeout; 18 | 19 | void Mdm_ProcessCmd(uint8_t *, uint8_t); 20 | void Mdm_Worker(); 21 | void Mdm_RfmTxDoneCb(); 22 | 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /GPSTracker/car/nmea.h: -------------------------------------------------------------------------------- 1 | #ifndef NMEA_h_ 2 | #define NMEA_h_ 3 | 4 | struct gpsdata_t { 5 | // time 6 | uint8_t hour; 7 | uint8_t min; 8 | uint8_t sec; 9 | 10 | // date 11 | uint8_t day; 12 | uint8_t month; 13 | uint8_t year; 14 | 15 | // position 16 | uint8_t valid; 17 | int32_t lat; 18 | int32_t lon; 19 | uint16_t alt; 20 | 21 | uint16_t heading; 22 | uint16_t speed; 23 | 24 | uint8_t sats; 25 | uint8_t hdop; 26 | }; 27 | 28 | extern struct gpsdata_t gpsdata; 29 | 30 | void NMEA_Parse(uint8_t *buf, uint8_t len); 31 | 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /GPSTracker/car/openocd.cfg: -------------------------------------------------------------------------------- 1 | 2 | interface buspirate 3 | buspirate_port /dev/ttyUSB0 4 | buspirate_speed fast # normal or fast 5 | 6 | buspirate_vreg 1 7 | 8 | buspirate_mode normal # normal or open-drain 9 | 10 | #interface parport 11 | #parport_port 0 12 | #parport_cable wiggler 13 | ##jtag_speed 0 14 | # 15 | set WORKAREASIZE 0x2800 16 | proc flash_load { } { 17 | flash write_image erase FLASH_RUN/stm32_car.elf 18 | } 19 | 20 | 21 | source [find target/stm32.cfg] 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /GPSTracker/car/platform.h: -------------------------------------------------------------------------------- 1 | #ifndef PLATFORM_H_ 2 | #define PLATFORM_H_ 3 | 4 | #define LED_ON Bit_RESET 5 | #define LED_OFF Bit_SET 6 | 7 | #define LED_RED_PIN GPIO_Pin_13 8 | #define LED_RED_GPIO GPIOA 9 | #define LED_GREEN_PIN GPIO_Pin_14 10 | #define LED_GREEN_GPIO GPIOA 11 | #define LED_YELLOW_PIN GPIO_Pin_15 12 | #define LED_YELLOW_GPIO GPIOA 13 | 14 | 15 | #define RFM_CS_PIN GPIO_Pin_4 16 | #define RFM_CS_GPIO GPIOA 17 | 18 | #define RFM_IRQ_PIN GPIO_Pin_8 19 | #define RFM_IRQ_GPIO GPIOA 20 | 21 | #define RFM_RST_PIN GPIO_Pin_1 22 | #define RFM_RST_GPIO GPIOA 23 | 24 | #define FLASH_CS_PIN GPIO_Pin_7 25 | #define FLASH_CS_GPIO GPIOB 26 | 27 | #define GPS_EN_PIN GPIO_Pin_11 28 | #define GPS_EN_GPIO GPIOA 29 | 30 | #define LED_RED(x) GPIO_WriteBit(LED_RED_GPIO, LED_RED_PIN, x) 31 | #define LED_GREEN(x) GPIO_WriteBit(LED_GREEN_GPIO, LED_GREEN_PIN, x) 32 | #define LED_YELLOW(x) GPIO_WriteBit(LED_YELLOW_GPIO, LED_YELLOW_PIN, x) 33 | 34 | #define RFM_CS(x) GPIO_WriteBit(RFM_CS_GPIO, RFM_CS_PIN, x) 35 | #define RFM_RST(x) GPIO_WriteBit(RFM_RST_GPIO, RFM_RST_PIN, x) 36 | //#define RFM_IRQ_READ() GPIO_ReadInputDataBit(RFM_IRQ_GPIO, RFM_IRQ_PIN) 37 | 38 | #define FLASH_CS(x) GPIO_WriteBit(FLASH_CS_GPIO, FLASH_CS_PIN, x) 39 | #define GPS_EN(x) GPIO_WriteBit(GPS_EN_GPIO, GPS_EN_PIN, x) 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /GPSTracker/car/rfm12.h: -------------------------------------------------------------------------------- 1 | #ifndef RFM12_h_ 2 | #define RFM12_h_ 3 | 4 | enum { 5 | RFM_STATE_SLEEP, 6 | RFM_STATE_IDLE, 7 | RFM_STATE_SCAN, 8 | RFM_STATE_SNIFF, 9 | RFM_STATE_RX, 10 | RFM_STATE_TX, 11 | }; 12 | 13 | #define RFM_BAND_433MHZ 1 14 | #define RFM_BAND_868MHZ 2 15 | #define RFM_BAND_915MHZ 3 16 | 17 | 18 | #define RFM_RECV_MODE 0x82D9 19 | #define RFM_XMIT_MODE 0x8239 20 | #define RFM_IDLE_MODE 0x8209 21 | #define RFM_SLEEP_MODE 0x8201 22 | #define RFM_WAKEUP_MODE 0x8203 23 | 24 | #define RFM_TX_REG 0xB800 25 | #define RFM_RX_REG 0xB000 26 | #define RFM_WAKEUP_REG 0xE000 27 | 28 | 29 | void RFM_Init(void); 30 | void RFM_SetDataRate(uint8_t r); 31 | void RFM_SetTXDeviation(uint8_t d); 32 | void RFM_SetRXWidth(uint8_t w); 33 | void RFM_SetGroup(uint8_t g); 34 | void RFM_SetBand(uint8_t b); 35 | void RFM_SetFreq(uint16_t f); 36 | void RFM_SetFIFO(uint8_t g); 37 | 38 | void RFM_IdleMode(); 39 | void RFM_SniffMode(uint8_t a); 40 | void RFM_ScanMode(); 41 | void RFM_RecvMode(); 42 | 43 | uint8_t RFM_Send(uint16_t id, uint8_t *data, uint8_t len); 44 | uint8_t RFM_ReadFifo(); 45 | uint8_t RFM_IsIdle(); 46 | 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /GPSTracker/car/rtc.c: -------------------------------------------------------------------------------- 1 | 2 | #include "stm32f10x.h" 3 | #include "rtc.h" 4 | 5 | #include "log.h" 6 | 7 | void RTC_IRQHandler(void) 8 | { 9 | ADC_Timer(); 10 | Log_Timer(); 11 | RTC_ClearFlag(RTC_IT_SEC); 12 | } 13 | 14 | void RTCInit(void) { 15 | NVIC_InitTypeDef NVIC_InitStructure = { 16 | .NVIC_IRQChannel = RTC_IRQn, 17 | .NVIC_IRQChannelPreemptionPriority = 1, 18 | .NVIC_IRQChannelSubPriority = 0, 19 | .NVIC_IRQChannelCmd = ENABLE 20 | }; 21 | 22 | 23 | // Allow access to BKP Domain 24 | PWR_BackupAccessCmd(ENABLE); 25 | 26 | // Reset Backup Domain 27 | BKP_DeInit(); 28 | 29 | // Disable the LSI OSC 30 | RCC_LSICmd(ENABLE); 31 | 32 | // Select the RTC Clock Source 33 | RCC_RTCCLKConfig(RCC_RTCCLKSource_LSI); 34 | 35 | // Enable the RTC Clock 36 | RCC_RTCCLKCmd(ENABLE); 37 | 38 | // Wait for RTC registers synchronization 39 | RTC_WaitForSynchro(); 40 | 41 | // Wait until last write operation on RTC registers has finished 42 | RTC_WaitForLastTask(); 43 | 44 | // Enable the RTC overflow interrupt 45 | RTC_ITConfig(RTC_IT_SEC, ENABLE); 46 | 47 | //Set 40000 prescaler - for one second interupt 48 | RTC_SetPrescaler(0x9C3F); 49 | 50 | NVIC_Init(&NVIC_InitStructure); 51 | 52 | } 53 | 54 | -------------------------------------------------------------------------------- /GPSTracker/car/rtc.h: -------------------------------------------------------------------------------- 1 | // rtc.h 2 | #ifndef __STM32F_RTC 3 | #define __STM32F_RTC 4 | 5 | void RTCInit(void); 6 | 7 | #endif 8 | 9 | -------------------------------------------------------------------------------- /GPSTracker/car/spi.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SPI driver for STM32 family processors 3 | * 4 | * 2009-2010 Michal Demin 5 | * 6 | */ 7 | #include "platform.h" 8 | #include "stm32f10x.h" 9 | 10 | #include "spi.h" 11 | 12 | static SPI_InitTypeDef *SPI_ConfCur = NULL; 13 | 14 | void SPI_init(void) 15 | { 16 | /* SPI_InitTypeDef SPIConf = { 17 | .SPI_Direction = SPI_Direction_2Lines_FullDuplex, 18 | .SPI_Mode = SPI_Mode_Master, 19 | .SPI_DataSize = SPI_DataSize_16b, 20 | .SPI_CPOL = SPI_CPOL_Low, 21 | .SPI_CPHA = SPI_CPHA_1Edge, 22 | .SPI_NSS = SPI_NSS_Soft, 23 | .SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_32, 24 | .SPI_FirstBit = SPI_FirstBit_MSB, 25 | .SPI_CRCPolynomial = 7 26 | }; 27 | 28 | 29 | SPI_Init(SPI1, &SPIConf); 30 | SPI_Cmd(SPI1, ENABLE);*/ 31 | } 32 | 33 | /* Simple Byte transmit */ 34 | uint16_t SPI_Xfer(SPI_InitTypeDef *c, uint16_t data) 35 | { 36 | if (SPI_ConfCur != c) { 37 | SPI_Cmd(SPI1, DISABLE); 38 | SPI_Init(SPI1, &SPIConf); 39 | SPI_Cmd(SPI1, ENABLE); 40 | } 41 | 42 | while ((SPI1->SR & SPI_I2S_FLAG_TXE) == RESET); 43 | 44 | // Send byte through the SPI1 peripheral 45 | SPI1->DR = data; 46 | 47 | // Wait to receive a byte 48 | while ((SPI1->SR & SPI_I2S_FLAG_RXNE) == RESET); 49 | 50 | return SPI1->DR; 51 | } 52 | 53 | -------------------------------------------------------------------------------- /GPSTracker/car/spi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPI driver for STM32 family processors 3 | * 4 | * 2009-2010 Michal Demin 5 | * 6 | */ 7 | 8 | #ifndef SPI_H_ 9 | #define SPI_H_ 10 | 11 | 12 | void SPI_init(); 13 | 14 | uint16_t SPI_Xfer(uint16_t data); 15 | 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /GPSTracker/car/uart.h: -------------------------------------------------------------------------------- 1 | #ifndef USART_H_ 2 | #define USART_H_ 3 | 4 | void UART_Init(); 5 | void UART_SendID(); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /GPSTracker/modem/.gdbinit: -------------------------------------------------------------------------------- 1 | 2 | file FLASH_RUN/stm32_modem.elf 3 | target remote localhost:3333 4 | 5 | # set the target-specific info 6 | set remote hardware-watchpoint-limit 4 7 | set remote hardware-breakpoint-limit 6 8 | monitor gdb_breakpoint_override hard 9 | 10 | monitor soft_reset_halt 11 | 12 | # enable debug mode 13 | break main 14 | continue 15 | #set variable DEBUG_ON = 1 16 | #del 1 17 | 18 | -------------------------------------------------------------------------------- /GPSTracker/modem/.gitignore: -------------------------------------------------------------------------------- 1 | FLASH_RUN/ 2 | 3 | -------------------------------------------------------------------------------- /GPSTracker/modem/adc.h: -------------------------------------------------------------------------------- 1 | #ifndef ADC_h_ 2 | #define ADC_h_ 3 | 4 | extern uint16_t AD_Data; 5 | 6 | 7 | void ADC_init(); 8 | void ADC_scan(uint8_t a); 9 | void ADC_start(); 10 | 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /GPSTracker/modem/buf.c: -------------------------------------------------------------------------------- 1 | #include "platform.h" 2 | #include "stm32f10x.h" 3 | 4 | #include "usb_lib.h" 5 | #include "usb_desc.h" 6 | #include "usb_mem.h" 7 | #include "hw_config.h" 8 | #include "usb_istr.h" 9 | 10 | #include "buf.h" 11 | 12 | #define IDX(x) (count_in + index_in + (x)) 13 | 14 | uint8_t buffer_in[1024]; 15 | uint8_t sending_in = 0; 16 | uint32_t count_in = 0; 17 | uint32_t index_in = 0; 18 | 19 | void Buf_PushByte(uint8_t b) 20 | { 21 | buffer_in[IDX(0)] = b; 22 | 23 | count_in ++; 24 | } 25 | 26 | void Buf_PushWord(uint16_t w) 27 | { 28 | buffer_in[IDX(0)] = w & 0xff; 29 | buffer_in[IDX(1)] = w >> 8; 30 | 31 | count_in += 2; 32 | } 33 | 34 | // TODO: check buffer overflow ... 35 | void Buf_PushString(uint8_t *p, uint8_t len) 36 | { 37 | uint8_t i; 38 | 39 | for(i = 0; i < len; i++) { 40 | buffer_in[IDX(i)] = p[i]; 41 | } 42 | 43 | count_in += len; 44 | } 45 | 46 | void Buf_Send() 47 | { 48 | uint8_t cnt = 64; 49 | 50 | if ((count_in == 0) || (sending_in)) 51 | return; 52 | 53 | sending_in = 1; 54 | 55 | if (count_in < 64) 56 | cnt = count_in; 57 | 58 | USB_SIL_Write(EP1_IN, buffer_in + index_in, count_in); 59 | SetEPTxValid(ENDP1); 60 | 61 | index_in += cnt; 62 | count_in -= cnt; 63 | 64 | if (count_in == 0) 65 | index_in = 0; 66 | } 67 | 68 | uint8_t Buf_Need(uint8_t len) 69 | { 70 | if (VIRTUAL_COM_PORT_DATA_SIZE - count_in < len) { 71 | SetEPTxValid(ENDP1); 72 | return 0; 73 | } 74 | 75 | return 1; 76 | } 77 | 78 | -------------------------------------------------------------------------------- /GPSTracker/modem/buf.h: -------------------------------------------------------------------------------- 1 | #ifndef BUF_h_ 2 | #define BUF_h_ 3 | 4 | //extern uint8_t buffer_in[1024]; 5 | extern uint8_t sending_in; 6 | //extern uint32_t count_in; 7 | //extern uint32_t index_in; 8 | 9 | void Buf_PushByte(uint8_t b); 10 | void Buf_PushWord(uint16_t w); 11 | void Buf_PushString(uint8_t *p, uint8_t len); 12 | 13 | uint8_t Buf_Need(uint8_t len); 14 | 15 | void Buf_Send(); 16 | 17 | #endif 18 | 19 | -------------------------------------------------------------------------------- /GPSTracker/modem/modem.h: -------------------------------------------------------------------------------- 1 | #ifndef MODEM_h_ 2 | #define MODEM_h_ 3 | 4 | enum { 5 | MDM_STATE_CMD, 6 | MDM_STATE_ANALYZER, 7 | MDM_STATE_COMM, 8 | MDM_STATE_SNIFF 9 | }; 10 | 11 | extern uint16_t a_freq; 12 | extern uint16_t a_delta; 13 | extern uint16_t a_start; 14 | extern uint16_t a_stop; 15 | extern uint16_t timer; 16 | 17 | extern uint16_t Mdm_SniffTimeout; 18 | 19 | void Mdm_Process(uint8_t *, uint8_t); 20 | void Mdm_Worker(); 21 | void Mdm_RfmTxDoneCb(); 22 | void Mdm_RfmRxDoneCb(); 23 | 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /GPSTracker/modem/openocd.cfg: -------------------------------------------------------------------------------- 1 | 2 | interface buspirate 3 | buspirate_port /dev/ttyUSB0 4 | buspirate_speed fast # normal or fast 5 | 6 | buspirate_vreg 1 7 | 8 | buspirate_mode normal # normal or open-drain 9 | 10 | #interface parport 11 | #parport_port 0 12 | #parport_cable wiggler 13 | ##jtag_speed 0 14 | # 15 | set WORKAREASIZE 0x2800 16 | proc flash_load { } { 17 | flash write_image erase FLASH_RUN/stm32_modem.elf 18 | } 19 | 20 | 21 | source [find target/stm32.cfg] 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /GPSTracker/modem/platform.h: -------------------------------------------------------------------------------- 1 | #ifndef PLATFORM_H_ 2 | #define PLATFORM_H_ 3 | 4 | #define LED_ON Bit_RESET 5 | #define LED_OFF Bit_SET 6 | 7 | #define LED_RED_PIN GPIO_Pin_0 8 | #define LED_RED_GPIO GPIOB 9 | #define LED_GREEN_PIN GPIO_Pin_1 10 | #define LED_GREEN_GPIO GPIOB 11 | #define LED_YELLOW_PIN GPIO_Pin_2 12 | #define LED_YELLOW_GPIO GPIOB 13 | 14 | 15 | #define RFM_CS_PIN GPIO_Pin_4 16 | #define RFM_CS_GPIO GPIOA 17 | 18 | #define RFM_IRQ_PIN GPIO_Pin_1 19 | #define RFM_IRQ_GPIO GPIOA 20 | 21 | #define RFM_RST_PIN GPIO_Pin_2 22 | #define RFM_RST_GPIO GPIOA 23 | 24 | #define RFM_INT_PIN GPIO_Pin_3 25 | #define RFM_INT_GPIO GPIOA 26 | 27 | #define USB_DISCONNECT_PIN GPIO_Pin_9 28 | #define USB_DISCONNECT GPIOA 29 | 30 | #define LED_RED(x) GPIO_WriteBit(LED_RED_GPIO, LED_RED_PIN, x) 31 | #define LED_GREEN(x) GPIO_WriteBit(LED_GREEN_GPIO, LED_GREEN_PIN, x) 32 | #define LED_YELLOW(x) GPIO_WriteBit(LED_YELLOW_GPIO, LED_YELLOW_PIN, x) 33 | 34 | #define RFM_CS(x) GPIO_WriteBit(RFM_CS_GPIO, RFM_CS_PIN, x) 35 | #define RFM_RST(x) GPIO_WriteBit(RFM_RST_GPIO, RFM_RST_PIN, x) 36 | #define RFM_IRQ_READ() GPIO_ReadInputDataBit(RFM_IRQ_GPIO, RFM_IRQ_PIN) 37 | 38 | #endif 39 | 40 | -------------------------------------------------------------------------------- /GPSTracker/modem/rfm12.h: -------------------------------------------------------------------------------- 1 | #ifndef RFM12_h_ 2 | #define RFM12_h_ 3 | 4 | enum { 5 | RFM_STATE_SLEEP, 6 | RFM_STATE_IDLE, 7 | RFM_STATE_SCAN, 8 | RFM_STATE_SNIFF, 9 | RFM_STATE_RX, 10 | RFM_STATE_TX, 11 | }; 12 | 13 | #define RFM_BAND_433MHZ 1 14 | #define RFM_BAND_868MHZ 2 15 | #define RFM_BAND_915MHZ 3 16 | 17 | 18 | #define RFM_RECV_MODE 0x82D9 19 | #define RFM_XMIT_MODE 0x8239 20 | #define RFM_IDLE_MODE 0x8209 21 | #define RFM_SLEEP_MODE 0x8201 22 | #define RFM_WAKEUP_MODE 0x8203 23 | 24 | #define RFM_TX_REG 0xB800 25 | #define RFM_RX_REG 0xB000 26 | #define RFM_WAKEUP_REG 0xE000 27 | 28 | 29 | void RFM_Init(void); 30 | void RFM_SetDataRate(uint8_t r); 31 | void RFM_SetTXDeviation(uint8_t d); 32 | void RFM_SetRXWidth(uint8_t w); 33 | void RFM_SetGroup(uint8_t g); 34 | void RFM_SetBand(uint8_t b); 35 | void RFM_SetFreq(uint16_t f); 36 | void RFM_SetFIFO(uint8_t g); 37 | 38 | void RFM_IdleMode(); 39 | void RFM_SniffMode(uint8_t a); 40 | void RFM_ScanMode(); 41 | void RFM_RecvMode(); 42 | 43 | uint8_t RFM_Send(uint16_t id, uint8_t *data, uint8_t len); 44 | uint8_t RFM_ReadFifo(); 45 | uint8_t RFM_IsIdle(); 46 | 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /GPSTracker/modem/spi.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SPI driver for STM32 family processors 3 | * 4 | * 2009-2010 Michal Demin 5 | * 6 | */ 7 | #include "platform.h" 8 | #include "stm32f10x.h" 9 | 10 | #include "spi.h" 11 | 12 | void SPI_init(void) 13 | { 14 | SPI_InitTypeDef SPIConf = { 15 | .SPI_Direction = SPI_Direction_2Lines_FullDuplex, 16 | .SPI_Mode = SPI_Mode_Master, 17 | .SPI_DataSize = SPI_DataSize_16b, 18 | .SPI_CPOL = SPI_CPOL_Low, 19 | .SPI_CPHA = SPI_CPHA_1Edge, 20 | .SPI_NSS = SPI_NSS_Soft, 21 | .SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_32, 22 | .SPI_FirstBit = SPI_FirstBit_MSB, 23 | .SPI_CRCPolynomial = 7 24 | }; 25 | 26 | SPI_Init(SPI1, &SPIConf); 27 | SPI_Cmd(SPI1, ENABLE); 28 | } 29 | 30 | /* Simple Byte transmit */ 31 | uint16_t SPI_Xfer(uint16_t data) 32 | { 33 | while ((SPI1->SR & SPI_I2S_FLAG_TXE) == RESET); 34 | 35 | // Send byte through the SPI1 peripheral 36 | SPI1->DR = data; 37 | 38 | // Wait to receive a byte 39 | while ((SPI1->SR & SPI_I2S_FLAG_RXNE) == RESET); 40 | 41 | return SPI1->DR; 42 | } 43 | 44 | -------------------------------------------------------------------------------- /GPSTracker/modem/spi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPI driver for STM32 family processors 3 | * 4 | * 2009-2010 Michal Demin 5 | * 6 | */ 7 | 8 | #ifndef SPI_H_ 9 | #define SPI_H_ 10 | 11 | 12 | void SPI_init(); 13 | 14 | uint16_t SPI_Xfer(uint16_t data); 15 | 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /GPSTracker/modem_dfu/.gdbinit: -------------------------------------------------------------------------------- 1 | 2 | file FLASH_RUN/stm32_modem_dfu.elf 3 | target remote localhost:3333 4 | 5 | # set the target-specific info 6 | set remote hardware-watchpoint-limit 4 7 | set remote hardware-breakpoint-limit 6 8 | monitor gdb_breakpoint_override hard 9 | 10 | monitor soft_reset_halt 11 | 12 | # enable debug mode 13 | break main 14 | continue 15 | #set variable DEBUG_ON = 1 16 | #del 1 17 | 18 | -------------------------------------------------------------------------------- /GPSTracker/modem_dfu/.gitignore: -------------------------------------------------------------------------------- 1 | FLASH_RUN/ 2 | 3 | -------------------------------------------------------------------------------- /GPSTracker/modem_dfu/openocd.cfg: -------------------------------------------------------------------------------- 1 | 2 | interface buspirate 3 | buspirate_port /dev/ttyUSB1 4 | buspirate_speed fast # normal or fast 5 | 6 | buspirate_vreg 1 7 | 8 | buspirate_mode normal # normal or open-drain 9 | 10 | #interface parport 11 | #parport_port 0 12 | #parport_cable wiggler 13 | ##jtag_speed 0 14 | # 15 | set WORKAREASIZE 0x2800 16 | proc flash_load { } { 17 | flash write_image erase FLASH_RUN/stm32_modem_dfu.elf 18 | } 19 | 20 | 21 | source [find target/stm32.cfg] 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /GPSTracker/modem_dfu/platform.h: -------------------------------------------------------------------------------- 1 | #ifndef PLATFORM_H_ 2 | #define PLATFORM_H_ 3 | 4 | #define USB_DISCONNECT GPIOA 5 | #define USB_DISCONNECT_PIN GPIO_Pin_9 6 | 7 | #define RCC_APB2Periph_GPIO_DISCONNECT RCC_APB2Periph_GPIOB 8 | 9 | #define LED_WRITE(x) GPIO_WriteBit(LED_GPIO, LED_PIN, x) 10 | 11 | #define LCD_RESET_WRITE(x) GPIO_WriteBit(LCD_RESET_GPIO, LCD_RESET_PIN, x) 12 | 13 | #define JOY_CENTER_READ GPIO_ReadInputDataBit(JOY_CENTER_GPIO, JOY_CENTER_PIN) 14 | 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /GPSTracker/pymodem/modem.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from serial import Serial 4 | import time 5 | import getopt, sys 6 | import os 7 | 8 | def hexit( text ): 9 | h = [] 10 | 11 | for c in text: 12 | h.append( "%02X" % (ord(c)) ) 13 | 14 | return " ".join(h) 15 | 16 | def print_pack( pack ): 17 | ID = ord(pack[1]) << 8 | ord(pack[0]) 18 | print "%04x (%02d) %s" % (ID, ord(pack[2]), hexit(pack[3:])) 19 | 20 | serial = Serial( "/dev/ttyACM1", 921600, timeout = 1, rtscts=0, dsrdtr=0 ) 21 | 22 | serial.flushInput() 23 | serial.flushOutput() 24 | 25 | #echo test 26 | serial.write("echo test ... OK\n") 27 | print serial.readline() 28 | 29 | #send message 30 | ID = 0x1234 31 | data = 200*"j" 32 | 33 | data_out = "%c%c%c%s" % (chr(ID & 0xff), chr(ID >> 8), chr(len(data)), data) 34 | print_pack(data_out) 35 | serial.write("s%s" % data_out) 36 | 37 | tmp = serial.read(3) 38 | if len(tmp) != 3: 39 | raise Exception("No answer") 40 | 41 | data_in = [] 42 | data_in[0:] = tmp 43 | 44 | data_in[3:] = serial.read(ord(tmp[2])) 45 | if len(data_in) != ord(tmp[0] + 3): 46 | raise Exception("Bad packet - data expected") 47 | 48 | print_pack(data_in) 49 | 50 | 51 | 52 | serial.close() 53 | 54 | 55 | -------------------------------------------------------------------------------- /GPSTracker/pymodem/serial/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #portable serial port access with python 3 | #this is a wrapper module for different platform implementations 4 | # 5 | # (C)2001-2002 Chris Liechti 6 | # this is distributed under a free software license, see license.txt 7 | 8 | VERSION = '2.4' 9 | 10 | import sys 11 | 12 | if sys.platform == 'cli': 13 | from serialcli import * 14 | else: 15 | import os 16 | #chose an implementation, depending on os 17 | if os.name == 'nt': #sys.platform == 'win32': 18 | from serialwin32 import * 19 | elif os.name == 'posix': 20 | from serialposix import * 21 | elif os.name == 'java': 22 | from serialjava import * 23 | else: 24 | raise Exception("Sorry: no implementation for your platform ('%s') available" % os.name) 25 | 26 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | 2 | Projects provided "as-is" with no warranty. 3 | 4 | I release my work under CC-BY-SA 3.0 licence. 5 | http://creativecommons.org/licenses/by-sa/3.0/ 6 | -------------------------------------------------------------------------------- /accel_test_rtos/.gdbinit: -------------------------------------------------------------------------------- 1 | 2 | 3 | file FLASH_RUN/stm32_menu.elf 4 | 5 | target remote localhost:3333 6 | 7 | monitor soft_reset_halt 8 | 9 | -------------------------------------------------------------------------------- /accel_test_rtos/.gitignore: -------------------------------------------------------------------------------- 1 | FLASH_RUN/ -------------------------------------------------------------------------------- /accel_test_rtos/ADIS1625x.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ADIS gyro driver 3 | * 4 | * 2009-2010 Michal Demin 5 | * 6 | */ 7 | #ifndef ADIS1625X_H_ 8 | #define ADIS1625X_H_ 9 | 10 | #define ADIS_READ 0x0000 11 | #define ADIS_WRITE 0x8000 12 | 13 | #define ADIS_REG_MASK 0x3f 14 | 15 | /* flags valid for data out regs */ 16 | #define ADIS_ND_FLAG 0x8000 17 | #define ADIS_EA_FLAG 0x4000 18 | #define ADIS_DATA 0x3FFF 19 | 20 | /* DATA OUT regs */ 21 | #define ENDURANCE 0x00 22 | #define SUPPLY_OUT 0x02 23 | #define GYRO_OUT 0x04 24 | #define AUX_ADC 0x0a 25 | #define TEMP_OUT 0x0c 26 | #define ANGL_OUT 0x0e 27 | 28 | /* CONFIG REGS */ 29 | 30 | /* gyro cal data */ 31 | #define GYRO_OFF 0x14 32 | #define GYRO_SCALE 0x16 33 | 34 | /* alarm settings */ 35 | #define ALM_MAG1 0x20 36 | #define ALM_MAG2 0x22 37 | #define ALM_SMPL1 0x24 38 | #define ALM_SMPL2 0x26 39 | #define ALM_CTRL 0x28 40 | 41 | /* dac */ 42 | #define AUX_DAC 0x30 43 | 44 | #define GPIO_CTRL 0x32 45 | #define MSC_CTRL 0x34 46 | 47 | /* ADC setting */ 48 | #define SMPL_PRD 0x36 49 | #define SENS_AVG 0x38 50 | 51 | /* sleep setting */ 52 | #define SLP_CNT 0x3a 53 | 54 | /* controll registers */ 55 | #define STATUS 0x3c 56 | #define COMMAND 0x3e 57 | 58 | void ADIS_Init(); 59 | void ADIS_Reset(); 60 | uint16_t ADIS_ReadReg(uint8_t reg); 61 | void ADIS_WriteReg(uint8_t reg, uint16_t data); 62 | 63 | 64 | #endif 65 | 66 | -------------------------------------------------------------------------------- /accel_test_rtos/adc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ADC driver 3 | * 4 | * 2009-2010 Michal Demin 5 | * 6 | */ 7 | #include "stm32f10x.h" 8 | 9 | #include "adc.h" 10 | 11 | 12 | 13 | void ADC_Setup(void) { 14 | 15 | ADC_InitTypeDef ADC_InitStructure; 16 | 17 | RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1, ENABLE); 18 | ADC_DeInit(ADC1); 19 | 20 | // ADC Structure Initialization 21 | ADC_StructInit(&ADC_InitStructure); 22 | 23 | // Preinit 24 | ADC_InitStructure.ADC_Mode = ADC_Mode_Independent; 25 | ADC_InitStructure.ADC_ScanConvMode = DISABLE; 26 | ADC_InitStructure.ADC_ContinuousConvMode = DISABLE; 27 | ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None; 28 | ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right; 29 | ADC_InitStructure.ADC_NbrOfChannel = 1; 30 | ADC_Init(ADC1, &ADC_InitStructure); 31 | 32 | // Enable the ADC 33 | ADC_Cmd(ADC1, ENABLE); 34 | } 35 | 36 | uint16_t ADC_GetChannel(uint8_t ch) { 37 | 38 | // Configure chanel 39 | ADC_RegularChannelConfig(ADC1, ch, 1, ADC_SampleTime_55Cycles5); 40 | 41 | // Start the conversion 42 | ADC_SoftwareStartConvCmd(ADC1, ENABLE); 43 | 44 | // Wait until conversion completion 45 | while(ADC_GetFlagStatus(ADC1, ADC_FLAG_EOC) == RESET); 46 | 47 | // Get the conversion value 48 | return ADC_GetConversionValue(ADC1); 49 | 50 | } 51 | 52 | -------------------------------------------------------------------------------- /accel_test_rtos/adc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ADC driver 3 | * 4 | * 2009-2010 Michal Demin 5 | * 6 | */ 7 | #ifndef ADC_H_ 8 | #define ADC_H_ 9 | 10 | 11 | void ADC_Setup(void); 12 | uint16_t ADC_GetChannel(uint8_t ch); 13 | 14 | #endif 15 | 16 | -------------------------------------------------------------------------------- /accel_test_rtos/input.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Input driver 3 | * 4 | * 2009-2010 Michal Demin 5 | * 6 | */ 7 | #ifndef INPUT_H_ 8 | #define INPUT_H_ 9 | 10 | #include "stm32f10x.h" 11 | 12 | #define UP_VALUE 960 13 | #define DOWN_VALUE 190 14 | #define LEFT_VALUE 1990 15 | #define RIGHT_VALUE 470 16 | #define DIVERSION 30 17 | 18 | enum { 19 | KEY_NONE=0, 20 | KEY_UP, 21 | KEY_DOWN, 22 | KEY_LEFT, 23 | KEY_RIGHT, 24 | KEY_CENTER, 25 | KEY_BACK 26 | }; 27 | 28 | void Input_Init(); 29 | uint8_t Input_GetEvent(); 30 | 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /accel_test_rtos/lisXXX.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Driver for LisXXX accelerometer 3 | * 4 | * 2009-2010 Michal Demin 5 | * 6 | */ 7 | 8 | #include "i2c.h" 9 | 10 | #include "lisXXX.h" 11 | 12 | void LisXXX_Init() { 13 | uint8_t val; 14 | Hrd_I2C_Init(); 15 | 16 | ReadReg(&val, WHO_AM_I); // have to be 0x3A 17 | 18 | // Set CTRL_REG1 19 | WriteReg(0xC7, CTRL_REG1);// 40hz sampling ? 20 | 21 | // Set CTRL_REG2 22 | WriteReg(0x55, CTRL_REG2); 23 | 24 | // Set CTRL_REG3 25 | WriteReg(0x00, CTRL_REG3); 26 | 27 | } 28 | 29 | void LisXXX_GetData(struct lisxxx_data_t *data) { 30 | uint8_t val_h; 31 | uint8_t val_l; 32 | 33 | // X 34 | ReadReg(&val_l, OUTX_L); 35 | ReadReg(&val_h, OUTX_H); 36 | data->ax = (val_h<<8)|val_l; 37 | 38 | // y 39 | ReadReg(&val_l, OUTY_L); 40 | ReadReg(&val_h, OUTY_H); 41 | data->ay = (val_h<<8)|val_l; 42 | 43 | // z 44 | ReadReg(&val_l, OUTZ_L); 45 | ReadReg(&val_h, OUTZ_H); 46 | data->az = (val_h<<8)|val_l; 47 | 48 | } 49 | 50 | -------------------------------------------------------------------------------- /accel_test_rtos/lisXXX.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Driver for LisXXX accelerometer 3 | * 4 | * 2009-2010 Michal Demin 5 | * 6 | */ 7 | #ifndef LISXXX_H_ 8 | #define LISXXX_H_ 9 | 10 | #define LIS_ADDRESS 0x3A 11 | 12 | #define WHO_AM_I 0x0F 13 | #define OFFSET_X 0x16 14 | #define OFFSET_Y 0x17 15 | #define OFFSET_Z 0x18 16 | #define GAIN_X 0x19 17 | #define GAIN_Y 0x1A 18 | #define GAIN_Z 0x1B 19 | #define CTRL_REG1 0x20 20 | #define CTRL_REG2 0x21 21 | #define CTRL_REG3 0x22 22 | #define HP_FILTER_RESET 0x23 23 | #define STATUS_REG 0x27 24 | #define OUTX_L 0x28 25 | #define OUTX_H 0x29 26 | #define OUTY_L 0x2A 27 | #define OUTY_H 0x2B 28 | #define OUTZ_L 0x2C 29 | #define OUTZ_H 0x2D 30 | #define FF_WU_CFG 0x30 31 | #define FF_WU_SRC 0x31 32 | #define FF_WU_ACK 0x32 33 | #define FF_WU_THS_L 0x34 34 | #define FF_WU_THS_H 0x35 35 | #define FF_WU_DURATION 0x36 36 | #define DD_CFG 0x38 37 | #define DD_SRC 0x39 38 | #define DD_ACK 0x3A 39 | #define DD_THSI_L 0x3C 40 | #define DD_THSI_H 0x3D 41 | #define DD_THSE_L 0x3E 42 | #define DD_THSE_H 0x3F 43 | 44 | struct lisxxx_data_t { 45 | int16_t ax; 46 | int16_t ay; 47 | int16_t az; 48 | }; 49 | 50 | void LisXXX_Init(); 51 | void LisXXX_GetData(struct lisxxx_data_t *); 52 | 53 | #endif 54 | 55 | -------------------------------------------------------------------------------- /accel_test_rtos/mems.h: -------------------------------------------------------------------------------- 1 | #ifndef MEMS_H_ 2 | #define MEMS_H_ 3 | 4 | #include "mems_pos.h" 5 | 6 | extern struct mems_sensors_t mems_sensors; 7 | extern struct position_t position; 8 | 9 | extern uint16_t mems_go; 10 | 11 | void Mems_Init(); 12 | 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /accel_test_rtos/mems_buf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Ring buffer for CAN messages 3 | * 4 | * 2010 Michal Demin 5 | * 6 | */ 7 | 8 | #include "platform.h" 9 | #include "stm32f10x.h" 10 | 11 | #include "canbuf.h" 12 | 13 | void CANBuf_Init(struct can_buffer_t *b) { 14 | uint16_t i; 15 | b->write = 0; 16 | b->read = 0; 17 | 18 | for (i = 0; i < CAN_BUFFER_SIZE; i++ ) { 19 | b->msgs[i].flags = CAN_MSG_INV; 20 | } 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /accel_test_rtos/menu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Simple menu implementation 3 | * 4 | * 2009-2010 Michal Demin 5 | * 6 | */ 7 | #ifndef MENU_H_ 8 | #define MENU_H_ 9 | 10 | #include "stm32f10x.h" 11 | 12 | #define MENU_MAX_DEPTH 3 13 | 14 | #define MENU_ARRAY_SIZE(x) (sizeof(x)/sizeof(menuitem_t)) 15 | 16 | enum { 17 | MENU_LAST=0, 18 | MENU_LABEL, 19 | MENU_LABEL_INV, 20 | MENU_SUB, 21 | MENU_EXEC, 22 | MENU_VAL, 23 | }; 24 | 25 | struct menuitem_t { 26 | const char *text; 27 | uint8_t type; 28 | void (*callback)(void); 29 | union { 30 | const struct menuitem_t* sub_menu; 31 | uint32_t *val; 32 | const uint32_t num; /* first label contains number of items :) */ 33 | }; 34 | }; 35 | 36 | 37 | 38 | void Menu_Init(); 39 | void Menu_Redraw(); 40 | void Menu_Action(); 41 | void Menu_ValChanger(uint32_t *ptr); 42 | 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /accel_test_rtos/openocd.cfg: -------------------------------------------------------------------------------- 1 | #interface parport 2 | #parport_port 0 3 | #parport_cable wiggler 4 | #jtag_speed 0 5 | # 6 | #source [find board/olimex_stm32_h103.cfg] 7 | 8 | interface buspirate 9 | buspirate_port /dev/ttyUSB0 10 | buspirate_speed f #n # fast 11 | 12 | reset_config srst_only 13 | 14 | proc flash_load {} { 15 | halt 16 | poll off 17 | flash write_image erase FLASH_RUN/stm32_menu.elf 18 | poll on 19 | } 20 | 21 | set WORKAREASIZE 0x5000 22 | 23 | source [find board/olimex_stm32_h103.cfg] 24 | -------------------------------------------------------------------------------- /accel_test_rtos/rtc_bkp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * RTC and BKP domain for STM32 family processors 3 | * 4 | * 2009-2010 Michal Demin 5 | * 6 | */ 7 | #ifndef RTC_BKP_H_ 8 | #define RTC_BKP_H_ 9 | 10 | 11 | void RTC_BKP_Init(void); 12 | 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /accel_test_rtos/spi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPI driver for STM32 family processors 3 | * 4 | * 2009-2010 Michal Demin 5 | * 6 | */ 7 | 8 | #ifndef SPI_H_ 9 | #define SPI_H_ 10 | 11 | 12 | void SPIx_Init(SPI_TypeDef *); 13 | 14 | /* lock before doing anything more */ 15 | void SPIx_Lock(SPI_TypeDef *); 16 | void SPIx_Unlock(SPI_TypeDef *); 17 | 18 | /* use dma to transfer the buffer */ 19 | void SPIx_TranscieveBuffer(SPI_TypeDef *SPI, SPI_InitTypeDef *SPIConf, void *inBuf, uint16_t inSize, void *outBuff, uint16_t outSize); 20 | 21 | /* transmit byte */ 22 | uint8_t SPIx_TransmitByte(SPI_TypeDef *SPI, SPI_InitTypeDef *SPIConf, uint8_t data); 23 | 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /accel_test_rtos/usart.c: -------------------------------------------------------------------------------- 1 | /* 2 | * USART driver for STM32 family processors 3 | * 4 | * 2010 Michal Demin 5 | * 6 | */ 7 | #include "FreeRTOS.h" 8 | #include "task.h" 9 | #include "queue.h" 10 | #include "semphr.h" 11 | 12 | #include "platform.h" 13 | #include "stm32f10x.h" 14 | 15 | #include "usart.h" 16 | 17 | void USART_Init() { 18 | 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /accel_test_rtos/usart.h: -------------------------------------------------------------------------------- 1 | /* 2 | * USART driver for STM32 family processors 3 | * 4 | * 2009-2010 Michal Demin 5 | * 6 | */ 7 | #ifndef USART_H_ 8 | #define USART_H_ 9 | 10 | 11 | void USART_Init(); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /blink_rtc/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/blink_rtc/Makefile -------------------------------------------------------------------------------- /blink_rtc/README: -------------------------------------------------------------------------------- 1 | Simple demo that uses RTC to blink LED every ~1sec. -------------------------------------------------------------------------------- /blink_rtc/openocd.cfg: -------------------------------------------------------------------------------- 1 | interface parport 2 | parport_port 0 3 | parport_cable wiggler 4 | jtag_speed 0 5 | 6 | source [find board/olimex_stm32_h103.cfg] 7 | 8 | 9 | -------------------------------------------------------------------------------- /blink_rtc/rtc.h: -------------------------------------------------------------------------------- 1 | // rtc.h 2 | #ifndef __STM32F_RTC 3 | #define __STM32F_RTC 4 | 5 | void RTCInit(void); 6 | 7 | #endif 8 | 9 | -------------------------------------------------------------------------------- /can_boot/.gdbinit: -------------------------------------------------------------------------------- 1 | 2 | 3 | file FLASH_RUN/stm32_can_encoders.elf 4 | 5 | target remote localhost:3333 6 | 7 | monitor soft_reset_halt 8 | 9 | break main 10 | continue 11 | set variable DEBUG_ON = 1 12 | 13 | define can_enable 14 | set variable SYS_InterruptEnable = 0x0000 15 | set variable CANController_Control = 1 16 | call CANController_ControlHandle () 17 | set variable CANController_Timing = { 0x03, 0x115 } 18 | call CANController_TimingHandle() 19 | set variable CANController_Control = 0 20 | call CANController_ControlHandle () 21 | set variable CANController_TXBuffer = {0x3, 0x80, {12,23,43 , 12,23,23,23,23}} 22 | set variable SYS_InterruptEnable = 0x000f 23 | end 24 | document can_enable 25 | Sets CAN timing to 1Mbit 26 | end 27 | 28 | -------------------------------------------------------------------------------- /can_boot/.gitignore: -------------------------------------------------------------------------------- 1 | FLASH_RUN/ 2 | 3 | -------------------------------------------------------------------------------- /can_boot/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/can_boot/Makefile -------------------------------------------------------------------------------- /can_boot/TODO: -------------------------------------------------------------------------------- 1 | 2 | - ram load, exec 3 | - node_id, speed, etc in flash 4 | - receive timeout 5 | - ... 6 | -------------------------------------------------------------------------------- /can_boot/can.h: -------------------------------------------------------------------------------- 1 | /* 2 | * bxCAN driver for STM32 family processors 3 | * 4 | * 2010 Michal Demin 5 | * 6 | */ 7 | 8 | #ifndef CANCONTROLLER_H_ 9 | #define CANCONTROLLER_H_ 10 | 11 | #include "canfestival.h" 12 | 13 | extern uint32_t CAN_Error; 14 | 15 | struct can_timing_t { 16 | const char *baud; 17 | uint16_t brp; // brp[0:9] 18 | uint16_t ts; // res[15] lbkm[14] res[13:10] swj[9:8] res[7] ts2[6:4] ts1[3:0] 19 | } __attribute__ ((packed)); 20 | 21 | #define CAN_MSG_SIZE 0x0F // DLC[0:3] 22 | #define CAN_MSG_RTR 0x10 // RTR[4] 23 | #define CAN_MSG_EID 0x20 // EID[5] 24 | #define CAN_MSG_INV 0x40 // is message in-valid 25 | 26 | struct can_message_t { 27 | uint8_t flags; 28 | uint32_t id; 29 | uint8_t data[8]; 30 | } __attribute__ ((packed)); 31 | 32 | uint8_t can_baudrate(char* baud); 33 | void can_init(char *baud); 34 | uint8_t can_receive(struct can_message_t *m); 35 | uint8_t can_send(struct can_message_t *m); 36 | 37 | void can_filter_clear(); 38 | void can_filter_addmask(uint16_t cobid, uint16_t cobid_mask, uint8_t prio); 39 | void can_filter_apply(); 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /can_boot/commands.h: -------------------------------------------------------------------------------- 1 | #ifndef COMMANDS_h_ 2 | #define COMMANDS_h_ 3 | 4 | 5 | enum { 6 | CMD_ID = 1, 7 | CMD_READPROG, 8 | CMD_WRITEPROG, 9 | CMD_ERASEPROG, 10 | CMD_READCONF, 11 | CMD_WRITECONF, 12 | CMD_WRITERAM, 13 | CMD_READRAM, 14 | CMD_JMP, 15 | CMD_CHKSUM, 16 | CMD_RESET, 17 | }; 18 | 19 | enum error { 20 | ERR_OK = 0, 21 | ERR_BAD_CMD, 22 | ERR_ADDR, 23 | ERR_SIZE, 24 | ERR_CHKSUM, 25 | ERR_FLASH, 26 | }; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /can_boot/openocd.cfg: -------------------------------------------------------------------------------- 1 | 2 | interface buspirate 3 | buspirate_port /dev/ttyUSB0 4 | buspirate_speed fast # normal or fast 5 | 6 | buspirate_vreg 1 7 | 8 | buspirate_mode normal # normal or open-drain 9 | 10 | #interface parport 11 | #parport_port 0 12 | #parport_cable wiggler 13 | ##jtag_speed 0 14 | # 15 | set WORKAREASIZE 0x2800 16 | proc flash_load { } { 17 | flash write_image erase FLASH_RUN/stm32_can_encoders.elf 18 | } 19 | 20 | 21 | source [find target/stm32.cfg] 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /can_boot/platform.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Platform specific file 3 | * 4 | * 2010 Michal Demin 5 | * 6 | */ 7 | #ifndef PLATFORM_H_ 8 | #define PLATFORM_H_ 9 | 10 | #define HAVE_BUTTON 1 11 | #define HAVE_MAGIC 1 12 | #define HAVE_LED 1 13 | 14 | #define APP_ADDR 0x08002000 15 | #define PAGE_SIZE 1024 16 | #define STRING_ID "BOOT" 17 | 18 | // node ID 19 | #define NODE_ID 127 20 | 21 | // magic 22 | #define MAGIC_ADDR 0x20002000 23 | #define MAGIC_KEY 0xDEADBEEF 24 | 25 | // button 26 | #define BUTTON_PIN GPIO_Pin_4 27 | #define BUTTON_GPIO GPIOB 28 | #define BUTTON_EXPECT 0 29 | #define RCC_EARLY_APB2 RCC_APB2Periph_GPIOB 30 | 31 | // led 32 | #define LED_GPIO GPIOA 33 | #define LED_PIN GPIO_Pin_13 34 | #define LED_ON Bit_RESET 35 | #define RCC_LED_APB2 RCC_APB2Periph_GPIOA 36 | 37 | 38 | #endif 39 | 40 | -------------------------------------------------------------------------------- /can_encoders/.gdbinit: -------------------------------------------------------------------------------- 1 | 2 | 3 | file FLASH_RUN/stm32_can_encoders.elf 4 | 5 | target remote localhost:3333 6 | 7 | monitor soft_reset_halt 8 | 9 | break main 10 | continue 11 | set variable DEBUG_ON = 1 12 | 13 | define can_enable 14 | set variable SYS_InterruptEnable = 0x0000 15 | set variable CANController_Control = 1 16 | call CANController_ControlHandle () 17 | set variable CANController_Timing = { 0x03, 0x115 } 18 | call CANController_TimingHandle() 19 | set variable CANController_Control = 0 20 | call CANController_ControlHandle () 21 | set variable CANController_TXBuffer = {0x3, 0x80, {12,23,43 , 12,23,23,23,23}} 22 | set variable SYS_InterruptEnable = 0x000f 23 | end 24 | document can_enable 25 | Sets CAN timing to 1Mbit 26 | end 27 | 28 | -------------------------------------------------------------------------------- /can_encoders/.gitignore: -------------------------------------------------------------------------------- 1 | FLASH_RUN/ 2 | 3 | -------------------------------------------------------------------------------- /can_encoders/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/can_encoders/Makefile -------------------------------------------------------------------------------- /can_encoders/STM32Encoders.h: -------------------------------------------------------------------------------- 1 | 2 | /* File generated by gen_cfile.py. Should not be modified. */ 3 | 4 | #ifndef STM32ENCODERS_H 5 | #define STM32ENCODERS_H 6 | 7 | #include "data.h" 8 | 9 | /* Prototypes of function provided by object dictionnary */ 10 | UNS32 STM32Encoders_valueRangeTest (UNS8 typeValue, void * value); 11 | const indextable * STM32Encoders_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks); 12 | 13 | /* Master node data struct */ 14 | extern CO_Data STM32Encoders_Data; 15 | extern UNS16 Operating_Parameters; /* Mapped at index 0x6000, subindex 0x00*/ 16 | extern UNS32 Position_Value; /* Mapped at index 0x6004, subindex 0x00*/ 17 | extern INTEGER32 Position_Value_for_Multi_Sensor_Device[2]; /* Mapped at index 0x6020, subindex 0x01 - 0x02 */ 18 | extern UNS16 Operating_Status; /* Mapped at index 0x6500, subindex 0x00*/ 19 | extern UNS32 Single_Turn_Resolution; /* Mapped at index 0x6501, subindex 0x00*/ 20 | extern UNS16 Number_of_Distinguishable_Revolutions; /* Mapped at index 0x6502, subindex 0x00*/ 21 | extern UNS40 Number_of_High_Precision_Revolutions; /* Mapped at index 0x6510, subindex 0x00*/ 22 | 23 | #endif // STM32ENCODERS_H 24 | -------------------------------------------------------------------------------- /can_encoders/can.h: -------------------------------------------------------------------------------- 1 | /* 2 | * bxCAN driver for STM32 family processors 3 | * 4 | * 2010 Michal Demin 5 | * 6 | */ 7 | 8 | #ifndef CANCONTROLLER_H_ 9 | #define CANCONTROLLER_H_ 10 | 11 | #include "canfestival.h" 12 | 13 | extern uint32_t CAN_Error; 14 | 15 | struct can_timing_t { 16 | const char *baud; 17 | uint16_t brp; // brp[0:9] 18 | uint16_t ts; // res[15] lbkm[14] res[13:10] swj[9:8] res[7] ts2[6:4] ts1[3:0] 19 | } __attribute__ ((packed)); 20 | 21 | #define CAN_MSG_SIZE 0x0F // DLC[0:3] 22 | #define CAN_MSG_RTR 0x10 // RTR[4] 23 | #define CAN_MSG_EID 0x20 // EID[5] 24 | #define CAN_MSG_INV 0x40 // is message in-valid 25 | 26 | struct can_message_t { 27 | uint8_t flags; 28 | uint32_t id; 29 | uint8_t data[8]; 30 | } __attribute__ ((packed)); 31 | 32 | uint8_t canChangeBaudRate( CAN_HANDLE fd, char* baud); 33 | void canInit(char *baud); 34 | void canHWReinit(void ); 35 | uint8_t canReceive(Message *m); 36 | uint8_t canSend(CAN_PORT notused, Message *m); 37 | 38 | void canFilterClear(); 39 | void canFilterAddMask(uint16_t cobid, uint16_t cobid_mask, uint8_t prio); 40 | void canFilterApply(); 41 | 42 | #endif 43 | 44 | -------------------------------------------------------------------------------- /can_encoders/enc1.h: -------------------------------------------------------------------------------- 1 | #ifndef ENC1_H_ 2 | #define ENC1_H_ 3 | 4 | void Enc1_Init(void); 5 | void Enc1_SetCount(uint32_t in); 6 | uint32_t Enc1_GetCount(void); 7 | 8 | #endif 9 | 10 | -------------------------------------------------------------------------------- /can_encoders/enc2.h: -------------------------------------------------------------------------------- 1 | #ifndef ENC2_H_ 2 | #define ENC2_H_ 3 | 4 | void Enc2_Init(void); 5 | void Enc2_SetCount(uint32_t in); 6 | uint32_t Enc2_GetCount(void); 7 | 8 | #endif 9 | 10 | -------------------------------------------------------------------------------- /can_encoders/openocd.cfg: -------------------------------------------------------------------------------- 1 | 2 | interface buspirate 3 | buspirate_port /dev/ttyUSB0 4 | buspirate_speed fast # normal or fast 5 | 6 | buspirate_vreg 1 7 | 8 | buspirate_mode normal # normal or open-drain 9 | 10 | #interface parport 11 | #parport_port 0 12 | #parport_cable wiggler 13 | ##jtag_speed 0 14 | # 15 | set WORKAREASIZE 0x2800 16 | proc flash_load { } { 17 | flash write_image erase FLASH_RUN/stm32_can_encoders.elf 18 | } 19 | 20 | 21 | source [find target/stm32.cfg] 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /can_encoders/platform.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Platform specific file 3 | * 4 | * 2010 Michal Demin 5 | * 6 | */ 7 | #ifndef PLATFORM_H_ 8 | #define PLATFORM_H_ 9 | 10 | #define LED_YELLOW_PIN GPIO_Pin_13 11 | #define LED_YELLOW_GPIO GPIOA 12 | 13 | #define LED_GREEN_PIN GPIO_Pin_14 14 | #define LED_GREEN_GPIO GPIOA 15 | 16 | #define LED_RED_PIN GPIO_Pin_15 17 | #define LED_RED_GPIO GPIOA 18 | 19 | #define LED_YELLOW(x) GPIO_WriteBit(LED_YELLOW_GPIO, LED_YELLOW_PIN, x) 20 | #define LED_GREEN(x) GPIO_WriteBit(LED_GREEN_GPIO, LED_GREEN_PIN, x) 21 | #define LED_RED(x) GPIO_WriteBit(LED_RED_GPIO, LED_RED_PIN, x) 22 | 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /dtmf/.gdbinit: -------------------------------------------------------------------------------- 1 | 2 | 3 | file FLASH_RUN/stm32f103stk.elf 4 | set arm abi APCS 5 | target remote localhost:3333 6 | 7 | monitor soft_reset_halt 8 | 9 | -------------------------------------------------------------------------------- /dtmf/README: -------------------------------------------------------------------------------- 1 | DTMF generator + detector - Michal Demin 2 | 3 | 4 | Generator based on AVR314 Appnote. 5 | Detector based on Goertzel algorithm. 6 | 7 | Intended to run on STM32-103STK olimex board. Uses boards 8 | audio connectors for audio input/output. 9 | -------------------------------------------------------------------------------- /dtmf/ad.h: -------------------------------------------------------------------------------- 1 | #ifndef AD_H_ 2 | #define AD_H_ 3 | 4 | #include "platform.h" 5 | 6 | typedef void (*ad_callback_t)(int16_t); 7 | 8 | void AD_Init(ad_callback_t); 9 | void AD_Start(void); 10 | void AD_Stop(void); 11 | void AD_SetTimer(uint16_t, uint16_t); 12 | 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /dtmf/dtmf.h: -------------------------------------------------------------------------------- 1 | #ifndef DTMF_h_ 2 | #define DTMF_h_ 3 | 4 | #include "stm32f10x.h" 5 | 6 | #define DTMF_697 0x01 7 | #define DTMF_770 0x02 8 | #define DTMF_852 0x03 9 | #define DTMF_941 0x04 10 | 11 | #define DTMF_1209 0x10 12 | #define DTMF_1336 0x20 13 | #define DTMF_1477 0x30 14 | #define DTMF_1633 0x40 15 | 16 | #define DTMF_1 (DTMF_697 + DTMF_1209) 17 | #define DTMF_2 (DTMF_697 + DTMF_1336) 18 | #define DTMF_3 (DTMF_697 + DTMF_1477) 19 | #define DTMF_A (DTMF_697 + DTMF_1633) 20 | #define DTMF_4 (DTMF_770 + DTMF_1209) 21 | #define DTMF_5 (DTMF_770 + DTMF_1336) 22 | #define DTMF_6 (DTMF_770 + DTMF_1477) 23 | #define DTMF_B (DTMF_770 + DTMF_1633) 24 | #define DTMF_7 (DTMF_852 + DTMF_1209) 25 | #define DTMF_8 (DTMF_852 + DTMF_1336) 26 | #define DTMF_9 (DTMF_852 + DTMF_1477) 27 | #define DTMF_C (DTMF_852 + DTMF_1633) 28 | #define DTMF_S (DTMF_941 + DTMF_1209) 29 | #define DTMF_0 (DTMF_941 + DTMF_1336) 30 | #define DTMF_H (DTMF_941 + DTMF_1477) 31 | #define DTMF_D (DTMF_941 + DTMF_1633) 32 | 33 | void dtmf_init(void); 34 | void dtmf_set(uint8_t code); 35 | void dtmf_deinit(void); 36 | uint8_t dtmf_sending(void); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /dtmf/dtmf_det.h: -------------------------------------------------------------------------------- 1 | #ifndef DTMF_DET_h_ 2 | #define DTMF_DET_h_ 3 | 4 | 5 | struct dtmf_det_t { 6 | int32_t prev[2]; 7 | int32_t coeff; 8 | }; 9 | 10 | void dtmf_det_init(); 11 | void dtmf_det_deinit(void); 12 | uint8_t dtmf_det_get(void); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /dtmf/openocd.cfg: -------------------------------------------------------------------------------- 1 | interface ft2232 2 | ft2232_device_desc "RoBoT_MFG Bus Blaster v2" 3 | ft2232_layout jtagkey 4 | ft2232_vid_pid 0x0403 0x6010 5 | 6 | 7 | set WORKAREASIZE 0x2800 8 | 9 | proc flash_load { } { 10 | reset halt 11 | flash write_image erase FLASH_RUN/stm32f103stk.elf 12 | } 13 | 14 | source [find target/stm32.cfg] 15 | 16 | -------------------------------------------------------------------------------- /dtmf/platform.h: -------------------------------------------------------------------------------- 1 | #ifndef PLATFORM_h_ 2 | #define PLATFORM_h_ 3 | 4 | 5 | #define LIKELY(x) __builtin_expect(!!(x), 1) 6 | #define UNLIKELY(x) __builtin_expect(!!(x), 0) 7 | #define ARRAY_SIZE(x) ((sizeof(x)/sizeof(x[0]))) 8 | #define BV(x) (1 << (x)) 9 | 10 | #ifndef NULL 11 | #define NULL 0 12 | #endif 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /dtmf/rtc.h: -------------------------------------------------------------------------------- 1 | // rtc.h 2 | #ifndef __STM32F_RTC 3 | #define __STM32F_RTC 4 | 5 | void RTCInit(void); 6 | 7 | #endif 8 | 9 | -------------------------------------------------------------------------------- /lib/CMSIS/Core/Documentation/CMSIS_Core.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CMSIS/Core/Documentation/CMSIS_Core.htm -------------------------------------------------------------------------------- /lib/CMSIS/License.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CMSIS/License.doc -------------------------------------------------------------------------------- /lib/CanFestival-3/.hgtags: -------------------------------------------------------------------------------- 1 | 0d84d95790d981298a04fed3f5248df3ad265b0c Before_NVRAM_LED_LSS_cleanup 2 | ddeeb217ed71df89f91f3c21e9afe0481e7c86d8 Root_BRANCH_3_0_RC2 3 | -------------------------------------------------------------------------------- /lib/CanFestival-3/AUTHORS: -------------------------------------------------------------------------------- 1 | 2 | Authors : 3 | ========= 4 | 5 | Edouard TISSERANT (www.canfestival.org) 6 | Francis DUPIN (LIVIC) 7 | Laurent BESSARD (www.canfestival.org) 8 | 9 | -------------------------------------------------------------------------------- /lib/CanFestival-3/CHANGES: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/CHANGES -------------------------------------------------------------------------------- /lib/CanFestival-3/CONTRIBUTORS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/CONTRIBUTORS -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/CANOpen_memento/CANOpen_memento.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/CANOpen_memento/CANOpen_memento.odg -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/CANOpen_memento/CANOpen_memento.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/CANOpen_memento/CANOpen_memento.pdf -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/code_debug.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/code_debug.txt -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/doxygen/.cvsignore: -------------------------------------------------------------------------------- 1 | html 2 | 3 | -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/doxygen/Makefile: -------------------------------------------------------------------------------- 1 | #! gmake 2 | 3 | # 4 | # Copyright (C) 2006 Nicolas GRANDEMANGE 5 | # 6 | # This file is part of canfestival, a library implementing the canopen 7 | # stack 8 | # 9 | # This library is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU Lesser General Public 11 | # License as published by the Free Software Foundation; either 12 | # version 2.1 of the License, or (at your option) any later version. 13 | # 14 | # This library is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | # Lesser General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU Lesser General Public 20 | # License along with this library; if not, write to the Free Software 21 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | # 23 | all: documentation 24 | 25 | clean: 26 | rm -rf html 27 | 28 | 29 | documentation: clean 30 | echo "Doxygen generation!!" 31 | doxygen Doxyfile 32 | #firefox html/index.html& 33 | 34 | -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/manual/Makefile: -------------------------------------------------------------------------------- 1 | #! gmake 2 | 3 | # 4 | # Copyright (C) 2006 Nicolas GRANDEMANGE 5 | # 6 | # This file is part of canfestival, a library implementing the canopen 7 | # stack 8 | # 9 | # This library is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU Lesser General Public 11 | # License as published by the Free Software Foundation; either 12 | # version 2.1 of the License, or (at your option) any later version. 13 | # 14 | # This library is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | # Lesser General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU Lesser General Public 20 | # License along with this library; if not, write to the Free Software 21 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | # 23 | 24 | all: manual 25 | 26 | clean: 27 | cd en && \ 28 | rm -f manual.aux manual.log manual.out manual.toc manual.pdf && \ 29 | rm -rf html && \ 30 | mkdir html 31 | 32 | manual: clean 33 | cd en && \ 34 | pdflatex manual.tex && \ 35 | pdflatex manual.tex && \ 36 | cp manual.pdf ../../../objdictgen/doc/manual_en.pdf && \ 37 | latex2html -split 0 -dir html manual.tex 38 | -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/manual/en/.cvsignore: -------------------------------------------------------------------------------- 1 | manual.lyx 2 | manual.out 3 | manual.pdf 4 | manual.toc 5 | manual.aux 6 | manual.log 7 | html 8 | -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/manual/en/Pictures/100000000000006D000000A31EC8CB54.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/manual/en/Pictures/100000000000006D000000A31EC8CB54.png -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/manual/en/Pictures/10000000000000AA0000006014F74635.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/manual/en/Pictures/10000000000000AA0000006014F74635.png -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/manual/en/Pictures/10000000000000AB000000C88F594413.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/manual/en/Pictures/10000000000000AB000000C88F594413.png -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/manual/en/Pictures/10000000000000AC000000C9C3F53FA6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/manual/en/Pictures/10000000000000AC000000C9C3F53FA6.png -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/manual/en/Pictures/10000000000000B6000000DF1EDD1E73.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/manual/en/Pictures/10000000000000B6000000DF1EDD1E73.png -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/manual/en/Pictures/100000000000022C000000DEDAD2140C.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/manual/en/Pictures/100000000000022C000000DEDAD2140C.png -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/manual/en/Pictures/1000000000000396000000FFC42573DA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/manual/en/Pictures/1000000000000396000000FFC42573DA.png -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/manual/en/Pictures/10000201000000B7000000C66AF89CD5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/manual/en/Pictures/10000201000000B7000000C66AF89CD5.png -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/manual/en/Pictures/10000201000001C4000000DD129D4661.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/manual/en/Pictures/10000201000001C4000000DD129D4661.png -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/manual/en/Pictures/10000201000001C40000010766961D7F.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/manual/en/Pictures/10000201000001C40000010766961D7F.png -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/manual/en/Pictures/10000201000001FC000001E5D65E8766.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/manual/en/Pictures/10000201000001FC000001E5D65E8766.png -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/manual/en/Pictures/1000020100000258000000832C6FFAB4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/manual/en/Pictures/1000020100000258000000832C6FFAB4.png -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/manual/en/Pictures/10000201000002DE000001D82D89C224.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/manual/en/Pictures/10000201000002DE000001D82D89C224.png -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/manual/en/Pictures/10000201000002F30000020B23ED7F67.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/manual/en/Pictures/10000201000002F30000020B23ED7F67.png -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/manual/en/Pictures/10000201000003440000025ACC3FD2F1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/manual/en/Pictures/10000201000003440000025ACC3FD2F1.png -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/manual/en/Pictures/10000201000003CA0000016604E6A5EF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/manual/en/Pictures/10000201000003CA0000016604E6A5EF.png -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/manual/en/Pictures/10000201000003E7000001C7B0296577.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/manual/en/Pictures/10000201000003E7000001C7B0296577.png -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/manual/en/Pictures/10000201000003F9000002CF880931E7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/manual/en/Pictures/10000201000003F9000002CF880931E7.png -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/manual/en/Pictures/10000201000003F9000002CF8B0CDAEA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/manual/en/Pictures/10000201000003F9000002CF8B0CDAEA.png -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/manual/en/Pictures/new_node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/manual/en/Pictures/new_node.png -------------------------------------------------------------------------------- /lib/CanFestival-3/doc/manual/en/Pictures/node_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/doc/manual/en/Pictures/node_info.png -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/can_anagate_win32/can_anagate_win32.def: -------------------------------------------------------------------------------- 1 | LIBRARY can_anagate_win32 2 | 3 | EXPORTS 4 | canReceive_driver 5 | canSend_driver 6 | canOpen_driver 7 | canClose_driver 8 | canChangeBaudRate_driver -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/can_can4linux/.cvsignore: -------------------------------------------------------------------------------- 1 | libcanfestival_can_can4linux.so 2 | Makefile 3 | -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/can_ixxat_win32/ixxat.def: -------------------------------------------------------------------------------- 1 | ; This file is part of CanFestival, a library implementing CanOpen Stack. 2 | ; 3 | ; CanFestival Copyright (C): Edouard TISSERANT and Francis DUPIN 4 | ; CanFestival Win32 port Copyright (C) 2007 Leonid Tochinski, ChattenAssociates, Inc. 5 | ; 6 | ; See COPYING file for copyrights details. 7 | ; 8 | ; This library is free software; you can redistribute it and/or 9 | ; modify it under the terms of the GNU Lesser General Public 10 | ; License as published by the Free Software Foundation; either 11 | ; version 2.1 of the License, or (at your option) any later version. 12 | ; 13 | ; This library is distributed in the hope that it will be useful, 14 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | ; Lesser General Public License for more details. 17 | ; 18 | ; You should have received a copy of the GNU Lesser General Public 19 | ; License along with this library; if not, write to the Free Software 20 | ; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | 22 | LIBRARY IXXAT 23 | 24 | EXPORTS 25 | canReceive_driver 26 | canSend_driver 27 | canOpen_driver 28 | canClose_driver 29 | -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/can_lincan/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/can_peak_linux/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | libcanfestival_can_peak_linux.so 3 | -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/can_peak_win32/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | cancfg.h 3 | Debug UNICODE 4 | cygcan_peak_win32.dll 5 | can_peak_win32.ncb 6 | can_peak_win32.vcproj.KONG.edouard.user 7 | Release 8 | -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/can_peak_win32/can_peak_win32.def: -------------------------------------------------------------------------------- 1 | LIBRARY can_peak_win32 2 | 3 | EXPORTS 4 | canReceive_driver 5 | canSend_driver 6 | canOpen_driver 7 | canClose_driver -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/can_peak_win32/cancfg.h.head: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of CanFestival, a library implementing CanOpen Stack. 3 | 4 | Copyright (C): Edouard TISSERANT and Francis DUPIN 5 | 6 | See COPYING file for copyrights details. 7 | 8 | This library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | This library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with this library; if not, write to the Free Software 20 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #ifndef __CANCFG_H__ 24 | #define __CANCFG_H__ 25 | 26 | 27 | #if defined(__CYGWIN__) 28 | #include 29 | #else 30 | #include 31 | #endif 32 | 33 | // Following part of the file is copied by configure script 34 | // from choosen PcanLight header file 35 | //------------------------------------------------------------------------------- 36 | //------------------------------------------------------------------------------- 37 | //------------------------------------------------------------------------------- 38 | -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/can_peak_win32/cancfg.h.tail: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------- 2 | //------------------------------------------------------------------------------- 3 | //------------------------------------------------------------------------------- 4 | 5 | #endif 6 | -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/can_socket/.cvsignore: -------------------------------------------------------------------------------- 1 | libcanfestival_can_socket.so 2 | Makefile 3 | -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/can_tcp_win32/.cvsignore: -------------------------------------------------------------------------------- 1 | libcanfestival_can_socket.so 2 | Makefile 3 | *.exe 4 | *.dll 5 | -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/can_tcp_win32/Socket.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/drivers/can_tcp_win32/Socket.cpp -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/can_tcp_win32/Socket.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/drivers/can_tcp_win32/Socket.h -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/can_uvccm_win32/.cvsignore: -------------------------------------------------------------------------------- 1 | Debug UNICODE 2 | can_uvccm_win32.vcproj.KONG.edouard.user 3 | Release 4 | -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/can_uvccm_win32/can_uvccm_win32.def: -------------------------------------------------------------------------------- 1 | ; This file is part of CanFestival, a library implementing CanOpen Stack. 2 | ; 3 | ; CanFestival Copyright (C): Edouard TISSERANT and Francis DUPIN 4 | ; CanFestival Win32 port Copyright (C) 2007 Leonid Tochinski, ChattenAssociates, Inc. 5 | ; 6 | ; See COPYING file for copyrights details. 7 | ; 8 | ; This library is free software; you can redistribute it and/or 9 | ; modify it under the terms of the GNU Lesser General Public 10 | ; License as published by the Free Software Foundation; either 11 | ; version 2.1 of the License, or (at your option) any later version. 12 | ; 13 | ; This library is distributed in the hope that it will be useful, 14 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | ; Lesser General Public License for more details. 17 | ; 18 | ; You should have received a copy of the GNU Lesser General Public 19 | ; License along with this library; if not, write to the Free Software 20 | ; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | 22 | LIBRARY can_uvccm_win32 23 | 24 | EXPORTS 25 | canReceive_driver 26 | canSend_driver 27 | canOpen_driver 28 | canClose_driver 29 | -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/can_virtual/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.a 3 | libcanfestival_can_virtual.so 4 | -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/can_vscom/.cvsignore: -------------------------------------------------------------------------------- 1 | VSCAN_API_1_0.zip 2 | libvs_can_api_arm.so 3 | Makefile 4 | libvs_can_api.so 5 | vs_can_api.h 6 | vs_can_api.lib 7 | libcanfestival_can_vscom.so 8 | vs_can_api.dll 9 | -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/hcs12/ports.s: -------------------------------------------------------------------------------- 1 | /* 2 | Define the i/o port global symbol 3 | */ 4 | 5 | .globl _io_ports 6 | _io_ports=0x0000 7 | 8 | /* 9 | 0x0000 is the default mapping at reset. (it is 0x1000 for 68hc11) 10 | */ 11 | -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/timers_rtai/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/timers_unix/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/timers_win32/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/timers_xeno/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/unix/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.a 3 | -------------------------------------------------------------------------------- /lib/CanFestival-3/drivers/win32/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.a 3 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/AT91/Master/ObjDict.h: -------------------------------------------------------------------------------- 1 | 2 | /* File generated by gen_cfile.py. Should not be modified. */ 3 | 4 | #ifndef OBJDICT_H 5 | #define OBJDICT_H 6 | 7 | #include "data.h" 8 | 9 | /* Prototypes of function provided by object dictionnary */ 10 | UNS32 ObjDict_valueRangeTest (UNS8 typeValue, void * value); 11 | const indextable * ObjDict_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks); 12 | 13 | /* Master node data struct */ 14 | extern CO_Data ObjDict_Data; 15 | extern UNS8 DI1; /* Mapped at index 0x2000, subindex 0x00*/ 16 | extern UNS8 DI2; /* Mapped at index 0x2001, subindex 0x00*/ 17 | extern UNS8 DO1; /* Mapped at index 0x2100, subindex 0x00*/ 18 | extern UNS8 DO2; /* Mapped at index 0x2101, subindex 0x00*/ 19 | 20 | #endif // OBJDICT_H 21 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/AT91/Master/io_macro.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of CanFestival, a library implementing CanOpen Stack. 3 | 4 | Copyright (C): Edouard TISSERANT and Francis DUPIN 5 | ARM Port: Peter CHRISTEN 6 | 7 | See COPYING file for copyrights details. 8 | 9 | This library is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU Lesser General Public 11 | License as published by the Free Software Foundation; either 12 | version 2.1 of the License, or (at your option) any later version. 13 | 14 | This library is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | Lesser General Public License for more details. 18 | 19 | You should have received a copy of the GNU Lesser General Public 20 | License along with this library; if not, write to the Free Software 21 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | */ 23 | 24 | #ifndef _IO_MACRO 25 | #define _IO_MACRO 26 | 27 | // Macros for set and clear bits in I/O registers 28 | #define setbit(address,bit) (address |= (1< 2 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/CANOpenShell/CANOpenShell.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of CanFestival, a library implementing CanOpen Stack. 3 | 4 | Copyright (C): Edouard TISSERANT and Francis DUPIN 5 | 6 | See COPYING file for copyrights details. 7 | 8 | This library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | This library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with this library; if not, write to the Free Software 20 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | #ifdef USE_XENO 23 | #define eprintf(...) 24 | #else 25 | #define eprintf(...) printf (__VA_ARGS__) 26 | #endif 27 | 28 | #include "canfestival.h" 29 | 30 | void help(void); 31 | void StartNode(UNS8); 32 | void StopNode(UNS8); 33 | void ResetNode(UNS8); 34 | void DiscoverNodes(void); 35 | void CheckReadInfoSDO(CO_Data*, UNS8); 36 | void GetSlaveNodeInfo(UNS8); 37 | void CheckReadSDO(CO_Data*, UNS8); 38 | void CheckWriteSDO(CO_Data*, UNS8); 39 | void ReadDeviceEntry(char*); 40 | void WriteDeviceEntry(char*); 41 | void SleepFunction(int); 42 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/CANOpenShell/CANOpenShell.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/examples/CANOpenShell/CANOpenShell.o -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/CANOpenShell/CANOpenShell.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual C++ Express 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CANOpenShell", "CANOpenShell.vcproj", "{06B3C378-9EE4-4C56-A519-775FF499DAB5}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {06B3C378-9EE4-4C56-A519-775FF499DAB5}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {06B3C378-9EE4-4C56-A519-775FF499DAB5}.Debug|Win32.Build.0 = Debug|Win32 14 | {06B3C378-9EE4-4C56-A519-775FF499DAB5}.Release|Win32.ActiveCfg = Release|Win32 15 | {06B3C378-9EE4-4C56-A519-775FF499DAB5}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/CANOpenShell/CANOpenShellMasterOD.h: -------------------------------------------------------------------------------- 1 | 2 | /* File generated by gen_cfile.py. Should not be modified. */ 3 | 4 | #ifndef CANOPENSHELLMASTEROD_H 5 | #define CANOPENSHELLMASTEROD_H 6 | 7 | #include "data.h" 8 | 9 | /* Prototypes of function provided by object dictionnary */ 10 | UNS32 CANOpenShellMasterOD_valueRangeTest (UNS8 typeValue, void * value); 11 | const indextable * CANOpenShellMasterOD_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks); 12 | 13 | /* Master node data struct */ 14 | extern CO_Data CANOpenShellMasterOD_Data; 15 | 16 | #endif // CANOPENSHELLMASTEROD_H 17 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/CANOpenShell/CANOpenShellMasterOD.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/examples/CANOpenShell/CANOpenShellMasterOD.o -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/CANOpenShell/CANOpenShellSlaveOD.h: -------------------------------------------------------------------------------- 1 | 2 | /* File generated by gen_cfile.py. Should not be modified. */ 3 | 4 | #ifndef CANOPENSHELLSLAVEOD_H 5 | #define CANOPENSHELLSLAVEOD_H 6 | 7 | #include "data.h" 8 | 9 | /* Prototypes of function provided by object dictionnary */ 10 | UNS32 CANOpenShellSlaveOD_valueRangeTest (UNS8 typeValue, void * value); 11 | const indextable * CANOpenShellSlaveOD_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks); 12 | 13 | /* Master node data struct */ 14 | extern CO_Data CANOpenShellSlaveOD_Data; 15 | 16 | #endif // CANOPENSHELLSLAVEOD_H 17 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/CANOpenShell/CANOpenShellSlaveOD.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/examples/CANOpenShell/CANOpenShellSlaveOD.o -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/CANOpenShell/CANOpenShellsln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual C++ Express 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CANOpenShell", "CANOpenShell.vcproj", "{06B3C378-9EE4-4C56-A519-775FF499DAB5}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {06B3C378-9EE4-4C56-A519-775FF499DAB5}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {06B3C378-9EE4-4C56-A519-775FF499DAB5}.Debug|Win32.Build.0 = Debug|Win32 14 | {06B3C378-9EE4-4C56-A519-775FF499DAB5}.Release|Win32.ActiveCfg = Release|Win32 15 | {06B3C378-9EE4-4C56-A519-775FF499DAB5}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/DS401_Master/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | TestMasterMicroMod 3 | DS401_Master 4 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/DS401_Slave_Gui/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | TestMasterSlave 3 | result.txt 4 | TestMasterSlave.exe 5 | TestMasterSalve.vcproj.KONG.edouard.user 6 | Release 7 | *.depend 8 | DS401_Slave_Gui 9 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/DS401_Slave_Gui/CallBack.h: -------------------------------------------------------------------------------- 1 | #ifndef CALLBACK_H_ 2 | #define CALLBACK_H_ 3 | 4 | extern "C" 5 | { 6 | #include "ObjDict.h" 7 | } 8 | 9 | void Call_heartbeatError (CO_Data * d, UNS8); 10 | 11 | UNS8 Call_canSend (Message *); 12 | 13 | void Call_initialisation (CO_Data * d); 14 | void Call_preOperational (CO_Data * d); 15 | void Call_operational (CO_Data * d); 16 | void Call_stopped (CO_Data * d); 17 | 18 | void Call_post_sync (CO_Data * d); 19 | void Call_post_TPDO (CO_Data * d); 20 | void Call_storeODSubIndex (CO_Data * d, UNS16 wIndex, UNS8 bSubindex); 21 | 22 | #endif /*CALLBACK_H_ */ 23 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/DS401_Slave_Gui/TestSlaveGui.h: -------------------------------------------------------------------------------- 1 | #ifndef TESTSLAVEGUI_H_ 2 | #define TESTSLAVEGUI_H_ 3 | 4 | extern "C" 5 | { 6 | #include "canfestival.h" 7 | } 8 | 9 | int main_can (s_BOARD SlaveBoard, char *LibraryPath); 10 | void stop_slave (); 11 | 12 | #endif /*TESTSLAVEGUI_H_ */ 13 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/SillySlave/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/SillySlave/README: -------------------------------------------------------------------------------- 1 | SillySlave example for CANfestival 2 | 3 | Its purpose is only to check if the selected 4 | driver works at least a minimum. The PC running this demo 5 | must be connected through CAN bus to a working master that 6 | recognizes the slave nodeId. The slave should be configured 7 | by the master, then switched to operative. After that, when 8 | the master sends a SYNC, the slave answers with PDO1, 9 | containing an integer that increments each time it is sent. 10 | 11 | Please have a look to main.h to tune the master and slave node IDs 12 | 13 | It's all. Enjoy it. 14 | GMB 15 | jan 17,2008 16 | 17 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/SillySlave/SillySlave.h: -------------------------------------------------------------------------------- 1 | 2 | /* File generated by gen_cfile.py. Should not be modified. */ 3 | 4 | #ifndef SILLYSLAVE_H 5 | #define SILLYSLAVE_H 6 | 7 | #include "data.h" 8 | 9 | /* Prototypes of function provided by object dictionnary */ 10 | UNS32 SillySlave_valueRangeTest (UNS8 typeValue, void * value); 11 | const indextable * SillySlave_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks); 12 | 13 | /* Master node data struct */ 14 | extern CO_Data SillySlave_Data; 15 | extern ODCallback_t Server_SDO_Parameter_callbacks[]; /* Callbacks of index0x1200 */ 16 | extern ODCallback_t Transmit_PDO_1_Parameter_callbacks[]; /* Callbacks of index0x1800 */ 17 | extern UNS8 LifeSignal; /* Mapped at index 0x2001, subindex 0x00*/ 18 | 19 | #endif // SILLYSLAVE_H 20 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/TestMasterMicroMod/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | TestMasterMicroMod 3 | *.exe 4 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/TestMasterMicroMod/TestMaster.h: -------------------------------------------------------------------------------- 1 | 2 | /* File generated by gen_cfile.py. Should not be modified. */ 3 | 4 | #ifndef TESTMASTER_H 5 | #define TESTMASTER_H 6 | 7 | #include "data.h" 8 | 9 | /* Prototypes of function provided by object dictionnary */ 10 | UNS32 TestMaster_valueRangeTest (UNS8 typeValue, void * value); 11 | const indextable * TestMaster_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks); 12 | 13 | /* Master node data struct */ 14 | extern CO_Data TestMaster_Data; 15 | extern UNS8 DO; /* Mapped at index 0x2000, subindex 0x00*/ 16 | extern UNS8 DI1; /* Mapped at index 0x200F, subindex 0x00*/ 17 | extern UNS8 DI2; /* Mapped at index 0x2010, subindex 0x00*/ 18 | extern UNS8 DI3; /* Mapped at index 0x2011, subindex 0x00*/ 19 | extern UNS8 DI4; /* Mapped at index 0x2012, subindex 0x00*/ 20 | extern UNS8 DI5; /* Mapped at index 0x2013, subindex 0x00*/ 21 | extern UNS8 DI6; /* Mapped at index 0x2014, subindex 0x00*/ 22 | extern UNS8 DI7; /* Mapped at index 0x2015, subindex 0x00*/ 23 | extern UNS8 DI8; /* Mapped at index 0x2016, subindex 0x00*/ 24 | 25 | #endif // TESTMASTER_H 26 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/TestMasterSlave/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | TestMasterSlave 3 | result.txt 4 | TestMasterSlave.exe 5 | TestMasterSalve.vcproj.KONG.edouard.user 6 | Release 7 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/TestMasterSlave/Master.h: -------------------------------------------------------------------------------- 1 | #include "TestMaster.h" 2 | 3 | void TestMaster_heartbeatError(CO_Data* d, UNS8); 4 | 5 | UNS8 TestMaster_canSend(Message *); 6 | 7 | void TestMaster_initialisation(CO_Data* d); 8 | void TestMaster_preOperational(CO_Data* d); 9 | void TestMaster_operational(CO_Data* d); 10 | void TestMaster_stopped(CO_Data* d); 11 | 12 | void TestMaster_post_sync(CO_Data* d); 13 | void TestMaster_post_TPDO(CO_Data* d); 14 | void TestMaster_post_emcy(CO_Data* d, UNS8 nodeID, UNS16 errCode, UNS8 errReg); 15 | void TestMaster_post_SlaveBootup(CO_Data* d, UNS8 nodeid); 16 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/TestMasterSlave/Slave.h: -------------------------------------------------------------------------------- 1 | #include "TestSlave.h" 2 | 3 | void TestSlave_heartbeatError(CO_Data* d, UNS8); 4 | 5 | UNS8 TestSlave_canSend(Message *); 6 | 7 | void TestSlave_initialisation(CO_Data* d); 8 | void TestSlave_preOperational(CO_Data* d); 9 | void TestSlave_operational(CO_Data* d); 10 | void TestSlave_stopped(CO_Data* d); 11 | 12 | void TestSlave_post_sync(CO_Data* d); 13 | void TestSlave_post_TPDO(CO_Data* d); 14 | void TestSlave_storeODSubIndex(CO_Data* d, UNS16 wIndex, UNS8 bSubindex); 15 | void TestSlave_post_emcy(CO_Data* d, UNS8 nodeID, UNS16 errCode, UNS8 errReg); 16 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/TestMasterSlave/TestMaster.h: -------------------------------------------------------------------------------- 1 | 2 | /* File generated by gen_cfile.py. Should not be modified. */ 3 | 4 | #ifndef TESTMASTER_H 5 | #define TESTMASTER_H 6 | 7 | #include "data.h" 8 | 9 | /* Prototypes of function provided by object dictionnary */ 10 | UNS32 TestMaster_valueRangeTest (UNS8 typeValue, void * value); 11 | const indextable * TestMaster_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks); 12 | 13 | /* Master node data struct */ 14 | extern CO_Data TestMaster_Data; 15 | extern UNS8 MasterMap1; /* Mapped at index 0x2000, subindex 0x00*/ 16 | extern UNS8 MasterMap2; /* Mapped at index 0x2001, subindex 0x00*/ 17 | extern UNS8 MasterMap3; /* Mapped at index 0x2002, subindex 0x00*/ 18 | extern UNS8 MasterMap4; /* Mapped at index 0x2003, subindex 0x00*/ 19 | extern UNS8 MasterMap5; /* Mapped at index 0x2004, subindex 0x00*/ 20 | extern UNS8 MasterMap6; /* Mapped at index 0x2005, subindex 0x00*/ 21 | extern UNS8 MasterMap7; /* Mapped at index 0x2006, subindex 0x00*/ 22 | extern UNS8 MasterMap8; /* Mapped at index 0x2007, subindex 0x00*/ 23 | extern UNS8 MasterMap9; /* Mapped at index 0x2008, subindex 0x00*/ 24 | extern UNS32 MasterMap10; /* Mapped at index 0x2009, subindex 0x00*/ 25 | extern UNS16 MasterMap11; /* Mapped at index 0x200A, subindex 0x00*/ 26 | extern INTEGER16 MasterMap12; /* Mapped at index 0x200B, subindex 0x00*/ 27 | extern INTEGER16 MasterMap13; /* Mapped at index 0x200C, subindex 0x00*/ 28 | 29 | #endif // TESTMASTER_H 30 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/TestMasterSlave/TestSlave.h: -------------------------------------------------------------------------------- 1 | 2 | /* File generated by gen_cfile.py. Should not be modified. */ 3 | 4 | #ifndef TESTSLAVE_H 5 | #define TESTSLAVE_H 6 | 7 | #include "data.h" 8 | 9 | /* Prototypes of function provided by object dictionnary */ 10 | UNS32 TestSlave_valueRangeTest (UNS8 typeValue, void * value); 11 | const indextable * TestSlave_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks); 12 | 13 | /* Master node data struct */ 14 | extern CO_Data TestSlave_Data; 15 | extern UNS8 SlaveMap1; /* Mapped at index 0x2000, subindex 0x00*/ 16 | extern UNS8 SlaveMap2; /* Mapped at index 0x2001, subindex 0x00*/ 17 | extern UNS8 SlaveMap3; /* Mapped at index 0x2002, subindex 0x00*/ 18 | extern UNS8 SlaveMap4; /* Mapped at index 0x2003, subindex 0x00*/ 19 | extern UNS8 SlaveMap5; /* Mapped at index 0x2004, subindex 0x00*/ 20 | extern UNS8 SlaveMap6; /* Mapped at index 0x2005, subindex 0x00*/ 21 | extern UNS8 SlaveMap7; /* Mapped at index 0x2006, subindex 0x00*/ 22 | extern UNS8 SlaveMap8; /* Mapped at index 0x2007, subindex 0x00*/ 23 | extern UNS8 SlaveMap9; /* Mapped at index 0x2008, subindex 0x00*/ 24 | extern UNS32 SlaveMap10; /* Mapped at index 0x2009, subindex 0x00*/ 25 | extern UNS16 SlaveMap11; /* Mapped at index 0x200A, subindex 0x00*/ 26 | extern INTEGER16 SlaveMap12; /* Mapped at index 0x200B, subindex 0x00*/ 27 | extern INTEGER16 SlaveMap13; /* Mapped at index 0x200C, subindex 0x00*/ 28 | 29 | #endif // TESTSLAVE_H 30 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/TestMasterSlaveLSS/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | TestMasterSlaveLSS 3 | result.txt 4 | TestMasterSlaveLSS.exe 5 | TestMasterSalve.vcproj.KONG.edouard.user 6 | Release 7 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/TestMasterSlaveLSS/Master.h: -------------------------------------------------------------------------------- 1 | #include "TestMaster.h" 2 | 3 | void TestMaster_heartbeatError(CO_Data* d, UNS8); 4 | 5 | UNS8 TestMaster_canSend(Message *); 6 | 7 | void TestMaster_initialisation(CO_Data* d); 8 | void TestMaster_preOperational(CO_Data* d); 9 | void TestMaster_operational(CO_Data* d); 10 | void TestMaster_stopped(CO_Data* d); 11 | 12 | void TestMaster_post_sync(CO_Data* d); 13 | void TestMaster_post_TPDO(CO_Data* d); 14 | void TestMaster_post_emcy(CO_Data* d, UNS8 nodeID, UNS16 errCode, UNS8 errReg); 15 | void TestMaster_post_SlaveBootup(CO_Data* d, UNS8 nodeid); 16 | 17 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/TestMasterSlaveLSS/SlaveA.h: -------------------------------------------------------------------------------- 1 | #include "TestSlaveA.h" 2 | 3 | void TestSlaveA_heartbeatError(CO_Data* d, UNS8); 4 | 5 | UNS8 TestSlaveA_canSend(Message *); 6 | 7 | void TestSlaveA_initialisation(CO_Data* d); 8 | void TestSlaveA_preOperational(CO_Data* d); 9 | void TestSlaveA_operational(CO_Data* d); 10 | void TestSlaveA_stopped(CO_Data* d); 11 | 12 | void TestSlaveA_post_sync(CO_Data* d); 13 | void TestSlaveA_post_TPDO(CO_Data* d); 14 | void TestSlaveA_storeODSubIndex(CO_Data* d, UNS16 wIndex, UNS8 bSubindex); 15 | void TestSlaveA_post_emcy(CO_Data* d, UNS8 nodeID, UNS16 errCode, UNS8 errReg); 16 | void TestSlaveA_NMT_Slave_Communications_Reset_Callback(CO_Data* d); 17 | void TestSlaveA_StoreConfiguration(CO_Data* d, UNS8 *error, UNS8 *spec_error); 18 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/TestMasterSlaveLSS/SlaveB.h: -------------------------------------------------------------------------------- 1 | #include "TestSlaveB.h" 2 | 3 | void TestSlaveB_heartbeatError(CO_Data* d, UNS8); 4 | 5 | UNS8 TestSlaveB_canSend(Message *); 6 | 7 | void TestSlaveB_initialisation(CO_Data* d); 8 | void TestSlaveB_preOperational(CO_Data* d); 9 | void TestSlaveB_operational(CO_Data* d); 10 | void TestSlaveB_stopped(CO_Data* d); 11 | 12 | void TestSlaveB_post_sync(CO_Data* d); 13 | void TestSlaveB_post_TPDO(CO_Data* d); 14 | void TestSlaveB_storeODSubIndex(CO_Data* d, UNS16 wIndex, UNS8 bSubindex); 15 | void TestSlaveB_post_emcy(CO_Data* d, UNS8 nodeID, UNS16 errCode, UNS8 errReg); 16 | void TestSlaveB_NMT_Slave_Communications_Reset_Callback(CO_Data* d); 17 | void TestSlaveB_StoreConfiguration(CO_Data* d, UNS8 *error, UNS8 *spec_error); 18 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/gene_SYNC_HCS12/trace32_flash_debug.cmm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/examples/gene_SYNC_HCS12/trace32_flash_debug.cmm -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/gene_SYNC_HCS12/trace32_flash_debug_sans_init.cmm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/examples/gene_SYNC_HCS12/trace32_flash_debug_sans_init.cmm -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/gene_SYNC_HCS12/trace32_flash_programmer.cmm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/examples/gene_SYNC_HCS12/trace32_flash_programmer.cmm -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/kerneltest/Master.h: -------------------------------------------------------------------------------- 1 | #include "TestMaster.h" 2 | 3 | void TestMaster_heartbeatError(CO_Data* d, UNS8); 4 | 5 | UNS8 TestMaster_canSend(Message *); 6 | 7 | void TestMaster_initialisation(CO_Data* d); 8 | void TestMaster_preOperational(CO_Data* d); 9 | void TestMaster_operational(CO_Data* d); 10 | void TestMaster_stopped(CO_Data* d); 11 | 12 | void TestMaster_post_sync(CO_Data* d); 13 | void TestMaster_post_TPDO(CO_Data* d); 14 | void TestMaster_post_emcy(CO_Data* d, UNS8 nodeID, UNS16 errCode, UNS8 errReg); 15 | void TestMaster_post_SlaveBootup(CO_Data* d, UNS8 nodeid); 16 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/kerneltest/Slave.h: -------------------------------------------------------------------------------- 1 | #include "TestSlave.h" 2 | 3 | void TestSlave_heartbeatError(CO_Data* d, UNS8); 4 | 5 | UNS8 TestSlave_canSend(Message *); 6 | 7 | void TestSlave_initialisation(CO_Data* d); 8 | void TestSlave_preOperational(CO_Data* d); 9 | void TestSlave_operational(CO_Data* d); 10 | void TestSlave_stopped(CO_Data* d); 11 | 12 | void TestSlave_post_sync(CO_Data* d); 13 | void TestSlave_post_TPDO(CO_Data* d); 14 | void TestSlave_storeODSubIndex(CO_Data* d, UNS16 wIndex, UNS8 bSubindex); 15 | void TestSlave_post_emcy(CO_Data* d, UNS8 nodeID, UNS16 errCode, UNS8 errReg); 16 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/kerneltest/TestMaster.h: -------------------------------------------------------------------------------- 1 | 2 | /* File generated by gen_cfile.py. Should not be modified. */ 3 | 4 | #ifndef TESTMASTER_H 5 | #define TESTMASTER_H 6 | 7 | #include "data.h" 8 | 9 | /* Prototypes of function provided by object dictionnary */ 10 | UNS32 TestMaster_valueRangeTest (UNS8 typeValue, void * value); 11 | const indextable * TestMaster_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks); 12 | 13 | /* Master node data struct */ 14 | extern CO_Data TestMaster_Data; 15 | extern UNS8 MasterMap1; /* Mapped at index 0x2000, subindex 0x00*/ 16 | extern UNS8 MasterMap2; /* Mapped at index 0x2001, subindex 0x00*/ 17 | extern UNS8 MasterMap3; /* Mapped at index 0x2002, subindex 0x00*/ 18 | extern UNS8 MasterMap4; /* Mapped at index 0x2003, subindex 0x00*/ 19 | extern UNS8 MasterMap5; /* Mapped at index 0x2004, subindex 0x00*/ 20 | extern UNS8 MasterMap6; /* Mapped at index 0x2005, subindex 0x00*/ 21 | extern UNS8 MasterMap7; /* Mapped at index 0x2006, subindex 0x00*/ 22 | extern UNS8 MasterMap8; /* Mapped at index 0x2007, subindex 0x00*/ 23 | extern UNS8 MasterMap9; /* Mapped at index 0x2008, subindex 0x00*/ 24 | extern UNS32 MasterMap10; /* Mapped at index 0x2009, subindex 0x00*/ 25 | extern UNS16 MasterMap11; /* Mapped at index 0x200A, subindex 0x00*/ 26 | extern INTEGER16 MasterMap12; /* Mapped at index 0x200B, subindex 0x00*/ 27 | extern INTEGER16 MasterMap13; /* Mapped at index 0x200C, subindex 0x00*/ 28 | 29 | #endif // TESTMASTER_H 30 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/kerneltest/TestMasterSlave.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of CanFestival, a library implementing CanOpen Stack. 3 | 4 | Copyright (C): Edouard TISSERANT and Francis DUPIN 5 | 6 | See COPYING file for copyrights details. 7 | 8 | This library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | This library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with this library; if not, write to the Free Software 20 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #ifndef TESTMASTERSLAVE_H 24 | #define TESTMASTERSLAVE_H 25 | 26 | #define eprintf(...) printk (KERN_INFO __VA_ARGS__) 27 | 28 | int TestMasterSlave_start (void); 29 | void TestMasterSlave_stop (void); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/kerneltest/console/console.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "console.h" 9 | 10 | 11 | void showhelp(void) { 12 | printf("\nCanFestival kernel test example console\n\n"); 13 | 14 | printf("start - start example\n"); 15 | printf("stop - stop example\n"); 16 | printf("quit - quit console\n"); 17 | printf("\n"); 18 | } 19 | 20 | int main(int argc,char *argv[]) 21 | { 22 | int canf_ktest_dev, cmd; 23 | char command[10]; 24 | char device_path[20] = "/dev/"; 25 | 26 | // create absolute path name for device 27 | strcat (device_path, DEVICE_NAME); 28 | 29 | canf_ktest_dev = open (device_path, O_WRONLY); 30 | 31 | if (canf_ktest_dev == -1) { 32 | perror ("Opening device"); 33 | return 1; 34 | } 35 | 36 | showhelp(); 37 | 38 | while (1) { 39 | printf("> "); 40 | scanf ("%s", &command); 41 | 42 | if (strcmp(command,"start") == 0) 43 | cmd = CMD_START; 44 | 45 | else if (strcmp(command,"stop") == 0) 46 | cmd = CMD_STOP; 47 | 48 | else if (strcmp(command,"quit") == 0) 49 | break; 50 | 51 | else { 52 | printf("Bad command\n"); 53 | continue; 54 | } 55 | 56 | write(canf_ktest_dev, &cmd, sizeof(cmd)); 57 | } 58 | 59 | close(canf_ktest_dev); 60 | return 0; 61 | } 62 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/kerneltest/console/console.h: -------------------------------------------------------------------------------- 1 | #ifndef __canftest_console_h__ 2 | #define __canftest_console_h__ 3 | 4 | #define DEVICE_NAME "canf_ktest" 5 | 6 | #define CMD_START '1' 7 | #define CMD_STOP '2' 8 | 9 | #endif // __canftest_console.h__ 10 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/kerneltest/insert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | module="canf_ktest" 4 | device="canf_ktest" 5 | mode="664" 6 | 7 | # insert neccessary modules 8 | /sbin/insmod ../../drivers/can_virtual_kernel/can_virtual.ko 9 | /sbin/insmod ../../src/canfestival.ko 10 | 11 | # insert module with all arguments we got 12 | # and use a pathname, as newer modutils don't look in . by default 13 | /sbin/insmod ./$module.ko $* || exit 1 14 | 15 | # remove stale nodes 16 | rm -f /dev/${device} 17 | 18 | # create device file 19 | major=$(awk "\$2==\"$device\" {print \$1; exit}" /proc/devices) 20 | mknod /dev/${device} c $major 0 21 | 22 | # give appropriate group/permissions, and change the group. 23 | # Not all distributions have staff, some have "wheel" instead. 24 | group="staff" 25 | grep -q '^staff:' /etc/group || group="wheel" 26 | chgrp $group /dev/${device} 27 | chmod $mode /dev/${device} 28 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/kerneltest/remove.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | module="canf_ktest" 4 | device="canf_ktest" 5 | 6 | /sbin/rmmod $module || exit 1 7 | /sbin/rmmod canfestival 8 | /sbin/rmmod can_virtual 9 | 10 | rm -f /dev/${device} 11 | 12 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/kerneltest/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | /bin/sh insert.sh 4 | 5 | console/canf_ktest_console 6 | 7 | /bin/sh remove.sh 8 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/win32test/.cvsignore: -------------------------------------------------------------------------------- 1 | Debug 2 | win32test.vcproj.KONG.edouard.user 3 | Release 4 | -------------------------------------------------------------------------------- /lib/CanFestival-3/examples/win32test/win32test.h: -------------------------------------------------------------------------------- 1 | 2 | /* File generated by gen_cfile.py. Should not be modified. */ 3 | 4 | #ifndef WIN32TEST_H 5 | #define WIN32TEST_H 6 | 7 | #include "data.h" 8 | 9 | /* Prototypes of function provided by object dictionnary */ 10 | UNS32 win32test_valueRangeTest (UNS8 typeValue, void * value); 11 | const indextable * win32test_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks); 12 | 13 | /* Master node data struct */ 14 | extern CO_Data win32test_Data; 15 | 16 | #endif // WIN32TEST_H 17 | -------------------------------------------------------------------------------- /lib/CanFestival-3/include/STM32/canfestival.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of CanFestival, a library implementing CanOpen Stack. 3 | 4 | Copyright (C): Edouard TISSERANT and Francis DUPIN 5 | AVR Port: Andreas GLAUSER and Peter CHRISTEN 6 | 7 | See COPYING file for copyrights details. 8 | 9 | This library is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU Lesser General Public 11 | License as published by the Free Software Foundation; either 12 | version 2.1 of the License, or (at your option) any later version. 13 | 14 | This library is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | Lesser General Public License for more details. 18 | 19 | You should have received a copy of the GNU Lesser General Public 20 | License along with this library; if not, write to the Free Software 21 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | */ 23 | 24 | 25 | #ifndef __CAN_CANFESTIVAL__ 26 | #define __CAN_CANFESTIVAL__ 27 | 28 | #include "applicfg.h" 29 | #include "data.h" 30 | 31 | // --------- to be called by user app --------- 32 | //UNS8 canSend(CAN_PORT notused, Message *m); 33 | //UNS8 canChangeBaudRate(CAN_PORT port, char* baud); 34 | TIMEVAL getTimerPeriod(void); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /lib/CanFestival-3/include/STM32/timerscfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of CanFestival, a library implementing CanOpen Stack. 3 | 4 | Copyright (C): Edouard TISSERANT and Francis DUPIN 5 | 6 | See COPYING file for copyrights details. 7 | 8 | This library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | This library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with this library; if not, write to the Free Software 20 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #ifndef __TIMERSCFG_H__ 24 | #define __TIMERSCFG_H__ 25 | #include 26 | 27 | #define TIMEVAL uint32_t 28 | #define TIMEVAL_MAX 0xFFFFFFFF 29 | 30 | #define US_TO_TIMEVAL(us) ((us) * 1) 31 | #define MS_TO_TIMEVAL(ms) (US_TO_TIMEVAL(ms) * 1000) 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /lib/CanFestival-3/include/dcf.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of CanFestival, a library implementing CanOpen Stack. 3 | 4 | Copyright (C): Edouard TISSERANT and Francis DUPIN 5 | 6 | See COPYING file for copyrights details. 7 | 8 | This library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | This library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with this library; if not, write to the Free Software 20 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | /** 24 | * @brief Send the consise dcf to node corresping to nodeId 25 | * @param *d Pointer on a CAN object data structure 26 | * @param nodeId Id of the slave node 27 | * @return 28 | */ 29 | UNS8 send_consise_dcf(CO_Data* d, UNS8 nodeId); 30 | -------------------------------------------------------------------------------- /lib/CanFestival-3/include/none/timerscfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of CanFestival, a library implementing CanOpen Stack. 3 | 4 | Copyright (C): Edouard TISSERANT and Francis DUPIN 5 | 6 | See COPYING file for copyrights details. 7 | 8 | This library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | This library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with this library; if not, write to the Free Software 20 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #ifndef __TIMERSCFG_H__ 24 | #define __TIMERSCFG_H__ 25 | 26 | /* Time unit : us */ 27 | /* Time resolution : 64bit (~584942 years) */ 28 | #define TIMEVAL unsigned long long 29 | #define TIMEVAL_MAX ~(TIMEVAL)0 30 | #define MS_TO_TIMEVAL(ms) ms*1000L 31 | #define US_TO_TIMEVAL(us) us 32 | 33 | #define TASK_HANDLE void* 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /lib/CanFestival-3/include/sysdep.h: -------------------------------------------------------------------------------- 1 | #ifndef __sysdep_h__ 2 | #define __sysdep_h__ 3 | 4 | #include "config.h" 5 | 6 | #ifdef CANOPEN_BIG_ENDIAN 7 | 8 | /* Warning: the argument must not update pointers, e.g. *p++ */ 9 | 10 | #define UNS16_LE(v) ((((UNS16)(v) & 0xff00) >> 8) | \ 11 | (((UNS16)(v) & 0x00ff) << 8)) 12 | 13 | #define UNS32_LE(v) ((((UNS32)(v) & 0xff000000) >> 24) | \ 14 | (((UNS32)(v) & 0x00ff0000) >> 8) | \ 15 | (((UNS32)(v) & 0x0000ff00) << 8) | \ 16 | (((UNS32)(v) & 0x000000ff) << 24)) 17 | 18 | #else 19 | 20 | #define UNS16_LE(v) (v) 21 | 22 | #define UNS32_LE(v) (v) 23 | 24 | #endif 25 | 26 | #endif /* __sysdep_h__ */ 27 | 28 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | objdict.xml 3 | gnosis 4 | Gnosis_Utils-1.2.1.tar.gz 5 | *.od 6 | *.pyc 7 | *.c 8 | *.h 9 | *.eds 10 | canfestival_config.py 11 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/Gnosis_Utils-current.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/Gnosis_Utils-current.tar.gz -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/commondialogs.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/commondialogs.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/doc/301_v04000201.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/doc/301_v04000201.pdf -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/doc/406_v03020000.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/doc/406_v03020000.pdf -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/doc/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |

6 | CanFestival is an OpenSource (LGPL) CANOpen framework. 7 |

8 | http://canfestival.sourceforge.net 9 |

10 | Copyright �: Edouard TISSERANT, Francis DUPIN and Laurent BESSARD 11 |

12 | Version: CAN Festival 3.0 13 |

14 | 15 | 16 | 19 | 23 | 24 | 25 | 28 | 29 |
17 | Contributor : 18 | 20 | LIVIC
21 | http://www.inrets.fr/ur/livic 22 |
26 | Supported by : 27 |
30 |
31 | 32 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/doc/canfestival.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/doc/canfestival.gif -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/doc/manual_en.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/doc/manual_en.pdf -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/doc_index/.cvsignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/doc_index/DS301_index.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/doc_index/DS301_index.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/doc_index/__init__.py: -------------------------------------------------------------------------------- 1 | # Package initialisation 2 | 3 | from DS301_index import * 4 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/doc_index/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/doc_index/__init__.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/eds_utils.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/eds_utils.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/examples/example_objdict.h: -------------------------------------------------------------------------------- 1 | 2 | /* File generated by gen_cfile.py. Should not be modified. */ 3 | 4 | #ifndef EXAMPLE_OBJDICT_H 5 | #define EXAMPLE_OBJDICT_H 6 | 7 | #include "data.h" 8 | 9 | /* Prototypes of function provided by object dictionnary */ 10 | UNS32 Linux_slave_valueRangeTest (UNS8 typeValue, void * value); 11 | const indextable * Linux_slave_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks); 12 | 13 | /* Master node data struct */ 14 | extern CO_Data Linux_slave_Data; 15 | extern ODCallback_t Transmit_PDO_1_Parameter_callbacks[]; /* Callbacks of index0x1800 */ 16 | extern ODCallback_t Transmit_PDO_2_Parameter_callbacks[]; /* Callbacks of index0x1801 */ 17 | extern UNS8 Time_seconds; /* Mapped at index 0x2000, subindex 0x01 */ 18 | extern UNS8 Time_minutes; /* Mapped at index 0x2000, subindex 0x02 */ 19 | extern UNS8 Time_hours; /* Mapped at index 0x2000, subindex 0x03 */ 20 | extern UNS8 Time_days; /* Mapped at index 0x2000, subindex 0x04 */ 21 | extern UNS32 canopenErrNB; /* Mapped at index 0x2001, subindex 0x00*/ 22 | extern UNS32 canopenErrVal; /* Mapped at index 0x2002, subindex 0x00*/ 23 | extern UNS8 strTest[10]; /* Mapped at index 0x2003, subindex 0x00*/ 24 | 25 | #endif // EXAMPLE_OBJDICT_H 26 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gen_cfile.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/gen_cfile.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/README: -------------------------------------------------------------------------------- 1 | The most current distutils release is available as: 2 | 3 | http://gnosis.cx/download/Gnosis_Utils-current.tar.gz 4 | 5 | This directory may contain more up-to-date versions of some files. 6 | 7 | ---------------------------------------------------------------------- 8 | BACKGROUND: Gnosis Utilities contains a number of Python libraries, 9 | most (but not all) related to working with XML. These include: 10 | 11 | gnosis.xml.pickle (XML pickling of Python objects) 12 | gnosis.xml.objectify (Any XML to "native" Python objects) 13 | gnosis.xml.validity (Enforce validity constraints) 14 | gnosis.xml.indexer (XPATH indexing of XML documents) 15 | gnosis.xml.relax (Tools for working with RelaxNG) 16 | gnosis.indexer (Full-text indexing/searching) 17 | [...].convert.txt2html (Convert ASCII source files to HTML) 18 | gnosis.util.dtd2sql (DTD -> SQL 'CREATE TABLE' statements) 19 | gnosis.util.sql2dtd (SQL query -> DTD for query results) 20 | gnosis.util.xml2sql (XML -> SQL 'INSERT INTO' statements) 21 | gnosis.util.combinators (Combinatorial higher-order functions) 22 | gnosis.util.introspect (Introspect Python objects) 23 | gnosis.magic (Multimethods, metaclasses, etc) 24 | 25 | ...and so much more! :-) 26 | 27 | 28 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/__init__.py: -------------------------------------------------------------------------------- 1 | import string 2 | from os import sep 3 | s = string 4 | d = s.join(s.split(__file__, sep)[:-1], sep)+sep 5 | _ = lambda f: s.rstrip(open(d+f).read()) 6 | l = lambda f: s.split(_(f),'\n') 7 | 8 | try: 9 | __doc__ = _('README') 10 | except: 11 | pass 12 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/gnosis/__init__.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/anon/README: -------------------------------------------------------------------------------- 1 | Consult for more information on this project, and a 2 | working interface page. 3 | 4 | =============================================================================== 5 | 6 | encode_address.py The main module for compression/encryption 7 | 8 | encode_address.cgi A particular implementation of the anonym generator 9 | (more an example than a finished front-end) 10 | 11 | huffman A Huffman encoding table (generated from a corpus 12 | of email addresses in my email archives) 13 | 14 | anon-forward.cgi A somewhat silly script to perform the forwarding 15 | that can be invoked via CGI (during testing) 16 | 17 | =============================================================================== 18 | 19 | You can generate a KEYFILE on a Unix-like system using: 20 | 21 | % head -c 64 /dev/random > KEYFILE 22 | 23 | The scripts 'new_*_key.sh' can be used to generate new keys for the named 24 | duration (and below). They currently produce a debugging display of the 25 | old and new keys; but that should go away. 26 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/anon/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/gnosis/anon/__init__.py -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/anon/anonym.py: -------------------------------------------------------------------------------- 1 | #!/home/gnosis/bin/python 2 | 3 | from SimpleXMLRPCServer import SimpleXMLRPCServer 4 | from encode_address import address_like, read_encoding,\ 5 | encrypt, ascii_huffman_encode,\ 6 | decrypt, ascii_huffman_decode 7 | KEYFILE = '/home/gnosis/.anonym_passphrase' 8 | HUFFMAN = '/home/gnosis/data/huffman' 9 | 10 | encmap, decmap = read_encoding(HUFFMAN) 11 | 12 | class Anonym: 13 | def anonym(self, duration, email): 14 | pw = open(KEYFILE).read() 15 | keys = {'perm':pw[:16], 'month':pw[16:32], 16 | 'week':pw[32:48], 'day':pw[48:64] } 17 | try: 18 | key = keys[duration] 19 | if not address_like(email): 20 | raise ValueError 21 | email = email.upper() 22 | enc = ascii_huffman_encode(email, encmap, encrypt, key) 23 | anonym = '.'+enc+'@gnosis.cx' 24 | except: 25 | anonym = "Invalid email or duration (try .help())" 26 | return anonym 27 | def help(self): 28 | return ("Email address must have right general pattern;\n" 29 | "Duration must be in (perm, month, week, day)") 30 | 31 | if __name__ == '__main__': 32 | server = SimpleXMLRPCServer(('', 8000)) 33 | server.register_instance(Anonym()) 34 | server.serve_forever() 35 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/anon/encode_address.cgi: -------------------------------------------------------------------------------- 1 | #!/home/gnosis/bin/python 2 | 3 | KEYFILE = '/path/to/the/keyfile' 4 | HTML = '../anon/index.html' 5 | 6 | import cgi 7 | query = cgi.FieldStorage() 8 | try: 9 | email = query.getvalue('email','test@test.lan') 10 | duration = query.getvalue('duration', 'Unknown') 11 | except: 12 | email = "Invalid" 13 | duration = "Unknown" 14 | 15 | from encode_address import address_like, read_encoding,\ 16 | encrypt, ascii_huffman_encode,\ 17 | decrypt, ascii_huffman_decode 18 | encmap, decmap = read_encoding('huffman') 19 | pw = open(KEYFILE).read() 20 | keys = {'perm':pw[:16], 'month':pw[16:32], 'week':pw[32:48], 21 | 'day':pw[48:64], 'Unknown':'Weak key'} 22 | key = keys[duration] 23 | try: 24 | if not address_like(email): 25 | raise ValueError 26 | enc = ascii_huffman_encode(email.upper(), encmap, encrypt, key) 27 | anonym = '.'+enc+'@gnosis.cx' 28 | verify = ascii_huffman_decode(enc, decmap, decrypt, key) 29 | except: 30 | anonym = "Invalid email address" 31 | verify = "Cannot verify" 32 | 33 | html = open(HTML).read() 34 | for s in (email, anonym, verify, duration): 35 | html = html.replace('[VALUE]', s, 1) 36 | 37 | print "Content-Type: text/html" 38 | print 39 | print html 40 | 41 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/anon/huffman: -------------------------------------------------------------------------------- 1 | 1213 E :1111 2 | 1162 O :1110 3 | 1040 . :1101 4 | 988 A :1100 5 | 838 C :1011 6 | 829 N :1010 7 | 820 M :1001 8 | 788 R :1000 9 | 750 S :0111 10 | 737 T :0110 11 | 724 I :0101 12 | 716 @ :0100 13 | 588 L :0011 14 | 517 U :0010 15 | 469 D :0001 16 | 344 H :00001111 17 | 328 G :00001110 18 | 287 P :00001101 19 | 250 B :00001100 20 | 212 K :00001011 21 | 205 Y :00001010 22 | 176 F :00001001 23 | 148 W :00001000 24 | 118 V :00000111 25 | 115 J :00000110 26 | 87 X :00000101 27 | 66 - :00000100 28 | 59 Z :00000011 29 | 36 1 :00000010 30 | 28 0 :00000001 31 | 27 Q :000000001111 32 | 25 _ :000000001110 33 | 24 2 :000000001101 34 | 16 5 :000000001100 35 | 15 4 :000000001011 36 | 15 / :000000001010 37 | 14 9 :000000001001 38 | 14 3 :000000001000 39 | 13 7 :000000000111 40 | 7 8 :000000000110 41 | 7 6 :000000000101 42 | 3 = :000000000100 43 | 2 : :000000000011 44 | 2 ! :000000000010 45 | RESRV :000000000001 46 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/anon/new_day_key.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | hexdump KEYFILE 3 | cp KEYFILE src 4 | echo `head -c 48 src``head -c 16 /dev/random` | head -c 64 > KEYFILE 5 | rm src 6 | hexdump KEYFILE 7 | 8 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/anon/new_month_key.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | hexdump KEYFILE 3 | cp KEYFILE src 4 | echo `head -c 16 src``head -c 48 /dev/random` | head -c 64 > KEYFILE 5 | rm src 6 | hexdump KEYFILE 7 | 8 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/anon/new_week_key.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | hexdump KEYFILE 3 | cp KEYFILE src 4 | echo `head -c 32 src``head -c 32 /dev/random` | head -c 64 > KEYFILE 5 | rm src 6 | hexdump KEYFILE 7 | 8 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/doc/__init__.py: -------------------------------------------------------------------------------- 1 | from os import sep 2 | d = sep.join(__file__.split(sep)[:-1])+sep 3 | _ = lambda f: open(d+f).read().rstrip() 4 | l = lambda f: _(f).split('\n') 5 | 6 | ANNOUNCE = _('gnosis_xml_util.announce') 7 | LICENSE = _('LICENSE') 8 | 9 | __doc__ = """Articles and other general documents about Gnosis package""" 10 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/magic/__init__.py: -------------------------------------------------------------------------------- 1 | "Perform black magic of unearthly and ungodly sorts" 2 | 3 | import inspect 4 | 5 | from dtdgenerator import * 6 | from metapickler import * 7 | 8 | class import_with_metaclass_C(object): 9 | "This is a class factory, not a metaclass" 10 | def __init__(self, module, metaclass): 11 | class Meta(object): __metaclass__ = metaclass 12 | dct = {'__module__':module} 13 | mod = __import__(module) 14 | for key, val in mod.__dict__.items(): 15 | if not inspect.isclass(val): 16 | setattr(self, key, val) 17 | else: 18 | setattr(self, key, type(key,(val,Meta),dct)) 19 | 20 | def import_with_metaclass(modname, metaklass): 21 | "Module importer substituting custom metaclass" 22 | class Meta(object): __metaclass__ = metaklass 23 | dct = {'__module__':modname} 24 | mod = __import__(modname) 25 | for key, val in mod.__dict__.items(): 26 | if inspect.isclass(val): 27 | setattr(mod, key, type(key,(val,Meta),dct)) 28 | return mod 29 | 30 | def from_import(module, names="*"): 31 | if names == "*": 32 | names = filter(lambda s: s[0]!="_",dir(module)) 33 | elif names == "**": 34 | semisafe = lambda s: s not in ('__file__','__name__') 35 | names = filter(semisafe, dir(module)) 36 | for name in names: 37 | inspect.currentframe(1).f_globals[name] = getattr(module, name) 38 | 39 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/pyconfig.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/gnosis/pyconfig.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/util/XtoY.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/gnosis/util/XtoY.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/util/__init__.py: -------------------------------------------------------------------------------- 1 | __doc__ = """Utilities for manipulating text and XML documents""" 2 | 3 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/util/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/gnosis/util/__init__.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/util/combinators.py: -------------------------------------------------------------------------------- 1 | from operator import mul, add, truth 2 | 3 | apply_each = lambda fns, args=[]: map(apply, fns, [args]*len(fns)) 4 | bools = lambda lst: map(truth, lst) 5 | bool_each = lambda fns, args=[]: bools(apply_each(fns, args)) 6 | conjoin = lambda fns, args=[]: reduce(mul, bool_each(fns, args)) 7 | all = lambda fns: lambda arg, fns=fns: conjoin(fns, (arg,)) 8 | both = lambda f,g: all((f,g)) 9 | all3 = lambda f,g,h: all((f,g,h)) 10 | and_ = lambda f,g: lambda x, f=f, g=g: f(x) and g(x) 11 | disjoin = lambda fns, args=[]: reduce(add, bool_each(fns, args)) 12 | some = lambda fns: lambda arg, fns=fns: disjoin(fns, (arg,)) 13 | either = lambda f,g: some((f,g)) 14 | anyof3 = lambda f,g,h: some((f,g,h)) 15 | or_ = lambda f,g: lambda x, f=f, g=g: f(x) or g(x) 16 | compose = lambda f,g: lambda x, f=f, g=g: f(g(x)) 17 | compose3 = lambda f,g,h: lambda x, f=f, g=g, h=h: f(g(h(x))) 18 | ident = lambda x: x 19 | not_ = lambda f: lambda x, f=f: not f(x) 20 | 21 | def shortcut_all(*fns): 22 | accum = fns[0] 23 | for fn in fns[1:]: 24 | accum = and_(accum, fn) 25 | return accum 26 | lazy_all = shortcut_all 27 | 28 | def shortcut_any(*fns): 29 | accum = fns[0] 30 | for fn in fns[1:]: 31 | accum = or_(accum, fn) 32 | return accum 33 | lazy_any = shortcut_any 34 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/util/combinators.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/gnosis/util/combinators.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/util/convert/__init__.py: -------------------------------------------------------------------------------- 1 | __doc__ = """Convert "smart ASCII" documents to other formats""" 2 | 3 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/util/convert/dyn_txt2html.py: -------------------------------------------------------------------------------- 1 | from dmTxt2Html import * # Import the body of 'Txt2Html' code 2 | from urllib import urlopen 3 | import sys 4 | 5 | # Check for updated functions (fail gracefully if not fetchable) 6 | try: 7 | updates = urlopen('http://gnosis.cx/download/t2h_textfuncs.py').read() 8 | fh = open('t2h_textfuncs.py', 'w') 9 | fh.write(updates) 10 | fh.close() 11 | except: 12 | sys.stderr.write('Cannot currently download Txt2Html updates') 13 | 14 | # Import the updated functions (if available) 15 | try: 16 | from t2h_textfuncs import * 17 | except: 18 | sys.stderr.write('Cannot import the updated Txt2Html functions') 19 | 20 | # Set options based on runmode (shell vs. CGI) 21 | if len(sys.argv) >= 2: 22 | cfg_dict = ParseArgs(sys.argv[1:]) 23 | main(cfg_dict) 24 | else: 25 | print "Please specify URL (and options) for Txt2Html conversion" 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/util/convert/fetch_txt2html.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from urllib import urlopen, urlencode 3 | if len(sys.argv) == 2: 4 | cgi = 'http://gnosis.cx/cgi/txt2html.cgi' 5 | opts = urlencode({'proxy': 'NONE', 6 | 'source': sys.argv[1]}) 7 | print urlopen(cgi, opts).read() 8 | else: 9 | print "Please specify URL for Txt2Html conversion" 10 | 11 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/util/convert/txt2html.cgi: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | """Check txt2html.txt for prepared documentation 3 | Docs may be updated with 'txt2html.cgi -rebuild_docs' 4 | """ 5 | from dmTxt2Html import * 6 | 7 | # Set options based on runmode (shell vs. CGI) 8 | if len(sys.argv) >= 2: 9 | cfg_dict = ParseArgs(sys.argv[1:]) 10 | else: 11 | cfg_dict = ParseCGI() 12 | 13 | if cfg_dict: main(cfg_dict) 14 | 15 | 16 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/util/convert/txt2html_dir.py: -------------------------------------------------------------------------------- 1 | from dmTxt2Html import * 2 | import glob 3 | 4 | txts = glob.glob('*.txt') 5 | cfg_dict = {'type': 'SMART_ASCII', 6 | 'proxy': 'NONE' } 7 | for fname in txts: 8 | cfg_dict['source'] = fname 9 | cfg_dict['target'] = fname[:-3]+'html' 10 | main(cfg_dict) 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/util/convert/typo_html.py: -------------------------------------------------------------------------------- 1 | codes = \ 2 | { 'emph' : ('', ''), 3 | 'strong' : ('', ''), 4 | 'module' : ('', ''), 5 | 'code' : ('', ''), 6 | 'title' : ('', ''), 7 | } 8 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/util/convert/typographify.def: -------------------------------------------------------------------------------- 1 | para := (plain / markup)+ 2 | plain := (word / whitespace / punctuation)+ 3 | whitespace := [ \t\r\n]+ 4 | alphanums := [a-zA-Z0-9]+ 5 | word := alphanums, (wordpunct, alphanums)*, contraction? 6 | wordpunct := [-_] 7 | contraction := "'", ('am'/'clock'/'d'/'ll'/'m'/'re'/'s'/'t'/'ve') 8 | markup := emph / strong / module / code / title 9 | emph := '-', plain, '-' 10 | strong := '*', plain, '*' 11 | module := '[', plain, ']' 12 | code := "'", plain, "'" 13 | title := '_', plain, '_' 14 | punctuation := (safepunct / mdash) 15 | mdash := '--' 16 | safepunct := [!@#$%^&()+=|\{}:;<>,.?/"] 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/util/convert/typographify.py: -------------------------------------------------------------------------------- 1 | import os 2 | from sys import stdin, stdout, stderr 3 | from simpleparse import generator 4 | from mx.TextTools import TextTools 5 | 6 | input = stdin.read() 7 | decl = open('typographify.def').read() 8 | from typo_html import codes 9 | parser = generator.buildParser(decl).parserbyname('para') 10 | taglist = TextTools.tag(input, parser) 11 | for tag, beg, end, parts in taglist[1]: 12 | if tag == 'plain': 13 | stdout.write(input[beg:end]) 14 | elif tag == 'markup': 15 | markup = parts[0] 16 | mtag, mbeg, mend = markup[:3] 17 | start, stop = codes.get(mtag, ('','')) 18 | stdout.write(start + input[mbeg+1:mend-1] + stop) 19 | stderr.write('parsed %s chars of %s\n' % (taglist[-1], len(input))) 20 | 21 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/util/introspect.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/gnosis/util/introspect.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/util/sql2xml_sample.xml.txt: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 10 | 11 | 12 | 13 | 14 | ]> 15 | 16 | 17 | 18 | 111-22-3333 19 | 1 20 | 21 | 22 | 333-22-4444 23 | 2 24 | 25 | 26 | 666-44-5555 27 | 1 28 | 29 | 30 | 999-88-7777 31 | 1 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/util/test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Some text about eggs. 5 | Ode to Spam 6 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/util/test/funcs.py: -------------------------------------------------------------------------------- 1 | import os, sys, string 2 | 3 | def pyver(): 4 | return string.split(sys.version)[0] 5 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/util/test/mixed.xml: -------------------------------------------------------------------------------- 1 | Some boldface word -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/util/test/test_data2attr.py: -------------------------------------------------------------------------------- 1 | from sys import version 2 | from gnosis.util.introspect import data2attr, attr2data 3 | 4 | if version >= '2.2': 5 | class NewList(list): pass 6 | class NewTuple(tuple): pass 7 | class NewDict(dict): pass 8 | 9 | nl = NewList([1,2,3]) 10 | nt = NewTuple([1,2,3]) 11 | nd = NewDict({1:2,3:4}) 12 | nl.attr = 'spam' 13 | nt.attr = 'spam' 14 | nd.attr = 'spam' 15 | 16 | nl = data2attr(nl) 17 | print nl, getattr(nl, '__coredata__', 'No __coredata__') 18 | nl = attr2data(nl) 19 | print nl, getattr(nl, '__coredata__', 'No __coredata__') 20 | 21 | nt = data2attr(nt) 22 | print nt, getattr(nt, '__coredata__', 'No __coredata__') 23 | nt = attr2data(nt) 24 | print nt, getattr(nt, '__coreData__', 'No __coreData__') 25 | 26 | nd = data2attr(nd) 27 | print nd, getattr(nd, '__coredata__', 'No __coredata__') 28 | nd = attr2data(nd) 29 | print nd, getattr(nd, '__coredata__', 'No __coredata__') 30 | else: 31 | print "data2attr() and attr2data() only work on 2.2+ new-style objects" 32 | 33 | 34 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/util/test/test_noinit.py: -------------------------------------------------------------------------------- 1 | from gnosis.util.introspect import instance_noinit 2 | 3 | class Old_noinit: pass 4 | 5 | class Old_init: 6 | def __init__(self): print "Init in Old" 7 | 8 | class New_slots_and_init(int): 9 | __slots__ = ('this','that') 10 | def __init__(self): print "Init in New w/ slots" 11 | 12 | class New_init_no_slots(int): 13 | def __init__(self): print "Init in New w/o slots" 14 | 15 | class New_slots_no_init(int): 16 | __slots__ = ('this','that') 17 | 18 | class New_no_slots_no_init(int): 19 | pass 20 | 21 | print "----- This should be the only line -----" 22 | instance_noinit(Old_noinit) 23 | instance_noinit(Old_init) 24 | instance_noinit(New_slots_and_init) 25 | instance_noinit(New_slots_no_init) 26 | instance_noinit(New_init_no_slots) 27 | instance_noinit(New_no_slots_no_init) 28 | 29 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/version.py: -------------------------------------------------------------------------------- 1 | 2 | PKGNAME = "Gnosis_Utils" 3 | 4 | # this gets bumped on every release 5 | MAJOR = 1 6 | MINOR = 2 7 | SUBVER = 2 8 | EXTRA = '' 9 | 10 | VSTRING = "%d.%d.%d%s" % (MAJOR,MINOR,SUBVER,EXTRA) 11 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/__init__.py: -------------------------------------------------------------------------------- 1 | """Utilities and Interfaces to make XML more Pythonic 2 | 3 | Please see the information in subpackages and submodules for 4 | explanation of usage, design, license, and other details 5 | """ 6 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/gnosis/xml/__init__.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/objectify/__init__.py: -------------------------------------------------------------------------------- 1 | """Transform XML Documents to Python objects 2 | 3 | Please see the information at gnosis.xml.objectify.doc for 4 | explanation of usage, design, license, and other details 5 | """ 6 | 7 | from utils import * 8 | from _objectify import * 9 | from _objectify import _XO_ 10 | 11 | # This call will enable namespace support in EXPAT 12 | config_nspace_sep() 13 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/objectify/doc/AUTHOR: -------------------------------------------------------------------------------- 1 | David Mertz 2 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/objectify/doc/COPYRIGHT: -------------------------------------------------------------------------------- 1 | These files are released to the public domain. I (dqm) would 2 | appreciate it if you choose to keep derived works under terms 3 | that promote freedom, but obviously am giving up any rights to 4 | compel such. 5 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/objectify/doc/THANKS_TO: -------------------------------------------------------------------------------- 1 | Grant Munsey 2 | Costas Malamas 3 | Kapil Thangavelu 4 | Mario Ruggier 5 | Bruno Lienard 6 | Frank McIngvale 7 | Arnold Weis 8 | Greg Aumann 9 | Rene Jager 10 | Bob Gibson 11 | Ville Vainio 12 | William McVey 13 | Gamaliel Masters 14 | Frank von Delft 15 | Adam Feur 16 | 17 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/objectify/doc/TODO: -------------------------------------------------------------------------------- 1 | - Add name munging to attributes (not just to tagnames), e.g.: 2 | 3 | >>> from gnosis.xml.objectify import make_instance 4 | >>> dir(make_instance('')) 5 | ['PCDATA', ..., '_seq', u'bar-baz', 'spam__eggs'] 6 | 7 | - Add a PyRXP (validating) parser. Also, try some timings vs EXPAT. 8 | 9 | - In Python 2.3, the DOM parser produces a list of two elements, e.g.: 10 | 11 | [, ] 12 | 13 | However, the first element contains only empty (None) PCDATA, and no 14 | children. I do not know why this happens, and only starting with 15 | 2.3; but then, EXPAT is currently the preferred parser. 16 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/objectify/doc/VERSION: -------------------------------------------------------------------------------- 1 | Revision: February 2004 2 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/objectify/doc/__init__.py: -------------------------------------------------------------------------------- 1 | from os import sep 2 | d = sep.join(__file__.split(sep)[:-1])+sep 3 | _= lambda f: open(d+f).read().rstrip() 4 | l= lambda f: _(f).split('\n') 5 | 6 | HOWTO = _('HOWTO') 7 | COPYRIGHT = _('COPYRIGHT') 8 | HISTORY = _('HISTORY') 9 | TODO = _('TODO') 10 | VERSION = _('VERSION') 11 | GOTCHAS = _('GOTCHAS') 12 | 13 | AUTHOR = l('AUTHOR') 14 | THANKS_TO = l('THANKS_TO') 15 | __doc__ = HOWTO 16 | 17 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/objectify/test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Some text about eggs. 5 | Ode to Spam 6 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/objectify/test/__init__.py: -------------------------------------------------------------------------------- 1 | # this exists only to prevent warnings during package build. 2 | # importing things from test doesn't make much sense :-) 3 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/objectify/test/test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Some text about eggs. 5 | Ode to Spam 6 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/objectify/test/test_basic.py: -------------------------------------------------------------------------------- 1 | "Read and print and objectified XML file" 2 | 3 | import sys 4 | from gnosis.xml.objectify import XML_Objectify, pyobj_printer, EXPAT, DOM 5 | 6 | if len(sys.argv) > 1: 7 | for filename in sys.argv[1:]: 8 | for parser in (DOM, EXPAT): 9 | try: 10 | xml_obj = XML_Objectify(filename, parser=parser) 11 | py_obj = xml_obj.make_instance() 12 | print pyobj_printer(py_obj).encode('UTF-8') 13 | print "++ SUCCESS ( using", parser, ")" 14 | print "="*50 15 | except: 16 | raise 17 | print "++ FAILED ( using", parser, ")" 18 | print "="*50 19 | else: 20 | print "Please specify one or more XML files to Objectify." 21 | 22 | 23 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/objectify/test/test_expat.py: -------------------------------------------------------------------------------- 1 | "Read using Expat parser and print and objectified XML file" 2 | 3 | import sys 4 | from gnosis.xml.objectify import XML_Objectify, pyobj_printer, EXPAT 5 | 6 | if len(sys.argv) > 1: 7 | for filename in sys.argv[1:]: 8 | try: 9 | xml_obj = XML_Objectify(xml_src=filename, parser=EXPAT) 10 | py_obj = xml_obj.make_instance() 11 | except SyntaxError: 12 | print "Caught SyntaxError exception!" 13 | print "Possibly an XML file with namespaces that is causing this," 14 | print "so try again but ignore XML namespaces..." 15 | XML_Objectify.expat_kwargs['nspace_sep'] = None 16 | xml_obj = XML_Objectify(xml_src=filename, parser=EXPAT) 17 | try: 18 | py_obj = xml_obj.make_instance() 19 | print "it worked!" 20 | except: 21 | print "it did NOT work!" 22 | raise 23 | print pyobj_printer(py_obj).encode('UTF-8') 24 | else: 25 | print "Please specify one or more XML files to Objectify." 26 | 27 | 28 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/objectify/test/test_expat2.py: -------------------------------------------------------------------------------- 1 | "Read using Expat parser and print and objectified XML file" 2 | 3 | import sys 4 | from gnosis.xml.objectify import XML_Objectify, pyobj_printer, EXPAT 5 | 6 | class MyExpatBased_XML_Objectify(XML_Objectify): 7 | expat_args = [] 8 | expat_kwargs = { 9 | 'nspace_sep' : None, # Ignore XML namespaces. 10 | } 11 | def __init__ (self, xml_src): 12 | XML_Objectify.__init__(self, xml_src=xml_src, parser=EXPAT) 13 | 14 | if len(sys.argv) > 1: 15 | for filename in sys.argv[1:]: 16 | try: 17 | xml_obj = XML_Objectify(xml_src=filename, parser=EXPAT) 18 | py_obj = xml_obj.make_instance() 19 | except SyntaxError: 20 | print\ 21 | """Caught SyntaxError exception! Possibly an XML file with namespaces that 22 | is causing this, so try again but ignore XML namespaces...""", 23 | xml_obj = MyExpatBased_XML_Objectify(filename) 24 | try: 25 | py_obj = xml_obj.make_instance() 26 | print "it worked!" 27 | except: 28 | print "it did NOT work!" 29 | raise 30 | print pyobj_printer(py_obj).encode('UTF-8') 31 | else: 32 | print "Please specify one or more XML files to Objectify." 33 | 34 | 35 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/objectify/test/test_xpath.py: -------------------------------------------------------------------------------- 1 | from gnosis.xml.objectify import make_instance 2 | from gnosis.xml.objectify.utils import XPath 3 | import sys 4 | 5 | xml = ''' 6 | this 7 | that 8 | 9 | stuff fo 10 | fum 11 | and fizzle 12 | more stuff 13 | 14 | 15 | ''' 16 | 17 | print xml 18 | print 19 | open('xpath.xml','w').write(xml) 20 | o = make_instance(xml) 21 | 22 | patterns = '''/bar //bar //* /baz/*/bar 23 | /bar[2] //bar[2..4] 24 | //@a1 //bar/@a1 /baz/@* //@* 25 | baz//bar/text() /baz/text()[3]''' 26 | 27 | for pattern in patterns.split(): 28 | print 'XPath:', pattern 29 | for match in XPath(o, pattern): 30 | print ' ', match 31 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/objectify/test/testns.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Some text about eggs. 5 | Ode to Spam 6 | 7 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/objectify/test/xpath.xml: -------------------------------------------------------------------------------- 1 | 2 | this 3 | that 4 | 5 | stuff fo 6 | fum 7 | and fizzle 8 | more stuff 9 | 10 | 11 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/objectify/xpath.xml: -------------------------------------------------------------------------------- 1 | 2 | this 3 | that 4 | 5 | stuff fo 6 | fum 7 | and fizzle 8 | more stuff 9 | 10 | 11 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/PyObject-0.48.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 16 | 17 | 18 | 25 | 26 | 30 | 31 | 38 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/PyObject.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 16 | 17 | 18 | 25 | 26 | 30 | 31 | 38 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/__init__.py: -------------------------------------------------------------------------------- 1 | """Store Python objects to (pickle-like) XML Documents 2 | 3 | Please see the information at gnosis.xml.pickle.doc for 4 | explanation of usage, design, license, and other details 5 | """ 6 | from gnosis.xml.pickle._pickle import \ 7 | XML_Pickler, XMLPicklingError, XMLUnpicklingError, \ 8 | dump, dumps, load, loads 9 | 10 | from gnosis.xml.pickle.util import \ 11 | setParanoia, getParanoia, setDeepCopy, getDeepCopy,\ 12 | get_class_from_store, add_class_to_store, remove_class_from_store,\ 13 | setParser, setVerbose, enumParsers 14 | 15 | from gnosis.xml.pickle.ext import * 16 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/gnosis/xml/pickle/__init__.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/_pickle.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/gnosis/xml/pickle/_pickle.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/doc/AUTHOR: -------------------------------------------------------------------------------- 1 | David Mertz 2 | Frank McIngvale 3 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/doc/COPYRIGHT: -------------------------------------------------------------------------------- 1 | These files are released to the public domain. I (dqm) would 2 | appreciate it if you choose to keep derived works under terms 3 | that promote freedom, but obviously am giving up any rights to 4 | compel such. 5 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/doc/THANKS_TO: -------------------------------------------------------------------------------- 1 | Grant Munsey 2 | Keith J. Farmer 3 | Anthony Baxter 4 | Joshua Macy 5 | Curtis Jensen 6 | Joe Kraska 7 | Chip Salzenberg 8 | Francesc Alted 9 | Frank McIngvale 10 | Frank Conradie 11 | Douglas Miller 12 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/doc/TODO: -------------------------------------------------------------------------------- 1 | Some things I saw in the Python 2.2(+.1c1) release notes ... need 2 | to check if these apply to us also: 3 | 4 | - The "pseudo-sequences" returned by os.stat(), os.fstat(), 5 | time.localtime() can now be pickled. 6 | 7 | - pickle.py, cPickle: allow pickling instances of new-style 8 | classes with a custom metaclass. 9 | 10 | - In pickle and cPickle, instead of masking errors in load() by 11 | transforming them into SystemError, we let the original 12 | exception propagate out. Also, implement support for 13 | __safe_for_unpickling__ in pickle, as it already was supported 14 | in cPickle. 15 | 16 | 17 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/doc/VERSION: -------------------------------------------------------------------------------- 1 | Revision: February 2004 2 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/doc/__init__.py: -------------------------------------------------------------------------------- 1 | from os import sep 2 | d = sep.join(__file__.split(sep)[:-1])+sep 3 | _= lambda f: open(d+f).read().rstrip() 4 | l= lambda f: _(f).split('\n') 5 | 6 | HOWTO = _('HOWTO') 7 | COPYRIGHT = _('COPYRIGHT') 8 | HISTORY = _('HISTORY') 9 | SECURITY = _('SECURITY') 10 | TODO = _('TODO') 11 | VERSION = _('VERSION') 12 | 13 | AUTHOR = l('AUTHOR') 14 | THANKS_TO = l('THANKS_TO') 15 | __doc__ = HOWTO 16 | 17 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/ext/__init__.py: -------------------------------------------------------------------------------- 1 | """The gnosis.xml.pickle type extension system. 2 | 3 | Please see [..]/gnosis/xml/pickle/doc/HOWTO.extensions for details 4 | """ 5 | __author__ = ["Frank McIngvale (frankm@hiwaay.net)", 6 | "David Mertz (mertz@gnosis.cx)", 7 | ] 8 | 9 | from _mutate import \ 10 | can_mutate,mutate,can_unmutate,unmutate,\ 11 | add_mutator,remove_mutator,XMLP_Mutator, XMLP_Mutated, \ 12 | get_unmutator, try_mutate 13 | 14 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/ext/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/gnosis/xml/pickle/ext/__init__.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/ext/_mutate.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/gnosis/xml/pickle/ext/_mutate.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/ext/_mutators.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/gnosis/xml/pickle/ext/_mutators.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/parsers/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/parsers/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/gnosis/xml/pickle/parsers/__init__.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/parsers/_dom.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/gnosis/xml/pickle/parsers/_dom.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/parsers/_sax.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/gnosis/xml/pickle/parsers/_sax.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/test/__init__.py: -------------------------------------------------------------------------------- 1 | # this exists only to prevent warnings during package build. 2 | # importing things from test doesn't make much sense :-) 3 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/test/funcs.py: -------------------------------------------------------------------------------- 1 | 2 | """ 3 | each test_*.py imports this to auto-set the parser based on 4 | the presence of a USE_... file 5 | 6 | -- frankm@hiwaay.net 7 | """ 8 | 9 | import os, sys, string 10 | import gnosis.xml.pickle as xml_pickle 11 | 12 | # set parser based on USE_... file present 13 | def set_parser(): 14 | if os.path.isfile('USE_SAX'): 15 | xml_pickle.setParser("SAX") 16 | elif os.path.isfile('USE_CEXPAT'): 17 | xml_pickle.setParser('cEXPAT') 18 | else: 19 | xml_pickle.setParser('DOM') 20 | 21 | # cheap substitutes for some shell functions 22 | def unlink(filename): 23 | if not os.path.isfile(filename): 24 | return 25 | 26 | # eegh ... convoluted, but this is the only 27 | # way I made it work for both Linux & Win32 28 | try: os.unlink(filename) 29 | except: pass 30 | 31 | try: os.remove(filename) 32 | except: pass 33 | 34 | def touch(filename): 35 | open(filename,'w') 36 | 37 | #def pyver(): 38 | # return string.split(sys.version)[0] 39 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/test/test_all_all.py: -------------------------------------------------------------------------------- 1 | 2 | # run test_all for all installed versions of Python 3 | # on the current machine. 4 | # 5 | # NOTE! You have to run this from the development (not installed) 6 | # tree, since it needs disthelper. 7 | 8 | import os, sys 9 | 10 | # hardcode location of disthelper 11 | dpath = os.path.abspath('../../../..') 12 | sys.path.insert(0,dpath) 13 | 14 | from disthelper.find_python import get_python_verlist 15 | 16 | for exe,info in get_python_verlist(): 17 | os.system('%s test_all.py' % exe) 18 | 19 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/test/test_circular.py: -------------------------------------------------------------------------------- 1 | import gnosis.xml.pickle as xml_pickle 2 | 3 | class Test: pass 4 | 5 | o1 = Test() 6 | o1.s = "o1" 7 | 8 | o2 = Test() 9 | o2.s = "o2" 10 | 11 | o1.obj1 = o2 12 | o1.obj2 = o2 13 | o2.obj3 = o1 14 | o2.obj4 = o1 15 | 16 | xml = xml_pickle.dumps(o1) 17 | #print xml 18 | 19 | z = xml_pickle.loads(xml) 20 | 21 | # check it 22 | if z.s != o1.s or z.obj1.s != o1.obj1.s or \ 23 | z.obj2.s != o1.obj2.s or z.obj1.obj3.s != o1.obj1.obj3.s or \ 24 | z.obj2.obj4.s != o1.obj2.obj4.s: 25 | raise "ERROR(1)" 26 | 27 | print "** OK **" 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/test/test_fail_exit.py: -------------------------------------------------------------------------------- 1 | # used for sanity checking the test harness 2 | # "fail" a test by using sys.exit(1) 3 | 4 | import sys 5 | sys.exit(1) 6 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/test/test_fail_raise_1.py: -------------------------------------------------------------------------------- 1 | # used for sanity checking the test harness 2 | # "fail" a test with an explicity raise, oldstyle 3 | 4 | raise "AAA" 5 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/test/test_fail_raise_2.py: -------------------------------------------------------------------------------- 1 | # used for sanity checking the test harness 2 | # fail a test with an explicit raise, newstyle 3 | 4 | raise Exception("AAA") 5 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/test/test_fail_raise_3.py: -------------------------------------------------------------------------------- 1 | 2 | # used for sanity checking the test harness 3 | # "fail" with an implicit raise 4 | 5 | class foo: pass 6 | f = foo() 7 | i = f.a 8 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/test/test_ftypes.py: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # show that imported classes are unpickled OK 4 | # 5 | 6 | import pickle 7 | import test_ftypes_i 8 | import gnosis.xml.pickle as xml_pickle 9 | import funcs 10 | 11 | funcs.set_parser() 12 | 13 | class foo: pass 14 | 15 | xml_pickle.setParanoia(0) 16 | 17 | f = foo() 18 | 19 | f.b = test_ftypes_i.gimme_bfunc() 20 | f.p = test_ftypes_i.gimme_pfunc() 21 | f.f = foo 22 | 23 | #print f.b, f.p, f.f 24 | 25 | x = xml_pickle.dumps(f) 26 | #print x 27 | 28 | g = xml_pickle.loads(x) 29 | 30 | #print g.b, g.p, g.f 31 | 32 | # check it 33 | for attr in ['b','p','f']: 34 | if getattr(f,attr) != getattr(g,attr): 35 | raise "ERROR(1)" 36 | 37 | print "** OK **" 38 | 39 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/test/test_ftypes_i.py: -------------------------------------------------------------------------------- 1 | 2 | # this is imported by test_ftypes 3 | 4 | def gimme_bfunc(): 5 | import time 6 | return time.time 7 | 8 | def gimme_pfunc(): 9 | return gimme_bfunc 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/test/test_gzfile.py: -------------------------------------------------------------------------------- 1 | 2 | # test binary pickling 3 | 4 | import gnosis.xml.pickle as xml_pickle 5 | import gzip 6 | from StringIO import StringIO 7 | 8 | # --- Make an object to play with --- 9 | class C: pass 10 | o = C() 11 | o.lst, o.dct = [1,2], {'spam':'eggs'} 12 | 13 | x = xml_pickle.dumps(o,1) 14 | 15 | # make sure xml_pickle really gzipped it 16 | sio = StringIO(x) 17 | gz = gzip.GzipFile('dummy','rb',9,sio) 18 | if gz.read(5) != '. 16 | # the problem is that new-style classes used as attributes weren't 17 | # being pickled correctly. 18 | 19 | # let it load my classes 20 | xml_pickle.setParanoia(0) 21 | 22 | if pyconfig.Have_ObjectClass(): # need new-style classes 23 | class PickleMeOld: 24 | def __init__(self): pass 25 | 26 | class PickleMeNew(object): 27 | def __init__(self): pass 28 | 29 | class Container(object): 30 | def __init__(self, klass): 31 | self.classRef = klass 32 | 33 | x = xml_pickle.dumps(Container(PickleMeOld)) 34 | o = xml_pickle.loads(x) 35 | if o.classRef != PickleMeOld: 36 | raise "ERROR(1)" 37 | 38 | x = xml_pickle.dumps(Container(PickleMeNew)) 39 | o = xml_pickle.loads(x) 40 | if o.classRef != PickleMeNew: 41 | raise "ERROR(2)" 42 | 43 | print "** OK **" 44 | 45 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/test/test_mixin.py: -------------------------------------------------------------------------------- 1 | # show that mixins works --fpm 2 | # 3 | 4 | import gnosis.xml.pickle as xml_pickle 5 | from gnosis.xml.pickle import XML_Pickler 6 | from gnosis.xml.pickle.util import setParanoia 7 | from UserList import UserList 8 | import funcs 9 | 10 | funcs.set_parser() 11 | 12 | class Foo: 13 | def hello(self): 14 | return "FOO!" 15 | 16 | class Bar(Foo,XML_Pickler): 17 | 18 | def __init__(self): 19 | XML_Pickler.__init__(self) 20 | 21 | def hello(self): 22 | return "BAR!" 23 | 24 | class Bat(Foo,XML_Pickler): 25 | 26 | def __init__(self): 27 | XML_Pickler.__init__(self) 28 | 29 | def hello(self): 30 | return "BAT!" 31 | 32 | class FunList(UserList,XML_Pickler): 33 | def __init__(self): 34 | XML_Pickler.__init__(self) 35 | UserList.__init__(self) 36 | 37 | # allow xml_pickle to use our imports 38 | setParanoia(0) 39 | 40 | l = FunList() 41 | l.append(Foo()) 42 | l.append(Bar()) 43 | l.append(Bat()) 44 | 45 | x = l.dumps() 46 | 47 | o = XML_Pickler().loads(x) 48 | 49 | if o[0].hello() != 'FOO!' or \ 50 | o[1].hello() != 'BAR!' or \ 51 | o[2].hello() != 'BAT!': 52 | raise "ERROR(1)" 53 | 54 | print "** OK **" 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/test/test_numpy.py: -------------------------------------------------------------------------------- 1 | 2 | import gnosis.xml.pickle as xml_pickle 3 | import Numeric,array 4 | import funcs 5 | 6 | funcs.set_parser() 7 | 8 | class foo: pass 9 | 10 | f = foo() 11 | 12 | f.a = Numeric.array([[1,2,3,4],[5,6,7,8]]) 13 | f.b = Numeric.array([1.2,2.3,3.4,4.5]) 14 | f.y = array.array('b',[1,2,3,4]) 15 | f.z = array.array('f',[1,2,3,4]) 16 | 17 | a = Numeric.array([6,7,8,9]) 18 | 19 | def testfoo(o1,o2): 20 | for attr in ['a','b','y','z', 21 | 'l','d','e']: 22 | if getattr(o1,attr) != getattr(o2,attr): 23 | raise "ERROR(1)" 24 | 25 | # make sure refs work 26 | f.l = [a,a,a] 27 | 28 | f.d = {'One':a,'Two':Numeric.array([10,11,12])} 29 | f.e = f.d['Two'] 30 | 31 | #print f.a, f.b, f.y,f.z,f.l,f.d,f.e 32 | 33 | x = xml_pickle.dumps(f) 34 | #print x 35 | 36 | #del f 37 | 38 | g = xml_pickle.loads(x) 39 | #print g.a,g.b,g.y,g.z,g.l,g.d,g.e 40 | 41 | #print "XML ", x 42 | 43 | testfoo(f,g) 44 | 45 | print "** OK **" 46 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/test/test_objectify.py: -------------------------------------------------------------------------------- 1 | 2 | """Make sure xml_pickle and xml_objectify play nicely together --dqm 3 | Note that xml_pickle no longer has any builtin knowledge of 4 | xml_objectify -- used to be necessary to workaround circular refs (fpm)""" 5 | 6 | import gnosis.xml.objectify as xo 7 | import gnosis.xml.pickle as xp 8 | from StringIO import StringIO 9 | import funcs 10 | 11 | funcs.set_parser() 12 | 13 | xml = ''' 14 | 15 | 16 | Some text about eggs. 17 | Ode to Spam 18 | 19 | ''' 20 | 21 | fh = StringIO(xml) 22 | o = xo.make_instance(xml) 23 | s = xp.dumps(o) 24 | #print "---------- xml_objectify'd object, xml_pickle'd ----------" 25 | #print s 26 | o2 = xp.loads(s) 27 | #print "---------- object after the pickle/unpickle cycle --------" 28 | #print xp.dumps(o2) 29 | 30 | if o.Eggs.PCDATA != o2.Eggs.PCDATA or \ 31 | o.MoreSpam.PCDATA != o2.MoreSpam.PCDATA: 32 | raise "ERROR(1)" 33 | 34 | print "** OK **" 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/test/test_pass_1.py: -------------------------------------------------------------------------------- 1 | 2 | # used for sanity checking the test harness 3 | # a NOP "pass" test 4 | 5 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/test/test_pass_2.py: -------------------------------------------------------------------------------- 1 | # used for sanity checking the test harness 2 | # a "pass" test by sys.exit(0) 3 | 4 | import sys 5 | sys.exit(0) 6 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/test/test_pass_3.py: -------------------------------------------------------------------------------- 1 | # used for sanity checking the test harness 2 | # a "pass" test that prints something 3 | 4 | print "** OK **" 5 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/test/test_ref.py: -------------------------------------------------------------------------------- 1 | "Demonstrate what happens with/without DEEPCOPY --fpm" 2 | 3 | import gnosis.xml.pickle as xml_pickle 4 | from gnosis.xml.pickle.util import setParanoia, setDeepCopy 5 | from UserList import UserList 6 | import sys 7 | import funcs 8 | 9 | funcs.set_parser() 10 | 11 | a = (1,2,3) 12 | b = [4,5,6] 13 | c = {'a':1,'b':2,'c':3,'d':[100,200,300]} 14 | dd = c['d'] # make sure subitems get refchecked 15 | uu = UserList([10,11,12]) 16 | 17 | u = UserList([[uu,c,b,a],[a,b,c,uu],[c,a,b,uu],dd]) 18 | #print u 19 | 20 | # allow xml_pickle to read our namespace 21 | setParanoia(0) 22 | 23 | # by default, with references 24 | x1 = xml_pickle.dumps(u) 25 | #print x 26 | #del u 27 | 28 | g = xml_pickle.loads(x1) 29 | #print g 30 | 31 | if u != g: 32 | raise "ERROR(1)" 33 | 34 | # next, using DEEPCOPY 35 | #print "------ DEEP COPY ------" 36 | setDeepCopy(1) 37 | x2 = xml_pickle.dumps(g) 38 | #print x 39 | #del g 40 | 41 | z = xml_pickle.loads(x2) 42 | 43 | # deepcopy version should be significantly larger 44 | if (len(x2) - len(x1)) < 1000: 45 | raise "ERROR(2)" 46 | 47 | if z != g: 48 | raise "ERROR(3)" 49 | 50 | print "** OK **" 51 | 52 | 53 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/test/test_slots.py: -------------------------------------------------------------------------------- 1 | 2 | "Simple __slots__ test" 3 | 4 | import gnosis.xml.pickle as xml_pickle 5 | import funcs 6 | 7 | funcs.set_parser() 8 | 9 | class foo(object): 10 | __slots__ = ('a','b') 11 | 12 | xml_pickle.setParanoia(0) 13 | 14 | f = foo() 15 | f.a = 1 16 | f.b = 2 17 | #print f.a, f.b 18 | 19 | s = xml_pickle.dumps(f) 20 | #print s 21 | 22 | g = xml_pickle.loads(s) 23 | #print g.a, g.b 24 | 25 | if g.__class__ != foo or g.a != f.a or g.b != f.b: 26 | raise "ERROR(1)" 27 | 28 | print "** OK **" 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/util/__init__.py: -------------------------------------------------------------------------------- 1 | from _flags import * 2 | from _util import \ 3 | _klass, _module, _EmptyClass, subnodes, \ 4 | safe_eval, safe_string, unsafe_string, safe_content, unsafe_content, \ 5 | _mini_getstack, _mini_currentframe, \ 6 | get_class_from_stack, get_class_full_search, get_class_from_vapor, \ 7 | get_class_from_store, add_class_to_store, remove_class_from_store, \ 8 | get_class_from_name, obj_from_name, get_function_info, \ 9 | unpickle_function, obj_from_classtype 10 | 11 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/util/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/gnosis/xml/pickle/util/__init__.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/util/_flags.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/gnosis/xml/pickle/util/_flags.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/pickle/util/_util.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/gnosis/xml/pickle/util/_util.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/README: -------------------------------------------------------------------------------- 1 | Example files and programming tools for working with RELAX NG 2 | 3 | Some of these files are part of James Clark's test suite (see 4 | clark.html for some details). 5 | 6 | All of the examples and scripts (unless indicated otherwise within 7 | the file) are released to the Public Domain. 8 | 9 | +++ 10 | 11 | To utilize the utility 'rnc2rng' download the following files, 12 | and place them in a working directory (or in your $PYTHONPATH): 13 | 14 | rnc2rng 15 | rnctree.py 16 | rnc_tokenize.py 17 | lex.py 18 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/gnosis/xml/relax/__init__.py -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/cardinality.rnc: -------------------------------------------------------------------------------- 1 | start = element bar { fivefoo, upto25foo } 2 | fivefoo = 3 | element foo { empty }, 4 | element foo { empty }, 5 | element foo { empty }, 6 | element foo { empty }, 7 | element foo { empty } 8 | maybefoo = element foo { empty }? 9 | upto25foo = 10 | fivefoo?, 11 | fivefoo?, 12 | fivefoo?, 13 | fivefoo?, 14 | maybefoo, 15 | maybefoo, 16 | maybefoo, 17 | maybefoo, 18 | maybefoo 19 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/cardinality.rng: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/clark.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | RELAX NG Test Suite 4 | 5 | 6 | 7 |

This is a test suite for the final version of the RELAX 9 | NG 1.0 Specification.

10 | 11 |

The test suite consists of a single XML file spectest.xml, which includes over 300 test 13 | cases. Each test case consists of a correct or incorrect RELAX NG 14 | schema and zero or more valid or invalid instances. A RELAX NG schema is available that specifies the format 16 | of the test suite.

17 | 18 |

In order to run the test suite it may be convenient to split it up 19 | into separate files. An XSLT stylesheet split.xsl is included to do this. This stylesheet 21 | uses SAXON extensions. Jing 23 | includes a class to run the test suite after it has been split up. 24 | The class is com.thaiopensource.relaxng.util.TestDriver. 25 | This class must be invoked with two arguments. The first argument is 26 | a log file for expected errors. The second argument is the directory 27 | containing the split-up test suite.

28 | 29 |
30 | James Clark 31 |
32 | 33 | 34 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/conv08.rnc: -------------------------------------------------------------------------------- 1 | include "res08.rnc" 2 | foo.body = text 3 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/conv08.rng: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/conv09.rng: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/curious.dtd: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/curious.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/patron-i1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | John Doe 5 | Second Name 6 | 12345678 7 | 8 | 9 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/patron-i2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | John Doe 4 | 12345678 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/patron-i3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/patron-v1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | John Doe 5 | 12345678 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/patron-v2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 09876545 4 | Jane Moe 5 | 6 | 7 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/patron.rnc: -------------------------------------------------------------------------------- 1 | element patron { 2 | element name { text } 3 | & element id-num { text } 4 | & element book { 5 | attribute isbn { text } 6 | | attribute title { text } 7 | }* 8 | } 9 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/patron.rng: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/patron.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/regextest.rnc: -------------------------------------------------------------------------------- 1 | # A schema for regextest.rnc in RELAX NG compact syntax 2 | 3 | element testSuite { 4 | element testCase { 5 | (element correct { text }, element valid|invalid { text }*) 6 | | element incorrect { text } 7 | }* 8 | } 9 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/res08.rnc: -------------------------------------------------------------------------------- 1 | start = element foo { foo.body } 2 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/res08.rng: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/res09.rng: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/rnc2rng: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import sys 3 | from rnctree import make_nodetree, token_list 4 | if len(sys.argv) > 1: 5 | tokens = token_list(open(sys.argv[1]).read()) 6 | else: 7 | tokens = token_list(sys.stdin.read()) 8 | root = make_nodetree(tokens) 9 | if len(sys.argv) > 2: 10 | open(sys.argv[2],'w').write(root.toxml()) 11 | else: 12 | print root.toxml() 13 | 14 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/xmlcat: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import sys 3 | from xml.sax import handler, make_parser 4 | from xml.sax.saxutils import escape 5 | 6 | class ContentGenerator(handler.ContentHandler): 7 | def __init__(self, out=sys.stdout): 8 | handler.ContentHandler.__init__(self) 9 | self._out = out 10 | def startDocument(self): 11 | xml_decl = '\n' 12 | self._out.write(xml_decl) 13 | def endDocument(self): 14 | self._out.write('\n') 15 | def startElement(self, name, attrs): 16 | self._out.write('<' + name) 17 | name_val = attrs.items() 18 | name_val.sort() # canonicalize attributes 19 | for (name, value) in name_val: 20 | self._out.write(' %s="%s"' % (name, escape(value))) 21 | self._out.write('>') 22 | def endElement(self, name): 23 | self._out.write('' % name) 24 | def characters(self, content): 25 | self._out.write(escape(content)) 26 | def ignorableWhitespace(self, content): 27 | self._out.write(content) 28 | def processingInstruction(self, target, data): 29 | self._out.write('' % (target, data)) 30 | 31 | if __name__=='__main__': 32 | parser = make_parser() 33 | parser.setContentHandler(ContentGenerator()) 34 | parser.parse(sys.argv[1]) 35 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/relax/xsdtest.rnc: -------------------------------------------------------------------------------- 1 | datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" 2 | 3 | start = 4 | element xsdtest { 5 | element datatype { 6 | attribute name { xsd:NCName }, 7 | ((param*, (valid|invalid)*) 8 | | (valid|invalid|equiv|length|lessThan|incomparable)*) 9 | }* 10 | } 11 | 12 | param = element param { attribute name { xsd:NCName }, string } 13 | valid = element valid { internalSubset?, string } 14 | invalid = element invalid { internalSubset?, string } 15 | equiv = element equiv { element class { value+ }+ } 16 | 17 | value = element value { internalSubset?, string } 18 | length = element length { attribute value { xsd:integer }, internalSubset?, string } 19 | lessThan = element lessThan { value, value } 20 | incomparable = element incomparable { value, value } 21 | 22 | internalSubset = attribute internalSubset { string } 23 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/validity/__init__.py: -------------------------------------------------------------------------------- 1 | """Library of Python objects that conform to XML validity rules 2 | 3 | Requires: Python 2.2+ 4 | (may use new-style classes, slots, properties, metaclasses) 5 | """ 6 | 7 | from _validity import * 8 | 9 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/validity/dtdgen.py: -------------------------------------------------------------------------------- 1 | from gnosis.magic import DTDGenerator, \ 2 | import_with_metaclass, from_import 3 | 4 | diss = import_with_metaclass('dissertation', DTDGenerator) 5 | from_import(diss,'**') 6 | 7 | if __name__=='__main__': 8 | from gnosis.xml.validity import PCDATA 9 | class section(Seq): _order = (dedication, chapter) 10 | sect = LiftSeq(section,('To Mom', 11 | ('It starts','When it began...'))) 12 | 13 | print sect 14 | print sect.with_internal_subset() 15 | 16 | print eval(explicit_section).with_internal_subset() 17 | print eval(lifting_section).with_internal_subset() 18 | 19 | "Miscellaneous other typical uses" 20 | p = paragraph(['spam and eggs', figure(), 'toast']) 21 | ps_ch1 = _paras([ p, paragraph('this and that'), "something else", 22 | paragraph(_mixedpara(figure())), 23 | paragraph(['stuff', table(), PCDATA('still more')]) 24 | ]) 25 | chap1 = chapter((title('My chapter'), ps_ch1)) 26 | dedict = _dedi(dedication("To Mom")) 27 | diss = LiftSeq( dissertation, ([], _chaps(chap1), _apps()) ) 28 | ps_ch1 += [ "friend, romans, countrymen", 29 | paragraph([figure(), table(), figure()]) ] 30 | ps_ch1.append("whatever") 31 | ps_ch1 += "Just words" 32 | del ps_ch1[-2] 33 | print diss.with_internal_subset() 34 | 35 | 36 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/validity/simple_diss.py: -------------------------------------------------------------------------------- 1 | from gnosis.xml.validity import * 2 | class figure(EMPTY): pass 3 | class _mixedpara(Or): _disjoins = (PCDATA, figure) 4 | class paragraph(Some): _type = _mixedpara 5 | class title(PCDATA): pass 6 | class _paras(Some): _type = paragraph 7 | class chapter(Seq): _order = (title, _paras) 8 | class dissertation(Some): _type = chapter 9 | 10 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/gnosis/xml/xmlmap.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/gnosis/xml/xmlmap.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/i18n/README: -------------------------------------------------------------------------------- 1 | To generate message.pot file: 2 | 3 | python mki18n.py -p --domain=objdictgen 4 | 5 | To generate .mo files for all languages: 6 | 7 | python mki18n.py -m --moTarget=../locale --domain=objdictgen 8 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/i18n/app.fil: -------------------------------------------------------------------------------- 1 | ../commondialogs.py 2 | ../eds_utils.py 3 | ../gen_cfile.py 4 | ../networkedit.py 5 | ../nodelist.py 6 | ../nodemanager.py 7 | ../objdictedit.py 8 | ../objdictgen.py 9 | ../subindextable.py 10 | -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/locale/fr_FR/LC_MESSAGES/objdictgen.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/locale/fr_FR/LC_MESSAGES/objdictgen.mo -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/locale/zh_CN/LC_MESSAGES/objdictgen.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/locale/zh_CN/LC_MESSAGES/objdictgen.mo -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/networkedit.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/networkedit.ico -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/networkedit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/networkedit.png -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/node.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/node.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/nodemanager.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/nodemanager.pyc -------------------------------------------------------------------------------- /lib/CanFestival-3/objdictgen/subindextable.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/CanFestival-3/objdictgen/subindextable.pyc -------------------------------------------------------------------------------- /lib/EEPROMEmulation_AN/13718.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/EEPROMEmulation_AN/13718.pdf -------------------------------------------------------------------------------- /lib/MEMS/mems_accel.c: -------------------------------------------------------------------------------- 1 | 2 | #include "mems_accel.h" 3 | 4 | void accel_init(struct accel_t *in) { 5 | int i; 6 | 7 | for (i=0; i<3; i++) { 8 | kalman_init(&in->filter[i], 0.001, 10); 9 | 10 | in->norm[i].coef_num = 2; 11 | in->norm[i].coef[0] = mems_ONE; 12 | in->norm[i].coef[1] = mems_ZERO; 13 | 14 | in->data.coef[i] = 0; 15 | } 16 | } 17 | 18 | void accel_process(struct accel_t *out, struct accel_raw_t *in) { 19 | struct vector_t vect_tmp; 20 | int i; 21 | 22 | for (i=0; i<3; i++) { 23 | vect_tmp.coef[i] = norm_process(&out->norm[i], in->data[i]); 24 | vect_tmp.coef[i] = kalman_process(&out->filter[i], vect_tmp.coef[i]); 25 | } 26 | // apply alignment 27 | matrix_mul(&out->data, &out->align, &vect_tmp); 28 | } 29 | 30 | void accel_normalize(struct accel_t *out, struct accel_raw_t *in) { 31 | int i; 32 | 33 | for (i=0; i<3; i++) { 34 | out->data.coef[i] = norm_process(&out->norm[i], in->data[i]); 35 | } 36 | } 37 | 38 | void accel_filter(struct accel_t *in) { 39 | int i; 40 | 41 | for (i=0; i<3; i++) { 42 | in->data.coef[i] = kalman_process(&in->filter[i], in->data.coef[i]); 43 | } 44 | } 45 | 46 | void accel_align(struct accel_t *in) { 47 | struct vector_t vect_tmp; 48 | int i; 49 | 50 | for (i=0; i<3; i++) { 51 | vect_tmp.coef[i] = in->data.coef[i]; 52 | } 53 | // apply alignment 54 | matrix_mul(&in->data, &in->align, &vect_tmp); 55 | } 56 | 57 | -------------------------------------------------------------------------------- /lib/MEMS/mems_accel.h: -------------------------------------------------------------------------------- 1 | #ifndef MEMS_ACCEL_h_ 2 | #define MEMS_ACCEL_h_ 3 | 4 | #include 5 | 6 | #include "mems_kalman.h" 7 | #include "mems_norm.h" 8 | #include "mems_vector.h" 9 | #include "mems_quaternion.h" 10 | 11 | enum { 12 | axis_X, 13 | axis_Y, 14 | axis_Z 15 | }; 16 | 17 | struct accel_raw_t { 18 | uint16_t data[3]; 19 | }; 20 | 21 | struct accel_t { 22 | struct vector_t data; 23 | 24 | struct norm_t norm[3]; 25 | struct kalman_t filter[3]; 26 | struct matrix_t align; 27 | }; 28 | 29 | void accel_init(struct accel_t *); 30 | void accel_process(struct accel_t *out, struct accel_raw_t *in); 31 | void accel_normalize(struct accel_t *, struct accel_raw_t *); 32 | void accel_filter(struct accel_t *); 33 | void accel_align(struct accel_t *); 34 | 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /lib/MEMS/mems_gyro.c: -------------------------------------------------------------------------------- 1 | #include "mems_gyro.h" 2 | 3 | void gyro_init(struct gyro_t *g) { 4 | 5 | kalman_init(&g->filter, 0.5*0.05, 0.1); 6 | g->norm.coef_num = 2; 7 | // TODO: move from here 8 | g->norm.coef[0] = 0.07326; // Hw dependent 9 | g->norm.coef[1] = mems_ZERO; 10 | 11 | g->rate = 0; 12 | g->angle = 0; 13 | } 14 | 15 | void gyro_process(struct gyro_t *out, struct gyro_raw_t *in) { 16 | frac tmp_rate; 17 | 18 | // 12bit 2s complement 19 | tmp_rate = (in->rate>0x2000)?in->rate-0x4000:in->rate; 20 | 21 | out->rate = norm_process(&out->norm, tmp_rate); 22 | out->rate = kalman_process(&out->filter, out->rate); 23 | 24 | out->angle = in->angle * 0.03663; // HW dependent (testing only) 25 | } 26 | -------------------------------------------------------------------------------- /lib/MEMS/mems_gyro.h: -------------------------------------------------------------------------------- 1 | #ifndef MEMS_GYRO_h_ 2 | #define MEMS_GYRO_h_ 3 | 4 | #include 5 | 6 | #include "mems_kalman.h" 7 | #include "mems_norm.h" 8 | #include "mems_vector.h" 9 | #include "mems_quaternion.h" 10 | 11 | struct gyro_raw_t { 12 | uint16_t rate; 13 | uint16_t angle; 14 | uint16_t temp; 15 | }; 16 | 17 | struct gyro_t { 18 | frac rate; 19 | // measured angle by the device 20 | // for testing purpose only 21 | frac angle; 22 | 23 | struct norm_t norm; 24 | struct kalman_t filter; 25 | }; 26 | 27 | void gyro_init(struct gyro_t *); 28 | void gyro_process(struct gyro_t *out, struct gyro_raw_t *in); 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /lib/MEMS/mems_kalman.c: -------------------------------------------------------------------------------- 1 | 2 | #include "mems_kalman.h" 3 | 4 | /** Initializes Kalman filter internal structure 5 | * 6 | * @param kf kalman_t structure pointer 7 | * @param Q process noise covariance 8 | * @param R measurement noise covariance 9 | */ 10 | void kalman_init(struct kalman_t *kf, frac Q, frac R) { 11 | kf->Xhat = mems_ZERO; 12 | kf->P = mems_ZERO; 13 | 14 | kf->Q = Q; 15 | kf->R = R; 16 | } 17 | 18 | /** Processes measurement, and predicts true state of aparatus 19 | * predicted result is available as "kf->Xhat" 20 | * 21 | * @param kf initialized kalman_t structure 22 | * @param z measured value 23 | */ 24 | frac kalman_process(struct kalman_t *kf, frac z) { 25 | frac Xhat_last; 26 | frac Plast; 27 | frac K; 28 | frac Inn; 29 | 30 | Xhat_last = kf->Xhat; 31 | Plast = mems_add(kf->P, kf->Q); 32 | 33 | /* UPDATE */ 34 | /* calculate Kalman gain */ 35 | K = mems_div(Plast, mems_add(Plast, kf->R)); 36 | 37 | 38 | /* calculate inovation vector */ 39 | Inn = mems_sub(z, Xhat_last); 40 | 41 | /* update estimate of state */ 42 | kf->Xhat = mems_add(Xhat_last, mems_mul(K, Inn)); 43 | 44 | /* update estimate error covariance */ 45 | kf->P = mems_mul(mems_sub(mems_ONE, K), Plast); 46 | 47 | return kf->Xhat; 48 | } 49 | 50 | -------------------------------------------------------------------------------- /lib/MEMS/mems_kalman.h: -------------------------------------------------------------------------------- 1 | #ifndef MEMS_KALMAN_h_ 2 | #define MEMS_KALMAN_h_ 3 | 4 | #include "mems_math.h" 5 | 6 | struct kalman_t { 7 | /* estimated output */ 8 | frac Xhat; 9 | /* estimated error covariance */ 10 | frac P; 11 | /* process noise covariance*/ 12 | frac Q; 13 | /* measurement noise covariance */ 14 | frac R; 15 | 16 | }; 17 | 18 | void kalman_init(struct kalman_t*, frac Q, frac R); 19 | frac kalman_process(struct kalman_t *kf, frac z); 20 | 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /lib/MEMS/mems_math.c: -------------------------------------------------------------------------------- 1 | #include "mems_math.h" 2 | 3 | #ifdef MEMS_FIXEDPOINT 4 | 5 | accum mems_sqrt (accum x) { 6 | accum squaredbit, root; 7 | 8 | if (x<1) return 0; 9 | 10 | squaredbit = (accum) ((((uint64_t) ~0L) >> 1) & ~(((uint64_t) ~0L) >> 2)); 11 | 12 | /* Form bits of the answer. */ 13 | isqrt_rem = x; 14 | root = 0; 15 | 16 | while (squaredbit > 0) { 17 | if (isqrt_rem >= (squaredbit | root)) { 18 | isqrt_rem -= (squaredbit | root); 19 | root >>= 1; 20 | root |= squaredbit; 21 | } else { 22 | root >>= 1; 23 | } 24 | squaredbit >>= 2; 25 | } 26 | return root; 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /lib/MEMS/mems_matrix.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Matrix multiplication 3 | * 4 | * 2009-2010 Michal Demin 5 | * 6 | */ 7 | #include "mems_matrix.h" 8 | 9 | void matrix_mul(struct vector_t *out, struct matrix_t *m, struct vector_t *v1) { 10 | int i; 11 | int j; 12 | 13 | for (i=0; i<3; i++) { 14 | out->coef[i] = mems_ZERO; 15 | for (j=0; j<3; j++) { 16 | frac tmp = mems_mul(m->coef[i][j], v1->coef[j]); 17 | out->coef[i] = mems_add(out->coef[i], tmp); 18 | } 19 | } 20 | 21 | } 22 | 23 | -------------------------------------------------------------------------------- /lib/MEMS/mems_matrix.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Matrix multiplication 3 | * 4 | * 2009-2010 Michal Demin 5 | * 6 | */ 7 | #ifndef MEMS_MATRIX_H_ 8 | #define MEMS_MATRIX_H_ 9 | 10 | #include "mems_math.h" 11 | 12 | #include "mems_vector.h" 13 | 14 | struct matrix_t { 15 | frac coef [3][3]; 16 | }; 17 | 18 | void matrix_mul(struct vector_t *out, struct matrix_t *m, struct vector_t *v1); 19 | 20 | #endif 21 | 22 | -------------------------------------------------------------------------------- /lib/MEMS/mems_norm.c: -------------------------------------------------------------------------------- 1 | #include "mems_norm.h" 2 | 3 | /* applies coeficients using horners scheme 4 | * args: 5 | * *norm - pointer to the structure with coeficients 6 | * z - input value 7 | * 8 | */ 9 | frac norm_process(struct norm_t *norm, frac z) { 10 | frac out = mems_ZERO; 11 | int i; 12 | 13 | for (i=0; icoef_num; i++) { 14 | out = mems_add(mems_mul(out, z), norm->coef[i]); 15 | } 16 | 17 | return out; 18 | 19 | } 20 | 21 | -------------------------------------------------------------------------------- /lib/MEMS/mems_norm.h: -------------------------------------------------------------------------------- 1 | #ifndef MEMS_NORM_h_ 2 | #define MEMS_NORM_h_ 3 | 4 | #include "mems_math.h" 5 | 6 | struct norm_t { 7 | int coef_num; 8 | frac coef[3]; 9 | }; 10 | 11 | frac norm_process(struct norm_t *, frac in); 12 | 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /lib/MEMS/mems_pos.h: -------------------------------------------------------------------------------- 1 | #ifndef MEMS_POSITION_h_ 2 | #define MEMS_POSITION_h_ 3 | 4 | #include "mems_math.h" 5 | #include "mems_accel.h" 6 | #include "mems_gyro.h" 7 | 8 | struct mems_sensors_t { 9 | struct accel_t accel; 10 | struct gyro_t gyro; 11 | }; 12 | 13 | 14 | struct position_t { 15 | frac dt; 16 | 17 | frac x; 18 | frac y; 19 | 20 | frac vx; 21 | frac vy; 22 | 23 | frac ax; 24 | frac ay; 25 | 26 | frac angle; 27 | frac omega; 28 | 29 | }; 30 | 31 | frac angle_normalize(frac); 32 | 33 | void position_init(struct position_t *pos, frac idt); 34 | 35 | void position_process_measurement(struct position_t *pos, struct mems_sensors_t *sens); 36 | void position_process_angle(struct position_t *pos, frac omega); 37 | void position_process_accel(struct position_t *pos, frac iax, frac iay); 38 | void position_process_speed(struct position_t *pos, frac ivx, frac ivy); 39 | 40 | void position_update(struct position_t *pos); 41 | 42 | void position_print(struct position_t *pos); 43 | 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /lib/MEMS/mems_quaternion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * quaternion 3 | * 4 | * 2009-2010 Michal Demin 5 | * 6 | */ 7 | #ifndef MEMS_QUATERNION_H_ 8 | #define MEMS_QUATERNION_H_ 9 | 10 | #include "mems_math.h" 11 | 12 | #include "mems_matrix.h" 13 | #include "mems_vector.h" 14 | 15 | struct quaternion_t { 16 | frac coef[4]; 17 | }; 18 | 19 | void quaternion_toRotMatrix(struct quaternion_t *q, struct matrix_t *m); 20 | struct vector_t *quaternion_rotate(struct quaternion_t *q, struct vector_t *v); 21 | struct quaternion_t *quaternion_align(struct quaternion_t *q, struct vector_t *v1, struct vector_t *v2); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /lib/MEMS/mems_vector.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Vector manipulation 3 | * 4 | * 2009-2010 Michal Demin 5 | * 6 | */ 7 | #ifndef MEMS_VECTOR_H_ 8 | #define MEMS_VECTOR_H_ 9 | 10 | #include "mems_math.h" 11 | 12 | struct vector_t { 13 | frac coef[3]; 14 | }; 15 | 16 | 17 | frac vector_dot(struct vector_t* v1, struct vector_t *v2); 18 | struct vector_t* vector_cross(struct vector_t *out, struct vector_t* v1, struct vector_t *v2); 19 | frac vector_len(struct vector_t *v); 20 | void vector_scale(struct vector_t *v, frac); 21 | void vector_normalize(struct vector_t *v); 22 | struct vector_t *vector_add(struct vector_t *out, struct vector_t* v1, struct vector_t *v2); 23 | 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /lib/STM32F10x_StdPeriph_Driver/inc/stm32f10x_fsmc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/STM32F10x_StdPeriph_Driver/inc/stm32f10x_fsmc.h -------------------------------------------------------------------------------- /lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_adc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_adc.c -------------------------------------------------------------------------------- /lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_can.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_can.c -------------------------------------------------------------------------------- /lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_dma.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_dma.c -------------------------------------------------------------------------------- /lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_exti.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_exti.c -------------------------------------------------------------------------------- /lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c -------------------------------------------------------------------------------- /lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_fsmc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_fsmc.c -------------------------------------------------------------------------------- /lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_i2c.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_i2c.c -------------------------------------------------------------------------------- /lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_rcc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_rcc.c -------------------------------------------------------------------------------- /lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_rtc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_rtc.c -------------------------------------------------------------------------------- /lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_sdio.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_sdio.c -------------------------------------------------------------------------------- /lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_tim.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_tim.c -------------------------------------------------------------------------------- /lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_usart.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robots/STM32/846271b5b5582f3b0c17a28dd124c02876dd868b/lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_usart.c --------------------------------------------------------------------------------