├── Changelog.txt ├── bsd.txt ├── demo ├── AT91SAM7X_ROWLEY │ ├── FreeRTOS │ │ ├── croutine.c │ │ ├── include │ │ │ ├── FreeRTOS.h │ │ │ ├── croutine.h │ │ │ ├── list.h │ │ │ ├── portable.h │ │ │ ├── portable.h.bak │ │ │ ├── projdefs.h │ │ │ ├── queue.h │ │ │ ├── semphr.h │ │ │ └── task.h │ │ ├── list.c │ │ ├── portable │ │ │ ├── GCC │ │ │ │ └── ARM7_AT91SAM7S │ │ │ │ │ ├── port.c │ │ │ │ │ ├── portISR.c │ │ │ │ │ └── portmacro.h │ │ │ └── MemMang │ │ │ │ ├── heap_1.c │ │ │ │ ├── heap_2.c │ │ │ │ └── heap_3.c │ │ ├── queue.c │ │ └── tasks.c │ ├── FreeRTOSConfig.h │ ├── demo.c │ ├── demo.hzp │ ├── demo.hzs │ ├── port │ │ ├── port.h │ │ ├── portevent.c │ │ ├── portother.c │ │ ├── portserial.c │ │ └── porttimer.c │ ├── support │ │ ├── AT91SAM7X256.h │ │ ├── AT91SAM7_target.js │ │ └── lib_AT91SAM7X256.h │ └── system │ │ ├── crt0.s │ │ └── startup.s ├── ATSAM3S │ ├── README.txt │ ├── board │ │ ├── at91sam3s4 │ │ │ ├── AT91SAM3S4.h │ │ │ ├── chip.h │ │ │ ├── flash.icf │ │ │ ├── flash.lds │ │ │ ├── sram.icf │ │ │ ├── sram.lds │ │ │ ├── sram_flashloader.icf │ │ │ └── sram_samba.lds │ │ ├── at91sam3u4 │ │ │ ├── AT91SAM3U4.h │ │ │ ├── chip.h │ │ │ ├── flash.icf │ │ │ ├── flash.lds │ │ │ ├── flash.sct │ │ │ ├── psram.icf │ │ │ ├── psram.lds │ │ │ ├── psram.sct │ │ │ ├── sram.icf │ │ │ ├── sram.lds │ │ │ ├── sram.sct │ │ │ └── sram_samba.lds │ │ ├── board.h │ │ ├── board_cstartup_gnu.c │ │ ├── board_cstartup_iar.c │ │ ├── board_cstartup_keil.c │ │ ├── board_lowlevel.c │ │ ├── board_lowlevel.h │ │ ├── board_memories.c │ │ ├── board_memories.h │ │ ├── exceptions.c │ │ └── exceptions.h │ ├── demo.c │ ├── demo.ewp │ ├── demo.eww │ ├── demo_rtu.bat │ ├── libraries │ │ ├── cmsis │ │ │ ├── core_cm3.c │ │ │ └── core_cm3.h │ │ └── drivers │ │ │ ├── acc │ │ │ ├── acc.c │ │ │ └── acc.h │ │ │ ├── adc │ │ │ ├── adc.c │ │ │ └── adc.h │ │ │ ├── async │ │ │ ├── async.c │ │ │ └── async.h │ │ │ ├── crccu │ │ │ ├── crccu.c │ │ │ └── crccu.h │ │ │ ├── dacc │ │ │ ├── dacc.c │ │ │ └── dacc.h │ │ │ ├── efc │ │ │ ├── efc.c │ │ │ └── efc.h │ │ │ ├── flash │ │ │ ├── flashd.c │ │ │ └── flashd.h │ │ │ ├── lcd │ │ │ ├── color.h │ │ │ ├── draw.c │ │ │ ├── draw.h │ │ │ ├── font.c │ │ │ ├── font.h │ │ │ ├── font10x14.h │ │ │ ├── lcdd.c │ │ │ └── lcdd.h │ │ │ ├── pio │ │ │ ├── pio.c │ │ │ ├── pio.h │ │ │ ├── pio_it.c │ │ │ ├── pio_it.h │ │ │ ├── pio_keypad.c │ │ │ └── pio_keypad.h │ │ │ ├── pmc │ │ │ ├── pmc.c │ │ │ └── pmc.h │ │ │ ├── pwmc │ │ │ ├── pwmc.c │ │ │ └── pwmc.h │ │ │ ├── qtouch │ │ │ ├── libQTouchIarCfg3SRevABeta1.txt │ │ │ ├── libQTouchIarCfg3SRevABeta2.txt │ │ │ └── libQTouchIarCfg3SRevB.txt │ │ │ ├── rtc │ │ │ ├── rtc.c │ │ │ └── rtc.h │ │ │ ├── rtt │ │ │ ├── rtt.c │ │ │ └── rtt.h │ │ │ ├── spi-flash │ │ │ ├── at45d.c │ │ │ ├── at45d.h │ │ │ ├── spi_at45.c │ │ │ ├── spi_at45.h │ │ │ ├── spi_pdc.c │ │ │ └── spi_pdc.h │ │ │ ├── spi │ │ │ ├── spi.c │ │ │ └── spi.h │ │ │ ├── ssc │ │ │ ├── ssc.c │ │ │ └── ssc.h │ │ │ ├── tc │ │ │ ├── tc.c │ │ │ └── tc.h │ │ │ ├── tsd │ │ │ ├── tsd.h │ │ │ ├── tsd_ads7843.c │ │ │ ├── tsd_ads7843.h │ │ │ ├── tsd_com.c │ │ │ └── tsd_com.h │ │ │ ├── twi │ │ │ ├── twi.c │ │ │ ├── twi.h │ │ │ ├── twid.c │ │ │ └── twid.h │ │ │ ├── usart │ │ │ ├── uart_console.c │ │ │ ├── uart_console.h │ │ │ ├── usart.c │ │ │ └── usart.h │ │ │ ├── utility │ │ │ ├── assert.h │ │ │ ├── bitbanding.h │ │ │ ├── bmp.c │ │ │ ├── bmp.h │ │ │ ├── clock.c │ │ │ ├── clock.h │ │ │ ├── encryption │ │ │ │ ├── aes_hardware.c │ │ │ │ ├── aes_hardware.h │ │ │ │ ├── aes_reference.c │ │ │ │ ├── aes_reference.h │ │ │ │ ├── encryption.h │ │ │ │ ├── libtomcrypt.c │ │ │ │ ├── libtomcrypt.h │ │ │ │ ├── tdes_hardware.c │ │ │ │ └── tdes_hardware.h │ │ │ ├── hamming.c │ │ │ ├── hamming.h │ │ │ ├── iap.c │ │ │ ├── iap.h │ │ │ ├── led.c │ │ │ ├── led.h │ │ │ ├── math.c │ │ │ ├── math.h │ │ │ ├── rand.c │ │ │ ├── rand.h │ │ │ ├── retarget.c │ │ │ ├── stdio.c │ │ │ ├── string.c │ │ │ ├── trace.c │ │ │ ├── trace.h │ │ │ ├── util.c │ │ │ ├── util.h │ │ │ ├── utility.dir │ │ │ ├── video.c │ │ │ ├── video.h │ │ │ ├── wav.c │ │ │ └── wav.h │ │ │ └── wdt │ │ │ ├── wdt.c │ │ │ └── wdt.h │ └── port │ │ ├── port.h │ │ ├── portevent.c │ │ ├── portother.c │ │ ├── portserial.c │ │ └── porttimer.c ├── ATSAM3S_FREERTOS │ ├── README.txt │ ├── board │ │ ├── at91sam3s4 │ │ │ ├── AT91SAM3S4.h │ │ │ ├── chip.h │ │ │ ├── flash.icf │ │ │ ├── flash.lds │ │ │ ├── sram.icf │ │ │ ├── sram.lds │ │ │ ├── sram_flashloader.icf │ │ │ └── sram_samba.lds │ │ ├── at91sam3u4 │ │ │ ├── AT91SAM3U4.h │ │ │ ├── chip.h │ │ │ ├── flash.icf │ │ │ ├── flash.lds │ │ │ ├── flash.sct │ │ │ ├── psram.icf │ │ │ ├── psram.lds │ │ │ ├── psram.sct │ │ │ ├── sram.icf │ │ │ ├── sram.lds │ │ │ ├── sram.sct │ │ │ └── sram_samba.lds │ │ ├── board.h │ │ ├── board_cstartup_gnu.c │ │ ├── board_cstartup_iar.c │ │ ├── board_cstartup_keil.c │ │ ├── board_lowlevel.c │ │ ├── board_lowlevel.h │ │ ├── board_memories.c │ │ ├── board_memories.h │ │ ├── exceptions.c │ │ └── exceptions.h │ ├── demo.c │ ├── demo.ewp │ ├── demo.eww │ ├── demo_rtu.bat │ ├── freertos │ │ ├── FreeRTOSConfig.h │ │ ├── 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 │ │ │ │ └── ARM_CM3_MPU │ │ │ │ │ ├── port.c │ │ │ │ │ └── portmacro.h │ │ │ ├── IAR │ │ │ │ └── ARM_CM3 │ │ │ │ │ ├── port.c │ │ │ │ │ ├── portasm.s │ │ │ │ │ └── portmacro.h │ │ │ ├── MemMang │ │ │ │ ├── heap_1.c │ │ │ │ ├── heap_2.c │ │ │ │ └── heap_3.c │ │ │ ├── RVDS │ │ │ │ └── ARM_CM3 │ │ │ │ │ ├── port.c │ │ │ │ │ └── portmacro.h │ │ │ └── readme.txt │ │ ├── queue.c │ │ ├── readme.txt │ │ └── tasks.c │ ├── libraries │ │ ├── cmsis │ │ │ ├── core_cm3.c │ │ │ └── core_cm3.h │ │ └── drivers │ │ │ ├── acc │ │ │ ├── acc.c │ │ │ └── acc.h │ │ │ ├── adc │ │ │ ├── adc.c │ │ │ └── adc.h │ │ │ ├── async │ │ │ ├── async.c │ │ │ └── async.h │ │ │ ├── crccu │ │ │ ├── crccu.c │ │ │ └── crccu.h │ │ │ ├── dacc │ │ │ ├── dacc.c │ │ │ └── dacc.h │ │ │ ├── efc │ │ │ ├── efc.c │ │ │ └── efc.h │ │ │ ├── flash │ │ │ ├── flashd.c │ │ │ └── flashd.h │ │ │ ├── lcd │ │ │ ├── color.h │ │ │ ├── draw.c │ │ │ ├── draw.h │ │ │ ├── font.c │ │ │ ├── font.h │ │ │ ├── font10x14.h │ │ │ ├── lcdd.c │ │ │ └── lcdd.h │ │ │ ├── pio │ │ │ ├── pio.c │ │ │ ├── pio.h │ │ │ ├── pio_it.c │ │ │ ├── pio_it.h │ │ │ ├── pio_keypad.c │ │ │ └── pio_keypad.h │ │ │ ├── pmc │ │ │ ├── pmc.c │ │ │ └── pmc.h │ │ │ ├── pwmc │ │ │ ├── pwmc.c │ │ │ └── pwmc.h │ │ │ ├── qtouch │ │ │ ├── libQTouchIarCfg3SRevABeta1.txt │ │ │ ├── libQTouchIarCfg3SRevABeta2.txt │ │ │ └── libQTouchIarCfg3SRevB.txt │ │ │ ├── rtc │ │ │ ├── rtc.c │ │ │ └── rtc.h │ │ │ ├── rtt │ │ │ ├── rtt.c │ │ │ └── rtt.h │ │ │ ├── spi-flash │ │ │ ├── at45d.c │ │ │ ├── at45d.h │ │ │ ├── spi_at45.c │ │ │ ├── spi_at45.h │ │ │ ├── spi_pdc.c │ │ │ └── spi_pdc.h │ │ │ ├── spi │ │ │ ├── spi.c │ │ │ └── spi.h │ │ │ ├── ssc │ │ │ ├── ssc.c │ │ │ └── ssc.h │ │ │ ├── tc │ │ │ ├── tc.c │ │ │ └── tc.h │ │ │ ├── tsd │ │ │ ├── tsd.h │ │ │ ├── tsd_ads7843.c │ │ │ ├── tsd_ads7843.h │ │ │ ├── tsd_com.c │ │ │ └── tsd_com.h │ │ │ ├── twi │ │ │ ├── twi.c │ │ │ ├── twi.h │ │ │ ├── twid.c │ │ │ └── twid.h │ │ │ ├── usart │ │ │ ├── uart_console.c │ │ │ ├── uart_console.h │ │ │ ├── usart.c │ │ │ └── usart.h │ │ │ ├── utility │ │ │ ├── assert.h │ │ │ ├── bitbanding.h │ │ │ ├── bmp.c │ │ │ ├── bmp.h │ │ │ ├── clock.c │ │ │ ├── clock.h │ │ │ ├── encryption │ │ │ │ ├── aes_hardware.c │ │ │ │ ├── aes_hardware.h │ │ │ │ ├── aes_reference.c │ │ │ │ ├── aes_reference.h │ │ │ │ ├── encryption.h │ │ │ │ ├── libtomcrypt.c │ │ │ │ ├── libtomcrypt.h │ │ │ │ ├── tdes_hardware.c │ │ │ │ └── tdes_hardware.h │ │ │ ├── hamming.c │ │ │ ├── hamming.h │ │ │ ├── iap.c │ │ │ ├── iap.h │ │ │ ├── led.c │ │ │ ├── led.h │ │ │ ├── math.c │ │ │ ├── math.h │ │ │ ├── rand.c │ │ │ ├── rand.h │ │ │ ├── retarget.c │ │ │ ├── stdio.c │ │ │ ├── string.c │ │ │ ├── trace.c │ │ │ ├── trace.h │ │ │ ├── util.c │ │ │ ├── util.h │ │ │ ├── utility.dir │ │ │ ├── video.c │ │ │ ├── video.h │ │ │ ├── wav.c │ │ │ └── wav.h │ │ │ └── wdt │ │ │ ├── wdt.c │ │ │ └── wdt.h │ └── port │ │ ├── port.h │ │ ├── portevent.c │ │ ├── portother.c │ │ ├── portserial.c │ │ └── porttimer.c ├── AVR │ ├── Makefile │ ├── README.txt │ ├── avrdude.conf │ ├── demo.c │ ├── demo_rtu.bat │ ├── demo_rtu.sh │ ├── excoils.c │ └── port │ │ ├── mbcrc.c │ │ ├── port.h │ │ ├── portevent.c │ │ ├── portserial.c │ │ └── porttimer.c ├── BARE │ ├── Makefile │ ├── demo.c │ └── port │ │ ├── port.h │ │ ├── portevent.c │ │ ├── portserial.c │ │ └── porttimer.c ├── HCS08 │ ├── demo.c │ └── port │ │ ├── port.h │ │ ├── portevent.c │ │ ├── portserial.c │ │ └── porttimer.c ├── LINUX │ ├── Makefile │ ├── README.txt │ ├── demo.c │ ├── demo.sh │ ├── demo.vpj │ └── port │ │ ├── port.h │ │ ├── portevent.c │ │ ├── portother.c │ │ ├── portserial.c │ │ └── porttimer.c ├── LINUXTCP │ ├── Makefile │ ├── demo.c │ └── port │ │ ├── port.h │ │ ├── portevent.c │ │ ├── portother.c │ │ └── porttcp.c ├── LPC214X │ ├── README.txt │ ├── Startup.s │ ├── build │ │ ├── .dont_remove │ │ ├── bin │ │ │ └── .dont_remove │ │ ├── lst │ │ │ └── .dont_remove │ │ └── obj │ │ │ └── .dont_remove │ ├── demo.Opt │ ├── demo.Uv2 │ ├── demo.c │ └── port │ │ ├── port.c │ │ ├── port.h │ │ ├── portevent.c │ │ ├── portserial.c │ │ └── porttimer.c ├── MCF5235 │ ├── Makefile │ ├── crt0.S │ ├── demo.c │ ├── init.c │ ├── m5235-ram.ld │ ├── mcf523x │ │ ├── descriptors.h │ │ ├── m523xevb.h │ │ ├── mcf523x.h │ │ ├── mcf523x_can.h │ │ ├── mcf523x_ccm.h │ │ ├── mcf523x_cfm.h │ │ ├── mcf523x_cs.h │ │ ├── mcf523x_eport.h │ │ ├── mcf523x_etpu.h │ │ ├── mcf523x_etpu_struc.h │ │ ├── mcf523x_fec.h │ │ ├── mcf523x_fmpll.h │ │ ├── mcf523x_gpio.h │ │ ├── mcf523x_i2c.h │ │ ├── mcf523x_intc0.h │ │ ├── mcf523x_intc1.h │ │ ├── mcf523x_mdha.h │ │ ├── mcf523x_pit.h │ │ ├── mcf523x_qspi.h │ │ ├── mcf523x_rcm.h │ │ ├── mcf523x_rng.h │ │ ├── mcf523x_scm.h │ │ ├── mcf523x_sdramc.h │ │ ├── mcf523x_skha.h │ │ ├── mcf523x_sram.h │ │ ├── mcf523x_timer.h │ │ ├── mcf523x_uart.h │ │ ├── mcf523x_vars.h │ │ ├── mcf523x_wtm.h │ │ ├── mcf5xxx.h │ │ └── typedefs.h │ ├── port │ │ ├── port.h │ │ ├── portevent.c │ │ ├── portother.c │ │ ├── portserial.c │ │ └── porttimer.c │ ├── support │ │ ├── AM29_160BB.CFP │ │ ├── m5235.gdb │ │ ├── mcf5235.CF │ │ └── mcf5235.mac │ └── vector.S ├── MCF5235CW │ ├── demo.c │ ├── demo.cww │ ├── demo.mcp │ ├── freertos │ │ ├── croutine.c │ │ ├── include │ │ │ ├── FreeRTOS.h │ │ │ ├── croutine.h │ │ │ ├── list.h │ │ │ ├── portable.h │ │ │ ├── projdefs.h │ │ │ ├── queue.h │ │ │ ├── semphr.h │ │ │ ├── serial.h │ │ │ └── task.h │ │ ├── list.c │ │ ├── portable │ │ │ ├── CodeWarrior │ │ │ │ └── MCF5235 │ │ │ │ │ ├── port.c │ │ │ │ │ └── portmacro.h │ │ │ └── MemMang │ │ │ │ ├── heap_1.c │ │ │ │ ├── heap_2.c │ │ │ │ └── heap_3.c │ │ ├── queue.c │ │ └── tasks.c │ ├── include │ │ ├── FreeRTOSConfig.h │ │ ├── arch │ │ │ ├── m523xbcc.h │ │ │ ├── mcf523x.h │ │ │ ├── mcf523x │ │ │ │ ├── descriptors.h │ │ │ │ ├── mcf523x_can.h │ │ │ │ ├── mcf523x_ccm.h │ │ │ │ ├── mcf523x_cfm.h │ │ │ │ ├── mcf523x_cs.h │ │ │ │ ├── mcf523x_eport.h │ │ │ │ ├── mcf523x_etpu.h │ │ │ │ ├── mcf523x_etpu_struc.h │ │ │ │ ├── mcf523x_fec.h │ │ │ │ ├── mcf523x_fmpll.h │ │ │ │ ├── mcf523x_gpio.h │ │ │ │ ├── mcf523x_i2c.h │ │ │ │ ├── mcf523x_intc0.h │ │ │ │ ├── mcf523x_intc1.h │ │ │ │ ├── mcf523x_mdha.h │ │ │ │ ├── mcf523x_pit.h │ │ │ │ ├── mcf523x_qspi.h │ │ │ │ ├── mcf523x_rcm.h │ │ │ │ ├── mcf523x_rng.h │ │ │ │ ├── mcf523x_scm.h │ │ │ │ ├── mcf523x_sdramc.h │ │ │ │ ├── mcf523x_skha.h │ │ │ │ ├── mcf523x_sram.h │ │ │ │ ├── mcf523x_timer.h │ │ │ │ ├── mcf523x_uart.h │ │ │ │ ├── mcf523x_vars.h │ │ │ │ └── mcf523x_wtm.h │ │ │ ├── mcf5xxx.h │ │ │ └── typedefs.h │ │ ├── ram_symbol.h │ │ └── rom_symbol.h │ ├── port │ │ ├── port.h │ │ ├── portevent.c │ │ ├── portother.c │ │ ├── portserial.c │ │ └── porttimer.c │ ├── support │ │ ├── mcf5235-bcckit-flash.xml │ │ ├── mcf5235-bcckit-test.xml │ │ ├── mcf523x-simple.cfg │ │ ├── mcf523x.cfg │ │ ├── mcf523x.mem │ │ ├── ram.lcf │ │ └── rom.lcf │ └── system │ │ ├── hwinit.c │ │ ├── interrupts.c │ │ ├── mcf523x_lo.s │ │ ├── mcf5xxx.s │ │ └── vectors.s ├── MCF5235TCP │ ├── FreeRTOSConfig.h │ ├── Makefile │ ├── README.txt │ ├── demo.c │ ├── demo.vpj │ ├── freertos │ │ ├── croutine.c │ │ ├── include │ │ │ ├── FreeRTOS.h │ │ │ ├── croutine.h │ │ │ ├── list.h │ │ │ ├── portable.h │ │ │ ├── projdefs.h │ │ │ ├── queue.h │ │ │ ├── semphr.h │ │ │ ├── serial.h │ │ │ └── task.h │ │ ├── list.c │ │ ├── portable │ │ │ ├── GCC │ │ │ │ └── MCF5235 │ │ │ │ │ ├── port.c │ │ │ │ │ └── portmacro.h │ │ │ └── MemMang │ │ │ │ ├── heap_1.c │ │ │ │ ├── heap_2.c │ │ │ │ └── heap_3.c │ │ ├── queue.c │ │ └── tasks.c │ ├── include │ │ └── arch │ │ │ ├── mcf523x.h │ │ │ ├── mcf523x │ │ │ ├── mcf523x_can.h │ │ │ ├── mcf523x_ccm.h │ │ │ ├── mcf523x_cs.h │ │ │ ├── mcf523x_eport.h │ │ │ ├── mcf523x_etpu.h │ │ │ ├── mcf523x_fec.h │ │ │ ├── mcf523x_fmpll.h │ │ │ ├── mcf523x_gpio.h │ │ │ ├── mcf523x_i2c.h │ │ │ ├── mcf523x_intc0.h │ │ │ ├── mcf523x_intc1.h │ │ │ ├── mcf523x_mdha.h │ │ │ ├── mcf523x_pit.h │ │ │ ├── mcf523x_qspi.h │ │ │ ├── mcf523x_rcm.h │ │ │ ├── mcf523x_rng.h │ │ │ ├── mcf523x_scm.h │ │ │ ├── mcf523x_sdramc.h │ │ │ ├── mcf523x_skha.h │ │ │ ├── mcf523x_sram.h │ │ │ ├── mcf523x_timer.h │ │ │ ├── mcf523x_uart.h │ │ │ └── mcf523x_wtm.h │ │ │ └── mcf5xxx.h │ ├── lwip │ │ ├── CHANGELOG │ │ ├── COPYING │ │ ├── FILES │ │ ├── README │ │ ├── contrib │ │ │ └── port │ │ │ │ └── FreeRTOS │ │ │ │ └── MCF5235 │ │ │ │ ├── arch │ │ │ │ ├── cc.h │ │ │ │ ├── cpu.h │ │ │ │ ├── perf.h │ │ │ │ └── sys_arch.h │ │ │ │ ├── netif │ │ │ │ ├── fec.c │ │ │ │ ├── fec.h │ │ │ │ ├── nbuf.c │ │ │ │ └── nbuf.h │ │ │ │ └── sys_arch.c │ │ ├── doc │ │ │ ├── contrib.txt │ │ │ ├── rawapi.txt │ │ │ ├── savannah.txt │ │ │ └── sys_arch.txt │ │ └── src │ │ │ ├── FILES │ │ │ ├── api │ │ │ ├── api_lib.c │ │ │ ├── api_msg.c │ │ │ ├── err.c │ │ │ ├── sockets.c │ │ │ └── tcpip.c │ │ │ ├── core │ │ │ ├── dhcp.c │ │ │ ├── inet.c │ │ │ ├── inet6.c │ │ │ ├── ipv4 │ │ │ │ ├── icmp.c │ │ │ │ ├── ip.c │ │ │ │ ├── ip_addr.c │ │ │ │ └── ip_frag.c │ │ │ ├── ipv6 │ │ │ │ ├── README │ │ │ │ ├── icmp6.c │ │ │ │ ├── ip6.c │ │ │ │ └── ip6_addr.c │ │ │ ├── mem.c │ │ │ ├── memp.c │ │ │ ├── netif.c │ │ │ ├── pbuf.c │ │ │ ├── raw.c │ │ │ ├── stats.c │ │ │ ├── sys.c │ │ │ ├── tcp.c │ │ │ ├── tcp_in.c │ │ │ ├── tcp_out.c │ │ │ └── udp.c │ │ │ ├── include │ │ │ ├── ipv4 │ │ │ │ └── lwip │ │ │ │ │ ├── icmp.h │ │ │ │ │ ├── inet.h │ │ │ │ │ ├── ip.h │ │ │ │ │ ├── ip_addr.h │ │ │ │ │ └── ip_frag.h │ │ │ ├── ipv6 │ │ │ │ └── lwip │ │ │ │ │ ├── icmp.h │ │ │ │ │ ├── inet.h │ │ │ │ │ ├── ip.h │ │ │ │ │ └── ip_addr.h │ │ │ ├── lwip │ │ │ │ ├── api.h │ │ │ │ ├── api_msg.h │ │ │ │ ├── arch.h │ │ │ │ ├── debug.h │ │ │ │ ├── def.h │ │ │ │ ├── dhcp.h │ │ │ │ ├── err.h │ │ │ │ ├── mem.h │ │ │ │ ├── memp.h │ │ │ │ ├── netif.h │ │ │ │ ├── opt.h │ │ │ │ ├── pbuf.h │ │ │ │ ├── raw.h │ │ │ │ ├── sio.h │ │ │ │ ├── snmp.h │ │ │ │ ├── sockets.h │ │ │ │ ├── stats.h │ │ │ │ ├── sys.h │ │ │ │ ├── tcp.h │ │ │ │ ├── tcpip.h │ │ │ │ └── udp.h │ │ │ └── netif │ │ │ │ ├── etharp.h │ │ │ │ ├── loopif.h │ │ │ │ └── slipif.h │ │ │ └── netif │ │ │ ├── FILES │ │ │ ├── etharp.c │ │ │ ├── ethernetif.c │ │ │ ├── loopif.c │ │ │ ├── ppp │ │ │ ├── auth.c │ │ │ ├── auth.h │ │ │ ├── chap.c │ │ │ ├── chap.h │ │ │ ├── chpms.c │ │ │ ├── chpms.h │ │ │ ├── fsm.c │ │ │ ├── fsm.h │ │ │ ├── ipcp.c │ │ │ ├── ipcp.h │ │ │ ├── lcp.c │ │ │ ├── lcp.h │ │ │ ├── magic.c │ │ │ ├── magic.h │ │ │ ├── md5.c │ │ │ ├── md5.h │ │ │ ├── pap.c │ │ │ ├── pap.h │ │ │ ├── ppp.c │ │ │ ├── ppp.h │ │ │ ├── pppdebug.h │ │ │ ├── randm.c │ │ │ ├── randm.h │ │ │ ├── vj.c │ │ │ ├── vj.h │ │ │ └── vjbsdhdr.h │ │ │ └── slipif.c │ ├── lwipopts.h │ ├── m5235-ram.ld │ ├── m5235-rom.ld │ ├── m5235.gdb │ ├── port │ │ ├── mbconfig.h │ │ ├── port.h │ │ ├── portevent.c │ │ ├── portother.c │ │ └── porttcp.c │ ├── simple.bat │ ├── simple.sh │ └── system │ │ ├── crt0.S │ │ ├── init.c │ │ ├── mcf5xxx.S │ │ ├── newlib.c │ │ ├── serial.c │ │ └── vector.S ├── MSP430 │ ├── Makefile │ ├── README.txt │ ├── demo.c │ ├── demo.hzp │ ├── demo.hzs │ ├── demo_rtu.sh │ ├── doc │ │ └── timing-snd-rcv.png │ ├── msp430.gdb │ ├── port │ │ ├── port.h │ │ ├── portevent.c │ │ ├── portserial.c │ │ └── porttimer.c │ └── system │ │ ├── dco-gcc.S │ │ ├── dco-rowley.S │ │ └── dco.h ├── STR71X │ ├── FreeRTOSConfig.h │ ├── crt0.s │ ├── demo.hzp │ ├── excoils.c │ ├── exdisc.c │ ├── exholding.c │ ├── freertos │ │ ├── include │ │ │ ├── FreeRTOS.h │ │ │ ├── list.h │ │ │ ├── portable.h │ │ │ ├── projdefs.h │ │ │ ├── queue.h │ │ │ ├── semphr.h │ │ │ └── task.h │ │ ├── list.c │ │ ├── portable │ │ │ ├── GCC │ │ │ │ └── ARM7_STR71X │ │ │ │ │ ├── port.c │ │ │ │ │ ├── portISR.c │ │ │ │ │ └── portmacro.h │ │ │ └── MemMang │ │ │ │ ├── heap_1.c │ │ │ │ ├── heap_2.c │ │ │ │ └── heap_3.c │ │ ├── queue.c │ │ ├── readme.txt │ │ └── tasks.c │ ├── library │ │ ├── 71x_lib.c │ │ ├── adc12.c │ │ ├── apb.c │ │ ├── bspi.c │ │ ├── can.c │ │ ├── eic.c │ │ ├── emi.c │ │ ├── flash.c │ │ ├── gpio.c │ │ ├── i2c.c │ │ ├── include │ │ │ ├── 71x_conf.h │ │ │ ├── 71x_it.h │ │ │ ├── 71x_lib.h │ │ │ ├── 71x_map.h │ │ │ ├── 71x_type.h │ │ │ ├── adc12.h │ │ │ ├── apb.h │ │ │ ├── bspi.h │ │ │ ├── can.h │ │ │ ├── eic.h │ │ │ ├── emi.h │ │ │ ├── flash.h │ │ │ ├── gpio.h │ │ │ ├── i2c.h │ │ │ ├── pcu.h │ │ │ ├── rccu.h │ │ │ ├── rtc.h │ │ │ ├── tim.h │ │ │ ├── uart.h │ │ │ ├── wdg.h │ │ │ └── xti.h │ │ ├── pcu.c │ │ ├── rccu.c │ │ ├── rtc.c │ │ ├── tim.c │ │ ├── uart.c │ │ ├── wdg.c │ │ └── xti.c │ ├── port │ │ ├── port.h │ │ ├── portevent.c │ │ ├── portserial.c │ │ └── porttimer.c │ ├── simple.bat │ ├── simple.c │ ├── simple2.c │ └── startup.s ├── STR71XGCC │ ├── FreeRTOSConfig.h │ ├── Makefile │ ├── README.txt │ ├── demo.c │ ├── demo.sh │ ├── freertos │ │ ├── croutine.c │ │ ├── include │ │ │ ├── FreeRTOS.h │ │ │ ├── croutine.h │ │ │ ├── list.h │ │ │ ├── portable.h │ │ │ ├── projdefs.h │ │ │ ├── queue.h │ │ │ ├── semphr.h │ │ │ └── task.h │ │ ├── list.c │ │ ├── portable │ │ │ ├── GCC │ │ │ │ └── ARM7_STR71X │ │ │ │ │ ├── port.c │ │ │ │ │ ├── portISR.c │ │ │ │ │ └── portmacro.h │ │ │ └── MemMang │ │ │ │ ├── heap_1.c │ │ │ │ ├── heap_2.c │ │ │ │ └── heap_3.c │ │ ├── queue.c │ │ └── tasks.c │ ├── libstr71x │ │ ├── 71x_lib.c │ │ ├── adc12.c │ │ ├── apb.c │ │ ├── bspi.c │ │ ├── can.c │ │ ├── eic.c │ │ ├── emi.c │ │ ├── flash.c │ │ ├── gpio.c │ │ ├── i2c.c │ │ ├── include │ │ │ ├── 71x_conf.h │ │ │ ├── 71x_it.h │ │ │ ├── 71x_lib.h │ │ │ ├── 71x_map.h │ │ │ ├── 71x_type.h │ │ │ ├── adc12.h │ │ │ ├── apb.h │ │ │ ├── bspi.h │ │ │ ├── can.h │ │ │ ├── eic.h │ │ │ ├── emi.h │ │ │ ├── flash.h │ │ │ ├── gpio.h │ │ │ ├── i2c.h │ │ │ ├── pcu.h │ │ │ ├── rccu.h │ │ │ ├── rtc.h │ │ │ ├── tim.h │ │ │ ├── uart.h │ │ │ ├── wdg.h │ │ │ └── xti.h │ │ ├── pcu.c │ │ ├── rccu.c │ │ ├── rtc.c │ │ ├── tim.c │ │ ├── uart.c │ │ ├── wdg.c │ │ └── xti.c │ ├── port │ │ ├── port.h │ │ ├── portevent.c │ │ ├── portserial.c │ │ └── porttimer.c │ ├── support │ │ ├── ram71x.ld │ │ ├── rom71x.ld │ │ └── target-71.gdb │ ├── system │ │ ├── startup.S │ │ └── vector.S │ └── tools │ │ ├── openocd │ │ ├── openocd.exe │ │ └── str71x_wig.cfg ├── STR71XTCP │ ├── FreeRTOSConfig.h │ ├── README.txt │ ├── crt0.s │ ├── demo.c │ ├── demo.hzp │ ├── demo.hzs │ ├── freertos │ │ ├── croutine.c │ │ ├── include │ │ │ ├── FreeRTOS.h │ │ │ ├── croutine.h │ │ │ ├── list.h │ │ │ ├── portable.h │ │ │ ├── projdefs.h │ │ │ ├── queue.h │ │ │ ├── semphr.h │ │ │ └── task.h │ │ ├── list.c │ │ ├── portable │ │ │ ├── GCC │ │ │ │ └── ARM7_STR71X │ │ │ │ │ ├── port.c │ │ │ │ │ ├── portISR.c │ │ │ │ │ └── portmacro.h │ │ │ └── MemMang │ │ │ │ ├── heap_1.c │ │ │ │ ├── heap_2.c │ │ │ │ └── heap_3.c │ │ ├── queue.c │ │ └── tasks.c │ ├── library │ │ ├── 71x_lib.c │ │ ├── adc12.c │ │ ├── apb.c │ │ ├── bspi.c │ │ ├── can.c │ │ ├── eic.c │ │ ├── emi.c │ │ ├── flash.c │ │ ├── gpio.c │ │ ├── i2c.c │ │ ├── include │ │ │ ├── 71x_conf.h │ │ │ ├── 71x_it.h │ │ │ ├── 71x_lib.h │ │ │ ├── 71x_map.h │ │ │ ├── 71x_type.h │ │ │ ├── adc12.h │ │ │ ├── apb.h │ │ │ ├── bspi.h │ │ │ ├── can.h │ │ │ ├── eic.h │ │ │ ├── emi.h │ │ │ ├── flash.h │ │ │ ├── gpio.h │ │ │ ├── i2c.h │ │ │ ├── pcu.h │ │ │ ├── rccu.h │ │ │ ├── rtc.h │ │ │ ├── tim.h │ │ │ ├── uart.h │ │ │ ├── wdg.h │ │ │ └── xti.h │ │ ├── pcu.c │ │ ├── rccu.c │ │ ├── rtc.c │ │ ├── tim.c │ │ ├── uart.c │ │ ├── wdg.c │ │ └── xti.c │ ├── lwip │ │ ├── CHANGELOG │ │ ├── COPYING │ │ ├── FILES │ │ ├── README │ │ ├── contrib │ │ │ └── port │ │ │ │ └── FreeRTOS │ │ │ │ └── STR71X │ │ │ │ ├── arch │ │ │ │ ├── cc.h │ │ │ │ ├── cpu.h │ │ │ │ ├── perf.h │ │ │ │ └── sys_arch.h │ │ │ │ ├── netif │ │ │ │ ├── serial.c │ │ │ │ └── serial.h │ │ │ │ └── sys_arch.c │ │ ├── doc │ │ │ ├── contrib.txt │ │ │ ├── rawapi.txt │ │ │ ├── savannah.txt │ │ │ └── sys_arch.txt │ │ └── src │ │ │ ├── FILES │ │ │ ├── api │ │ │ ├── api_lib.c │ │ │ ├── api_msg.c │ │ │ ├── err.c │ │ │ ├── sockets.c │ │ │ └── tcpip.c │ │ │ ├── core │ │ │ ├── dhcp.c │ │ │ ├── inet.c │ │ │ ├── inet6.c │ │ │ ├── ipv4 │ │ │ │ ├── icmp.c │ │ │ │ ├── ip.c │ │ │ │ ├── ip_addr.c │ │ │ │ └── ip_frag.c │ │ │ ├── ipv6 │ │ │ │ ├── README │ │ │ │ ├── icmp6.c │ │ │ │ ├── ip6.c │ │ │ │ └── ip6_addr.c │ │ │ ├── mem.c │ │ │ ├── memp.c │ │ │ ├── netif.c │ │ │ ├── pbuf.c │ │ │ ├── raw.c │ │ │ ├── stats.c │ │ │ ├── sys.c │ │ │ ├── tcp.c │ │ │ ├── tcp_in.c │ │ │ ├── tcp_out.c │ │ │ └── udp.c │ │ │ ├── include │ │ │ ├── ipv4 │ │ │ │ └── lwip │ │ │ │ │ ├── icmp.h │ │ │ │ │ ├── inet.h │ │ │ │ │ ├── ip.h │ │ │ │ │ ├── ip_addr.h │ │ │ │ │ └── ip_frag.h │ │ │ ├── ipv6 │ │ │ │ └── lwip │ │ │ │ │ ├── icmp.h │ │ │ │ │ ├── inet.h │ │ │ │ │ ├── ip.h │ │ │ │ │ └── ip_addr.h │ │ │ ├── lwip │ │ │ │ ├── api.h │ │ │ │ ├── api_msg.h │ │ │ │ ├── arch.h │ │ │ │ ├── debug.h │ │ │ │ ├── def.h │ │ │ │ ├── dhcp.h │ │ │ │ ├── err.h │ │ │ │ ├── mem.h │ │ │ │ ├── memp.h │ │ │ │ ├── netif.h │ │ │ │ ├── opt.h │ │ │ │ ├── pbuf.h │ │ │ │ ├── raw.h │ │ │ │ ├── sio.h │ │ │ │ ├── snmp.h │ │ │ │ ├── sockets.h │ │ │ │ ├── stats.h │ │ │ │ ├── sys.h │ │ │ │ ├── tcp.h │ │ │ │ ├── tcpip.h │ │ │ │ └── udp.h │ │ │ └── netif │ │ │ │ ├── etharp.h │ │ │ │ ├── loopif.h │ │ │ │ └── slipif.h │ │ │ └── netif │ │ │ ├── FILES │ │ │ ├── etharp.c │ │ │ ├── ethernetif.c │ │ │ ├── loopif.c │ │ │ ├── ppp │ │ │ ├── auth.c │ │ │ ├── auth.h │ │ │ ├── chap.c │ │ │ ├── chap.h │ │ │ ├── chpms.c │ │ │ ├── chpms.h │ │ │ ├── fsm.c │ │ │ ├── fsm.h │ │ │ ├── ipcp.c │ │ │ ├── ipcp.h │ │ │ ├── lcp.c │ │ │ ├── lcp.h │ │ │ ├── magic.c │ │ │ ├── magic.h │ │ │ ├── md5.c │ │ │ ├── md5.h │ │ │ ├── pap.c │ │ │ ├── pap.h │ │ │ ├── ppp.c │ │ │ ├── ppp.h │ │ │ ├── pppdebug.h │ │ │ ├── randm.c │ │ │ ├── randm.h │ │ │ ├── vj.c │ │ │ ├── vj.h │ │ │ └── vjbsdhdr.h │ │ │ └── slipif.c │ ├── lwipopts.h │ ├── port │ │ ├── mbconfig.h │ │ ├── port.h │ │ ├── portevent.c │ │ ├── portother.c │ │ └── porttcp.c │ ├── simple.bat │ ├── simple.sh │ ├── startup.s │ └── utils │ │ ├── options │ │ ├── options-pap │ │ ├── options.ttyS0 │ │ ├── pap-secrets │ │ └── server.sh ├── WIN32 │ ├── Port │ │ ├── port.h │ │ ├── portevent.c │ │ ├── portother.c │ │ ├── portserial.c │ │ └── porttimer.c │ ├── demo.cpp │ ├── demo.vcproj │ ├── stdafx.cpp │ └── stdafx.h ├── WIN32TCP │ ├── Port │ │ ├── port.h │ │ ├── portevent.c │ │ ├── portother.c │ │ └── porttcp.c │ ├── demo.cpp │ ├── demo.vcproj │ ├── stdafx.cpp │ └── stdafx.h └── Z8ENCORE │ ├── README.txt │ ├── demo.c │ ├── demo.wsp │ ├── demo.zdsproj │ └── port │ ├── port.h │ ├── portevent.c │ ├── portserial.c │ └── porttimer.c ├── doc ├── TODO.txt ├── dox.css ├── dox_html_footer ├── dox_html_header ├── doxygen.conf ├── main.dox ├── memory.ods ├── porting.dox └── tips.dox ├── gpl.txt ├── lgpl.txt ├── modbus ├── ascii │ ├── mbascii.c │ └── mbascii.h ├── functions │ ├── mbfunccoils.c │ ├── mbfuncdiag.c │ ├── mbfuncdisc.c │ ├── mbfuncholding.c │ ├── mbfuncinput.c │ ├── mbfuncother.c │ └── mbutils.c ├── include │ ├── mb.h │ ├── mbconfig.h │ ├── mbframe.h │ ├── mbfunc.h │ ├── mbport.h │ ├── mbproto.h │ └── mbutils.h ├── mb.c ├── rtu │ ├── mbcrc.c │ ├── mbcrc.h │ ├── mbrtu.c │ └── mbrtu.h └── tcp │ ├── mbtcp.c │ └── mbtcp.h └── tools ├── README.txt ├── doxygen.exe ├── indent.sh ├── lint-arm.sh └── lint-avr.sh /bsd.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006 Christian Walter 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions 6 | are met: 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 3. The name of the author may not be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | 26 | -------------------------------------------------------------------------------- /demo/AT91SAM7X_ROWLEY/FreeRTOSConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MODBUS Slave Library: A portable MODBUS slave for MODBUS ASCII/RTU/TCP. 3 | * Copyright (c) 2007 Christian Walter 4 | * All rights reserved. 5 | * 6 | * $Id: FreeRTOSConfig.h,v 1.1 2007/09/12 10:15:56 wolti Exp $ 7 | */ 8 | 9 | #ifndef FREERTOS_CONFIG_H 10 | #define FREERTOS_CONFIG_H 11 | 12 | /* ----------------------- Defines ------------------------------------------*/ 13 | 14 | #define vPortYieldProcessor swi_handler 15 | 16 | #define configUSE_PREEMPTION ( 1 ) 17 | #define configUSE_IDLE_HOOK ( 0 ) 18 | #define configUSE_TICK_HOOK ( 1 ) 19 | #define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 48054857UL ) 20 | #define configTICK_RATE_HZ ( ( portTickType ) 1000 ) 21 | #define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 ) 22 | #define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 128 ) 23 | #define configTOTAL_HEAP_SIZE ( ( size_t ) 2048 ) 24 | #define configMAX_TASK_NAME_LEN ( 16 ) 25 | #define configUSE_TRACE_FACILITY ( 1 ) 26 | #define configUSE_16_BIT_TICKS ( 0 ) 27 | #define configIDLE_SHOULD_YIELD ( 1 ) 28 | #define configUSE_CO_ROUTINES ( 0 ) 29 | #define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) 30 | 31 | #define INCLUDE_vTaskPrioritySet ( 1 ) 32 | #define INCLUDE_uxTaskPriorityGet ( 1 ) 33 | #define INCLUDE_vTaskDelete ( 1 ) 34 | #define INCLUDE_vTaskCleanUpResources ( 0 ) 35 | #define INCLUDE_vTaskSuspend ( 1 ) 36 | #define INCLUDE_vTaskDelayUntil ( 1 ) 37 | #define INCLUDE_vTaskDelay ( 1 ) 38 | #define INCLUDE_xTaskGetCurrentTaskHandle ( 1 ) 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /demo/AT91SAM7X_ROWLEY/support/lib_AT91SAM7X256.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/demo/AT91SAM7X_ROWLEY/support/lib_AT91SAM7X256.h -------------------------------------------------------------------------------- /demo/ATSAM3S/board/at91sam3s4/flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ 4 | /*-Vector table start*/ 5 | define symbol __ICFEDIT_vector_start__ = 0x000400000; /*Add for CMSIS*/ 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 8 | define symbol __ICFEDIT_region_RAM_end__ = 0x2000BFFF; 9 | define symbol __ICFEDIT_region_ROM_start__ = 0x00400000; 10 | define symbol __ICFEDIT_region_ROM_end__ = 0x0043FFFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x800; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | 15 | export symbol __ICFEDIT_vector_start__; /*Add for CMSIS*/ 16 | /**** End of ICF editor section. ###ICF###*/ 17 | 18 | define memory mem with size = 4G; 19 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 20 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 21 | 22 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 23 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 24 | 25 | initialize by copy { readwrite }; 26 | do not initialize { section .noinit }; 27 | 28 | place at address mem:__ICFEDIT_vector_start__ { readonly section .vectors }; /*Add for CMSIS*/ 29 | place in ROM_region { readonly }; 30 | place in RAM_region { readwrite,,block CSTACK, block HEAP }; 31 | -------------------------------------------------------------------------------- /demo/ATSAM3S/board/at91sam3s4/sram.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ 4 | /*-Vector table start*/ 5 | define symbol __ICFEDIT_vector_start__ = 0x20000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 8 | define symbol __ICFEDIT_region_RAM_end__ = 0x2000BFFF; 9 | /*-Sizes-*/ 10 | define symbol __ICFEDIT_size_cstack__ = 0x900; 11 | define symbol __ICFEDIT_size_heap__ = 0x200; 12 | /*-Exports-*/ 13 | export symbol __ICFEDIT_vector_start__; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define memory mem with size = 4G; 17 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 18 | 19 | /* define block RamVect with alignment = 8, size = __ICFEDIT_size_vectors__ { }; */ 20 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 21 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 22 | 23 | initialize by copy { readwrite }; 24 | do not initialize { section .noinit }; 25 | 26 | place at address mem:__ICFEDIT_vector_start__ { readonly section .vectors }; 27 | place in RAM_region { readonly, readwrite, block CSTACK, block HEAP }; 28 | -------------------------------------------------------------------------------- /demo/ATSAM3S/board/at91sam3s4/sram_flashloader.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x20000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x0; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000040; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x2000BFFF; 11 | 12 | /*-Sizes-*/ 13 | define symbol __ICFEDIT_size_cstack__ = 0x0200; 14 | define symbol __ICFEDIT_size_heap__ = 0x000; 15 | /**** End of ICF editor section. ###ICF###*/ 16 | 17 | 18 | define memory mem with size = 4G; 19 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 20 | 21 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 22 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 23 | 24 | //initialize by copy { readwrite }; 25 | do not initialize { section .noinit }; 26 | 27 | place at address mem:__ICFEDIT_intvec_start__ { section .intvec }; 28 | 29 | place at start of RAM_region { block RamTop with fixed order {readonly, section LOWEND}}; 30 | place at end of RAM_region { block RamBottom with fixed order {section HIGHSTART, readwrite, section .init, 31 | block CSTACK, block HEAP}}; 32 | 33 | 34 | -------------------------------------------------------------------------------- /demo/ATSAM3S/board/at91sam3u4/sram.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ 4 | /*-Vector table start*/ 5 | define symbol __ICFEDIT_vector_start__ = 0x20000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_RAM0_start__ = 0x20000000; 8 | define symbol __ICFEDIT_region_RAM0_end__ = 0x20007FFF; 9 | define symbol __ICFEDIT_region_RAM1_start__ = 0x20080000; 10 | define symbol __ICFEDIT_region_RAM1_end__ = 0x20083FFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /*-Exports-*/ 15 | export symbol __ICFEDIT_vector_start__; 16 | /**** End of ICF editor section. ###ICF###*/ 17 | 18 | define memory mem with size = 4G; 19 | define region RAM0_region = mem:[from __ICFEDIT_region_RAM0_start__ to __ICFEDIT_region_RAM0_end__]; 20 | define region RAM1_region = mem:[from __ICFEDIT_region_RAM1_start__ to __ICFEDIT_region_RAM1_end__]; 21 | /*define region RAM_region = mem:[from __ICFEDIT_region_RAM0_start__+__ICFEDIT_size_vectors__ to __ICFEDIT_region_RAM0_end__] | 22 | mem:[from __ICFEDIT_region_RAM1_start__ to __ICFEDIT_region_RAM1_end__];*/ 23 | 24 | /* define block RamVect with alignment = 8, size = __ICFEDIT_size_vectors__ { }; */ 25 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 26 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 27 | 28 | initialize by copy { readwrite }; 29 | do not initialize { section .noinit }; 30 | 31 | place at address mem:__ICFEDIT_vector_start__ { readonly section .vectors }; 32 | place in RAM0_region { readonly }; 33 | place in RAM1_region { readwrite, block CSTACK, block HEAP }; 34 | -------------------------------------------------------------------------------- /demo/ATSAM3S/board/board.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/demo/ATSAM3S/board/board.h -------------------------------------------------------------------------------- /demo/ATSAM3S/demo.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\demo.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /demo/ATSAM3S/demo_rtu.bat: -------------------------------------------------------------------------------- 1 | ..\..\tools\modpoll.exe -m rtu -a 10 -r 1000 -c 4 -t 3 -b 38400 -d 8 -p even COM1 2 | -------------------------------------------------------------------------------- /demo/ATSAM3S/libraries/drivers/lcd/lcdd.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ATMEL Microcontroller Software Support 3 | * ---------------------------------------------------------------------------- 4 | * Copyright (c) 2008, Atmel Corporation 5 | * 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * 11 | * - Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the disclaimer below. 13 | * 14 | * Atmel's name may not be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 20 | * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 23 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 26 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * ---------------------------------------------------------------------------- 28 | */ 29 | 30 | /** 31 | * \file 32 | * 33 | * Interface for LCD driver. 34 | * 35 | */ 36 | 37 | #ifndef LCDD_H 38 | #define LCDD_H 39 | 40 | /*---------------------------------------------------------------------------- 41 | * Exported functions 42 | *----------------------------------------------------------------------------*/ 43 | 44 | extern void LCDD_Initialize(void); 45 | 46 | extern void LCDD_On(void); 47 | 48 | extern void LCDD_Off(void); 49 | 50 | extern void LCDD_SetBacklight (uint32_t step); 51 | 52 | #endif /* #ifndef LCDD_H */ 53 | -------------------------------------------------------------------------------- /demo/ATSAM3S/libraries/drivers/qtouch/libQTouchIarCfg3SRevABeta1.txt: -------------------------------------------------------------------------------- 1 | QTouch library for AT91SAM3S-EK board version A. 2 | Modified board. 3 | 4 | Burst pulses 5 CPU cycles wide. 5 | 6 | Slider on pins PA0, PA1, PA2, PA3, PA4, PA5 7 | -------------------------------------------------------------------------------- /demo/ATSAM3S/libraries/drivers/qtouch/libQTouchIarCfg3SRevABeta2.txt: -------------------------------------------------------------------------------- 1 | QTouch library for AT91SAM3S-EK board version A. 2 | Modified board. 3 | 4 | Burst pulses 5 CPU cycles wide. 5 | 6 | A Valid key on pins PC22 and PC23 7 | A UP key on pins PC24 and PC25 8 | A Down key on pins PC26 and PC27 9 | A Left key on pins PC28 and PC29 10 | A right key on pins PC30 and PC31 11 | -------------------------------------------------------------------------------- /demo/ATSAM3S/libraries/drivers/qtouch/libQTouchIarCfg3SRevB.txt: -------------------------------------------------------------------------------- 1 | QTouch library for AT91SAM3S-EK board version B. 2 | 3 | Burst pulses 5 CPU cycles wide. 4 | 5 | Slider on pins PA0, PA1, PA2, PA3, PA4, PA5 6 | 7 | A Valid key on pins PC22 and PC23 8 | A UP key on pins PC24 and PC25 9 | A Down key on pins PC26 and PC27 10 | A Left key on pins PC28 and PC29 11 | A right key on pins PC30 and PC31 12 | -------------------------------------------------------------------------------- /demo/ATSAM3S/libraries/drivers/tsd/tsd_ads7843.h: -------------------------------------------------------------------------------- 1 | #ifndef _TSD_ADS7843_ 2 | #define _TSD_ADS7843_ 3 | 4 | /*---------------------------------------------------------------------------- 5 | * External functions 6 | *----------------------------------------------------------------------------*/ 7 | extern void TSD_PenPressed( uint32_t dwX, uint32_t dwY ) ; 8 | extern void TSD_PenMoved( uint32_t dwX, uint32_t dwY ) ; 9 | extern void TSD_PenReleased( uint32_t dwX, uint32_t dwY ) ; 10 | 11 | /*---------------------------------------------------------------------------- 12 | * Exported functions 13 | *----------------------------------------------------------------------------*/ 14 | extern void TSD_WaitPenPressed( void ) ; 15 | extern void TSD_WaitPenReleased( void ) ; 16 | extern void TSD_GetRawMeasurement( uint32_t *pData ) ; 17 | extern void TSD_Initialize( int8_t calEn ) ; 18 | 19 | 20 | #endif // _TSD_ADS7843_ -------------------------------------------------------------------------------- /demo/ATSAM3S/libraries/drivers/usart/uart_console.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ATMEL Microcontroller Software Support 3 | * ---------------------------------------------------------------------------- 4 | * Copyright (c) 2009, Atmel Corporation 5 | * 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * 11 | * - Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the disclaimer below. 13 | * 14 | * Atmel's name may not be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 20 | * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 23 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 26 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * ---------------------------------------------------------------------------- 28 | */ 29 | 30 | 31 | #ifndef UART_CONSOLE_H_ 32 | #define UART_CONSOLE_H_ 33 | 34 | extern void UART_PutChar(uint8_t c); 35 | extern uint8_t UART_GetChar(void); 36 | extern bool UART_IsRxReady(void); 37 | 38 | #endif /* UART_CONSOLE_H_ */ 39 | -------------------------------------------------------------------------------- /demo/ATSAM3S/libraries/drivers/utility/clock.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ATMEL Microcontroller Software Support 3 | * ---------------------------------------------------------------------------- 4 | * Copyright (c) 2008, Atmel Corporation 5 | * 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * 11 | * - Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the disclaimer below. 13 | * 14 | * Atmel's name may not be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 20 | * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 23 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 26 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * ---------------------------------------------------------------------------- 28 | */ 29 | 30 | #ifndef CLOCK_H 31 | #define CLOCK_H 32 | 33 | //------------------------------------------------------------------------------ 34 | // Global Functions 35 | //------------------------------------------------------------------------------ 36 | 37 | extern void CLOCK_SetConfig(unsigned char configuration); 38 | 39 | extern void CLOCK_DisplayMenu(void); 40 | 41 | extern void CLOCK_UserChangeConfig(void); 42 | 43 | extern unsigned short CLOCK_GetCurrMCK(void); 44 | 45 | extern unsigned short CLOCK_GetCurrPCK(void); 46 | 47 | #endif //#ifndef FREQCONF_H 48 | -------------------------------------------------------------------------------- /demo/ATSAM3S/libraries/drivers/utility/iap.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ATMEL Microcontroller Software Support 3 | * ---------------------------------------------------------------------------- 4 | * Copyright (c) 2008, Atmel Corporation 5 | * 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * 11 | * - Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the disclaimer below. 13 | * 14 | * Atmel's name may not be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 20 | * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 23 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 26 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * ---------------------------------------------------------------------------- 28 | */ 29 | 30 | /* 31 | Title: IAP 32 | 33 | About: Purpose 34 | Small function for using IAP feature. 35 | 36 | About: Usage 37 | Perform a FLASH command using . 38 | 39 | */ 40 | 41 | #ifndef IAP_H 42 | #define IAP_H 43 | 44 | //------------------------------------------------------------------------------ 45 | // Exported functions 46 | //------------------------------------------------------------------------------ 47 | 48 | extern unsigned long IAP_PerformCmd (unsigned long FlashCmd); 49 | 50 | #endif //#ifndef IAP_H 51 | 52 | -------------------------------------------------------------------------------- /demo/ATSAM3S/libraries/drivers/utility/math.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ATMEL Microcontroller Software Support 3 | * ---------------------------------------------------------------------------- 4 | * Copyright (c) 2008, Atmel Corporation 5 | * 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * 11 | * - Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the disclaimer below. 13 | * 14 | * Atmel's name may not be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 20 | * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 23 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 26 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * ---------------------------------------------------------------------------- 28 | */ 29 | 30 | #ifndef MATH_H 31 | #define MATH_H 32 | 33 | //------------------------------------------------------------------------------ 34 | // Exported functions 35 | //------------------------------------------------------------------------------ 36 | 37 | extern unsigned int min(unsigned int a, unsigned int b); 38 | extern unsigned int absv(signed int value); 39 | extern unsigned int power(unsigned int x, unsigned int y); 40 | #endif //#ifndef MATH_H 41 | 42 | -------------------------------------------------------------------------------- /demo/ATSAM3S/libraries/drivers/utility/trace.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ATMEL Microcontroller Software Support 3 | * ---------------------------------------------------------------------------- 4 | * Copyright (c) 2008, Atmel Corporation 5 | * 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * 11 | * - Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the disclaimer below. 13 | * 14 | * Atmel's name may not be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 20 | * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 23 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 26 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * ---------------------------------------------------------------------------- 28 | */ 29 | 30 | 31 | //------------------------------------------------------------------------------ 32 | // Headers 33 | //------------------------------------------------------------------------------ 34 | 35 | #include "trace.h" 36 | 37 | //------------------------------------------------------------------------------ 38 | // Internal variables 39 | //------------------------------------------------------------------------------ 40 | 41 | /// Trace level can be set at applet initialization 42 | #if !defined(NOTRACE) && (DYN_TRACES == 1) 43 | unsigned int traceLevel = TRACE_LEVEL; 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /demo/ATSAM3S/libraries/drivers/utility/video.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/demo/ATSAM3S/libraries/drivers/utility/video.c -------------------------------------------------------------------------------- /demo/ATSAM3S_FREERTOS/board/at91sam3s4/flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ 4 | /*-Vector table start*/ 5 | define symbol __ICFEDIT_vector_start__ = 0x000400000; /*Add for CMSIS*/ 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 8 | define symbol __ICFEDIT_region_RAM_end__ = 0x2000BFFF; 9 | define symbol __ICFEDIT_region_ROM_start__ = 0x00400000; 10 | define symbol __ICFEDIT_region_ROM_end__ = 0x0043FFFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x800; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | 15 | export symbol __ICFEDIT_vector_start__; /*Add for CMSIS*/ 16 | /**** End of ICF editor section. ###ICF###*/ 17 | 18 | define memory mem with size = 4G; 19 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 20 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 21 | 22 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 23 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 24 | 25 | initialize by copy { readwrite }; 26 | do not initialize { section .noinit }; 27 | 28 | place at address mem:__ICFEDIT_vector_start__ { readonly section .vectors }; /*Add for CMSIS*/ 29 | place in ROM_region { readonly }; 30 | place in RAM_region { readwrite,,block CSTACK, block HEAP }; 31 | -------------------------------------------------------------------------------- /demo/ATSAM3S_FREERTOS/board/at91sam3s4/sram.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ 4 | /*-Vector table start*/ 5 | define symbol __ICFEDIT_vector_start__ = 0x20000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 8 | define symbol __ICFEDIT_region_RAM_end__ = 0x2000BFFF; 9 | /*-Sizes-*/ 10 | define symbol __ICFEDIT_size_cstack__ = 0x900; 11 | define symbol __ICFEDIT_size_heap__ = 0x200; 12 | /*-Exports-*/ 13 | export symbol __ICFEDIT_vector_start__; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define memory mem with size = 4G; 17 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 18 | 19 | /* define block RamVect with alignment = 8, size = __ICFEDIT_size_vectors__ { }; */ 20 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 21 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 22 | 23 | initialize by copy { readwrite }; 24 | do not initialize { section .noinit }; 25 | 26 | place at address mem:__ICFEDIT_vector_start__ { readonly section .vectors }; 27 | place in RAM_region { readonly, readwrite, block CSTACK, block HEAP }; 28 | -------------------------------------------------------------------------------- /demo/ATSAM3S_FREERTOS/board/at91sam3s4/sram_flashloader.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x20000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x0; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000040; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x2000BFFF; 11 | 12 | /*-Sizes-*/ 13 | define symbol __ICFEDIT_size_cstack__ = 0x0200; 14 | define symbol __ICFEDIT_size_heap__ = 0x000; 15 | /**** End of ICF editor section. ###ICF###*/ 16 | 17 | 18 | define memory mem with size = 4G; 19 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 20 | 21 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 22 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 23 | 24 | //initialize by copy { readwrite }; 25 | do not initialize { section .noinit }; 26 | 27 | place at address mem:__ICFEDIT_intvec_start__ { section .intvec }; 28 | 29 | place at start of RAM_region { block RamTop with fixed order {readonly, section LOWEND}}; 30 | place at end of RAM_region { block RamBottom with fixed order {section HIGHSTART, readwrite, section .init, 31 | block CSTACK, block HEAP}}; 32 | 33 | 34 | -------------------------------------------------------------------------------- /demo/ATSAM3S_FREERTOS/board/at91sam3u4/sram.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ 4 | /*-Vector table start*/ 5 | define symbol __ICFEDIT_vector_start__ = 0x20000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_RAM0_start__ = 0x20000000; 8 | define symbol __ICFEDIT_region_RAM0_end__ = 0x20007FFF; 9 | define symbol __ICFEDIT_region_RAM1_start__ = 0x20080000; 10 | define symbol __ICFEDIT_region_RAM1_end__ = 0x20083FFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /*-Exports-*/ 15 | export symbol __ICFEDIT_vector_start__; 16 | /**** End of ICF editor section. ###ICF###*/ 17 | 18 | define memory mem with size = 4G; 19 | define region RAM0_region = mem:[from __ICFEDIT_region_RAM0_start__ to __ICFEDIT_region_RAM0_end__]; 20 | define region RAM1_region = mem:[from __ICFEDIT_region_RAM1_start__ to __ICFEDIT_region_RAM1_end__]; 21 | /*define region RAM_region = mem:[from __ICFEDIT_region_RAM0_start__+__ICFEDIT_size_vectors__ to __ICFEDIT_region_RAM0_end__] | 22 | mem:[from __ICFEDIT_region_RAM1_start__ to __ICFEDIT_region_RAM1_end__];*/ 23 | 24 | /* define block RamVect with alignment = 8, size = __ICFEDIT_size_vectors__ { }; */ 25 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 26 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 27 | 28 | initialize by copy { readwrite }; 29 | do not initialize { section .noinit }; 30 | 31 | place at address mem:__ICFEDIT_vector_start__ { readonly section .vectors }; 32 | place in RAM0_region { readonly }; 33 | place in RAM1_region { readwrite, block CSTACK, block HEAP }; 34 | -------------------------------------------------------------------------------- /demo/ATSAM3S_FREERTOS/board/board.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/demo/ATSAM3S_FREERTOS/board/board.h -------------------------------------------------------------------------------- /demo/ATSAM3S_FREERTOS/demo.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\demo.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /demo/ATSAM3S_FREERTOS/demo_rtu.bat: -------------------------------------------------------------------------------- 1 | ..\..\tools\modpoll.exe -m rtu -a 10 -r 1000 -c 4 -t 3 -b 38400 -d 8 -p even COM1 2 | -------------------------------------------------------------------------------- /demo/ATSAM3S_FREERTOS/freertos/portable/readme.txt: -------------------------------------------------------------------------------- 1 | Each real time kernel port consists of three files that contain the core kernel 2 | components and are common to every port, and one or more files that are 3 | specific to a particular microcontroller and/or compiler. 4 | 5 | 6 | + The FreeRTOS/Source/Portable/MemMang directory contains the three sample 7 | memory allocators as described on the http://www.FreeRTOS.org WEB site. 8 | 9 | + The other directories each contain files specific to a particular 10 | microcontroller or compiler. 11 | 12 | 13 | 14 | For example, if you are interested in the GCC port for the ATMega323 15 | microcontroller then the port specific files are contained in 16 | FreeRTOS/Source/Portable/GCC/ATMega323 directory. If this is the only 17 | port you are interested in then all the other directories can be 18 | ignored. 19 | 20 | -------------------------------------------------------------------------------- /demo/ATSAM3S_FREERTOS/freertos/readme.txt: -------------------------------------------------------------------------------- 1 | Each real time kernel port consists of three files that contain the core kernel 2 | components and are common to every port, and one or more files that are 3 | specific to a particular microcontroller and or compiler. 4 | 5 | + The FreeRTOS/Source directory contains the three files that are common to 6 | every port - list.c, queue.c and tasks.c. The kernel is contained within these 7 | three files. croutine.c implements the optional co-routine functionality - which 8 | is normally only used on very memory limited systems. 9 | 10 | + The FreeRTOS/Source/Portable directory contains the files that are specific to 11 | a particular microcontroller and or compiler. 12 | 13 | + The FreeRTOS/Source/include directory contains the real time kernel header 14 | files. 15 | 16 | See the readme file in the FreeRTOS/Source/Portable directory for more 17 | information. -------------------------------------------------------------------------------- /demo/ATSAM3S_FREERTOS/libraries/drivers/lcd/lcdd.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ATMEL Microcontroller Software Support 3 | * ---------------------------------------------------------------------------- 4 | * Copyright (c) 2008, Atmel Corporation 5 | * 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * 11 | * - Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the disclaimer below. 13 | * 14 | * Atmel's name may not be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 20 | * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 23 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 26 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * ---------------------------------------------------------------------------- 28 | */ 29 | 30 | /** 31 | * \file 32 | * 33 | * Interface for LCD driver. 34 | * 35 | */ 36 | 37 | #ifndef LCDD_H 38 | #define LCDD_H 39 | 40 | /*---------------------------------------------------------------------------- 41 | * Exported functions 42 | *----------------------------------------------------------------------------*/ 43 | 44 | extern void LCDD_Initialize(void); 45 | 46 | extern void LCDD_On(void); 47 | 48 | extern void LCDD_Off(void); 49 | 50 | extern void LCDD_SetBacklight (uint32_t step); 51 | 52 | #endif /* #ifndef LCDD_H */ 53 | -------------------------------------------------------------------------------- /demo/ATSAM3S_FREERTOS/libraries/drivers/qtouch/libQTouchIarCfg3SRevABeta1.txt: -------------------------------------------------------------------------------- 1 | QTouch library for AT91SAM3S-EK board version A. 2 | Modified board. 3 | 4 | Burst pulses 5 CPU cycles wide. 5 | 6 | Slider on pins PA0, PA1, PA2, PA3, PA4, PA5 7 | -------------------------------------------------------------------------------- /demo/ATSAM3S_FREERTOS/libraries/drivers/qtouch/libQTouchIarCfg3SRevABeta2.txt: -------------------------------------------------------------------------------- 1 | QTouch library for AT91SAM3S-EK board version A. 2 | Modified board. 3 | 4 | Burst pulses 5 CPU cycles wide. 5 | 6 | A Valid key on pins PC22 and PC23 7 | A UP key on pins PC24 and PC25 8 | A Down key on pins PC26 and PC27 9 | A Left key on pins PC28 and PC29 10 | A right key on pins PC30 and PC31 11 | -------------------------------------------------------------------------------- /demo/ATSAM3S_FREERTOS/libraries/drivers/qtouch/libQTouchIarCfg3SRevB.txt: -------------------------------------------------------------------------------- 1 | QTouch library for AT91SAM3S-EK board version B. 2 | 3 | Burst pulses 5 CPU cycles wide. 4 | 5 | Slider on pins PA0, PA1, PA2, PA3, PA4, PA5 6 | 7 | A Valid key on pins PC22 and PC23 8 | A UP key on pins PC24 and PC25 9 | A Down key on pins PC26 and PC27 10 | A Left key on pins PC28 and PC29 11 | A right key on pins PC30 and PC31 12 | -------------------------------------------------------------------------------- /demo/ATSAM3S_FREERTOS/libraries/drivers/tsd/tsd_ads7843.h: -------------------------------------------------------------------------------- 1 | #ifndef _TSD_ADS7843_ 2 | #define _TSD_ADS7843_ 3 | 4 | /*---------------------------------------------------------------------------- 5 | * External functions 6 | *----------------------------------------------------------------------------*/ 7 | extern void TSD_PenPressed( uint32_t dwX, uint32_t dwY ) ; 8 | extern void TSD_PenMoved( uint32_t dwX, uint32_t dwY ) ; 9 | extern void TSD_PenReleased( uint32_t dwX, uint32_t dwY ) ; 10 | 11 | /*---------------------------------------------------------------------------- 12 | * Exported functions 13 | *----------------------------------------------------------------------------*/ 14 | extern void TSD_WaitPenPressed( void ) ; 15 | extern void TSD_WaitPenReleased( void ) ; 16 | extern void TSD_GetRawMeasurement( uint32_t *pData ) ; 17 | extern void TSD_Initialize( int8_t calEn ) ; 18 | 19 | 20 | #endif // _TSD_ADS7843_ -------------------------------------------------------------------------------- /demo/ATSAM3S_FREERTOS/libraries/drivers/usart/uart_console.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ATMEL Microcontroller Software Support 3 | * ---------------------------------------------------------------------------- 4 | * Copyright (c) 2009, Atmel Corporation 5 | * 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * 11 | * - Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the disclaimer below. 13 | * 14 | * Atmel's name may not be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 20 | * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 23 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 26 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * ---------------------------------------------------------------------------- 28 | */ 29 | 30 | 31 | #ifndef UART_CONSOLE_H_ 32 | #define UART_CONSOLE_H_ 33 | 34 | extern void UART_PutChar(uint8_t c); 35 | extern uint8_t UART_GetChar(void); 36 | extern bool UART_IsRxReady(void); 37 | 38 | #endif /* UART_CONSOLE_H_ */ 39 | -------------------------------------------------------------------------------- /demo/ATSAM3S_FREERTOS/libraries/drivers/utility/clock.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ATMEL Microcontroller Software Support 3 | * ---------------------------------------------------------------------------- 4 | * Copyright (c) 2008, Atmel Corporation 5 | * 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * 11 | * - Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the disclaimer below. 13 | * 14 | * Atmel's name may not be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 20 | * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 23 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 26 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * ---------------------------------------------------------------------------- 28 | */ 29 | 30 | #ifndef CLOCK_H 31 | #define CLOCK_H 32 | 33 | //------------------------------------------------------------------------------ 34 | // Global Functions 35 | //------------------------------------------------------------------------------ 36 | 37 | extern void CLOCK_SetConfig(unsigned char configuration); 38 | 39 | extern void CLOCK_DisplayMenu(void); 40 | 41 | extern void CLOCK_UserChangeConfig(void); 42 | 43 | extern unsigned short CLOCK_GetCurrMCK(void); 44 | 45 | extern unsigned short CLOCK_GetCurrPCK(void); 46 | 47 | #endif //#ifndef FREQCONF_H 48 | -------------------------------------------------------------------------------- /demo/ATSAM3S_FREERTOS/libraries/drivers/utility/iap.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ATMEL Microcontroller Software Support 3 | * ---------------------------------------------------------------------------- 4 | * Copyright (c) 2008, Atmel Corporation 5 | * 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * 11 | * - Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the disclaimer below. 13 | * 14 | * Atmel's name may not be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 20 | * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 23 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 26 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * ---------------------------------------------------------------------------- 28 | */ 29 | 30 | /* 31 | Title: IAP 32 | 33 | About: Purpose 34 | Small function for using IAP feature. 35 | 36 | About: Usage 37 | Perform a FLASH command using . 38 | 39 | */ 40 | 41 | #ifndef IAP_H 42 | #define IAP_H 43 | 44 | //------------------------------------------------------------------------------ 45 | // Exported functions 46 | //------------------------------------------------------------------------------ 47 | 48 | extern unsigned long IAP_PerformCmd (unsigned long FlashCmd); 49 | 50 | #endif //#ifndef IAP_H 51 | 52 | -------------------------------------------------------------------------------- /demo/ATSAM3S_FREERTOS/libraries/drivers/utility/math.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ATMEL Microcontroller Software Support 3 | * ---------------------------------------------------------------------------- 4 | * Copyright (c) 2008, Atmel Corporation 5 | * 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * 11 | * - Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the disclaimer below. 13 | * 14 | * Atmel's name may not be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 20 | * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 23 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 26 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * ---------------------------------------------------------------------------- 28 | */ 29 | 30 | #ifndef MATH_H 31 | #define MATH_H 32 | 33 | //------------------------------------------------------------------------------ 34 | // Exported functions 35 | //------------------------------------------------------------------------------ 36 | 37 | extern unsigned int min(unsigned int a, unsigned int b); 38 | extern unsigned int absv(signed int value); 39 | extern unsigned int power(unsigned int x, unsigned int y); 40 | #endif //#ifndef MATH_H 41 | 42 | -------------------------------------------------------------------------------- /demo/ATSAM3S_FREERTOS/libraries/drivers/utility/video.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/demo/ATSAM3S_FREERTOS/libraries/drivers/utility/video.c -------------------------------------------------------------------------------- /demo/AVR/demo_rtu.bat: -------------------------------------------------------------------------------- 1 | ..\..\tools\modpoll.exe -m rtu -a 10 -r 1000 -c 4 -t 3 -b 38400 -d 8 -p even COM1 2 | -------------------------------------------------------------------------------- /demo/AVR/demo_rtu.sh: -------------------------------------------------------------------------------- 1 | ../../tools/modpoll -m rtu -a 10 -r 1000 -c 4 -t 3 -b 38400 -d 8 -p even /dev/ttyS0 2 | -------------------------------------------------------------------------------- /demo/AVR/port/portevent.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: ATMega168 Port 3 | * Copyright (C) 2006 Christian Walter 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id: portevent.c,v 1.2 2006/05/14 21:55:01 wolti Exp $ 20 | */ 21 | 22 | /* ----------------------- Modbus includes ----------------------------------*/ 23 | #include "mb.h" 24 | #include "mbport.h" 25 | 26 | /* ----------------------- Variables ----------------------------------------*/ 27 | static eMBEventType eQueuedEvent; 28 | static BOOL xEventInQueue; 29 | 30 | /* ----------------------- Start implementation -----------------------------*/ 31 | BOOL 32 | xMBPortEventInit( void ) 33 | { 34 | xEventInQueue = FALSE; 35 | return TRUE; 36 | } 37 | 38 | BOOL 39 | xMBPortEventPost( eMBEventType eEvent ) 40 | { 41 | xEventInQueue = TRUE; 42 | eQueuedEvent = eEvent; 43 | return TRUE; 44 | } 45 | 46 | BOOL 47 | xMBPortEventGet( eMBEventType * eEvent ) 48 | { 49 | BOOL xEventHappened = FALSE; 50 | 51 | if( xEventInQueue ) 52 | { 53 | *eEvent = eQueuedEvent; 54 | xEventInQueue = FALSE; 55 | xEventHappened = TRUE; 56 | } 57 | return xEventHappened; 58 | } 59 | -------------------------------------------------------------------------------- /demo/BARE/Makefile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Makefile for the BARE project 3 | ############################################################################### 4 | 5 | ## General Flags 6 | PROJECT = demo 7 | TARGET = demo 8 | 9 | CC=gcc 10 | OBJCOPY=/cygdrive/c/WinAVR/bin/avr-objcopy 11 | 12 | ## Options common to compile, link and assembly rules 13 | COMMON = 14 | 15 | ## Compile options common for all C compilation units. 16 | CFLAGS = $(COMMON) \ 17 | -Iport -I. \ 18 | -I../../modbus/rtu -I../../modbus/ascii -I../../modbus/include 19 | CFLAGS += -Wall -gstabs -Os -Wall -Wstrict-prototypes 20 | 21 | CFLAGS += -Wp,-M,-MP,-MT,$(*F).o,-MF,dep/$(@F).d 22 | 23 | ## Assembly specific flags 24 | ASMFLAGS = $(COMMON) 25 | ASMFLAGS += -x assembler-with-cpp -Wa,-gstabs 26 | 27 | ## Linker flags 28 | LDFLAGS = $(COMMON) 29 | LDFLAGS += -Wl,-Map=$(TARGET).map,--cref 30 | 31 | ## Objects that must be built in order to link 32 | OBJECTS = demo.o 33 | MBPORTOBJECTS = port/portserial.o \ 34 | port/portevent.o \ 35 | port/porttimer.o 36 | MBOBJECTS = ../../modbus/mb.o \ 37 | ../../modbus/rtu/mbrtu.o \ 38 | ../../modbus/rtu/mbcrc.o \ 39 | ../../modbus/ascii/mbascii.o \ 40 | ../../modbus/functions/mbfunccoils.o \ 41 | ../../modbus/functions/mbfuncdiag.o \ 42 | ../../modbus/functions/mbfuncholding.o \ 43 | ../../modbus/functions/mbfuncinput.o \ 44 | ../../modbus/functions/mbfuncother.o \ 45 | ../../modbus/functions/mbfuncdisc.o \ 46 | ../../modbus/functions/mbutils.o 47 | 48 | 49 | ## Build 50 | all: $(TARGET).elf 51 | 52 | ## Compile 53 | demo.o: demo.c 54 | $(CC) $(INCLUDES) $(CFLAGS) -c $< 55 | 56 | ##Link 57 | $(TARGET).elf: $(OBJECTS) $(MBOBJECTS) $(MBPORTOBJECTS) 58 | $(CC) $(LDFLAGS) $(OBJECTS) $(MBPORTOBJECTS) $(MBOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET).elf 59 | 60 | ## Clean target 61 | .PHONY: clean 62 | clean: 63 | -rm -rf $(OBJECTS) $(MBOBJECTS) $(MBPORTOBJECTS) $(TARGET).elf $(TARGET).map 64 | 65 | ## Other dependencies 66 | -include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*) 67 | 68 | -------------------------------------------------------------------------------- /demo/BARE/port/port.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: BARE Port 3 | * Copyright (C) 2006 Christian Walter 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id: port.h,v 1.1 2006/08/22 21:35:13 wolti Exp $ 20 | */ 21 | 22 | #ifndef _PORT_H 23 | #define _PORT_H 24 | 25 | #include 26 | #include 27 | 28 | #define INLINE inline 29 | #define PR_BEGIN_EXTERN_C extern "C" { 30 | #define PR_END_EXTERN_C } 31 | 32 | #define ENTER_CRITICAL_SECTION( ) 33 | #define EXIT_CRITICAL_SECTION( ) 34 | 35 | typedef uint8_t BOOL; 36 | 37 | typedef unsigned char UCHAR; 38 | typedef char CHAR; 39 | 40 | typedef uint16_t USHORT; 41 | typedef int16_t SHORT; 42 | 43 | typedef uint32_t ULONG; 44 | typedef int32_t LONG; 45 | 46 | #ifndef TRUE 47 | #define TRUE 1 48 | #endif 49 | 50 | #ifndef FALSE 51 | #define FALSE 0 52 | #endif 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /demo/BARE/port/portevent.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: BARE Port 3 | * Copyright (C) 2006 Christian Walter 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id: portevent.c,v 1.1 2006/08/22 21:35:13 wolti Exp $ 20 | */ 21 | 22 | /* ----------------------- Modbus includes ----------------------------------*/ 23 | #include "mb.h" 24 | #include "mbport.h" 25 | 26 | /* ----------------------- Variables ----------------------------------------*/ 27 | static eMBEventType eQueuedEvent; 28 | static BOOL xEventInQueue; 29 | 30 | /* ----------------------- Start implementation -----------------------------*/ 31 | BOOL 32 | xMBPortEventInit( void ) 33 | { 34 | xEventInQueue = FALSE; 35 | return TRUE; 36 | } 37 | 38 | BOOL 39 | xMBPortEventPost( eMBEventType eEvent ) 40 | { 41 | xEventInQueue = TRUE; 42 | eQueuedEvent = eEvent; 43 | return TRUE; 44 | } 45 | 46 | BOOL 47 | xMBPortEventGet( eMBEventType * eEvent ) 48 | { 49 | BOOL xEventHappened = FALSE; 50 | 51 | if( xEventInQueue ) 52 | { 53 | *eEvent = eQueuedEvent; 54 | xEventInQueue = FALSE; 55 | xEventHappened = TRUE; 56 | } 57 | return xEventHappened; 58 | } 59 | -------------------------------------------------------------------------------- /demo/BARE/port/porttimer.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: BARE Port 3 | * Copyright (C) 2006 Christian Walter 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id: porttimer.c,v 1.1 2006/08/22 21:35:13 wolti Exp $ 20 | */ 21 | 22 | /* ----------------------- Platform includes --------------------------------*/ 23 | #include "port.h" 24 | 25 | /* ----------------------- Modbus includes ----------------------------------*/ 26 | #include "mb.h" 27 | #include "mbport.h" 28 | 29 | /* ----------------------- static functions ---------------------------------*/ 30 | static void prvvTIMERExpiredISR( void ); 31 | 32 | /* ----------------------- Start implementation -----------------------------*/ 33 | BOOL 34 | xMBPortTimersInit( USHORT usTim1Timerout50us ) 35 | { 36 | return FALSE; 37 | } 38 | 39 | 40 | inline void 41 | vMBPortTimersEnable( ) 42 | { 43 | /* Enable the timer with the timeout passed to xMBPortTimersInit( ) */ 44 | } 45 | 46 | inline void 47 | vMBPortTimersDisable( ) 48 | { 49 | /* Disable any pending timers. */ 50 | } 51 | 52 | /* Create an ISR which is called whenever the timer has expired. This function 53 | * must then call pxMBPortCBTimerExpired( ) to notify the protocol stack that 54 | * the timer has expired. 55 | */ 56 | static void prvvTIMERExpiredISR( void ) 57 | { 58 | ( void )pxMBPortCBTimerExpired( ); 59 | } 60 | 61 | -------------------------------------------------------------------------------- /demo/HCS08/port/portevent.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: BARE Port 3 | * Copyright (C) 2006 Christian Walter 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id: portevent.c,v 1.1 2008/03/28 15:59:07 wolti Exp $ 20 | */ 21 | 22 | /* ----------------------- Modbus includes ----------------------------------*/ 23 | #include "mb.h" 24 | #include "mbport.h" 25 | 26 | /* ----------------------- Variables ----------------------------------------*/ 27 | static eMBEventType eQueuedEvent; 28 | static BOOL xEventInQueue; 29 | 30 | /* ----------------------- Start implementation -----------------------------*/ 31 | BOOL 32 | xMBPortEventInit( void ) 33 | { 34 | xEventInQueue = FALSE; 35 | return TRUE; 36 | } 37 | 38 | BOOL 39 | xMBPortEventPost( eMBEventType eEvent ) 40 | { 41 | xEventInQueue = TRUE; 42 | eQueuedEvent = eEvent; 43 | return TRUE; 44 | } 45 | 46 | BOOL 47 | xMBPortEventGet( eMBEventType * eEvent ) 48 | { 49 | BOOL xEventHappened = FALSE; 50 | 51 | if( xEventInQueue ) 52 | { 53 | *eEvent = eQueuedEvent; 54 | xEventInQueue = FALSE; 55 | xEventHappened = TRUE; 56 | } 57 | return xEventHappened; 58 | } 59 | -------------------------------------------------------------------------------- /demo/LINUX/README.txt: -------------------------------------------------------------------------------- 1 | 2 | FREEMODBUS 0.8 LINUX EXAMPLE 3 | ============================ 4 | 5 | REQUIREMENTS 6 | ============ 7 | 8 | This example contains a simple demo program for a Linux host. The default 9 | demo opens the serial port on /dev/ttyS0 and waits for commands from an 10 | Modbus master. Demo versions of Modbus Masters can be found in [1] and [2]. 11 | 12 | INSTALLATION 13 | ============ 14 | 15 | The program can be built by calling 'make flash'. This demo application 16 | was tested on Redhat Enterprise Linux 4 (RHEL4) but should work on any 17 | recent distribution. 18 | 19 | TESTING 20 | ======= 21 | 22 | Install a Null-Modem cable between /dev/ttyS0 and /dev/ttyS1. Next start 23 | the Modbus Sample Application and test if the input registers starting at 24 | protocol address 1000 can be read. There are four registers value available 25 | and the output should look like: 26 | 27 | Polling slave (Ctrl-C to stop) ... 28 | [1000]: 6474 29 | [1001]: 0 30 | [1002]: 0 31 | [1003]: 0 32 | Polling slave (Ctrl-C to stop) ... 33 | [1000]: -8831 34 | [1001]: 0 35 | [1002]: 0 36 | [1003]: 0 37 | Polling slave (Ctrl-C to stop) ... 38 | 39 | The simple testing utility used in the 'demo.sh' script can be found at [3]. 40 | 41 | [1] WinTech ModScan32: http://www.win-tech.com/html/modscan32.htm 42 | [2] Modus Poll: http://www.modbustools.com/modbus_poll.asp 43 | [3] FieldTalk Modpoll: http://www.focus-sw.com/fieldtalk/modpoll.html 44 | 45 | Version: $Id: README.txt,v 1.1 2006/08/01 20:58:49 wolti Exp $ 46 | -------------------------------------------------------------------------------- /demo/LINUX/demo.sh: -------------------------------------------------------------------------------- 1 | ./modpoll -b 38400 -d 8 -p even -a 10 -t 3 -r 1000 /dev/ttyS1 2 | -------------------------------------------------------------------------------- /demo/LPC214X/README.txt: -------------------------------------------------------------------------------- 1 | 2 | FREEMODBUS 1.2 LPC214X PORT 3 | =========================== 4 | 5 | REQUIREMENTS 6 | ============ 7 | 8 | This demo application provides a port for the LPC214X series of processors 9 | from NXP Semiconductors. The port was done using the MCB2140 from Keil[1] 10 | which features a LPC2148 MCU. 11 | It requires a wired serial port to a host processor and a Modbus Master 12 | Software on the PC side to be useful. Demo versions of Modbus Masters 13 | can be found in [2] and [3]. 14 | 15 | 16 | TESTING 17 | ======= 18 | 19 | Start the Modbus Sample Application and test if the input registers starting 20 | at protocol address 1000 can be read. There are four registers value avai- 21 | lable and the output should look like: 22 | 23 | Polling slave (Ctrl-C to stop) ... 24 | [1000]: 6474 25 | [1001]: 0 26 | [1002]: 0 27 | [1003]: 0 28 | Polling slave (Ctrl-C to stop) ... 29 | [1000]: -8831 30 | [1001]: 0 31 | [1002]: 0 32 | [1003]: 0 33 | Polling slave (Ctrl-C to stop) ... 34 | 35 | The simple testing utility used in the 'demo_rtu.bat' script can be found 36 | at [4]. 37 | 38 | 39 | [1] Keil MCB2140 kit: http://www.keil.com/mcb2140/ 40 | [2] WinTech ModScan32: http://www.win-tech.com/html/modscan32.htm 41 | [3] Modus Poll: http://www.modbustools.com/modbus_poll.asp 42 | [4] FieldTalk Modpoll: http://www.focus-sw.com/fieldtalk/modpoll.html 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /demo/LPC214X/build/.dont_remove: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/demo/LPC214X/build/.dont_remove -------------------------------------------------------------------------------- /demo/LPC214X/build/bin/.dont_remove: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/demo/LPC214X/build/bin/.dont_remove -------------------------------------------------------------------------------- /demo/LPC214X/build/lst/.dont_remove: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/demo/LPC214X/build/lst/.dont_remove -------------------------------------------------------------------------------- /demo/LPC214X/build/obj/.dont_remove: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/demo/LPC214X/build/obj/.dont_remove -------------------------------------------------------------------------------- /demo/LPC214X/demo.Uv2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/demo/LPC214X/demo.Uv2 -------------------------------------------------------------------------------- /demo/LPC214X/port/port.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: LPC214X Port 3 | * Copyright (C) 2007 Tiago Prado Lone 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id: port.c,v 1.1 2007/04/24 23:15:18 wolti Exp $ 20 | */ 21 | 22 | /* ----------------------- System includes --------------------------------*/ 23 | #include 24 | 25 | /* ----------------------- Modbus includes ----------------------------------*/ 26 | 27 | /* ----------------------- Variables ----------------------------------------*/ 28 | int VIC_Temp; 29 | 30 | /* ----------------------- Start implementation -----------------------------*/ 31 | void 32 | EnterCriticalSection( ) 33 | { 34 | VIC_Temp = VICIntEnable; /* Save VICIntEnable */ 35 | VICIntEnClr = VIC_Temp; /* Disable Interruptions */ 36 | } 37 | 38 | void 39 | ExitCriticalSection( ) 40 | { 41 | VICIntEnable = VIC_Temp; /* Restore VICIntEnable */ 42 | } 43 | -------------------------------------------------------------------------------- /demo/LPC214X/port/port.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: BARE Port 3 | * Copyright (C) 2006 Christian Walter 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id: port.h,v 1.1 2007/04/24 23:15:18 wolti Exp $ 20 | */ 21 | 22 | #ifndef _PORT_H 23 | #define _PORT_H 24 | 25 | #include 26 | #include 27 | 28 | #define INLINE 29 | #define PR_BEGIN_EXTERN_C extern "C" { 30 | #define PR_END_EXTERN_C } 31 | 32 | #define ENTER_CRITICAL_SECTION( ) EnterCriticalSection( ) 33 | #define EXIT_CRITICAL_SECTION( ) ExitCriticalSection( ) 34 | 35 | #define CCLK 60000000L 36 | #define PCLK CCLK/4 37 | 38 | void EnterCriticalSection( void ); 39 | void ExitCriticalSection( void ); 40 | 41 | typedef uint8_t BOOL; 42 | 43 | typedef unsigned char UCHAR; 44 | typedef char CHAR; 45 | 46 | typedef uint16_t USHORT; 47 | typedef int16_t SHORT; 48 | 49 | typedef uint32_t ULONG; 50 | typedef int32_t LONG; 51 | 52 | #ifndef TRUE 53 | #define TRUE 1 54 | #endif 55 | 56 | #ifndef FALSE 57 | #define FALSE 0 58 | #endif 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /demo/LPC214X/port/portevent.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: LPC214X Port 3 | * Copyright (C) 2007 Tiago Prado Lone 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id: portevent.c,v 1.1 2007/04/24 23:15:18 wolti Exp $ 20 | */ 21 | 22 | /* ----------------------- Modbus includes ----------------------------------*/ 23 | #include "mb.h" 24 | #include "mbport.h" 25 | 26 | /* ----------------------- Variables ----------------------------------------*/ 27 | static eMBEventType eQueuedEvent; 28 | static BOOL xEventInQueue; 29 | 30 | /* ----------------------- Start implementation -----------------------------*/ 31 | BOOL 32 | xMBPortEventInit( void ) 33 | { 34 | xEventInQueue = FALSE; 35 | return TRUE; 36 | } 37 | 38 | BOOL 39 | xMBPortEventPost( eMBEventType eEvent ) 40 | { 41 | xEventInQueue = TRUE; 42 | eQueuedEvent = eEvent; 43 | return TRUE; 44 | } 45 | 46 | BOOL 47 | xMBPortEventGet( eMBEventType * eEvent ) 48 | { 49 | BOOL xEventHappened = FALSE; 50 | 51 | if( xEventInQueue ) 52 | { 53 | *eEvent = eQueuedEvent; 54 | xEventInQueue = FALSE; 55 | xEventHappened = TRUE; 56 | } 57 | return xEventHappened; 58 | } 59 | -------------------------------------------------------------------------------- /demo/MCF5235/m5235-ram.ld: -------------------------------------------------------------------------------- 1 | STARTUP(crt0.o) 2 | INPUT(vector.o) 3 | OUTPUT_ARCH(m68k) 4 | SEARCH_DIR(.) 5 | GROUP(-lc -lgcc) 6 | 7 | __DYNAMIC = 0; 8 | 9 | MEMORY 10 | { 11 | ram (rwx) : ORIGIN = 0x00100000, LENGTH = 0x00010000 12 | per (rwx) : ORIGIN = 0x40000000, LENGTH = 0x40000000 13 | } 14 | 15 | PROVIDE (__stack = 0x10FFFC); 16 | 17 | SECTIONS 18 | { 19 | .text : 20 | { 21 | __text_start = . ; 22 | *(.vector) 23 | . = ALIGN (0x100); 24 | *(.text) 25 | . = ALIGN (16); 26 | 27 | *(.eh_frame) 28 | . = ALIGN (16); 29 | 30 | *(.gnu.linkonce.t.*) 31 | 32 | . = ALIGN(0x4); 33 | __CTOR_LIST__ = .; 34 | ___CTOR_LIST__ = .; 35 | LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) 36 | *(.ctors) 37 | LONG(0) 38 | __CTOR_END__ = .; 39 | __DTOR_LIST__ = .; 40 | ___DTOR_LIST__ = .; 41 | LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) 42 | *(.dtors) 43 | LONG(0) 44 | __DTOR_END__ = .; 45 | *(.rodata) 46 | *(.gcc_except_table) 47 | 48 | . = ALIGN(0x2); 49 | __INIT_SECTION__ = . ; 50 | LONG (0x4e560000) /* linkw %fp,#0 */ 51 | *(.init) 52 | SHORT (0x4e5e) /* unlk %fp */ 53 | SHORT (0x4e75) /* rts */ 54 | 55 | __FINI_SECTION__ = . ; 56 | LONG (0x4e560000) /* linkw %fp,#0 */ 57 | *(.fini) 58 | SHORT (0x4e5e) /* unlk %fp */ 59 | SHORT (0x4e75) /* rts */ 60 | 61 | *(.lit) 62 | . = ALIGN(16); 63 | _etext = .; 64 | etext = .; 65 | } > ram 66 | 67 | .data : 68 | { 69 | copy_start = .; 70 | *(.shdata) 71 | *(.data) 72 | *(.gnu.linkonce.d.*) 73 | . = ALIGN (16); 74 | _edata = .; 75 | copy_end = .; 76 | } > ram 77 | 78 | .bss : 79 | { 80 | . = ALIGN(0x4); 81 | __bss_start = . ; 82 | *(.shbss) 83 | *(.bss) 84 | *(COMMON) 85 | _end = ALIGN (0x8); 86 | __end = _end; 87 | } > ram 88 | 89 | .peripheral (NOLOAD): 90 | { 91 | __per_start = . ; 92 | *(.peripheral) 93 | } > per 94 | 95 | .stab 0 (NOLOAD) : 96 | { 97 | *(.stab) 98 | } 99 | 100 | .stabstr 0 (NOLOAD) : 101 | { 102 | *(.stabstr) 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /demo/MCF5235/mcf523x/m523xevb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: m523xevb.h 3 | * Purpose: Evaluation board definitions and memory map information 4 | * 5 | * Notes: 6 | */ 7 | 8 | #ifndef _M523XEVB_H 9 | #define _M523XEVB_H 10 | 11 | /********************************************************************/ 12 | 13 | #include "mcf5xxx.h" 14 | #include "mcf523x.h" 15 | #include "io.h" 16 | 17 | /********************************************************************/ 18 | 19 | /* 20 | * Debug prints ON (#undef) or OFF (#define) 21 | */ 22 | #undef DEBUG 23 | 24 | /* 25 | * System Bus Clock Info 26 | */ 27 | #define SYSTEM_CLOCK 75 /* system bus frequency in MHz */ 28 | #define PERIOD 13.33 /* system bus period in ns */ 29 | 30 | #define UART_BAUD 19200 /* 19200 */ 31 | 32 | /* 33 | * Flash Device Info 34 | */ 35 | #define AMD_FLASH_AM29PL160CB_16BIT 36 | 37 | /* 38 | * Ethernet Port Info 39 | */ 40 | #define FEC_PHY0 (0x01) 41 | 42 | /* 43 | * Memory map definitions from linker command files 44 | */ 45 | extern uint8 __IPSBAR[]; 46 | extern uint8 __SDRAM[]; 47 | extern uint8 __SDRAM_SIZE[]; 48 | extern uint8 __SRAM[]; 49 | extern uint8 __SRAM_SIZE[]; 50 | extern uint8 __EXT_SRAM[]; 51 | extern uint8 __EXT_SRAM_SIZE[]; 52 | extern uint8 __EXT_FLASH[]; 53 | extern uint8 __EXT_FLASH_SIZE[]; 54 | 55 | /* 56 | * Memory Map Info 57 | */ 58 | #define IPSBAR_ADDRESS (uint32)__IPSBAR 59 | 60 | #define SDRAM_ADDRESS (uint32)__SDRAM 61 | #define SDRAM_SIZE (uint32)__SDRAM_SIZE 62 | 63 | #define SRAM_ADDRESS (uint32)__SRAM 64 | #define SRAM_SIZE (uint32)__SRAM_SIZE 65 | 66 | #define EXT_SRAM_ADDRESS (uint32)__EXT_SRAM 67 | #define EXT_SRAM_SIZE (uint32)__EXT_SRAM_SIZE 68 | 69 | #define EXT_FLASH_ADDRESS (uint32)__EXT_FLASH 70 | #define EXT_FLASH_SIZE (uint32)__EXT_FLASH_SIZE 71 | 72 | /* 73 | * Interrupt Controller Definitions 74 | */ 75 | #define TIMER_NETWORK_LEVEL 3 76 | #define FEC_LEVEL 4 77 | 78 | /* 79 | * Timer period info 80 | */ 81 | #define TIMER_NETWORK_PERIOD 1000000000/0x10000 /* 1 sec / max timeout */ 82 | 83 | /********************************************************************/ 84 | 85 | #endif /* _M523XEVB_H */ 86 | -------------------------------------------------------------------------------- /demo/MCF5235/mcf523x/mcf523x_fmpll.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: mcf523x_fmpll.h 3 | * Purpose: Register and bit definitions for the MCF523X 4 | * 5 | * Notes: 6 | * 7 | */ 8 | 9 | #ifndef __MCF523X_FMPLL_H__ 10 | #define __MCF523X_FMPLL_H__ 11 | 12 | /********************************************************************* 13 | * 14 | * Frequency Modulated Phase Locked Loop (FMPLL) 15 | * 16 | *********************************************************************/ 17 | 18 | /* Register read/write macros */ 19 | #define MCF_FMPLL_SYNCR (*(vuint32*)(void*)(&__IPSBAR[0x120000])) 20 | #define MCF_FMPLL_SYNSR (*(vuint32*)(void*)(&__IPSBAR[0x120004])) 21 | 22 | /* Bit definitions and macros for MCF_FMPLL_SYNCR */ 23 | #define MCF_FMPLL_SYNCR_EXP(x) (((x)&0x000003FF)<<0) 24 | #define MCF_FMPLL_SYNCR_DEPTH(x) (((x)&0x00000003)<<10) 25 | #define MCF_FMPLL_SYNCR_RATE (0x00001000) 26 | #define MCF_FMPLL_SYNCR_LOCIRQ (0x00002000) 27 | #define MCF_FMPLL_SYNCR_LOLIRQ (0x00004000) 28 | #define MCF_FMPLL_SYNCR_DISCLK (0x00008000) 29 | #define MCF_FMPLL_SYNCR_LOCRE (0x00010000) 30 | #define MCF_FMPLL_SYNCR_LOLRE (0x00020000) 31 | #define MCF_FMPLL_SYNCR_LOCEN (0x00040000) 32 | #define MCF_FMPLL_SYNCR_RFD(x) (((x)&0x00000007)<<19) 33 | #define MCF_FMPLL_SYNCR_MFD(x) (((x)&0x00000007)<<24) 34 | 35 | /* Bit definitions and macros for MCF_FMPLL_SYNSR */ 36 | #define MCF_FMPLL_SYNSR_CALPASS (0x00000001) 37 | #define MCF_FMPLL_SYNSR_CALDONE (0x00000002) 38 | #define MCF_FMPLL_SYNSR_LOCF (0x00000004) 39 | #define MCF_FMPLL_SYNSR_LOCK (0x00000008) 40 | #define MCF_FMPLL_SYNSR_LOCKS (0x00000010) 41 | #define MCF_FMPLL_SYNSR_PLLREF (0x00000020) 42 | #define MCF_FMPLL_SYNSR_PLLSEL (0x00000040) 43 | #define MCF_FMPLL_SYNSR_MODE (0x00000080) 44 | #define MCF_FMPLL_SYNSR_LOC (0x00000100) 45 | #define MCF_FMPLL_SYNSR_LOLF (0x00000200) 46 | 47 | /********************************************************************/ 48 | 49 | #endif /* __MCF523X_FMPLL_H__ */ 50 | -------------------------------------------------------------------------------- /demo/MCF5235/port/port.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: MCF5235 Port 3 | * Copyright (C) 2006 Christian Walter 4 | * Parts of crt0.S Copyright (c) 1995, 1996, 1998 Cygnus Support 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | * 20 | * File: $Id: port.h,v 1.2 2006/06/15 15:29:41 wolti Exp $ 21 | */ 22 | 23 | #ifndef _PORT_H 24 | #define _PORT_H 25 | 26 | #define INLINE inline 27 | #define PR_BEGIN_EXTERN_C extern "C" { 28 | #define PR_END_EXTERN_C } 29 | 30 | #define ENTER_CRITICAL_SECTION( ) prvvPortEnterCritical() 31 | #define EXIT_CRITICAL_SECTION( ) prvvPortExitCritical() 32 | 33 | #define assert( x ) 34 | 35 | inline void prvvPortEnterCritical( ); 36 | inline void prvvPortExitCritical( ); 37 | 38 | typedef char BOOL; 39 | 40 | typedef unsigned char UCHAR; 41 | typedef char CHAR; 42 | 43 | typedef unsigned short USHORT; 44 | typedef short SHORT; 45 | 46 | typedef unsigned long ULONG; 47 | typedef long LONG; 48 | 49 | #ifndef TRUE 50 | #define TRUE 1 51 | #endif 52 | 53 | #ifndef FALSE 54 | #define FALSE 0 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /demo/MCF5235/port/portevent.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: MCF5235 Port 3 | * Copyright (C) 2006 Christian Walter 4 | * Parts of crt0.S Copyright (c) 1995, 1996, 1998 Cygnus Support 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | * 20 | * File: $Id: portevent.c,v 1.1 2006/05/14 21:59:16 wolti Exp $ 21 | */ 22 | 23 | /* ----------------------- Modbus includes ----------------------------------*/ 24 | #include "mb.h" 25 | #include "mbport.h" 26 | 27 | /* ----------------------- Variables ----------------------------------------*/ 28 | static eMBEventType eQueuedEvent; 29 | static BOOL xEventInQueue; 30 | 31 | /* ----------------------- Start implementation -----------------------------*/ 32 | BOOL 33 | xMBPortEventInit( void ) 34 | { 35 | xEventInQueue = FALSE; 36 | return TRUE; 37 | } 38 | 39 | BOOL 40 | xMBPortEventPost( eMBEventType eEvent ) 41 | { 42 | xEventInQueue = TRUE; 43 | eQueuedEvent = eEvent; 44 | return TRUE; 45 | } 46 | 47 | BOOL 48 | xMBPortEventGet( eMBEventType * eEvent ) 49 | { 50 | BOOL xEventHappened = FALSE; 51 | 52 | if( xEventInQueue ) 53 | { 54 | *eEvent = eQueuedEvent; 55 | xEventInQueue = FALSE; 56 | xEventHappened = TRUE; 57 | } 58 | return xEventHappened; 59 | } 60 | -------------------------------------------------------------------------------- /demo/MCF5235/support/m5235.gdb: -------------------------------------------------------------------------------- 1 | define setup-and-load 2 | set $rambar=0x100001 3 | tbreak start 4 | tbreak main 5 | end 6 | 7 | define debug-printexception 8 | printf "vector: %d", *(unsigned short *)$sp >> 2 &0x1F 9 | printf "old pc: 0x%08x", *(unsigned long *)($sp + 4) 10 | printf "old sr: 0x%02x", *(unsigned short *)($sp + 2) 11 | end 12 | 13 | define execute 14 | # set $sp = *(long *)0x20000 15 | set $pc = *(long *)0x100004 16 | tk gdbtk_update 17 | end 18 | 19 | define write 20 | set *0x1000000 = 33 21 | end 22 | 23 | define simple 24 | write 25 | print /x *0x1000000 26 | end 27 | 28 | define wait 29 | set $delay = 10000 30 | while $delay > 0 31 | set $delay = $delay - 1 32 | end 33 | end 34 | 35 | define debug-sramtest 36 | set $srambase = 0x20000000 37 | set $sramsize = 0x00010000 38 | printf "Testing SRAM : 0x%08X - 0x%08X\n", $srambase, ($srambase + $sramsize) 39 | set $i = $srambase 40 | while $i < ($srambase + $sramsize) 41 | set *(unsigned long *)($i) = 0xAA55AA55 42 | wait 43 | if 0xAA55AA55 != *(unsigned long *)$i 44 | printf " 0x%08X = FAIL\n", $i 45 | else 46 | printf " 0x%08X = OK\n", $i 47 | end 48 | set $i = $i + 0x1000 49 | end 50 | end 51 | 52 | define debug-sdramtest 53 | set $sdrambase = 0x00000000 54 | set $sdramsize = 0x01100000 55 | printf "Testing SDRAM : 0x%08X - 0x%08X\n", $sdrambase, ($sdrambase + $sdramsize) 56 | set $i = $sdrambase 57 | while $i < ($sdrambase + $sdramsize) 58 | set *(unsigned long *)($i) = 0xAA55AA55 59 | wait 60 | if 0xAA55AA55 != *(unsigned long *)$i 61 | printf " 0x%08X = FAIL\n", $i 62 | else 63 | printf " 0x%08X = OK\n", $i 64 | end 65 | set $i = $i + 0x10000 66 | end 67 | end 68 | -------------------------------------------------------------------------------- /demo/MCF5235/support/mcf5235.mac: -------------------------------------------------------------------------------- 1 | ; set IPSBAR address 2 | mbar 40000000 3 | ; set RAMBAR for processor 4 | control c05 100001 5 | ; load debug file 6 | hload ..\demo.elf 7 | ; set breakpoint at main 8 | br main 9 | -------------------------------------------------------------------------------- /demo/MCF5235CW/demo.mcp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/demo/MCF5235CW/demo.mcp -------------------------------------------------------------------------------- /demo/MCF5235CW/freertos/include/projdefs.h: -------------------------------------------------------------------------------- 1 | /* 2 | FreeRTOS.org V4.0.5 - Copyright (C) 2003-2006 Richard Barry. 3 | 4 | This file is part of the FreeRTOS.org distribution. 5 | 6 | FreeRTOS.org is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | FreeRTOS.org is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with FreeRTOS.org; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | A special exception to the GPL can be applied should you wish to distribute 21 | a combined work that includes FreeRTOS.org, without being obliged to provide 22 | the source code for any proprietary components. See the licensing section 23 | of http://www.FreeRTOS.org for full details of how and when the exception 24 | can be applied. 25 | 26 | *************************************************************************** 27 | See http://www.FreeRTOS.org for documentation, latest information, license 28 | and contact details. Please ensure to read the configuration and relevant 29 | port sections of the online documentation. 30 | *************************************************************************** 31 | */ 32 | 33 | #ifndef PROJDEFS_H 34 | #define PROJDEFS_H 35 | 36 | /* Defines to prototype to which task functions must conform. */ 37 | typedef void (*pdTASK_CODE)( void * ); 38 | 39 | #define pdTRUE ( 1 ) 40 | #define pdFALSE ( 0 ) 41 | 42 | #define pdPASS ( 1 ) 43 | #define pdFAIL ( 0 ) 44 | 45 | /* Error definitions. */ 46 | #define errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY ( -1 ) 47 | #define errNO_TASK_TO_RUN ( -2 ) 48 | #define errQUEUE_FULL ( -3 ) 49 | #define errQUEUE_BLOCKED ( -4 ) 50 | #define errQUEUE_YIELD ( -5 ) 51 | 52 | #endif 53 | 54 | 55 | -------------------------------------------------------------------------------- /demo/MCF5235CW/include/arch/m523xbcc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: m523xbcc.h 3 | * Purpose: Evaluation board definitions and memory map information 4 | * 5 | * Notes: 6 | */ 7 | 8 | #ifndef _M523XBCC_H 9 | #define _M523XBCC_H 10 | 11 | /********************************************************************/ 12 | 13 | #include "mcf5xxx.h" 14 | #include "mcf523x.h" 15 | #include "io.h" 16 | 17 | /********************************************************************/ 18 | 19 | /* 20 | * Debug prints ON (#undef) or OFF (#define) 21 | */ 22 | #undef DEBUG 23 | 24 | /* 25 | * System Bus Clock Info 26 | */ 27 | #define SYSTEM_CLOCK 75 /* system bus frequency in MHz */ 28 | #define PERIOD 13.33 /* system bus period in ns */ 29 | 30 | /* 31 | * Flash Device Info 32 | */ 33 | #define AMD_FLASH_AM29PL160CB_16BIT 34 | 35 | /* 36 | * Ethernet Port Info 37 | */ 38 | #define FEC_PHY0 (0x01) 39 | 40 | /* 41 | * Memory map definitions from linker command files 42 | */ 43 | extern uint8 __IPSBAR[]; 44 | extern uint8 __SDRAM[]; 45 | extern uint8 __SDRAM_SIZE[]; 46 | extern uint8 __SRAM[]; 47 | extern uint8 __SRAM_SIZE[]; 48 | extern uint8 __EXT_FLASH[]; 49 | extern uint8 __EXT_FLASH_SIZE[]; 50 | 51 | /* 52 | * Memory Map Info 53 | */ 54 | #define IPSBAR_ADDRESS (uint32)__IPSBAR 55 | 56 | #define SDRAM_ADDRESS (uint32)__SDRAM 57 | #define SDRAM_SIZE (uint32)__SDRAM_SIZE 58 | 59 | #define SRAM_ADDRESS (uint32)__SRAM 60 | #define SRAM_SIZE (uint32)__SRAM_SIZE 61 | 62 | #define EXT_FLASH_ADDRESS (uint32)__EXT_FLASH 63 | #define EXT_FLASH_SIZE (uint32)__EXT_FLASH_SIZE 64 | 65 | /* 66 | * Interrupt Controller Definitions 67 | */ 68 | #define TIMER_NETWORK_LEVEL 3 69 | #define FEC_LEVEL 4 70 | 71 | /* 72 | * Timer period info 73 | */ 74 | #define TIMER_NETWORK_PERIOD 1000000000/0x10000 /* 1 sec / max timeout */ 75 | 76 | /********************************************************************/ 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /demo/MCF5235CW/include/arch/mcf523x/mcf523x_fmpll.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: mcf523x_fmpll.h 3 | * Purpose: Register and bit definitions for the MCF523X 4 | * 5 | * Notes: 6 | * 7 | */ 8 | 9 | #ifndef __MCF523X_FMPLL_H__ 10 | #define __MCF523X_FMPLL_H__ 11 | 12 | /********************************************************************* 13 | * 14 | * Frequency Modulated Phase Locked Loop (FMPLL) 15 | * 16 | *********************************************************************/ 17 | 18 | /* Register read/write macros */ 19 | #define MCF_FMPLL_SYNCR (*(vuint32*)(void*)(&__IPSBAR[0x120000])) 20 | #define MCF_FMPLL_SYNSR (*(vuint32*)(void*)(&__IPSBAR[0x120004])) 21 | 22 | /* Bit definitions and macros for MCF_FMPLL_SYNCR */ 23 | #define MCF_FMPLL_SYNCR_EXP(x) (((x)&0x000003FF)<<0) 24 | #define MCF_FMPLL_SYNCR_DEPTH(x) (((x)&0x00000003)<<10) 25 | #define MCF_FMPLL_SYNCR_RATE (0x00001000) 26 | #define MCF_FMPLL_SYNCR_LOCIRQ (0x00002000) 27 | #define MCF_FMPLL_SYNCR_LOLIRQ (0x00004000) 28 | #define MCF_FMPLL_SYNCR_DISCLK (0x00008000) 29 | #define MCF_FMPLL_SYNCR_LOCRE (0x00010000) 30 | #define MCF_FMPLL_SYNCR_LOLRE (0x00020000) 31 | #define MCF_FMPLL_SYNCR_LOCEN (0x00040000) 32 | #define MCF_FMPLL_SYNCR_RFD(x) (((x)&0x00000007)<<19) 33 | #define MCF_FMPLL_SYNCR_MFD(x) (((x)&0x00000007)<<24) 34 | 35 | /* Bit definitions and macros for MCF_FMPLL_SYNSR */ 36 | #define MCF_FMPLL_SYNSR_CALPASS (0x00000001) 37 | #define MCF_FMPLL_SYNSR_CALDONE (0x00000002) 38 | #define MCF_FMPLL_SYNSR_LOCF (0x00000004) 39 | #define MCF_FMPLL_SYNSR_LOCK (0x00000008) 40 | #define MCF_FMPLL_SYNSR_LOCKS (0x00000010) 41 | #define MCF_FMPLL_SYNSR_PLLREF (0x00000020) 42 | #define MCF_FMPLL_SYNSR_PLLSEL (0x00000040) 43 | #define MCF_FMPLL_SYNSR_MODE (0x00000080) 44 | #define MCF_FMPLL_SYNSR_LOC (0x00000100) 45 | #define MCF_FMPLL_SYNSR_LOLF (0x00000200) 46 | 47 | /********************************************************************/ 48 | 49 | #endif /* __MCF523X_FMPLL_H__ */ 50 | -------------------------------------------------------------------------------- /demo/MCF5235CW/include/ram_symbol.h: -------------------------------------------------------------------------------- 1 | /* 2 | FreeRTOS MCF5235 port - Copyright (C) 2006 Christian Walter. 3 | Copyright @ 1995-2005 Freescale Semiconductor, Inc. All rights reserved 4 | 5 | FreeRTOS is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | FreeRTOS is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with FreeRTOS; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | A special exception to the GPL can be applied should you wish to distribute 20 | a combined work that includes FreeRTOS, without being obliged to provide 21 | the source code for any proprietary components. See the licensing section 22 | of http://www.FreeRTOS.org for full details of how and when the exception 23 | can be applied. 24 | 25 | *************************************************************************** 26 | See http://www.FreeRTOS.org for documentation, latest information, license 27 | and contact details. Please ensure to read the configuration and relevant 28 | port sections of the online documentation. 29 | *************************************************************************** 30 | */ 31 | 32 | /* Defining DEBUG turns on debug print information */ 33 | #define DEBUG 1 34 | 35 | /* CodeWarrior looks for an underscore prepended to C function names */ 36 | #define _UNDERSCORE_ 37 | 38 | /* Define a constant to inform files we are using CodeWarrior */ 39 | #ifndef _MWERKS_ 40 | #define _MWERKS_ 41 | #endif 42 | 43 | /* Modify the interrupt type to work with CodeWarrior */ 44 | #define __interrupt__ __declspec(interrupt) 45 | 46 | #define CODEWARRIOR_MCF5235 47 | #define FCPU ( 150000000UL ) 48 | #define FSYS_2 ( 75000000UL ) 49 | -------------------------------------------------------------------------------- /demo/MCF5235CW/port/port.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: MCF5235 Port 3 | * Copyright (C) 2006 Christian Walter 4 | * Parts of crt0.S Copyright (c) 1995, 1996, 1998 Cygnus Support 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | * 20 | * File: $Id: port.h,v 1.1 2007/02/19 00:56:14 wolti Exp $ 21 | */ 22 | 23 | #ifndef _PORT_H 24 | #define _PORT_H 25 | 26 | /* ----------------------- Defines ----------------------------------------- */ 27 | #define INLINE 28 | #define PR_BEGIN_EXTERN_C extern "C" { 29 | #define PR_END_EXTERN_C } 30 | 31 | #undef assert 32 | #define assert( x ) 33 | 34 | #define ENTER_CRITICAL_SECTION( ) prvvPortEnterCritical() 35 | #define EXIT_CRITICAL_SECTION( ) prvvPortExitCritical() 36 | 37 | #ifndef TRUE 38 | #define TRUE 1 39 | #endif 40 | 41 | #ifndef FALSE 42 | #define FALSE 0 43 | #endif 44 | 45 | /* ----------------------- Type definitions -------------------------------- */ 46 | typedef char BOOL; 47 | 48 | typedef unsigned char UCHAR; 49 | typedef char CHAR; 50 | 51 | typedef unsigned short USHORT; 52 | typedef short SHORT; 53 | 54 | typedef unsigned long ULONG; 55 | typedef long LONG; 56 | 57 | /* ----------------------- Defines ----------------------------------------- */ 58 | void prvvPortEnterCritical( ); 59 | void prvvPortExitCritical( ); 60 | 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /demo/MCF5235CW/port/portevent.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: MCF5235 Port 3 | * Copyright (C) 2006 Christian Walter 4 | * Parts of crt0.S Copyright (c) 1995, 1996, 1998 Cygnus Support 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | * 20 | * File: $Id: portevent.c,v 1.1 2007/02/19 00:56:14 wolti Exp $ 21 | */ 22 | 23 | /* ----------------------- Modbus includes ----------------------------------*/ 24 | #include "mb.h" 25 | #include "mbport.h" 26 | 27 | /* ----------------------- Variables ----------------------------------------*/ 28 | static eMBEventType eQueuedEvent; 29 | static BOOL xEventInQueue; 30 | 31 | /* ----------------------- Start implementation -----------------------------*/ 32 | BOOL 33 | xMBPortEventInit( void ) 34 | { 35 | xEventInQueue = FALSE; 36 | return TRUE; 37 | } 38 | 39 | BOOL 40 | xMBPortEventPost( eMBEventType eEvent ) 41 | { 42 | xEventInQueue = TRUE; 43 | eQueuedEvent = eEvent; 44 | return TRUE; 45 | } 46 | 47 | BOOL 48 | xMBPortEventGet( eMBEventType * eEvent ) 49 | { 50 | BOOL xEventHappened = FALSE; 51 | 52 | if( xEventInQueue ) 53 | { 54 | *eEvent = eQueuedEvent; 55 | xEventInQueue = FALSE; 56 | xEventHappened = TRUE; 57 | } 58 | return xEventHappened; 59 | } 60 | -------------------------------------------------------------------------------- /demo/MCF5235CW/port/portother.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: MCF5235 Port 3 | * Copyright (C) 2006 Christian Walter 4 | * Parts of crt0.S Copyright (c) 1995, 1996, 1998 Cygnus Support 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | * 20 | * File: $Id: portother.c,v 1.1 2007/02/19 00:56:14 wolti Exp $ 21 | */ 22 | 23 | /* ----------------------- System includes ----------------------------------*/ 24 | #include "port.h" 25 | #include "mcf5xxx.h" 26 | #include "mcf523x.h" 27 | 28 | /* ----------------------- Modbus includes ----------------------------------*/ 29 | #include "mb.h" 30 | #include "mbport.h" 31 | 32 | /* ----------------------- Static variables ---------------------------------*/ 33 | static int uiRegSR; 34 | static char *heap_ptr; 35 | 36 | /* ----------------------- Start implementation -----------------------------*/ 37 | void 38 | prvvPortEnterCritical( ) 39 | { 40 | 41 | uiRegSR = asm_set_ipl( 7 ); 42 | } 43 | 44 | void 45 | prvvPortExitCritical( ) 46 | { 47 | ( void )asm_set_ipl( ( uint32 ) uiRegSR ); 48 | } 49 | -------------------------------------------------------------------------------- /demo/MCF5235CW/support/mcf5235-bcckit-flash.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 523x 7 | PEMICRO_PARALLEL 8 | true 9 | C:\Projects\freemodbus-new\demo\MCF5235CW\support\mcf523x.cfg 10 | 0x10000000 11 | 0x10006000 12 | true 13 | false 14 | 15 | 16 | 17 | 0x00000000 18 | AM29PL160CB 19 | 1Mx16x1 20 | 0x00000000 21 | 0x001FFFFF 22 | 23 | 24 | 25 | true 26 | 27 | Auto Detect 28 | false 29 | 0xFF800000 30 | 0xFFFFFFFF 31 | false 32 | 0x00000000 33 | 34 | 35 | 36 | true 37 | 38 | true 39 | 40 | 41 | 42 | FileOnTarg 43 | 0xFF800000 44 | 0x007FFFFF 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /demo/MCF5235CW/support/mcf5235-bcckit-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | Generic 7 | PEMICRO_PARALLEL 8 | true 9 | C:\Projects\freemodbus-new\demo\MCF5235CW\support\mcf523x.cfg 10 | 11 | 12 | 13 | read 14 | byte 15 | 0x01000000 16 | 67 17 | 18 | 19 | 20 | read 21 | byte 22 | 0x00100000 23 | 0x67 24 | 1000 25 | 26 | 27 | 28 | true 29 | true 30 | true 31 | 0x00000010 32 | 0x000000FF 33 | byte 34 | 1 35 | false 36 | 0x00000100 37 | 0x0000FFFF 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /demo/MCF5235CW/support/mcf523x-simple.cfg: -------------------------------------------------------------------------------- 1 | ResetHalt 2 | Delay 200 3 | Stop 4 | 5 | ; --------------------------- WCR DISABLE------------------------------------ 6 | writemem.w 0x40140000 0x0000 7 | 8 | -------------------------------------------------------------------------------- /demo/MCF5235CW/support/mcf523x.cfg: -------------------------------------------------------------------------------- 1 | ResetHalt 2 | Delay 200 3 | Stop 4 | 5 | ; --------------------------- Set VBR to beginning of SRAM ------------------ 6 | ; writecontrolreg 0x0801 0x20000000 7 | 8 | ; --------------------------- RAMBAR INIT ----------------------------------- 9 | ; Set RAMBAR = 0x20000001 10 | writecontrolreg 0x0C05 0x20000001 11 | 12 | ; --------------------------- FLASH INIT ------------------------------------ 13 | ; 2MB FLASH on CS0 at 0x00000000 14 | writemem.w 0x40000080 0x0000 15 | writemem.l 0x40000084 0x001F0001 16 | writemem.w 0x4000008A 0x1980 17 | delay 100 18 | 19 | ; --------------------------- SDRAM INIT ------------------------------------ 20 | ; 16MB SDRAM at 0x10000000 21 | 22 | ; Set PAR_SDRAM to allow SDRAM signals to be enabled 23 | writemem.b 0x40100046 0x3F 24 | ; Set PAR_AD to allow 32-bit SDRAM if the exteranl boot device is 16-bits 25 | writemem.b 0x40100040 0xE1 26 | 27 | ; 16 MB SDRAM 28 | writemem.w 0x40000040 0x0446 29 | writemem.l 0x40000048 0x10001300 30 | writemem.l 0x4000004C 0x00FC0001 31 | 32 | ; Set IP in DACR and init precharge. 33 | writemem.l 0x40000048 0x10001308 34 | writemem.l 0x10000000 0xAA55AA55 35 | 36 | ; Wait a bit 37 | delay 100 38 | 39 | ; Set RE in DACR 40 | writemem.l 0x40000048 0x10009300 41 | ; Issue IMRS 42 | writemem.l 0x40000048 0x10009340 43 | writemem.l 0x10000400 0xAA55AA55 44 | 45 | ; Wait a bit more 46 | delay 600 47 | 48 | ; --------------------------- WCR DISABLE------------------------------------ 49 | writemem.w 0x40140000 0x0000 50 | 51 | -------------------------------------------------------------------------------- /demo/MCF5235CW/system/interrupts.c: -------------------------------------------------------------------------------- 1 | /* 2 | FreeRTOS MCF5235 port - Copyright (C) 2006 Christian Walter. 3 | Copyright @ 1995-2005 Freescale Semiconductor, Inc. All rights reserved 4 | 5 | FreeRTOS is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | FreeRTOS is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with FreeRTOS; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | A special exception to the GPL can be applied should you wish to distribute 20 | a combined work that includes FreeRTOS, without being obliged to provide 21 | the source code for any proprietary components. See the licensing section 22 | of http://www.FreeRTOS.org for full details of how and when the exception 23 | can be applied. 24 | 25 | *************************************************************************** 26 | See http://www.FreeRTOS.org for documentation, latest information, license 27 | and contact details. Please ensure to read the configuration and relevant 28 | port sections of the online documentation. 29 | *************************************************************************** 30 | */ 31 | 32 | #include "m523xbcc.h" 33 | 34 | void 35 | exception_handler( void *framep ) 36 | { 37 | ( void )framep; 38 | } 39 | 40 | __interrupt__ void 41 | irq_handler( void ) 42 | { 43 | /* 44 | * This is the catch all interrupt handler for all user defined 45 | * interrupts. To create specific handlers, create a new interrupt 46 | * handler and change vectors.s to point to the new handler. 47 | */ 48 | } 49 | -------------------------------------------------------------------------------- /demo/MCF5235CW/system/mcf5xxx.s: -------------------------------------------------------------------------------- 1 | /* 2 | FreeRTOS MCF5235 port - Copyright (C) 2006 Christian Walter. 3 | Copyright @ 1995-2005 Freescale Semiconductor, Inc. All rights reserved. 4 | 5 | FreeRTOS is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | FreeRTOS is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with FreeRTOS; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | A special exception to the GPL can be applied should you wish to distribute 20 | a combined work that includes FreeRTOS, without being obliged to provide 21 | the source code for any proprietary components. See the licensing section 22 | of http://www.FreeRTOS.org for full details of how and when the exception 23 | can be applied. 24 | 25 | *************************************************************************** 26 | See http://www.FreeRTOS.org for documentation, latest information, license 27 | and contact details. Please ensure to read the configuration and relevant 28 | port sections of the online documentation. 29 | *************************************************************************** 30 | */ 31 | 32 | 33 | 34 | .end 35 | /********************************************************************/ 36 | -------------------------------------------------------------------------------- /demo/MCF5235TCP/freertos/include/projdefs.h: -------------------------------------------------------------------------------- 1 | /* 2 | FreeRTOS.org V4.0.5 - Copyright (C) 2003-2006 Richard Barry. 3 | 4 | This file is part of the FreeRTOS.org distribution. 5 | 6 | FreeRTOS.org is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | FreeRTOS.org is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with FreeRTOS.org; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | A special exception to the GPL can be applied should you wish to distribute 21 | a combined work that includes FreeRTOS.org, without being obliged to provide 22 | the source code for any proprietary components. See the licensing section 23 | of http://www.FreeRTOS.org for full details of how and when the exception 24 | can be applied. 25 | 26 | *************************************************************************** 27 | See http://www.FreeRTOS.org for documentation, latest information, license 28 | and contact details. Please ensure to read the configuration and relevant 29 | port sections of the online documentation. 30 | *************************************************************************** 31 | */ 32 | 33 | #ifndef PROJDEFS_H 34 | #define PROJDEFS_H 35 | 36 | /* Defines to prototype to which task functions must conform. */ 37 | typedef void (*pdTASK_CODE)( void * ); 38 | 39 | #define pdTRUE ( 1 ) 40 | #define pdFALSE ( 0 ) 41 | 42 | #define pdPASS ( 1 ) 43 | #define pdFAIL ( 0 ) 44 | 45 | /* Error definitions. */ 46 | #define errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY ( -1 ) 47 | #define errNO_TASK_TO_RUN ( -2 ) 48 | #define errQUEUE_FULL ( -3 ) 49 | #define errQUEUE_BLOCKED ( -4 ) 50 | #define errQUEUE_YIELD ( -5 ) 51 | 52 | #endif 53 | 54 | 55 | -------------------------------------------------------------------------------- /demo/MCF5235TCP/include/arch/mcf523x.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: mcf523x.h 3 | * Purpose: Register and bit definitions for the MCF523X 4 | * 5 | * Notes: 6 | * 7 | */ 8 | 9 | #ifndef __MCF523X_H__ 10 | #define __MCF523X_H__ 11 | 12 | /*********************************************************************/ 13 | 14 | #include "mcf523x/mcf523x_fec.h" 15 | #include "mcf523x/mcf523x_rng.h" 16 | #include "mcf523x/mcf523x_fmpll.h" 17 | #include "mcf523x/mcf523x_cs.h" 18 | #include "mcf523x/mcf523x_intc0.h" 19 | #include "mcf523x/mcf523x_intc1.h" 20 | #include "mcf523x/mcf523x_sdramc.h" 21 | #include "mcf523x/mcf523x_sram.h" 22 | #include "mcf523x/mcf523x_uart.h" 23 | #include "mcf523x/mcf523x_timer.h" 24 | #include "mcf523x/mcf523x_qspi.h" 25 | #include "mcf523x/mcf523x_eport.h" 26 | #include "mcf523x/mcf523x_i2c.h" 27 | #include "mcf523x/mcf523x_scm.h" 28 | #include "mcf523x/mcf523x_pit.h" 29 | #include "mcf523x/mcf523x_can.h" 30 | #include "mcf523x/mcf523x_wtm.h" 31 | #include "mcf523x/mcf523x_gpio.h" 32 | #include "mcf523x/mcf523x_mdha.h" 33 | #include "mcf523x/mcf523x_ccm.h" 34 | #include "mcf523x/mcf523x_rcm.h" 35 | #include "mcf523x/mcf523x_etpu.h" 36 | 37 | 38 | /********************************************************************/ 39 | 40 | #endif /* __MCF523X_H__ */ 41 | -------------------------------------------------------------------------------- /demo/MCF5235TCP/include/arch/mcf523x/mcf523x_ccm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: mcf523x_ccm.h 3 | * Purpose: Register and bit definitions for the MCF523X 4 | * 5 | * Notes: 6 | * 7 | */ 8 | 9 | #ifndef __MCF523X_CCM_H__ 10 | #define __MCF523X_CCM_H__ 11 | 12 | /********************************************************************* 13 | * 14 | * Chip Configuration Module (CCM) 15 | * 16 | *********************************************************************/ 17 | 18 | /* Register read/write macros */ 19 | #define MCF_CCM_CCR (*(vuint16*)(void*)(&__IPSBAR[0x110004])) 20 | #define MCF_CCM_LPCR (*(vuint8 *)(void*)(&__IPSBAR[0x110007])) 21 | #define MCF_CCM_CIR (*(vuint16*)(void*)(&__IPSBAR[0x11000A])) 22 | #define MCF_CCM_RCON (*(vuint16*)(void*)(&__IPSBAR[0x110008])) 23 | 24 | /* Bit definitions and macros for MCF_CCM_CCR */ 25 | #define MCF_CCM_CCR_BMT(x) (((x)&0x0007)<<0) 26 | #define MCF_CCM_CCR_BME (0x0008) 27 | #define MCF_CCM_CCR_SZEN (0x0040) 28 | #define MCF_CCM_CCR_MODE(x) (((x)&0x0007)<<8) 29 | 30 | /* Bit definitions and macros for MCF_CCM_LPCR */ 31 | #define MCF_CCM_LPCR_STPMD(x) (((x)&0x03)<<3) 32 | #define MCF_CCM_LPCR_LPMD(x) (((x)&0x03)<<6) 33 | #define MCF_CCM_LPCR_LPMD_STOP (0xC0) 34 | #define MCF_CCM_LPCR_LPMD_WAIT (0x80) 35 | #define MCF_CCM_LPCR_LPMD_DOZE (0x40) 36 | #define MCF_CCM_LPCR_LPMD_RUN (0x00) 37 | 38 | /* Bit definitions and macros for MCF_CCM_CIR */ 39 | #define MCF_CCM_CIR_PRN(x) (((x)&0x003F)<<0) 40 | #define MCF_CCM_CIR_PIN(x) (((x)&0x03FF)<<6) 41 | 42 | /* Bit definitions and macros for MCF_CCM_RCON */ 43 | #define MCF_CCM_RCON_MODE (0x0001) 44 | #define MCF_CCM_RCON_BOOTPS(x) (((x)&0x0003)<<3) 45 | #define MCF_CCM_RCON_RLOAD (0x0020) 46 | #define MCF_CCM_RCON_RCSC(x) (((x)&0x0003)<<8) 47 | 48 | /********************************************************************/ 49 | 50 | #endif /* __MCF523X_CCM_H__ */ 51 | -------------------------------------------------------------------------------- /demo/MCF5235TCP/include/arch/mcf523x/mcf523x_fmpll.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: mcf523x_fmpll.h 3 | * Purpose: Register and bit definitions for the MCF523X 4 | * 5 | * Notes: 6 | * 7 | */ 8 | 9 | #ifndef __MCF523X_FMPLL_H__ 10 | #define __MCF523X_FMPLL_H__ 11 | 12 | /********************************************************************* 13 | * 14 | * Frequency Modulated Phase Locked Loop (FMPLL) 15 | * 16 | *********************************************************************/ 17 | 18 | /* Register read/write macros */ 19 | #define MCF_FMPLL_SYNCR (*(vuint32*)(void*)(&__IPSBAR[0x120000])) 20 | #define MCF_FMPLL_SYNSR (*(vuint32*)(void*)(&__IPSBAR[0x120004])) 21 | 22 | /* Bit definitions and macros for MCF_FMPLL_SYNCR */ 23 | #define MCF_FMPLL_SYNCR_EXP(x) (((x)&0x000003FF)<<0) 24 | #define MCF_FMPLL_SYNCR_DEPTH(x) (((x)&0x00000003)<<10) 25 | #define MCF_FMPLL_SYNCR_RATE (0x00001000) 26 | #define MCF_FMPLL_SYNCR_LOCIRQ (0x00002000) 27 | #define MCF_FMPLL_SYNCR_LOLIRQ (0x00004000) 28 | #define MCF_FMPLL_SYNCR_DISCLK (0x00008000) 29 | #define MCF_FMPLL_SYNCR_LOCRE (0x00010000) 30 | #define MCF_FMPLL_SYNCR_LOLRE (0x00020000) 31 | #define MCF_FMPLL_SYNCR_LOCEN (0x00040000) 32 | #define MCF_FMPLL_SYNCR_RFD(x) (((x)&0x00000007)<<19) 33 | #define MCF_FMPLL_SYNCR_MFD(x) (((x)&0x00000007)<<24) 34 | 35 | /* Bit definitions and macros for MCF_FMPLL_SYNSR */ 36 | #define MCF_FMPLL_SYNSR_CALPASS (0x00000001) 37 | #define MCF_FMPLL_SYNSR_CALDONE (0x00000002) 38 | #define MCF_FMPLL_SYNSR_LOCF (0x00000004) 39 | #define MCF_FMPLL_SYNSR_LOCK (0x00000008) 40 | #define MCF_FMPLL_SYNSR_LOCKS (0x00000010) 41 | #define MCF_FMPLL_SYNSR_PLLREF (0x00000020) 42 | #define MCF_FMPLL_SYNSR_PLLSEL (0x00000040) 43 | #define MCF_FMPLL_SYNSR_MODE (0x00000080) 44 | #define MCF_FMPLL_SYNSR_LOC (0x00000100) 45 | #define MCF_FMPLL_SYNSR_LOLF (0x00000200) 46 | 47 | /********************************************************************/ 48 | 49 | #endif /* __MCF523X_FMPLL_H__ */ 50 | -------------------------------------------------------------------------------- /demo/MCF5235TCP/include/arch/mcf523x/mcf523x_i2c.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: mcf523x_i2c.h 3 | * Purpose: Register and bit definitions for the MCF523X 4 | * 5 | * Notes: 6 | * 7 | */ 8 | 9 | #ifndef __MCF523X_I2C_H__ 10 | #define __MCF523X_I2C_H__ 11 | 12 | /********************************************************************* 13 | * 14 | * I2C Module (I2C) 15 | * 16 | *********************************************************************/ 17 | 18 | /* Register read/write macros */ 19 | #define MCF_I2C_I2AR (*(vuint8 *)(void*)(&__IPSBAR[0x000300])) 20 | #define MCF_I2C_I2FDR (*(vuint8 *)(void*)(&__IPSBAR[0x000304])) 21 | #define MCF_I2C_I2CR (*(vuint8 *)(void*)(&__IPSBAR[0x000308])) 22 | #define MCF_I2C_I2SR (*(vuint8 *)(void*)(&__IPSBAR[0x00030C])) 23 | #define MCF_I2C_I2DR (*(vuint8 *)(void*)(&__IPSBAR[0x000310])) 24 | #define MCF_I2C_I2ICR (*(vuint8 *)(void*)(&__IPSBAR[0x000320])) 25 | 26 | /* Bit definitions and macros for MCF_I2C_I2AR */ 27 | #define MCF_I2C_I2AR_ADR(x) (((x)&0x7F)<<1) 28 | 29 | /* Bit definitions and macros for MCF_I2C_I2FDR */ 30 | #define MCF_I2C_I2FDR_IC(x) (((x)&0x3F)<<0) 31 | 32 | /* Bit definitions and macros for MCF_I2C_I2CR */ 33 | #define MCF_I2C_I2CR_RSTA (0x04) 34 | #define MCF_I2C_I2CR_TXAK (0x08) 35 | #define MCF_I2C_I2CR_MTX (0x10) 36 | #define MCF_I2C_I2CR_MSTA (0x20) 37 | #define MCF_I2C_I2CR_IIEN (0x40) 38 | #define MCF_I2C_I2CR_IEN (0x80) 39 | 40 | /* Bit definitions and macros for MCF_I2C_I2SR */ 41 | #define MCF_I2C_I2SR_RXAK (0x01) 42 | #define MCF_I2C_I2SR_IIF (0x02) 43 | #define MCF_I2C_I2SR_SRW (0x04) 44 | #define MCF_I2C_I2SR_IAL (0x10) 45 | #define MCF_I2C_I2SR_IBB (0x20) 46 | #define MCF_I2C_I2SR_IAAS (0x40) 47 | #define MCF_I2C_I2SR_ICF (0x80) 48 | 49 | /* Bit definitions and macros for MCF_I2C_I2ICR */ 50 | #define MCF_I2C_I2ICR_IE (0x01) 51 | #define MCF_I2C_I2ICR_RE (0x02) 52 | #define MCF_I2C_I2ICR_TE (0x04) 53 | #define MCF_I2C_I2ICR_BNBE (0x08) 54 | 55 | /********************************************************************/ 56 | 57 | #endif /* __MCF523X_I2C_H__ */ 58 | -------------------------------------------------------------------------------- /demo/MCF5235TCP/include/arch/mcf523x/mcf523x_rcm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: mcf523x_rcm.h 3 | * Purpose: Register and bit definitions for the MCF523X 4 | * 5 | * Notes: 6 | * 7 | */ 8 | 9 | #ifndef __MCF523X_RCM_H__ 10 | #define __MCF523X_RCM_H__ 11 | 12 | /********************************************************************* 13 | * 14 | * Reset Configuration Module (RCM) 15 | * 16 | *********************************************************************/ 17 | 18 | /* Register read/write macros */ 19 | #define MCF_RCM_RCR (*(vuint8 *)(void*)(&__IPSBAR[0x110000])) 20 | #define MCF_RCM_RSR (*(vuint8 *)(void*)(&__IPSBAR[0x110001])) 21 | 22 | /* Bit definitions and macros for MCF_RCM_RCR */ 23 | #define MCF_RCM_RCR_FRCRSTOUT (0x40) 24 | #define MCF_RCM_RCR_SOFTRST (0x80) 25 | 26 | /* Bit definitions and macros for MCF_RCM_RSR */ 27 | #define MCF_RCM_RSR_LOL (0x01) 28 | #define MCF_RCM_RSR_LOC (0x02) 29 | #define MCF_RCM_RSR_EXT (0x04) 30 | #define MCF_RCM_RSR_POR (0x08) 31 | #define MCF_RCM_RSR_WDR (0x10) 32 | #define MCF_RCM_RSR_SOFT (0x20) 33 | 34 | /********************************************************************/ 35 | 36 | #endif /* __MCF523X_RCM_H__ */ 37 | -------------------------------------------------------------------------------- /demo/MCF5235TCP/include/arch/mcf523x/mcf523x_rng.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: mcf523x_rng.h 3 | * Purpose: Register and bit definitions for the MCF523X 4 | * 5 | * Notes: 6 | * 7 | */ 8 | 9 | #ifndef __MCF523X_RNG_H__ 10 | #define __MCF523X_RNG_H__ 11 | 12 | /********************************************************************* 13 | * 14 | * Random Number Generator (RNG) 15 | * 16 | *********************************************************************/ 17 | 18 | /* Register read/write macros */ 19 | #define MCF_RNG_RNGCR (*(vuint32*)(void*)(&__IPSBAR[0x1A0000])) 20 | #define MCF_RNG_RNGSR (*(vuint32*)(void*)(&__IPSBAR[0x1A0004])) 21 | #define MCF_RNG_RNGER (*(vuint32*)(void*)(&__IPSBAR[0x1A0008])) 22 | #define MCF_RNG_RNGOUT (*(vuint32*)(void*)(&__IPSBAR[0x1A000C])) 23 | 24 | /* Bit definitions and macros for MCF_RNG_RNGCR */ 25 | #define MCF_RNG_RNGCR_GO (0x00000001) 26 | #define MCF_RNG_RNGCR_HA (0x00000002) 27 | #define MCF_RNG_RNGCR_IM (0x00000004) 28 | #define MCF_RNG_RNGCR_CI (0x00000008) 29 | 30 | /* Bit definitions and macros for MCF_RNG_RNGSR */ 31 | #define MCF_RNG_RNGSR_SV (0x00000001) 32 | #define MCF_RNG_RNGSR_LRS (0x00000002) 33 | #define MCF_RNG_RNGSR_FUF (0x00000004) 34 | #define MCF_RNG_RNGSR_EI (0x00000008) 35 | #define MCF_RNG_RNGSR_OFL(x) (((x)&0x000000FF)<<8) 36 | #define MCF_RNG_RNGSR_OFS(x) (((x)&0x000000FF)<<16) 37 | 38 | /********************************************************************/ 39 | 40 | #endif /* __MCF523X_RNG_H__ */ 41 | -------------------------------------------------------------------------------- /demo/MCF5235TCP/include/arch/mcf523x/mcf523x_sram.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: mcf523x_sram.h 3 | * Purpose: Register and bit definitions for the MCF523X 4 | * 5 | * Notes: 6 | * 7 | */ 8 | 9 | #ifndef __MCF523X_SRAM_H__ 10 | #define __MCF523X_SRAM_H__ 11 | 12 | /********************************************************************* 13 | * 14 | * 64KByte System SRAM (SRAM) 15 | * 16 | *********************************************************************/ 17 | 18 | /* Register read/write macros */ 19 | #define MCF_SRAM_RAMBAR (*(vuint32*)(void*)(&__IPSBAR[0x20000000])) 20 | 21 | /* Bit definitions and macros for MCF_SRAM_RAMBAR */ 22 | #define MCF_SRAM_RAMBAR_V (0x00000001) 23 | #define MCF_SRAM_RAMBAR_UD (0x00000002) 24 | #define MCF_SRAM_RAMBAR_UC (0x00000004) 25 | #define MCF_SRAM_RAMBAR_SD (0x00000008) 26 | #define MCF_SRAM_RAMBAR_SC (0x00000010) 27 | #define MCF_SRAM_RAMBAR_CI (0x00000020) 28 | #define MCF_SRAM_RAMBAR_WP (0x00000100) 29 | #define MCF_SRAM_RAMBAR_SPV (0x00000200) 30 | #define MCF_SRAM_RAMBAR_PRI2 (0x00000400) 31 | #define MCF_SRAM_RAMBAR_PRI1 (0x00000800) 32 | #define MCF_SRAM_RAMBAR_BA(x) (((x)&0x0000FFFF)<<16) 33 | 34 | /********************************************************************/ 35 | 36 | #endif /* __MCF523X_SRAM_H__ */ 37 | -------------------------------------------------------------------------------- /demo/MCF5235TCP/lwip/COPYING: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, 2002 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | 33 | 34 | -------------------------------------------------------------------------------- /demo/MCF5235TCP/lwip/FILES: -------------------------------------------------------------------------------- 1 | src/ - The source code for the lwIP TCP/IP stack. 2 | doc/ - The documentation for lwIP. 3 | 4 | See also the FILES file in each subdirectory. 5 | -------------------------------------------------------------------------------- /demo/MCF5235TCP/lwip/contrib/port/FreeRTOS/MCF5235/arch/cpu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __CPU_H__ 33 | #define __CPU_H__ 34 | 35 | /* ------------------------ Defines --------------------------------------- */ 36 | #define BYTE_ORDER BIG_ENDIAN 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /demo/MCF5235TCP/lwip/contrib/port/FreeRTOS/MCF5235/arch/perf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __PERF_H__ 33 | #define __PERF_H__ 34 | 35 | /* ------------------------ Defines --------------------------------------- */ 36 | #define PERF_START /* null definition */ 37 | #define PERF_STOP(x) /* null definition */ 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /demo/MCF5235TCP/lwip/contrib/port/FreeRTOS/MCF5235/netif/fec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006 Christian Walter 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * Author: Christian Walter 28 | * 29 | * File: $Id: fec.h,v 1.1 2006/08/30 23:18:07 wolti Exp $ 30 | */ 31 | 32 | #ifndef _FEC_H 33 | #define _FEC_H 34 | 35 | /* ------------------------ Defines --------------------------------------- */ 36 | 37 | /* ------------------------ Prototypes ------------------------------------ */ 38 | err_t mcf523xfec_init( struct netif * netif ); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /demo/MCF5235TCP/lwip/src/FILES: -------------------------------------------------------------------------------- 1 | api/ - The code for the high-level wrapper API. Not needed if 2 | you use the lowel-level call-back/raw API. 3 | 4 | core/ - The core of the TPC/IP stack; protocol implementations, 5 | memory and buffer management, and the low-level raw API. 6 | 7 | include/ - lwIP include files. 8 | 9 | netif/ - Generic network interface device drivers are kept here, 10 | as well as the ARP module. 11 | 12 | For more information on the various subdirectories, check the FILES 13 | file in each directory. 14 | -------------------------------------------------------------------------------- /demo/MCF5235TCP/lwip/src/core/ipv6/README: -------------------------------------------------------------------------------- 1 | IPv6 support in lwIP is very experimental. 2 | -------------------------------------------------------------------------------- /demo/MCF5235TCP/lwip/src/include/ipv4/lwip/ip_frag.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Jani Monoses 30 | * 31 | */ 32 | 33 | #ifndef __LWIP_IP_FRAG_H__ 34 | #define __LWIP_IP_FRAG_H__ 35 | 36 | #include "lwip/err.h" 37 | #include "lwip/pbuf.h" 38 | #include "lwip/netif.h" 39 | #include "lwip/ip_addr.h" 40 | 41 | void ip_reass_tmr(void); 42 | struct pbuf * ip_reass(struct pbuf *p); 43 | err_t ip_frag(struct pbuf *p, struct netif *netif, struct ip_addr *dest); 44 | 45 | #endif /* __LWIP_IP_FRAG_H__ */ 46 | 47 | 48 | -------------------------------------------------------------------------------- /demo/MCF5235TCP/lwip/src/include/lwip/def.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __LWIP_DEF_H__ 33 | #define __LWIP_DEF_H__ 34 | 35 | /* this might define NULL already */ 36 | #include "arch/cc.h" 37 | 38 | #define LWIP_MAX(x , y) (x) > (y) ? (x) : (y) 39 | #define LWIP_MIN(x , y) (x) < (y) ? (x) : (y) 40 | 41 | #ifndef NULL 42 | #define NULL ((void *)0) 43 | #endif 44 | 45 | 46 | #endif /* __LWIP_DEF_H__ */ 47 | 48 | -------------------------------------------------------------------------------- /demo/MCF5235TCP/lwip/src/include/netif/loopif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __NETIF_LOOPIF_H__ 33 | #define __NETIF_LOOPIF_H__ 34 | 35 | #include "lwip/netif.h" 36 | 37 | err_t loopif_init(struct netif *netif); 38 | 39 | #endif /* __NETIF_LOOPIF_H__ */ 40 | -------------------------------------------------------------------------------- /demo/MCF5235TCP/lwip/src/include/netif/slipif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the Institute nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | * Author: Adam Dunkels 32 | * 33 | */ 34 | #ifndef __NETIF_SLIPIF_H__ 35 | #define __NETIF_SLIPIF_H__ 36 | 37 | #include "lwip/netif.h" 38 | 39 | err_t slipif_init(struct netif * netif); 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /demo/MCF5235TCP/lwip/src/netif/FILES: -------------------------------------------------------------------------------- 1 | This directory contains generic network interface device drivers that 2 | do not contain any hardware or architecture specific code. The files 3 | are: 4 | 5 | etharp.c 6 | Implements the ARP (Address Resolution Protocol) over 7 | Ethernet. The code in this file should be used together with 8 | Ethernet device drivers. Note that this module has been 9 | largely made Ethernet independent so you should be able to 10 | adapt this for other link layers (such as Firewire). 11 | 12 | ethernetif.c 13 | An example of how an Ethernet device driver could look. This 14 | file can be used as a "skeleton" for developing new Ethernet 15 | network device drivers. It uses the etharp.c ARP code. 16 | 17 | loopif.c 18 | An example network interface that shows how a "loopback" 19 | interface would work. This is not really intended for actual 20 | use, but as a very basic example of how initialization and 21 | output functions work. 22 | 23 | slipif.c 24 | A generic implementation of the SLIP (Serial Line IP) 25 | protocol. It requires a sio (serial I/O) module to work. 26 | 27 | ppp/ Point-to-Point Protocol stack 28 | -------------------------------------------------------------------------------- /demo/MCF5235TCP/simple.bat: -------------------------------------------------------------------------------- 1 | ..\..\tools\modpoll.exe -m tcp 10.0.10.2 -r 1000 -t 3:int 2 | -------------------------------------------------------------------------------- /demo/MCF5235TCP/simple.sh: -------------------------------------------------------------------------------- 1 | ../../tools/modpoll -m tcp 10.0.10.2 -r 1000 -t 3:int 2 | -------------------------------------------------------------------------------- /demo/MSP430/README.txt: -------------------------------------------------------------------------------- 1 | 2 | FREEMODBUS 1.1 MSP430 PORT 3 | ========================== 4 | 5 | REQUIREMENTS 6 | ============ 7 | 8 | This demo application provides a port for the MSP430 series of processors 9 | from Text Instruments. The port was done using the MSP430-P169 from 10 | Olimex[1] which features a MSP430F169 MCU. 11 | It requires a wired serial port to a host processor and a Modbus Master 12 | Software on the PC side to be useful. Demo versions of Modbus Masters 13 | can be found in [2] and [3]. 14 | 15 | INSTALLATION 16 | ============ 17 | 18 | SOURCE 19 | ====== 20 | 21 | TESTING 22 | ======= 23 | 24 | Start the Modbus Sample Application and test if the input registers starting 25 | at protocol address 1000 can be read. There are four registers value available 26 | and the output should look like: 27 | 28 | Polling slave (Ctrl-C to stop) ... 29 | [1000]: 6474 30 | [1001]: 0 31 | [1002]: 0 32 | [1003]: 0 33 | Polling slave (Ctrl-C to stop) ... 34 | [1000]: -8831 35 | [1001]: 0 36 | [1002]: 0 37 | [1003]: 0 38 | Polling slave (Ctrl-C to stop) ... 39 | 40 | The simple testing utility used in the 'demo_rtu.bat' script can be found 41 | at [4]. 42 | 43 | PROBLEMS 44 | ======== 45 | 46 | [1] Olimex MSP430-P169 kit: http://www.olimex.com/dev/msp-p169.html 47 | [2] WinTech ModScan32: http://www.win-tech.com/html/modscan32.htm 48 | [3] Modus Poll: http://www.modbustools.com/modbus_poll.asp 49 | [4] FieldTalk Modpoll: http://www.focus-sw.com/fieldtalk/modpoll.html 50 | 51 | Version: $Id: README.txt,v 1.1 2006/11/19 03:00:33 wolti Exp $ 52 | -------------------------------------------------------------------------------- /demo/MSP430/demo_rtu.sh: -------------------------------------------------------------------------------- 1 | ../../tools/modpoll -m rtu -a 10 -r 1000 -c 4 -t 3 -b 38400 -d 8 -p even /dev/ttyUSB0 2 | -------------------------------------------------------------------------------- /demo/MSP430/doc/timing-snd-rcv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/demo/MSP430/doc/timing-snd-rcv.png -------------------------------------------------------------------------------- /demo/MSP430/msp430.gdb: -------------------------------------------------------------------------------- 1 | define setup-and-load 2 | set remoteaddresssize 16 3 | set remotetimeout 999999 4 | set download-write-size 512 5 | set remote memory-write-packet-size 512 6 | set remote memory-write-packet-size fixed 7 | set remote memory-read-packet-size 512 8 | set remote memory-read-packet-size fixed 9 | end 10 | -------------------------------------------------------------------------------- /demo/MSP430/port/port.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: MSP430 Port 3 | * Copyright (C) 2006 Christian Walter 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id: port.h,v 1.2 2006/11/19 03:36:01 wolti Exp $ 20 | */ 21 | 22 | #ifndef _PORT_H 23 | #define _PORT_H 24 | 25 | /* ----------------------- Platform includes --------------------------------*/ 26 | 27 | #include 28 | #if defined (__GNUC__) 29 | #include 30 | #endif 31 | #undef CHAR 32 | 33 | /* ----------------------- Defines ------------------------------------------*/ 34 | #define INLINE 35 | #define PR_BEGIN_EXTERN_C extern "C" { 36 | #define PR_END_EXTERN_C } 37 | 38 | #define ENTER_CRITICAL_SECTION( ) EnterCriticalSection( ) 39 | #define EXIT_CRITICAL_SECTION( ) ExitCriticalSection( ) 40 | #define assert( expr ) 41 | 42 | #define SMCLK ( 4000000UL ) 43 | #define ACLK ( 32768UL ) 44 | 45 | typedef char BOOL; 46 | 47 | typedef unsigned char UCHAR; 48 | 49 | typedef char CHAR; 50 | 51 | typedef unsigned short USHORT; 52 | typedef short SHORT; 53 | 54 | typedef unsigned long ULONG; 55 | typedef long LONG; 56 | 57 | #ifndef TRUE 58 | #define TRUE 1 59 | #endif 60 | 61 | #ifndef FALSE 62 | #define FALSE 0 63 | #endif 64 | 65 | void EnterCriticalSection( void ); 66 | void ExitCriticalSection( void ); 67 | 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /demo/MSP430/port/portevent.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: MSP430 Port 3 | * Copyright (C) 2006 Christian Walter 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id: portevent.c,v 1.1 2006/11/19 03:00:34 wolti Exp $ 20 | */ 21 | 22 | /* ----------------------- Modbus includes ----------------------------------*/ 23 | #include "mb.h" 24 | #include "mbport.h" 25 | 26 | /* ----------------------- Variables ----------------------------------------*/ 27 | static eMBEventType eQueuedEvent; 28 | static BOOL xEventInQueue; 29 | 30 | /* ----------------------- Start implementation -----------------------------*/ 31 | BOOL 32 | xMBPortEventInit( void ) 33 | { 34 | xEventInQueue = FALSE; 35 | return TRUE; 36 | } 37 | 38 | BOOL 39 | xMBPortEventPost( eMBEventType eEvent ) 40 | { 41 | xEventInQueue = TRUE; 42 | eQueuedEvent = eEvent; 43 | return TRUE; 44 | } 45 | 46 | BOOL 47 | xMBPortEventGet( eMBEventType * eEvent ) 48 | { 49 | BOOL xEventHappened = FALSE; 50 | 51 | if( xEventInQueue ) 52 | { 53 | *eEvent = eQueuedEvent; 54 | xEventInQueue = FALSE; 55 | xEventHappened = TRUE; 56 | } 57 | return xEventHappened; 58 | } 59 | -------------------------------------------------------------------------------- /demo/STR71X/freertos/include/projdefs.h: -------------------------------------------------------------------------------- 1 | /* 2 | FreeRTOS V3.2.4 - Copyright (C) 2003-2005 Richard Barry. 3 | 4 | This file is part of the FreeRTOS distribution. 5 | 6 | FreeRTOS is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | FreeRTOS is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with FreeRTOS; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | A special exception to the GPL can be applied should you wish to distribute 21 | a combined work that includes FreeRTOS, without being obliged to provide 22 | the source code for any proprietary components. See the licensing section 23 | of http://www.FreeRTOS.org for full details of how and when the exception 24 | can be applied. 25 | 26 | *************************************************************************** 27 | See http://www.FreeRTOS.org for documentation, latest information, license 28 | and contact details. Please ensure to read the configuration and relevant 29 | port sections of the online documentation. 30 | *************************************************************************** 31 | */ 32 | 33 | #ifndef PROJDEFS_H 34 | #define PROJDEFS_H 35 | 36 | typedef void (*pdTASK_CODE)( void * ); 37 | 38 | #define pdTRUE ( 1 ) 39 | #define pdFALSE ( 0 ) 40 | 41 | #define pdPASS ( 1 ) 42 | #define pdFAIL ( 0 ) 43 | 44 | /* Error definitions. */ 45 | #define errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY ( -1 ) 46 | #define errNO_TASK_TO_RUN ( -2 ) 47 | #define errQUEUE_FULL ( -3 ) 48 | 49 | 50 | #endif 51 | 52 | 53 | -------------------------------------------------------------------------------- /demo/STR71X/freertos/readme.txt: -------------------------------------------------------------------------------- 1 | Each real time kernel port consists of three files that contain the core kernel 2 | components and are common to every port, and one or more files that are 3 | specific to a particular microcontroller and or compiler. 4 | 5 | + The FreeRTOS/Source directory contains the three files that are common to 6 | every port. The kernel is contained within these three files. 7 | 8 | + The FreeRTOS/Source/Portable directory contains the files that are specific to 9 | a particular microcontroller and or compiler. 10 | 11 | + The FreeRTOS/Source/include directory contains the real time kernel header 12 | files. 13 | 14 | See the readme file in the FreeRTOS/Source/Portable directory for more 15 | information. -------------------------------------------------------------------------------- /demo/STR71X/library/apb.c: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2003 STMicroelectronics ******************** 2 | * File Name : apb.c 3 | * Author : MCD Application Team 4 | * Date First Issued : 05/30/2003 5 | * Description : This file provides all the APB software functions 6 | ******************************************************************************** 7 | * History: 8 | * 24/05/2005 : V3.0 9 | * 30/11/2004 : V2.0 10 | * 14/07/2004 : V1.3 11 | * 01/01/2004 : V1.2 12 | ******************************************************************************* 13 | THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH 14 | CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 15 | AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT 16 | OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT 17 | OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION 18 | CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 19 | *******************************************************************************/ 20 | 21 | #include "apb.h" 22 | 23 | 24 | /******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/ 25 | -------------------------------------------------------------------------------- /demo/STR71X/library/bspi.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/demo/STR71X/library/bspi.c -------------------------------------------------------------------------------- /demo/STR71X/library/emi.c: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2003 STMicroelectronics ******************** 2 | * File Name : emi.c 3 | * Author : MCD Application Team 4 | * Date First Issued : 08/08/2003 5 | * Description : This file provides all the EMI software functions 6 | ******************************************************************************** 7 | * History: 8 | * 24/05/2005 : V3.0 9 | * 30/11/2004 : V2.0 10 | * 14/07/2004 : V1.3 11 | * 01/01/2004 : V1.2 12 | ******************************************************************************* 13 | THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH 14 | CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 15 | AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT 16 | OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT 17 | OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION 18 | CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 19 | *******************************************************************************/ 20 | 21 | #include "emi.h" 22 | 23 | 24 | /******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/ 25 | -------------------------------------------------------------------------------- /demo/STR71X/library/include/bspi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/demo/STR71X/library/include/bspi.h -------------------------------------------------------------------------------- /demo/STR71X/library/include/emi.h: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2003 STMicroelectronics ******************** 2 | * File Name : emi.h 3 | * Author : MCD Application Team 4 | * Date First Issued : 08/08/2003 5 | * Description : This file contains all the functions prototypes for the 6 | * EMI software library. 7 | ******************************************************************************** 8 | * History: 9 | * 24/05/2005 : V3.0 10 | * 30/11/2004 : V2.0 11 | * 14/07/2004 : V1.3 12 | * 01/01/2004 : V1.2 13 | ******************************************************************************* 14 | THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH 15 | CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 16 | AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT 17 | OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT 18 | OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION 19 | CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 20 | *******************************************************************************/ 21 | 22 | #ifndef _EMI_H 23 | #define _EMI_H 24 | 25 | #include "71x_map.h" 26 | 27 | #define EMI_ENABLE 0x8000 28 | #define EMI_DISABLE 0x0000 29 | #define EMI_WAITSTATE(n) ((n) << 2) 30 | #define EMI_SIZE_8 0x0000 31 | #define EMI_SIZE_16 0x0001 32 | 33 | #define EMI_BANK0 EXTMEM_BASE 34 | #define EMI_BANK1 (EXTMEM_BASE + 0x2000000) 35 | #define EMI_BANK2 (EXTMEM_BASE + 0x4000000) 36 | 37 | /******************************************************************************* 38 | * Function Name : EMI_Config 39 | * Description : This routine is used, for each bank, to configure enabling, 40 | * : cycle length and bus size. 41 | * Input : Bank (u8) 42 | * : Config (u16) 43 | * Return : None 44 | *******************************************************************************/ 45 | INLINE void EMI_Config(u8 Bank, u16 Config) 46 | { 47 | *(u16 *)(EMI_BASE + (4*Bank)) = Config; 48 | } 49 | 50 | #endif // _EMI_H 51 | 52 | /******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/ 53 | -------------------------------------------------------------------------------- /demo/STR71X/port/port.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: STR71x Port 3 | * Copyright (C) 2006 Christian Walter 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id: port.h,v 1.6 2006/06/15 15:27:16 wolti Exp $ 20 | */ 21 | 22 | #ifndef _PORT_H 23 | #define _PORT_H 24 | 25 | #include "assert.h" 26 | #include "FreeRTOS.h" 27 | 28 | /* work aroung a problem when inline is also defined in 71x_conf.h */ 29 | #ifdef INLINE 30 | #undef INLINE 31 | #endif 32 | 33 | #define INLINE inline 34 | 35 | #define PR_BEGIN_EXTERN_C extern "C" { 36 | #define PR_END_EXTERN_C } 37 | 38 | #define ENTER_CRITICAL_SECTION( ) portENTER_CRITICAL( ) 39 | #define EXIT_CRITICAL_SECTION( ) portEXIT_CRITICAL( ) 40 | 41 | typedef char BOOL; 42 | 43 | typedef unsigned char UCHAR; 44 | typedef char CHAR; 45 | 46 | typedef unsigned short USHORT; 47 | typedef short SHORT; 48 | 49 | typedef unsigned long ULONG; 50 | typedef long LONG; 51 | 52 | #ifndef TRUE 53 | #define TRUE 1 54 | #endif 55 | 56 | #ifndef FALSE 57 | #define FALSE 0 58 | #endif 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /demo/STR71X/simple.bat: -------------------------------------------------------------------------------- 1 | ..\..\tools\modpoll.exe -m ascii -a 10 -r 1000 -c 4 -t 3 -b 9600 -d 7 -p even COM4 -------------------------------------------------------------------------------- /demo/STR71XGCC/demo.sh: -------------------------------------------------------------------------------- 1 | ../../tools/modpoll -m rtu -a 10 -r 1000 -c 4 -t 3 -b 38400 -d 8 -p even /dev/ttyUSB0 2 | -------------------------------------------------------------------------------- /demo/STR71XGCC/libstr71x/apb.c: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2003 STMicroelectronics ******************** 2 | * File Name : apb.c 3 | * Author : MCD Application Team 4 | * Date First Issued : 05/30/2003 5 | * Description : This file provides all the APB software functions 6 | ******************************************************************************** 7 | * History: 8 | * 13/01/2006 : V3.1 9 | * 24/05/2005 : V3.0 10 | * 30/11/2004 : V2.0 11 | * 14/07/2004 : V1.3 12 | * 01/01/2004 : V1.2 13 | ******************************************************************************* 14 | THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH 15 | CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 16 | AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT 17 | OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT 18 | OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION 19 | CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 20 | *******************************************************************************/ 21 | 22 | #include "apb.h" 23 | 24 | 25 | /******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/ 26 | -------------------------------------------------------------------------------- /demo/STR71XGCC/libstr71x/bspi.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/demo/STR71XGCC/libstr71x/bspi.c -------------------------------------------------------------------------------- /demo/STR71XGCC/libstr71x/emi.c: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2003 STMicroelectronics ******************** 2 | * File Name : emi.c 3 | * Author : MCD Application Team 4 | * Date First Issued : 08/08/2003 5 | * Description : This file provides all the EMI software functions 6 | ******************************************************************************** 7 | * History: 8 | * 13/01/2006 : V3.1 9 | * 24/05/2005 : V3.0 10 | * 30/11/2004 : V2.0 11 | * 14/07/2004 : V1.3 12 | * 01/01/2004 : V1.2 13 | ******************************************************************************* 14 | THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH 15 | CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 16 | AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT 17 | OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT 18 | OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION 19 | CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 20 | *******************************************************************************/ 21 | 22 | #include "emi.h" 23 | 24 | 25 | /******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/ 26 | -------------------------------------------------------------------------------- /demo/STR71XGCC/libstr71x/include/bspi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/demo/STR71XGCC/libstr71x/include/bspi.h -------------------------------------------------------------------------------- /demo/STR71XGCC/libstr71x/include/wdg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/demo/STR71XGCC/libstr71x/include/wdg.h -------------------------------------------------------------------------------- /demo/STR71XGCC/port/port.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: STR71x Port 3 | * Copyright (C) 2006 Christian Walter 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id: port.h,v 1.1 2006/11/02 23:14:44 wolti Exp $ 20 | */ 21 | 22 | #ifndef _PORT_H 23 | #define _PORT_H 24 | 25 | #include "assert.h" 26 | #include "FreeRTOS.h" 27 | 28 | /* work aroung a problem when inline is also defined in 71x_conf.h */ 29 | #ifdef INLINE 30 | #undef INLINE 31 | #endif 32 | 33 | #define INLINE 34 | 35 | #define PR_BEGIN_EXTERN_C extern "C" { 36 | #define PR_END_EXTERN_C } 37 | 38 | #define ENTER_CRITICAL_SECTION( ) portENTER_CRITICAL( ) 39 | #define EXIT_CRITICAL_SECTION( ) portEXIT_CRITICAL( ) 40 | 41 | typedef char BOOL; 42 | 43 | typedef unsigned char UCHAR; 44 | typedef char CHAR; 45 | 46 | typedef unsigned short USHORT; 47 | typedef short SHORT; 48 | 49 | typedef unsigned long ULONG; 50 | typedef long LONG; 51 | 52 | #ifndef TRUE 53 | #define TRUE 1 54 | #endif 55 | 56 | #ifndef FALSE 57 | #define FALSE 0 58 | #endif 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /demo/STR71XGCC/support/target-71.gdb: -------------------------------------------------------------------------------- 1 | # 2 | # STR71X GDB Target Scripts for FreeModbus 3 | # Copyright 2005 Anglia Design, Spencer Oliver 4 | # Modifications Copyright (C) 2006 Christian Walter 5 | # 6 | # This demo code and associated components are provided as is and has no 7 | # warranty, implied or otherwise. You are free to use/modify any of the 8 | # provided code at your own risk in your applications with the expressed 9 | # limitation of liability (see below) 10 | # 11 | # LIMITATION OF LIABILITY: ANGLIA OR ANGLIA DESIGNS SHALL NOT BE LIABLE 12 | # FOR ANY LOSS OF PROFITS, LOSS OF USE, LOSS OF DATA, INTERRUPTION OF 13 | # BUSINESS, NOR FOR INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES 14 | # OF ANY KIND WHETHER UNDER THIS AGREEMENT OR OTHERWISE, EVEN IF ADVISED OF 15 | # THE POSSIBILITY OF SUCH DAMAGES. 16 | # 17 | # $Id: target-71.gdb,v 1.1 2006/11/02 23:14:44 wolti Exp $ 18 | # 19 | 20 | set remote memory-write-packet-size 1024 21 | set remote memory-write-packet-size fixed 22 | 23 | set remote memory-read-packet-size 1024 24 | set remote memory-read-packet-size fixed 25 | set remote hardware-watchpoint-limit 2 26 | set remote hardware-breakpoint-limit 2 27 | 28 | # reset and map 0 to internal ram 29 | define ramreset 30 | set *(int*)0xA0000050 = 0x800A 31 | monitor arm7_9 sw_bkpts enable 32 | tb main 33 | echo Mapped internal SRAM at address 0x00000000\n 34 | end 35 | 36 | # reset and map 0 to flash 37 | define romreset 38 | set *(int*)0xA0000050 = 0x8008 39 | monitor arm7_9 force_hw_bkpts enable 40 | thb main 41 | echo Mapped internal FLASH at address 0x00000000\n 42 | end 43 | 44 | define setup-and-load-rom 45 | reset 46 | romreset 47 | end 48 | 49 | define setup-and-load-ram 50 | reset 51 | ramreset 52 | end 53 | 54 | define reset 55 | monitor reset 56 | monitor sleep 50 57 | monitor soft_reset_halt 58 | end 59 | 60 | -------------------------------------------------------------------------------- /demo/STR71XGCC/tools/openocd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/demo/STR71XGCC/tools/openocd -------------------------------------------------------------------------------- /demo/STR71XGCC/tools/openocd.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/demo/STR71XGCC/tools/openocd.exe -------------------------------------------------------------------------------- /demo/STR71XGCC/tools/str71x_wig.cfg: -------------------------------------------------------------------------------- 1 | # STR71X OpenOCD configuration for FreeModbus 2 | # 3 | # Copyright (C) 2006 Christian Walter 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | # 19 | # $Id: str71x_wig.cfg,v 1.1 2006/11/02 23:14:44 wolti Exp $ 20 | # 21 | 22 | #daemon configuration 23 | telnet_port 4444 24 | gdb_port 3333 25 | 26 | #interface 27 | interface parport 28 | parport_port 0 29 | parport_cable wiggler 30 | jtag_speed 0 31 | #use combined on interfaces or targets that can't set TRST/SRST separately 32 | reset_config trst_and_srst 33 | 34 | #jtag scan chain 35 | #format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE) 36 | jtag_device 4 0x1 0xf 0xe 37 | 38 | #target configuration 39 | daemon_startup reset 40 | #target 41 | #target arm7tdmi 42 | target arm7tdmi little run_and_halt 0 arm7tdmi 43 | run_and_halt_time 0 30 44 | 45 | working_area str71x 0x2000F000 0x00001000 nobackup 46 | #flash configuration 47 | flash bank str7x 0x40000000 0x00040000 0 0 STR71x 0 48 | flash bank str7x 0x400C0000 0x00004000 0 0 STR71x 0 49 | -------------------------------------------------------------------------------- /demo/STR71XTCP/library/apb.c: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2003 STMicroelectronics ******************** 2 | * File Name : apb.c 3 | * Author : MCD Application Team 4 | * Date First Issued : 05/30/2003 5 | * Description : This file provides all the APB software functions 6 | ******************************************************************************** 7 | * History: 8 | * 24/05/2005 : V3.0 9 | * 30/11/2004 : V2.0 10 | * 14/07/2004 : V1.3 11 | * 01/01/2004 : V1.2 12 | ******************************************************************************* 13 | THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH 14 | CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 15 | AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT 16 | OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT 17 | OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION 18 | CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 19 | *******************************************************************************/ 20 | 21 | #include "apb.h" 22 | 23 | 24 | /******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/ 25 | -------------------------------------------------------------------------------- /demo/STR71XTCP/library/bspi.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/demo/STR71XTCP/library/bspi.c -------------------------------------------------------------------------------- /demo/STR71XTCP/library/emi.c: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2003 STMicroelectronics ******************** 2 | * File Name : emi.c 3 | * Author : MCD Application Team 4 | * Date First Issued : 08/08/2003 5 | * Description : This file provides all the EMI software functions 6 | ******************************************************************************** 7 | * History: 8 | * 24/05/2005 : V3.0 9 | * 30/11/2004 : V2.0 10 | * 14/07/2004 : V1.3 11 | * 01/01/2004 : V1.2 12 | ******************************************************************************* 13 | THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH 14 | CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 15 | AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT 16 | OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT 17 | OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION 18 | CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 19 | *******************************************************************************/ 20 | 21 | #include "emi.h" 22 | 23 | 24 | /******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/ 25 | -------------------------------------------------------------------------------- /demo/STR71XTCP/library/include/bspi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/demo/STR71XTCP/library/include/bspi.h -------------------------------------------------------------------------------- /demo/STR71XTCP/library/include/emi.h: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2003 STMicroelectronics ******************** 2 | * File Name : emi.h 3 | * Author : MCD Application Team 4 | * Date First Issued : 08/08/2003 5 | * Description : This file contains all the functions prototypes for the 6 | * EMI software library. 7 | ******************************************************************************** 8 | * History: 9 | * 24/05/2005 : V3.0 10 | * 30/11/2004 : V2.0 11 | * 14/07/2004 : V1.3 12 | * 01/01/2004 : V1.2 13 | ******************************************************************************* 14 | THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH 15 | CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 16 | AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT 17 | OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT 18 | OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION 19 | CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 20 | *******************************************************************************/ 21 | 22 | #ifndef _EMI_H 23 | #define _EMI_H 24 | 25 | #include "71x_map.h" 26 | 27 | #define EMI_ENABLE 0x8000 28 | #define EMI_DISABLE 0x0000 29 | #define EMI_WAITSTATE(n) ((n) << 2) 30 | #define EMI_SIZE_8 0x0000 31 | #define EMI_SIZE_16 0x0001 32 | 33 | #define EMI_BANK0 EXTMEM_BASE 34 | #define EMI_BANK1 (EXTMEM_BASE + 0x2000000) 35 | #define EMI_BANK2 (EXTMEM_BASE + 0x4000000) 36 | 37 | /******************************************************************************* 38 | * Function Name : EMI_Config 39 | * Description : This routine is used, for each bank, to configure enabling, 40 | * : cycle length and bus size. 41 | * Input : Bank (u8) 42 | * : Config (u16) 43 | * Return : None 44 | *******************************************************************************/ 45 | INLINE void EMI_Config(u8 Bank, u16 Config) 46 | { 47 | *(u16 *)(EMI_BASE + (4*Bank)) = Config; 48 | } 49 | 50 | #endif // _EMI_H 51 | 52 | /******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/ 53 | -------------------------------------------------------------------------------- /demo/STR71XTCP/lwip/COPYING: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, 2002 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | 33 | 34 | -------------------------------------------------------------------------------- /demo/STR71XTCP/lwip/FILES: -------------------------------------------------------------------------------- 1 | src/ - The source code for the lwIP TCP/IP stack. 2 | doc/ - The documentation for lwIP. 3 | 4 | See also the FILES file in each subdirectory. 5 | -------------------------------------------------------------------------------- /demo/STR71XTCP/lwip/contrib/port/FreeRTOS/STR71X/arch/cpu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __CPU_H__ 33 | #define __CPU_H__ 34 | 35 | /* ------------------------ Defines --------------------------------------- */ 36 | #define BYTE_ORDER LITTLE_ENDIAN 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /demo/STR71XTCP/lwip/contrib/port/FreeRTOS/STR71X/arch/perf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __PERF_H__ 33 | #define __PERF_H__ 34 | 35 | /* ------------------------ Defines --------------------------------------- */ 36 | #define PERF_START /* null definition */ 37 | #define PERF_STOP(x) /* null definition */ 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /demo/STR71XTCP/lwip/contrib/port/FreeRTOS/STR71X/netif/serial.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: STR71/lwIP Port serial driver. 3 | * Copyright (C) 2006 Christian Walter 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id: serial.h,v 1.2 2006/09/04 12:40:21 wolti Exp $ 20 | */ 21 | 22 | #ifndef _SERIAL_H 23 | #define _SERIAL_H 24 | 25 | /* ------------------------ Platform includes ----------------------------- */ 26 | 27 | #include "uart.h" 28 | 29 | /* ------------------------ Defines --------------------------------------- */ 30 | 31 | /* ------------------------ Type definitions ----------------------------- */ 32 | 33 | typedef enum 34 | { 35 | SIO_PAR_NONE, 36 | SIO_PAR_ODD, 37 | SIO_PAR_EVEN 38 | } sio_parity_t; 39 | 40 | typedef enum 41 | { 42 | SIO_STOP_0_5, 43 | SIO_STOP_1, 44 | SIO_STOP_1_5, 45 | SIO_STOP_2 46 | } sio_stop_t; 47 | 48 | /* ------------------------ Prototypes ------------------------------------ */ 49 | sio_fd_t sio_open_new( u8_t devnr, u32_t baudrate, u8_t databits, 50 | sio_stop_t stopbits, sio_parity_t parity ); 51 | u32_t sio_write_noisr( sio_fd_t fd, u8_t * buf, u32_t size ); 52 | void sio_send_noisr( u8_t data, sio_fd_t fd ); 53 | #endif 54 | -------------------------------------------------------------------------------- /demo/STR71XTCP/lwip/src/FILES: -------------------------------------------------------------------------------- 1 | api/ - The code for the high-level wrapper API. Not needed if 2 | you use the lowel-level call-back/raw API. 3 | 4 | core/ - The core of the TPC/IP stack; protocol implementations, 5 | memory and buffer management, and the low-level raw API. 6 | 7 | include/ - lwIP include files. 8 | 9 | netif/ - Generic network interface device drivers are kept here, 10 | as well as the ARP module. 11 | 12 | For more information on the various subdirectories, check the FILES 13 | file in each directory. 14 | -------------------------------------------------------------------------------- /demo/STR71XTCP/lwip/src/core/ipv6/README: -------------------------------------------------------------------------------- 1 | IPv6 support in lwIP is very experimental. 2 | -------------------------------------------------------------------------------- /demo/STR71XTCP/lwip/src/include/ipv4/lwip/ip_frag.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Jani Monoses 30 | * 31 | */ 32 | 33 | #ifndef __LWIP_IP_FRAG_H__ 34 | #define __LWIP_IP_FRAG_H__ 35 | 36 | #include "lwip/err.h" 37 | #include "lwip/pbuf.h" 38 | #include "lwip/netif.h" 39 | #include "lwip/ip_addr.h" 40 | 41 | void ip_reass_tmr(void); 42 | struct pbuf * ip_reass(struct pbuf *p); 43 | err_t ip_frag(struct pbuf *p, struct netif *netif, struct ip_addr *dest); 44 | 45 | #endif /* __LWIP_IP_FRAG_H__ */ 46 | 47 | 48 | -------------------------------------------------------------------------------- /demo/STR71XTCP/lwip/src/include/lwip/def.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __LWIP_DEF_H__ 33 | #define __LWIP_DEF_H__ 34 | 35 | /* this might define NULL already */ 36 | #include "arch/cc.h" 37 | 38 | #define LWIP_MAX(x , y) (x) > (y) ? (x) : (y) 39 | #define LWIP_MIN(x , y) (x) < (y) ? (x) : (y) 40 | 41 | #ifndef NULL 42 | #define NULL ((void *)0) 43 | #endif 44 | 45 | 46 | #endif /* __LWIP_DEF_H__ */ 47 | 48 | -------------------------------------------------------------------------------- /demo/STR71XTCP/lwip/src/include/netif/loopif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __NETIF_LOOPIF_H__ 33 | #define __NETIF_LOOPIF_H__ 34 | 35 | #include "lwip/netif.h" 36 | 37 | err_t loopif_init(struct netif *netif); 38 | 39 | #endif /* __NETIF_LOOPIF_H__ */ 40 | -------------------------------------------------------------------------------- /demo/STR71XTCP/lwip/src/include/netif/slipif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the Institute nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | * Author: Adam Dunkels 32 | * 33 | */ 34 | #ifndef __NETIF_SLIPIF_H__ 35 | #define __NETIF_SLIPIF_H__ 36 | 37 | #include "lwip/netif.h" 38 | 39 | err_t slipif_init(struct netif * netif); 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /demo/STR71XTCP/lwip/src/netif/FILES: -------------------------------------------------------------------------------- 1 | This directory contains generic network interface device drivers that 2 | do not contain any hardware or architecture specific code. The files 3 | are: 4 | 5 | etharp.c 6 | Implements the ARP (Address Resolution Protocol) over 7 | Ethernet. The code in this file should be used together with 8 | Ethernet device drivers. Note that this module has been 9 | largely made Ethernet independent so you should be able to 10 | adapt this for other link layers (such as Firewire). 11 | 12 | ethernetif.c 13 | An example of how an Ethernet device driver could look. This 14 | file can be used as a "skeleton" for developing new Ethernet 15 | network device drivers. It uses the etharp.c ARP code. 16 | 17 | loopif.c 18 | An example network interface that shows how a "loopback" 19 | interface would work. This is not really intended for actual 20 | use, but as a very basic example of how initialization and 21 | output functions work. 22 | 23 | slipif.c 24 | A generic implementation of the SLIP (Serial Line IP) 25 | protocol. It requires a sio (serial I/O) module to work. 26 | 27 | ppp/ Point-to-Point Protocol stack 28 | -------------------------------------------------------------------------------- /demo/STR71XTCP/simple.bat: -------------------------------------------------------------------------------- 1 | ..\..\tools\modpoll.exe -m tcp 10.0.10.2 -r 1000 -t 3:int 2 | -------------------------------------------------------------------------------- /demo/STR71XTCP/simple.sh: -------------------------------------------------------------------------------- 1 | ../../tools/modpoll -m tcp 10.0.10.2 -r 1000 -t 3:int 2 | -------------------------------------------------------------------------------- /demo/STR71XTCP/utils/options: -------------------------------------------------------------------------------- 1 | asyncmap 0 2 | lock 3 | noauth 4 | nodefaultroute 5 | silent 6 | -------------------------------------------------------------------------------- /demo/STR71XTCP/utils/options-pap: -------------------------------------------------------------------------------- 1 | asyncmap 0 2 | lock 3 | auth 4 | nodefaultroute 5 | silent 6 | -------------------------------------------------------------------------------- /demo/STR71XTCP/utils/options.ttyS0: -------------------------------------------------------------------------------- 1 | # no modem control lines 2 | local 3 | nocrtscts 4 | 5 | # local address:remote address 6 | 10.0.10.1:10.0.10.2 7 | # pppd waits for connection on ttyS1 8 | passive 9 | # pppd stays enabled even if remote disconnects. 10 | persist 11 | # proxy into lan 12 | proxyarp 13 | # disable compressoin 14 | #nodeflate 15 | #nobsdcomp 16 | #novj 17 | -------------------------------------------------------------------------------- /demo/STR71XTCP/utils/pap-secrets: -------------------------------------------------------------------------------- 1 | # Secrets for authentication using PAP 2 | # client server secret IP addresses 3 | freemodbus * insecure * 4 | -------------------------------------------------------------------------------- /demo/STR71XTCP/utils/server.sh: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------------------------- 2 | # server.sh - starts a local PPP server to connect with the target. 3 | # 4 | # Autor: Christian Walter 5 | # --------------------------------------------------------------------------- 6 | SER_DEV="/dev/ttyUSB0" 7 | SER_SPEED="115200" 8 | stty raw -parenb cs8 -cstopb -F $SER_DEV 9 | /usr/sbin/pppd debug nodetach $SER_DEV $SER_SPEED 10 | -------------------------------------------------------------------------------- /demo/WIN32/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // freemodbus.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /demo/WIN32/stdafx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: Win32 Demo Application 3 | * Copyright (C) 2006 Christian Walter 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id: stdafx.h,v 1.3 2006/06/18 13:03:54 wolti Exp $ 20 | */ 21 | 22 | #pragma once 23 | 24 | 25 | #define WIN32_LEAN_AND_MEAN 26 | #include 27 | #include 28 | #include 29 | 30 | #include 31 | -------------------------------------------------------------------------------- /demo/WIN32TCP/Port/port.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: BSD Socket Library Port 3 | * Copyright (C) 2006 Christian Walter 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id: port.h,v 1.2 2006/06/26 19:24:07 wolti Exp $ 20 | */ 21 | 22 | #ifndef _PORT_H 23 | #define _PORT_H 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #define INLINE 30 | #define PR_BEGIN_EXTERN_C extern "C" { 31 | #define PR_END_EXTERN_C } 32 | 33 | #ifdef __cplusplus 34 | PR_BEGIN_EXTERN_C 35 | #endif 36 | 37 | /* ----------------------- Defines ------------------------------------------*/ 38 | 39 | #define ENTER_CRITICAL_SECTION( ) 40 | #define EXIT_CRITICAL_SECTION( ) 41 | #define MB_PORT_HAS_CLOSE 1 42 | #ifndef TRUE 43 | #define TRUE 1 44 | #endif 45 | #ifndef FALSE 46 | #define FALSE 0 47 | #endif 48 | 49 | /* ----------------------- Type definitions ---------------------------------*/ 50 | 51 | typedef enum 52 | { 53 | MB_LOG_DEBUG, 54 | MB_LOG_INFO, 55 | MB_LOG_WARN, 56 | MB_LOG_ERROR 57 | } eMBPortLogLevel; 58 | 59 | /* ----------------------- Function prototypes ------------------------------*/ 60 | 61 | void vMBPortLog( eMBPortLogLevel eLevel, const TCHAR * szModule, 62 | const TCHAR * szFmt, ... ); 63 | 64 | #ifdef __cplusplus 65 | PR_END_EXTERN_C 66 | #endif 67 | #endif 68 | -------------------------------------------------------------------------------- /demo/WIN32TCP/Port/portevent.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: Win32 Port 3 | * Copyright (C) 2006 Christian Walter 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id: portevent.c,v 1.2 2006/06/26 19:24:07 wolti Exp $ 20 | */ 21 | 22 | /* ----------------------- Modbus includes ----------------------------------*/ 23 | #include "mb.h" 24 | #include "mbport.h" 25 | 26 | /* ----------------------- Variables ----------------------------------------*/ 27 | static eMBEventType eQueuedEvent; 28 | static BOOL xEventInQueue; 29 | 30 | /* ----------------------- Function prototypes ------------------------------*/ 31 | BOOL xMBPortTCPPool( void ); 32 | 33 | /* ----------------------- Start implementation -----------------------------*/ 34 | BOOL 35 | xMBPortEventInit( void ) 36 | { 37 | xEventInQueue = FALSE; 38 | return TRUE; 39 | } 40 | 41 | BOOL 42 | xMBPortEventPost( eMBEventType eEvent ) 43 | { 44 | xEventInQueue = TRUE; 45 | eQueuedEvent = eEvent; 46 | return TRUE; 47 | } 48 | 49 | BOOL 50 | xMBPortEventGet( eMBEventType * eEvent ) 51 | { 52 | BOOL xEventHappened = FALSE; 53 | 54 | if( xEventInQueue ) 55 | { 56 | *eEvent = eQueuedEvent; 57 | xEventInQueue = FALSE; 58 | xEventHappened = TRUE; 59 | } 60 | else 61 | { 62 | /* We can't do anything with errors from the pooling module. */ 63 | ( void )xMBPortTCPPool( ); 64 | } 65 | return xEventHappened; 66 | } 67 | -------------------------------------------------------------------------------- /demo/WIN32TCP/stdafx.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: Win32TCP Demo Application 3 | * Copyright (C) 2006 Christian Walter 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id: stdafx.cpp,v 1.1 2006/06/25 00:20:19 wolti Exp $ 20 | */ 21 | 22 | #include "stdafx.h" 23 | -------------------------------------------------------------------------------- /demo/WIN32TCP/stdafx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: Win32TCP Demo Application 3 | * Copyright (C) 2006 Christian Walter 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id: stdafx.h,v 1.1 2006/06/25 00:20:19 wolti Exp $ 20 | */ 21 | 22 | #pragma once 23 | 24 | #define WIN32_LEAN_AND_MEAN 25 | #include 26 | #include 27 | #include 28 | #include 29 | -------------------------------------------------------------------------------- /demo/Z8ENCORE/README.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/demo/Z8ENCORE/README.txt -------------------------------------------------------------------------------- /demo/Z8ENCORE/port/port.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: Z8Encore Port for Z8F6422 3 | * Copyright (C) 2007 Tiago Prado Lone 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id: port.h,v 1.1 2007/04/24 23:42:43 wolti Exp $ 20 | */ 21 | 22 | #ifndef _PORT_H 23 | #define _PORT_H 24 | 25 | #include 26 | 27 | #include 28 | 29 | #define INLINE 30 | #define PR_BEGIN_EXTERN_C extern "C" { 31 | #define PR_END_EXTERN_C } 32 | 33 | #define CLOCK 18432000 34 | 35 | #define ENTER_CRITICAL_SECTION( ) DI() 36 | #define EXIT_CRITICAL_SECTION( ) EI() 37 | 38 | typedef unsigned char BOOL; 39 | 40 | typedef unsigned char UCHAR; 41 | typedef char CHAR; 42 | 43 | typedef unsigned int USHORT; 44 | typedef int SHORT; 45 | 46 | typedef unsigned long ULONG; 47 | typedef long LONG; 48 | 49 | #ifndef TRUE 50 | #define TRUE 1 51 | #endif 52 | 53 | #ifndef FALSE 54 | #define FALSE 0 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /demo/Z8ENCORE/port/portevent.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: Z8Encore Port for Z8F6422 3 | * Copyright (C) 2007 Tiago Prado Lone 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id: portevent.c,v 1.1 2007/04/24 23:42:43 wolti Exp $ 20 | */ 21 | 22 | /* ----------------------- Modbus includes ----------------------------------*/ 23 | #include "mb.h" 24 | #include "mbport.h" 25 | 26 | /* ----------------------- Variables ----------------------------------------*/ 27 | static eMBEventType eQueuedEvent; 28 | static BOOL xEventInQueue; 29 | 30 | /* ----------------------- Start implementation -----------------------------*/ 31 | BOOL 32 | xMBPortEventInit( void ) 33 | { 34 | xEventInQueue = FALSE; 35 | return TRUE; 36 | } 37 | 38 | BOOL 39 | xMBPortEventPost( eMBEventType eEvent ) 40 | { 41 | xEventInQueue = TRUE; 42 | eQueuedEvent = eEvent; 43 | return TRUE; 44 | } 45 | 46 | BOOL 47 | xMBPortEventGet( eMBEventType * eEvent ) 48 | { 49 | BOOL xEventHappened = FALSE; 50 | 51 | if( xEventInQueue ) 52 | { 53 | *eEvent = eQueuedEvent; 54 | xEventInQueue = FALSE; 55 | xEventHappened = TRUE; 56 | } 57 | return xEventHappened; 58 | } 59 | -------------------------------------------------------------------------------- /doc/TODO.txt: -------------------------------------------------------------------------------- 1 | 2 | Modbus Gernal: 3 | 4 | Modbus RTU/ASCII: 5 | 6 | - Parity checking should be used for the characters when received. This 7 | is not strictly necessary because we use CRC or LRC but it is recommended 8 | in the standard 9 | 10 | Difficulty: easy 11 | Priority: low 12 | 13 | Modbus TCP: 14 | 15 | - vMBTCPPortEnable( ) should be called by the protocol stack to enable 16 | processing of input connections. This function must be called by 17 | the protocol stack and therefore must be added to the TCP porting layer. 18 | 19 | Difficulty: medium 20 | Priority: high 21 | 22 | - MCF5235TCP port uses an outdated version of the FreeRTOS/lwIP porting 23 | layer. They should be merged with the STR71X porting layer. 24 | 25 | Modbus Functions: 26 | 27 | - If not initialized the Get Slave ID function must also return the 28 | run indicator byte in the result and maybe a dummy slave id. 29 | 30 | Difficulty: easy 31 | Priority: medium 32 | 33 | 34 | -------------------------------------------------------------------------------- /doc/dox_html_footer: -------------------------------------------------------------------------------- 1 | 2 |
3 |

Automatically generated by Doxygen $doxygenversion on $date.

4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /doc/dox_html_header: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $title 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /doc/memory.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/doc/memory.ods -------------------------------------------------------------------------------- /doc/tips.dox: -------------------------------------------------------------------------------- 1 | /*! \page sec_tips Tips 2 | 3 | This page provides some tips for using the FreeModbus protocol stack. 4 | 5 | \section sec_tips_memory Reducing memory requirements 6 | The memory requirements of FreeModbus can be tuned in the following way. These are basic tricks and can easily be done: 7 | 8 | - Decided if you need RTU, ASCII and TCP at the same time. If not disable 9 | them in the file mbconfig.h by settings the respective options 10 | MB_RTU_ENABLED, MB_ASCII_ENABLED and MB_TCP_ENABLED to zero. 11 | - If you don't need all Modbus functions disable them in the file mbconfig.h. 12 | This will reduce code requirements. 13 | - Set the variable MB_FUNC_HANDLERS_MAX in mbconfig.h to the number 14 | of functions codes you want to support. 15 | 16 | If you have stronger limits you can also try the following options. Note that this options have an impact on the features of the protocol stack. 17 | 18 | - Use some compiler directive to put the mapping of function codes to 19 | handler functions into the flash memory of you CPU. You can find this 20 | table in the file mb.c at the top of the file. The static variable is 21 | named xFuncHandlers. 22 | 23 | - Reduce the size of the RTU buffer. In this case longer frames will 24 | result in an error (Your device will drop all these frames). This is 25 | possible if you will never get read/write requests with that number 26 | of registers or your total amount of registers is small anyway. 27 | 28 | - You could also remove some function pointers which make the protocol 29 | stack configurable and replace them by the functions itself. For 30 | example if you only want to use RTU remove the callback functions from 31 | the porting layer and fill in the appropriate calls. This will save 32 | the space for all function pointers. 33 | */ 34 | -------------------------------------------------------------------------------- /modbus/functions/mbfuncdiag.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. 3 | * Copyright (c) 2006 Christian Walter 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 3. The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | * File: $Id: mbfuncdiag.c,v 1.3 2006/12/07 22:10:34 wolti Exp $ 29 | */ 30 | -------------------------------------------------------------------------------- /modbus/rtu/mbcrc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. 3 | * Copyright (c) 2006 Christian Walter 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 3. The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | * File: $Id: mbcrc.h,v 1.5 2006/12/07 22:10:34 wolti Exp $ 29 | */ 30 | 31 | #ifndef _MB_CRC_H 32 | #define _MB_CRC_H 33 | 34 | USHORT usMBCRC16( UCHAR * pucFrame, USHORT usLen ); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /tools/README.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/tools/README.txt -------------------------------------------------------------------------------- /tools/doxygen.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismerck/freemodbus/1e97a41b23f8ff466e6d66a962d8d3ec8bd32da5/tools/doxygen.exe -------------------------------------------------------------------------------- /tools/indent.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | MYDIR="/cygdrive/c/GnuWin32/bin/" 4 | 5 | $MYDIR/indent.exe --version 6 | $MYDIR/indent.exe \ 7 | --declaration-indentation16 \ 8 | --procnames-start-lines \ 9 | --blank-lines-after-procedures \ 10 | --break-before-boolean-operator \ 11 | --braces-after-if-line \ 12 | --braces-after-struct-decl-line \ 13 | --brace-indent0 \ 14 | --case-indentation0 \ 15 | --no-space-after-function-call-names \ 16 | --no-space-after-for \ 17 | --no-space-after-if \ 18 | --no-space-after-while \ 19 | --no-space-after-casts \ 20 | --space-after-parentheses \ 21 | --dont-format-comments \ 22 | --indent-level4 \ 23 | --ignore-newlines \ 24 | --no-tabs \ 25 | --line-length120 \ 26 | $@ 27 | 28 | unix2dos $@ 29 | -------------------------------------------------------------------------------- /tools/lint-arm.sh: -------------------------------------------------------------------------------- 1 | splint \ 2 | -I. -I../../modbus/include -I../../modbus/rtu -I../../modbus/ascii \ 3 | -Iport -Ilibrary/include \ 4 | -Ifreertos/include -Ifreertos/portable/GCC/ARM7_STR71X/ \ 5 | -DSTR71X_GCC=1 -nullpass +charint -booltype BOOL $@ 6 | -------------------------------------------------------------------------------- /tools/lint-avr.sh: -------------------------------------------------------------------------------- 1 | splint \ 2 | -I. -I../../modbus/include -I../../modbus/rtu -I../../modbus/ascii \ 3 | -Iport -I/cygdrive/c/WinAVR/avr/include \ 4 | -nullpass +charint -booltype BOOL -D__AVR_ATmega168__=1 $@ 5 | --------------------------------------------------------------------------------