├── .gitignore ├── Doxyfile ├── LICENSE.md ├── README.md ├── arch ├── arch.h ├── arm.ld.S ├── arm7 │ ├── arm7.c │ ├── arm7.h │ ├── delay_arm.S │ ├── irq_arm7.c │ ├── irq_arm7.h │ ├── irq_arm7_private.h │ └── startup_arm7.S ├── arm_extram.ld.S ├── cortex_m3 │ ├── cortex_m3.c │ ├── cortex_m3.h │ ├── delay_cortex_m3.S │ ├── memmap_cortex_m3.h │ ├── startup_cortexm.S │ ├── stm │ │ ├── arch_stm32.h │ │ ├── dma_stm32.c │ │ ├── dma_stm32.h │ │ ├── gpio_stm32.c │ │ ├── gpio_stm32.h │ │ ├── rand_stm32f2.c │ │ ├── rcc_stm32f2.c │ │ ├── rcc_stm32f2.h │ │ ├── sdio_stm32f2xx.c │ │ ├── stm32f2xx_regsusb.h │ │ ├── timer_stm32.c │ │ ├── uart_stm32.c │ │ ├── usb_stm32f2xx.c │ │ └── vectors_stm32.h │ └── vectors_cortex_m3.h ├── hw_config.h └── memmap.h ├── core ├── cc_macro.h ├── dbg.h ├── delay.h ├── dev.h ├── error.c ├── error.h ├── event.c ├── event.h ├── event_private.c ├── event_private.h ├── magic.h ├── mem.c ├── mem.h ├── mem_pool.c ├── mem_pool.h ├── mem_private.c ├── mem_private.h ├── mutex.c ├── mutex.h ├── mutex_private.c ├── mutex_private.h ├── queue.c ├── queue.h ├── queue_private.c ├── queue_private.h ├── sem.c ├── sem.h ├── sem_private.c ├── sem_private.h ├── startup.c ├── sys_call.c ├── sys_call.h ├── sys_calls.h ├── sys_time.c ├── sys_time.h ├── sys_time_private.c ├── sys_time_private.h ├── sys_timer.c ├── sys_timer.h ├── thread.c ├── thread.h ├── thread_private.c ├── thread_private.h └── types.h ├── doc └── html │ ├── About.html │ ├── README_8md.html │ ├── about.html │ ├── annotated.html │ ├── arch_8h_source.html │ ├── arch__stm32_8h_source.html │ ├── arm7_8h_source.html │ ├── bc_s.png │ ├── bdwn.png │ ├── cc__macro_8h_source.html │ ├── classes.html │ ├── closed.png │ ├── config_8h_source.html │ ├── console_8h_source.html │ ├── cortex__m3_8h_source.html │ ├── dbg_8h_source.html │ ├── dbg__console_8h_source.html │ ├── dbg__console__private_8h_source.html │ ├── delay_8h_source.html │ ├── dev_8h_source.html │ ├── dir_01c6325566f30b431ac6c2179435531b.html │ ├── dir_0ceb3f223a0db68bf93d97c933fa6180.html │ ├── dir_294c33d5330defff057f25a730b75cca.html │ ├── dir_2f5b351b1c7da456365c5419c01dfb78.html │ ├── dir_4270bfced15e0e73154b13468c7c9ad9.html │ ├── dir_47727034b76072a844d36429f7783cbd.html │ ├── dir_56c01256fe7db77f0a0ae9e2a0dc4505.html │ ├── dir_6f7417a983749ee44ee0489b81910026.html │ ├── dir_97aefd0d527b934f1d99a682da8fe6a9.html │ ├── dir_9a56ca7e6eee1ce2b0916408d35257d4.html │ ├── dir_cdf821652a09c47141ef39b6120cbdaf.html │ ├── dir_cfafba98a580ce4b62f8a6fa96d7cbb0.html │ ├── dir_d41ce877eb409a4791b288730010abe2.html │ ├── dir_dfacb4c4bbd4233d3d500b32c7cc4486.html │ ├── dir_e1b4b7e9fb26413f63fc6f2ff5bf06dc.html │ ├── dir_e5d1f5f6e7fc36a2806750c6e0e1bb58.html │ ├── dir_ea9599923402ca8ab47fc3e495999dea.html │ ├── dir_f35053085212e5014a63c9329be93422.html │ ├── dlist_8h_source.html │ ├── dma__stm32_8h_source.html │ ├── doxygen.css │ ├── doxygen.png │ ├── dynsections.js │ ├── error_8h_source.html │ ├── event_8h_source.html │ ├── event__private_8h_source.html │ ├── example_2stm32f2_2config_2kernel__config_8h_source.html │ ├── files.html │ ├── ftv2blank.png │ ├── ftv2cl.png │ ├── ftv2doc.png │ ├── ftv2folderclosed.png │ ├── ftv2folderopen.png │ ├── ftv2lastnode.png │ ├── ftv2link.png │ ├── ftv2mlastnode.png │ ├── ftv2mnode.png │ ├── ftv2mo.png │ ├── ftv2node.png │ ├── ftv2ns.png │ ├── ftv2plastnode.png │ ├── ftv2pnode.png │ ├── ftv2splitbar.png │ ├── ftv2vertline.png │ ├── functions.html │ ├── functions_vars.html │ ├── gettingstarted.html │ ├── gettingstarted_8md.html │ ├── gpio_8h_source.html │ ├── gpio__custom_8h_source.html │ ├── gpio__default_8h_source.html │ ├── gpio__stm32f2_8h_source.html │ ├── gpio__user_8h_source.html │ ├── group__HALT.html │ ├── group__arch__porting.html │ ├── group__data__queue.html │ ├── group__debug.html │ ├── group__error.html │ ├── group__event.html │ ├── group__group.html │ ├── group__lib__dlist.html │ ├── group__lib__printf.html │ ├── group__lib__rb.html │ ├── group__lib__rb__block.html │ ├── group__lib__slist.html │ ├── group__lib__time.html │ ├── group__memory.html │ ├── group__message__queue.html │ ├── group__mutex.html │ ├── group__profiling.html │ ├── group__semaphore.html │ ├── group__thread.html │ ├── group__user__provided.html │ ├── hw__config_8h_source.html │ ├── hw__config__stm32f2_8h_source.html │ ├── index.html │ ├── installdox │ ├── irq_8h_source.html │ ├── irq__arm7_8h_source.html │ ├── irq__arm7__private_8h_source.html │ ├── jquery.js │ ├── keyboard_8h_source.html │ ├── magic_8h_source.html │ ├── md_LICENSE.html │ ├── md_README.html │ ├── md_getting_started.html │ ├── md_gettingstarted.html │ ├── md_overview.html │ ├── mem_8h_source.html │ ├── mem__pool_8h_source.html │ ├── mem__private_8h_source.html │ ├── memmap_8h_source.html │ ├── memmap__cortex__m3_8h_source.html │ ├── modules.html │ ├── mutex_8h_source.html │ ├── mutex__private_8h_source.html │ ├── nav_f.png │ ├── nav_g.png │ ├── nav_h.png │ ├── open.png │ ├── page1.html │ ├── page2.html │ ├── pages.html │ ├── printf_8h_source.html │ ├── profile_8h_source.html │ ├── profile__stm32_8h_source.html │ ├── queue_8h_source.html │ ├── queue__private_8h_source.html │ ├── rand_8h_source.html │ ├── rb_8h_source.html │ ├── rb__block_8h_source.html │ ├── rcc_8h_source.html │ ├── rcc__stm32f2_8h_source.html │ ├── rtc_8h_source.html │ ├── search │ ├── all_5f.html │ ├── all_5f.js │ ├── all_61.html │ ├── all_61.js │ ├── all_62.html │ ├── all_62.js │ ├── all_63.html │ ├── all_63.js │ ├── all_64.html │ ├── all_64.js │ ├── all_65.html │ ├── all_65.js │ ├── all_66.html │ ├── all_66.js │ ├── all_67.html │ ├── all_67.js │ ├── all_68.html │ ├── all_68.js │ ├── all_69.html │ ├── all_69.js │ ├── all_6b.html │ ├── all_6b.js │ ├── all_6c.html │ ├── all_6c.js │ ├── all_6d.html │ ├── all_6d.js │ ├── all_6f.html │ ├── all_6f.js │ ├── all_70.html │ ├── all_70.js │ ├── all_71.html │ ├── all_71.js │ ├── all_72.html │ ├── all_72.js │ ├── all_73.html │ ├── all_73.js │ ├── all_74.html │ ├── all_74.js │ ├── all_75.html │ ├── all_75.js │ ├── all_77.html │ ├── all_77.js │ ├── classes_5f.html │ ├── classes_5f.js │ ├── classes_63.html │ ├── classes_63.js │ ├── classes_64.html │ ├── classes_64.js │ ├── classes_65.html │ ├── classes_65.js │ ├── classes_6b.html │ ├── classes_6b.js │ ├── classes_6d.html │ ├── classes_6d.js │ ├── classes_71.html │ ├── classes_71.js │ ├── classes_72.html │ ├── classes_72.js │ ├── classes_73.html │ ├── classes_73.js │ ├── classes_74.html │ ├── classes_74.js │ ├── classes_75.html │ ├── classes_75.js │ ├── close.png │ ├── enums_65.html │ ├── enums_65.js │ ├── files_67.html │ ├── files_67.js │ ├── files_72.html │ ├── files_72.js │ ├── functions_61.html │ ├── functions_61.js │ ├── functions_64.html │ ├── functions_64.js │ ├── functions_65.html │ ├── functions_65.js │ ├── functions_66.html │ ├── functions_66.js │ ├── functions_67.html │ ├── functions_67.js │ ├── functions_68.html │ ├── functions_68.js │ ├── functions_69.html │ ├── functions_69.js │ ├── functions_6d.html │ ├── functions_6d.js │ ├── functions_70.html │ ├── functions_70.js │ ├── functions_71.html │ ├── functions_71.js │ ├── functions_72.html │ ├── functions_72.js │ ├── functions_73.html │ ├── functions_73.js │ ├── functions_74.html │ ├── functions_74.js │ ├── functions_75.html │ ├── functions_75.js │ ├── groups_61.html │ ├── groups_61.js │ ├── groups_62.html │ ├── groups_62.js │ ├── groups_64.html │ ├── groups_64.js │ ├── groups_65.html │ ├── groups_65.js │ ├── groups_67.html │ ├── groups_67.js │ ├── groups_6d.html │ ├── groups_6d.js │ ├── groups_70.html │ ├── groups_70.js │ ├── groups_72.html │ ├── groups_72.js │ ├── groups_73.html │ ├── groups_73.js │ ├── groups_74.html │ ├── groups_74.js │ ├── groups_75.html │ ├── groups_75.js │ ├── mag_sel.png │ ├── nomatches.html │ ├── pages_61.html │ ├── pages_61.js │ ├── pages_67.html │ ├── pages_67.js │ ├── pages_6c.html │ ├── pages_6c.js │ ├── pages_6d.html │ ├── pages_6d.js │ ├── pages_6f.html │ ├── pages_6f.js │ ├── pages_70.html │ ├── pages_70.js │ ├── search.css │ ├── search.js │ ├── search_l.png │ ├── search_m.png │ ├── search_r.png │ ├── typedefs_74.html │ ├── typedefs_74.js │ ├── typedefs_77.html │ ├── typedefs_77.js │ ├── variables_73.html │ ├── variables_73.js │ ├── variables_74.html │ ├── variables_74.js │ ├── variables_75.html │ └── variables_75.js │ ├── sem_8h_source.html │ ├── sem__private_8h_source.html │ ├── slist_8h_source.html │ ├── structCONSOLE.html │ ├── structCONSOLE__HEADER.html │ ├── structDLIST__ENUM.html │ ├── structDMA__FULL__TypeDef.html │ ├── structEVENT.html │ ├── structKEYBOARD.html │ ├── structKEYBOARD__CREATE__PARAMS.html │ ├── structMEM__POOL.html │ ├── structMEM__POOL__ENTRY.html │ ├── structMEM__POOL__STAT.html │ ├── structMUTEX.html │ ├── structQUEUE.html │ ├── structRB.html │ ├── structRB__BLOCK.html │ ├── structRB__BLOCK__HEADER.html │ ├── structRB__HEADER.html │ ├── structSEMAPHORE.html │ ├── structSW__TIMER.html │ ├── structTHREAD.html │ ├── structTHREAD__CALL.html │ ├── structTIME.html │ ├── structTIMER.html │ ├── structUART__BAUD.html │ ├── structUART__CB.html │ ├── structUART__HW.html │ ├── struct__DLIST.html │ ├── struct__SLIST.html │ ├── structtm.html │ ├── sw__timer_8h_source.html │ ├── sync_off.png │ ├── sync_on.png │ ├── sys__call_8h_source.html │ ├── sys__calls_8h_source.html │ ├── sys__time_8h_source.html │ ├── sys__time__private_8h_source.html │ ├── sys__timer_8h_source.html │ ├── tab_a.png │ ├── tab_b.png │ ├── tab_h.png │ ├── tab_s.png │ ├── tabs.css │ ├── template_2kernel__config_8h_source.html │ ├── thread_8h_source.html │ ├── thread__private_8h_source.html │ ├── time_8h_source.html │ ├── timer_8h_source.html │ ├── types_8h_source.html │ ├── uart_8h_source.html │ ├── vectors__cortex__m3_8h_source.html │ ├── vectors__stm32_8h_source.html │ └── wdt_8h_source.html ├── drv_if ├── gpio.h ├── gpio_default.h ├── irq.h ├── rand.h ├── rcc.h ├── rtc.h ├── sdio.h ├── timer.h ├── uart.h ├── usb.h └── wdt.h ├── example ├── stm32f2 │ ├── Makefile │ ├── config │ │ ├── config.h │ │ ├── hw_config_stm32f2.h │ │ └── kernel_config.h │ ├── main.c │ └── mod │ │ └── gpio_user │ │ ├── gpio_user.c │ │ └── gpio_user.h └── stm32f2usbreader │ ├── Makefile │ ├── config │ ├── config.h │ ├── hw_config_stm32f2.h │ └── kernel_config.h │ ├── main.c │ └── mod │ ├── gpio_user │ ├── gpio_user.c │ └── gpio_user.h │ └── usb_desc_user │ ├── usb_desc_user.c │ └── usb_desc_user.h ├── getting started.md ├── lib ├── dlist.c ├── dlist.h ├── printf.c ├── printf.h ├── rand.c ├── rb.h ├── rb_block.h ├── slist.h ├── time.c └── time.h ├── mod ├── console │ ├── console.c │ └── console.h ├── dbg_console │ ├── dbg_console.c │ ├── dbg_console.h │ ├── dbg_console_private.c │ └── dbg_console_private.h ├── keyboard │ ├── keyboard.c │ └── keyboard.h ├── scsi │ ├── scsi.c │ ├── scsi.h │ ├── scsi_defs.h │ ├── scsi_io.c │ ├── scsi_io.h │ ├── scsi_page.c │ ├── scsi_page.h │ └── scsi_private.h ├── sd_card │ ├── sd_card.c │ ├── sd_card.h │ ├── sd_card_cmd.c │ ├── sd_card_cmd.h │ └── sd_card_defs.h ├── storage │ ├── storage.c │ └── storage.h ├── sw_timer │ ├── sw_timer.c │ └── sw_timer.h ├── usb_msc │ ├── usb_msc.c │ ├── usb_msc.h │ ├── usb_msc_io.c │ └── usb_msc_io.h └── usbd │ ├── usb_desc.c │ ├── usb_desc.h │ ├── usbd.c │ ├── usbd.h │ ├── usbd_core.c │ ├── usbd_core.h │ ├── usbd_core_io.c │ └── usbd_core_io.h └── template ├── Makefile_stm32 ├── gpio_custom.h ├── hw_config_stm32f1.h ├── hw_config_stm32f2.h └── kernel_config.h /.gitignore: -------------------------------------------------------------------------------- 1 | example/stm32f2/stm32f2.pro 2 | example/stm32f2/stm32f2.pro.user 3 | example/stm32f2/build 4 | example/stm32f2/build/*.* 5 | example/stm32f2/build/* 6 | example/stm32f2usbreader/stm32f2usbreader.pro 7 | example/stm32f2usbreader/stm32f2usbreader.pro.user 8 | example/stm32f2usbreader/build 9 | example/stm32f2usbreader/build/* 10 | example/stm32f2usbreader/build/*.* 11 | example/stm32f2usbreader/output 12 | example/stm32f2usbreader/output/* 13 | example/stm32f2usbreader/output/*.* 14 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | M-Kernel - embedded RTOS 2 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | 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 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | -------------------------------------------------------------------------------- /arch/arch.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef ARCH_H 28 | #define ARCH_H 29 | 30 | /* 31 | arch.h - decode MCU family 32 | */ 33 | 34 | #include "arch_stm32.h" 35 | #ifdef CUSTOM_ARCH 36 | #include "arch_custom.h" 37 | #endif 38 | 39 | #ifdef ARM7 40 | #include "arm7.h" 41 | #elif defined(CORTEX_M3) 42 | #include "cortex_m3.h" 43 | #define NVIC_PRESENT 44 | #else 45 | #error MCU architecture is not decoded! Define MCU in Makefile! 46 | #endif 47 | 48 | #endif // ARCH_H 49 | -------------------------------------------------------------------------------- /arch/arm7/delay_arm.S: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | /* exported global constant and functions */ 28 | .global delay_init 29 | 30 | .global delay_us 31 | .global delay_ms 32 | 33 | /* imported global constant and functions */ 34 | .extern _core_cycles_us; 35 | .extern _core_cycles_ms; 36 | 37 | /* data segment */ 38 | 39 | .section .text, "ax" 40 | .code 32 41 | 42 | /* 43 | void delay_us(unsinged int us) 44 | */ 45 | 46 | delay_us: 47 | ldr r1, =_core_cycles_us 48 | ldr r1, [r1] 49 | mul r2, r1, r0 50 | @2 cycles - calling and return, 4 instructions 51 | mov r0, #6 52 | us_loop: 53 | add r2, r2, #3 54 | cmp r2, r0 55 | blo us_loop 56 | 57 | bx lr 58 | 59 | /* 60 | void delay_ms(unsinged int ms) 61 | */ 62 | 63 | delay_ms: 64 | ldr r2, =_core_cycles_ms 65 | ldr r2, [r2] 66 | mov r1, #7 67 | 68 | ms_loop: 69 | nop 70 | add r1, r1, #4 71 | cmp r1, r2 72 | blo ms_loop 73 | 74 | sub r0, r0, #1 75 | mov r1, #4 76 | cmp r0, #0 77 | bne ms_loop 78 | 79 | bx lr 80 | -------------------------------------------------------------------------------- /arch/arm7/irq_arm7.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef IRQ_ARM7_H 28 | #define IRQ_ARM7_H 29 | 30 | #include "arch.h" 31 | 32 | #define IRQ_LOWEST_PRIORITY 0xff 33 | #define IRQ_NO_IRQ 0x100 34 | 35 | #ifndef __ASSEMBLER__ 36 | typedef void (*ISR_VECTOR)(void); 37 | 38 | void irq_init(); 39 | IRQn irq_get_current_vector(); 40 | //must be called, when interrupts are disabled 41 | void irq_register_vector(IRQn irq, ISR_VECTOR vector); 42 | void irq_set_priority(IRQn irq, unsigned char priority); 43 | void fiq_register_vector(IRQn irq, ISR_VECTOR vector); 44 | void irq_clear_pending(IRQn irq); 45 | 46 | //must be declared by hw 47 | void irq_mask(IRQn irq); 48 | void irq_unmask(IRQn irq); 49 | bool irq_is_masked(IRQn irq); 50 | void fiq_mask(); 51 | void fiq_unmask(); 52 | bool fiq_is_masked(); 53 | #endif //__ASSEMBLER__ 54 | 55 | #endif // IRQ_ARM7_H 56 | -------------------------------------------------------------------------------- /arch/arm7/irq_arm7_private.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef IRQ_ARM7_PRIVATE_H 28 | #define IRQ_ARM7_PRIVATE_H 29 | 30 | #include "arch.h" 31 | 32 | extern void irq_hw_init(); 33 | extern IRQn irq_hw_get_vector(); 34 | extern void irq_hw_exit(IRQn irq); 35 | extern void fiq_hw_exit(); 36 | extern void fiq_hw_set_source(IRQn irq); 37 | 38 | #endif // IRQ_ARM7_PRIVATE_H 39 | -------------------------------------------------------------------------------- /arch/cortex_m3/cortex_m3.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef CORTEX_M3_H 28 | #define CORTEX_M3_H 29 | 30 | //r0..r12, sp, lr, pc, psr 31 | #define CONTEXT_SIZE (16 * 4) 32 | 33 | #ifndef __ASSEMBLER__ 34 | 35 | #include "cc_macro.h" 36 | 37 | #define IRQ_STATE unsigned int 38 | 39 | #define reset NVIC_SystemReset 40 | 41 | #define disable_interrupts __disable_irq 42 | #define enable_interrupts __enable_irq 43 | 44 | __attribute__( ( always_inline ) ) __STATIC_INLINE IRQ_STATE interrupts_save_and_disable(void) 45 | { 46 | IRQ_STATE result; 47 | __ASM volatile ("MRS %0, primask\n\t" 48 | "cpsid i" : "=r" (result) ); 49 | return(result); 50 | } 51 | 52 | __attribute__( ( always_inline ) ) __STATIC_INLINE void interrupts_restore(IRQ_STATE state) 53 | { 54 | __ASM volatile ("MSR primask, %0" : : "r" (state) ); 55 | } 56 | 57 | #endif //__ASSEMBLER__ 58 | 59 | #endif // CORTEX_M3_H 60 | -------------------------------------------------------------------------------- /arch/cortex_m3/delay_cortex_m3.S: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | /* exported global constant and functions */ 28 | .global delay_us 29 | .global delay_ms 30 | 31 | /* imported global constant and functions */ 32 | .extern _core_cycles_us 33 | .extern _core_cycles_ms 34 | 35 | .section .text, "ax" 36 | .syntax unified 37 | .thumb 38 | 39 | /* 40 | void delay_us(unsinged int us) 41 | */ 42 | 43 | .thumb_func 44 | delay_us: 45 | ldr r1, =_core_cycles_us 46 | ldr r1, [r1] 47 | mul r1, r1, r0 48 | @2 cycles - calling and return, 4 instructions 49 | mov r0, #6 50 | us_loop: 51 | add r1, r1, #3 52 | cmp r1, r0 53 | blo us_loop 54 | 55 | bx lr 56 | 57 | .thumb_func 58 | delay_ms: 59 | ldr r2, =_core_cycles_ms 60 | ldr r2, [r2] 61 | mov r1, #7 62 | 63 | ms_loop: 64 | nop 65 | add r1, r1, #4 66 | cmp r1, r2 67 | blo ms_loop 68 | 69 | sub r0, r0, #1 70 | mov r1, #4 71 | cmp r0, #0 72 | bne ms_loop 73 | 74 | bx lr 75 | -------------------------------------------------------------------------------- /arch/cortex_m3/memmap_cortex_m3.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef MEMMAP_CORTEX_M3_H 28 | #define MEMMAP_CORTEX_M3_H 29 | 30 | //logical memory layout 31 | 32 | /* 33 | .data 34 | .bss 35 | .sys_data 36 | .sys_bss 37 | [system pool] 38 | 39 | /\ 40 | [global pool] 41 | \/ 42 | 43 | [thread stacks] 44 | SVC stack 45 | */ 46 | 47 | //external memory layout 48 | #define SVC_STACK_TOP (INT_RAM_BASE + INT_RAM_SIZE - SVC_STACK_SIZE * 4) 49 | #define SVC_STACK_END (SVC_STACK_TOP + SVC_STACK_SIZE * 4) 50 | 51 | #define SYSTEM_POOL_BASE ((uint32_t)&_sys_end) 52 | 53 | #define THREAD_STACK_BASE (SVC_STACK_TOP - THREAD_STACK_SIZE) 54 | #define THREAD_STACK_ALIGN 8 55 | 56 | #define DATA_POOL_BASE (SYSTEM_POOL_BASE + SYSTEM_POOL_SIZE) 57 | #define DATA_POOL_SIZE (THREAD_STACK_BASE - DATA_POOL_BASE) 58 | 59 | #endif // MEMMAP_CORTEX_M3_H 60 | -------------------------------------------------------------------------------- /arch/cortex_m3/stm/rand_stm32f2.c: -------------------------------------------------------------------------------- 1 | #include "rand.h" 2 | #include "arch.h" 3 | #include "dbg.h" 4 | 5 | void srand() 6 | { 7 | RCC->AHB2ENR |= RCC_AHB2ENR_RNGEN; 8 | RNG->SR = 0; 9 | RNG->CR = RNG_CR_RNGEN; 10 | //generate first seed and discard it 11 | rand(); 12 | } 13 | 14 | unsigned int rand() 15 | { 16 | int retry = 3; 17 | while (--retry) 18 | { 19 | while (RNG->SR == 0) {} 20 | if (RNG->SR == RNG_SR_DRDY) 21 | return RNG->DR; 22 | //restart RNG 23 | RNG->CR &= ~RNG_CR_RNGEN; 24 | RNG->SR = 0; 25 | RNG->CR |= RNG_CR_RNGEN; 26 | } 27 | #if (RANDOM_DEBUG) 28 | if (RNG->SR & RNG_SR_CECS) 29 | printf("RNG: clock failure\n\r"); 30 | else if (RNG->SR & RNG_SR_SECS) 31 | printf("RNG: seed error\n\r"); 32 | #endif //RANDOM_DEBUG 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /arch/cortex_m3/stm/rcc_stm32f2.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef RCC_STM32F2_H 28 | #define RCC_STM32F2_H 29 | 30 | #if defined(STM32F2) 31 | extern unsigned long _fs_freq; 32 | #endif 33 | extern unsigned long _ahb_freq; 34 | extern unsigned long _apb1_freq; 35 | extern unsigned long _apb2_freq; 36 | 37 | #endif // RCC_STM32F2_H 38 | -------------------------------------------------------------------------------- /arch/cortex_m3/vectors_cortex_m3.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded real-time RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef VECTORS_CORTEX_M3_H 28 | #define VECTORS_CORTEX_M3_H 29 | 30 | #include "arch.h" 31 | 32 | #ifdef STM 33 | #include "vectors_stm32.h" 34 | #elif defined CUSTOM_ARCH 35 | #include "vectors_cortexm_custom.h" 36 | #else 37 | #error Vendor is not decoded 38 | #endif 39 | 40 | 41 | #endif // VECTORS_CORTEX_M3_H 42 | -------------------------------------------------------------------------------- /arch/hw_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef HW_CONFIG_H 28 | #define HW_CONFIG_H 29 | 30 | /* 31 | hardware-specific config 32 | */ 33 | 34 | #include "arch.h" 35 | 36 | #ifdef STM 37 | 38 | #if defined(STM32F1) 39 | #include "hw_config_stm32f1.h" 40 | #elif defined(STM32F2) 41 | #include "hw_config_stm32f2.h" 42 | #elif defined(STM32F4) 43 | #include "hw_config_stm32f4.h" 44 | #endif 45 | 46 | #elif defined(CUSTOM_ARCH) 47 | #include "hw_config_custom.h" 48 | #endif 49 | 50 | #endif // HW_CONFIG_H 51 | -------------------------------------------------------------------------------- /arch/memmap.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef MEMMAP_H 28 | #define MEMMAP_H 29 | 30 | #ifndef __ASSEMBLER__ 31 | //defined in .ld 32 | extern unsigned int _end; 33 | extern unsigned int _sys_end; 34 | #endif //__ASSEMBLER__ 35 | 36 | #include "arch.h" 37 | #ifdef CUSTOM_ARCH 38 | #include "memmap_custom.h" 39 | #endif 40 | #ifdef CORTEX_M3 41 | #include "memmap_cortex_m3.h" 42 | #endif 43 | 44 | #endif // MEMMAP_H 45 | -------------------------------------------------------------------------------- /core/delay.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef DELAY_H 28 | #define DELAY_H 29 | 30 | /* 31 | common process delay 32 | */ 33 | 34 | 35 | extern void delay_us(unsigned int us); 36 | //it's preferred to call sleep_ms 37 | extern void delay_ms(unsigned int ms); 38 | 39 | #endif // DELAY_H 40 | -------------------------------------------------------------------------------- /core/event.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef EVENT_H 28 | #define EVENT_H 29 | 30 | #include "time.h" 31 | #include "types.h" 32 | 33 | HANDLE event_create(); 34 | void event_pulse(HANDLE event); 35 | void event_set(HANDLE event); 36 | bool event_is_set(HANDLE event); 37 | void event_clear(HANDLE event); 38 | bool event_wait(HANDLE event, TIME* timeout); 39 | bool event_wait_ms(HANDLE event, unsigned int timeout_ms); 40 | bool event_wait_us(HANDLE event, unsigned int timeout_us); 41 | void event_destroy(HANDLE event); 42 | 43 | #endif // EVENT_H 44 | -------------------------------------------------------------------------------- /core/event_private.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef EVENT_PRIVATE_H 28 | #define EVENT_PRIVATE_H 29 | 30 | #include "thread_private.h" 31 | #include "dbg.h" 32 | 33 | typedef struct { 34 | MAGIC; 35 | bool set; 36 | THREAD* waiters; 37 | }EVENT; 38 | 39 | //called from thread_private.c on destroy or timeout 40 | void svc_event_lock_release(EVENT* event, THREAD* thread); 41 | 42 | unsigned int svc_event_handler(unsigned int num, unsigned int param1, unsigned int param2); 43 | 44 | #endif // EVENT_PRIVATE_H 45 | -------------------------------------------------------------------------------- /core/magic.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef MAGIC_H 28 | #define MAGIC_H 29 | 30 | /* 31 | magic.h - magics for kernel marks 32 | */ 33 | 34 | #define MAGIC_MEM_POOL_ENTRY 0xbde4e2f1 35 | #define MAGIC_MEM_POOL_ALIGN_SPACE 0x851ab238 36 | #define MAGIC_MEM_POOL_UNUSED 0xed8bb5a9 37 | #define MAGIC_RANGE_TOP 0x27f0d1c2 38 | #define MAGIC_RANGE_BOTTOM 0xb45f8dc3 39 | 40 | #define MAGIC_TIMER 0xbecafcf5 41 | #define MAGIC_THREAD 0x7de32076 42 | #define MAGIC_MUTEX 0xd0cc6e26 43 | #define MAGIC_EVENT 0x57e198c7 44 | #define MAGIC_SEMAPHORE 0xabfd92d9 45 | #define MAGIC_QUEUE 0x6b54bbeb 46 | 47 | #define MAGIC_UNINITIALIZED 0xcdcdcdcd 48 | #define MAGIC_UNINITIALIZED_BYTE 0xcd 49 | 50 | #endif // MAGIC_H 51 | -------------------------------------------------------------------------------- /core/mem.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef MEM_H 28 | #define MEM_H 29 | 30 | #include "kernel_config.h" 31 | #include "types.h" 32 | 33 | //allocate data in current thread pool 34 | void* malloc_aligned(int size, int align); 35 | void* malloc(int size); 36 | void free(void* ptr); 37 | 38 | HANDLE pool_allocate(char* name, int size); 39 | void pool_free(HANDLE pool); 40 | void pool_select(HANDLE pool); 41 | void pool_select_global(); 42 | 43 | #if (KERNEL_PROFILING) 44 | void mem_stat(); 45 | #endif //KERNEL_PROFILING 46 | 47 | #endif // MEM_H 48 | -------------------------------------------------------------------------------- /core/mem_private.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef MEM_PRIVATE_H 28 | #define MEM_PRIVATE_H 29 | 30 | void mem_init(); 31 | 32 | //system memory pool. Only in supervisor context 33 | void* sys_alloc(int size); 34 | void* sys_alloc_aligned(int size, int align); 35 | void sys_free(void* ptr); 36 | 37 | //allocate stack for thread. Only in supervisor context 38 | void* stack_alloc(int size); 39 | void stack_free(void* ptr); 40 | 41 | unsigned int svc_mem_handler(unsigned int num, unsigned int param1, unsigned int param2); 42 | 43 | #endif // MEM_PRIVATE_H 44 | -------------------------------------------------------------------------------- /core/mutex.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef MUTEX_H 28 | #define MUTEX_H 29 | 30 | #include "types.h" 31 | #include "sys_time.h" 32 | 33 | HANDLE mutex_create(); 34 | bool mutex_lock(HANDLE mutex, TIME* timeout); 35 | bool mutex_lock_ms(HANDLE mutex, unsigned int timeout_ms); 36 | bool mutex_lock_us(HANDLE mutex, unsigned int timeout_us); 37 | void mutex_unlock(HANDLE mutex); 38 | void mutex_destroy(HANDLE mutex); 39 | 40 | #endif // MUTEX_H 41 | -------------------------------------------------------------------------------- /core/mutex_private.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef MUTEX_PRIVATE_H 28 | #define MUTEX_PRIVATE_H 29 | 30 | #include "dlist.h" 31 | #include "thread_private.h" 32 | #include "dbg.h" 33 | 34 | typedef struct { 35 | DLIST list; 36 | MAGIC; 37 | //only one item 38 | THREAD* owner; 39 | //list 40 | THREAD* waiters; 41 | }MUTEX; 42 | 43 | //update owner priority according lowest priority of owner's all waiters of all mutexes 44 | //can be called from thread_private.c on base priority update 45 | //also called internally on mutex unlock 46 | unsigned int svc_mutex_calculate_owner_priority(THREAD* thread); 47 | //release lock, acquired by mutex. Called from thread_private to release 48 | //locked object - by timeout or thread termination. also can be called on normal release 49 | void svc_mutex_lock_release(MUTEX* mutex, THREAD* thread); 50 | 51 | unsigned int svc_mutex_handler(unsigned int num, unsigned int param1, unsigned int param2); 52 | 53 | #endif // MUTEX_PRIVATE_H 54 | -------------------------------------------------------------------------------- /core/queue_private.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef QUEUE_PRIVATE_H 28 | #define QUEUE_PRIVATE_H 29 | 30 | #include "thread_private.h" 31 | #include "dbg.h" 32 | #include "dlist.h" 33 | 34 | typedef struct { 35 | MAGIC; 36 | unsigned int align_offset; 37 | void* mem_block; 38 | DLIST* free_blocks; 39 | DLIST* filled_blocks; 40 | THREAD* push_waiters; 41 | THREAD* pull_waiters; 42 | }QUEUE; 43 | 44 | //called from thread_private.c on destroy or timeout 45 | void svc_queue_lock_release(QUEUE* queue, THREAD* thread); 46 | 47 | unsigned int svc_queue_handler(unsigned int num, unsigned int param1, unsigned int param2, unsigned int param3); 48 | 49 | #endif // QUEUE_PRIVATE_H 50 | -------------------------------------------------------------------------------- /core/sem.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef SEM_H 28 | #define SEM_H 29 | 30 | /* 31 | Semaphore 32 | */ 33 | 34 | 35 | #include "time.h" 36 | #include "types.h" 37 | 38 | HANDLE semaphore_create(); 39 | void semaphore_signal(HANDLE sem); 40 | bool semaphore_wait(HANDLE sem, TIME* timeout); 41 | bool sempahore_wait_ms(HANDLE sem, unsigned int timeout_ms); 42 | bool semaphore_wait_us(HANDLE sem, unsigned int timeout_us); 43 | void semaphore_destroy(HANDLE sem); 44 | 45 | #endif // SEM_H 46 | -------------------------------------------------------------------------------- /core/sem_private.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef SEM_PRIVATE_H 28 | #define SEM_PRIVATE_H 29 | 30 | #include "thread_private.h" 31 | #include "dbg.h" 32 | 33 | typedef struct { 34 | MAGIC; 35 | int value; 36 | THREAD* waiters; 37 | }SEMAPHORE; 38 | 39 | //called from thread_private.c on destroy or timeout 40 | void svc_semaphore_lock_release(SEMAPHORE* sem, THREAD* thread); 41 | 42 | unsigned int svc_semaphore_handler(unsigned int num, unsigned int param1, unsigned int param2); 43 | 44 | 45 | #endif // SEM_PRIVATE_H 46 | -------------------------------------------------------------------------------- /core/sys_call.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef SYS_CALL_H 28 | #define SYS_CALL_H 29 | 30 | unsigned int sys_call(unsigned int num, unsigned int param1, unsigned int param2, unsigned int param3); 31 | unsigned int sys_handler(unsigned int num, unsigned int param1, unsigned int param2, unsigned int param3); 32 | 33 | /** \addtogroup arch_porting architecture porting 34 | \{ 35 | */ 36 | /** 37 | \brief arch-dependent context raiser 38 | \details If current contex is not enough during sys_call, context is raised, using 39 | this arch-specific function. After calling, return value is provided. 40 | 41 | For example, for cortex-m3 "svc 0x12" instruction is used. 42 | 43 | \param num: sys-call number 44 | \param param1: parameter 1. num-specific 45 | \param param2: parameter 2. num-specific 46 | \param param3: parameter 3. num-specific 47 | \retval result value. num-specific 48 | */ 49 | extern unsigned int do_sys_call(unsigned int num, unsigned int param1, unsigned int param2, unsigned int param3); 50 | /** \} */ // end of arch_porting group 51 | 52 | #endif // SYS_CALL_H 53 | -------------------------------------------------------------------------------- /core/sys_time.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef SYS_TIME_H 28 | #define SYS_TIME_H 29 | 30 | #include "time.h" 31 | 32 | //wrappers around sys_call 33 | time_t get_sys_time(); 34 | void set_sys_time(time_t time); 35 | TIME* get_uptime(TIME* uptime); 36 | TIME* time_elapsed(TIME* from, TIME* res); 37 | unsigned int time_elapsed_ms(TIME* from); 38 | unsigned int time_elapsed_us(TIME* from); 39 | 40 | #endif // SYS_TIME_H 41 | -------------------------------------------------------------------------------- /core/sys_time_private.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef SYS_TIME_PRIVATE_H 28 | #define SYS_TIME_PRIVATE_H 29 | 30 | #include "sys_timer.h" 31 | 32 | void sys_time_init(); 33 | unsigned int svc_sys_time_handler(unsigned int num, unsigned int param1); 34 | 35 | #endif // SYS_TIME_PRIVATE_H 36 | -------------------------------------------------------------------------------- /core/sys_timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef SYS_TIMER_H 28 | #define SYS_TIMER_H 29 | 30 | #include "time.h" 31 | #include "dlist.h" 32 | #include "sys_time.h" 33 | 34 | typedef void (*SYS_TIMER_HANDLER)(void*); 35 | 36 | typedef struct { 37 | DLIST list; 38 | TIME time; 39 | SYS_TIMER_HANDLER callback; 40 | void* param; 41 | }TIMER; 42 | 43 | void sys_timer_init(); 44 | 45 | //can be called from SVC/IRQ 46 | void svc_sys_timer_create(TIMER* timer); 47 | void svc_sys_timer_destroy(TIMER* timer); 48 | TIME* svc_get_uptime(TIME* uptime); 49 | unsigned int svc_sys_timer_handler(unsigned int num, unsigned int param1); 50 | //can be called from SVC/IRQ/SYS 51 | void sys_timer_create(TIMER* timer); 52 | void sys_timer_destroy(TIMER* timer); 53 | 54 | #endif // SYS_TIMER_H 55 | -------------------------------------------------------------------------------- /core/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef _TYPES_H_ 28 | #define _TYPES_H_ 29 | 30 | #include 31 | #include 32 | 33 | #ifndef NULL 34 | #define NULL 0 35 | #endif 36 | 37 | #define HANDLE unsigned int 38 | #define INVALID_HANDLE NULL 39 | 40 | #define INFINITE 0x0 41 | 42 | #define WORD_SIZE sizeof(unsigned int) 43 | #define WORD_SIZE_BITS (WORD_SIZE * 8) 44 | 45 | #endif /*_TYPES_H_*/ 46 | -------------------------------------------------------------------------------- /doc/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexeyk13/mkernel/df756a9ed1bcd20ea7e82375f7329d68ae1c9a06/doc/html/bc_s.png -------------------------------------------------------------------------------- /doc/html/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexeyk13/mkernel/df756a9ed1bcd20ea7e82375f7329d68ae1c9a06/doc/html/bdwn.png -------------------------------------------------------------------------------- /doc/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexeyk13/mkernel/df756a9ed1bcd20ea7e82375f7329d68ae1c9a06/doc/html/closed.png -------------------------------------------------------------------------------- /doc/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexeyk13/mkernel/df756a9ed1bcd20ea7e82375f7329d68ae1c9a06/doc/html/doxygen.png -------------------------------------------------------------------------------- /doc/html/dynsections.js: -------------------------------------------------------------------------------- 1 | function toggleVisibility(linkObj) 2 | { 3 | var base = $(linkObj).attr('id'); 4 | var summary = $('#'+base+'-summary'); 5 | var content = $('#'+base+'-content'); 6 | var trigger = $('#'+base+'-trigger'); 7 | var src=$(trigger).attr('src'); 8 | if (content.is(':visible')===true) { 9 | content.hide(); 10 | summary.show(); 11 | $(linkObj).addClass('closed').removeClass('opened'); 12 | $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); 13 | } else { 14 | content.show(); 15 | summary.hide(); 16 | $(linkObj).removeClass('closed').addClass('opened'); 17 | $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); 18 | } 19 | return false; 20 | } 21 | 22 | function updateStripes() 23 | { 24 | $('table.directory tr'). 25 | removeClass('even').filter(':visible:even').addClass('even'); 26 | } 27 | function toggleLevel(level) 28 | { 29 | $('table.directory tr').each(function(){ 30 | var l = this.id.split('_').length-1; 31 | var i = $('#img'+this.id.substring(3)); 32 | var a = $('#arr'+this.id.substring(3)); 33 | if (l 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/all_5f.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['_5fdlist',['_DLIST',['../struct__DLIST.html',1,'']]], 4 | ['_5fslist',['_SLIST',['../struct__SLIST.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/all_61.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/all_61.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['about',['About',['../about.html',1,'']]], 4 | ['application_5finit',['application_init',['../group__user__provided.html#ga30548166a2f46e9b006b93f10d2c1eca',1,'application_init(): main.c'],['../group__user__provided.html#ga30548166a2f46e9b006b93f10d2c1eca',1,'application_init(void): main.c']]], 5 | ['architecture_20porting',['architecture porting',['../group__arch__porting.html',1,'']]], 6 | ['assert',['ASSERT',['../group__debug.html#ga0966b817b229d48e5ffc7feab19a0be6',1,'dbg.h']]], 7 | ['atou',['atou',['../group__lib__printf.html#ga91e75980e7d28e4f27d7fb56bcf7a8ae',1,'atou(char *buf, int size): printf.c'],['../group__lib__printf.html#ga91e75980e7d28e4f27d7fb56bcf7a8ae',1,'atou(char *buf, int size): printf.c']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /doc/html/search/all_62.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/all_62.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['block_20based_20ring_20buffer',['block based ring buffer',['../group__lib__rb__block.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/all_63.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/all_63.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['check_5fcontext',['CHECK_CONTEXT',['../group__debug.html#gadf8b71d9ff4ab75e38819e176addfb42',1,'dbg.h']]], 4 | ['check_5fmagic',['CHECK_MAGIC',['../group__debug.html#gaeb2d8372533a0a9fb6cc231fc7d1bdce',1,'dbg.h']]], 5 | ['console',['CONSOLE',['../structCONSOLE.html',1,'']]], 6 | ['console_5fheader',['CONSOLE_HEADER',['../structCONSOLE__HEADER.html',1,'']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /doc/html/search/all_64.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/all_65.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/all_66.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/all_66.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['fatal_5ferror',['fatal_error',['../group__error.html#gaadb946f614ff7c1d5a303697c660a726',1,'fatal_error(ERROR_CODE ec, const char *name): error.c'],['../group__error.html#gaadb946f614ff7c1d5a303697c660a726',1,'fatal_error(ERROR_CODE ec, const char *name): error.c']]], 4 | ['fatal_5ferror_5faddress',['fatal_error_address',['../group__error.html#ga8cb9ba70072e0fcec77ee44c8ea13bf3',1,'fatal_error_address(ERROR_CODE ec, unsigned int address): error.c'],['../group__error.html#ga8cb9ba70072e0fcec77ee44c8ea13bf3',1,'fatal_error_address(ERROR_CODE ec, unsigned int address): error.c']]], 5 | ['format',['format',['../group__lib__printf.html#ga1daa4cbd90e3c33fb5e65e5e2a460b01',1,'format(WRITE_HANDLER write_handler, void *write_param, char *fmt, va_list va): printf.c'],['../group__lib__printf.html#ga1daa4cbd90e3c33fb5e65e5e2a460b01',1,'format(WRITE_HANDLER write_handler, void *write_param, char *fmt, va_list va): printf.c']]], 6 | ['free',['free',['../group__memory.html#gafbedc913aa4651b3c3b4b3aecd9b4711',1,'free(void *ptr): mem.c'],['../group__memory.html#gafbedc913aa4651b3c3b4b3aecd9b4711',1,'free(void *ptr): mem.c']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /doc/html/search/all_67.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/all_67.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['get_5fsys_5ftime',['get_sys_time',['../group__lib__time.html#gafed71163cdc28c8bd79ed4322d7020f4',1,'get_sys_time(): sys_time.c'],['../group__lib__time.html#gafed71163cdc28c8bd79ed4322d7020f4',1,'get_sys_time(): sys_time.c']]], 4 | ['get_5fuptime',['get_uptime',['../group__lib__time.html#gae01c254fbc317020aaab8bac8cbcda0b',1,'get_uptime(TIME *uptime): sys_time.c'],['../group__lib__time.html#gae01c254fbc317020aaab8bac8cbcda0b',1,'get_uptime(TIME *uptime): sys_time.c']]], 5 | ['getting_20started',['Getting started',['../gettingstarted.html',1,'']]], 6 | ['gmtime',['gmtime',['../group__lib__time.html#ga1140f64812abee9fc56ac5b08dc2c8c5',1,'gmtime(time_t time, struct tm *ts): time.c'],['../group__lib__time.html#ga1140f64812abee9fc56ac5b08dc2c8c5',1,'gmtime(time_t time, struct tm *ts): time.c']]], 7 | ['getting_20started',['Getting started',['../md_gettingstarted.html',1,'']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /doc/html/search/all_68.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/all_68.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['halt',['HALT',['../group__debug.html#ga597f2881b60f9b4f9ae6451abaaa1b7c',1,'dbg.h']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/all_69.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/all_69.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['idle_5ftask',['idle_task',['../group__user__provided.html#ga72b95d7bf14c8b40e3df1b5c0a647a29',1,'idle_task(void): main.c'],['../group__user__provided.html#ga72b95d7bf14c8b40e3df1b5c0a647a29',1,'idle_task(void): main.c']]], 4 | ['is_5fdlist_5fcontains',['is_dlist_contains',['../group__lib__dlist.html#ga92f22783f8831c0b70c4ff3233e4691a',1,'is_dlist_contains(DLIST **dlist, DLIST *entry): dlist.c'],['../group__lib__dlist.html#ga92f22783f8831c0b70c4ff3233e4691a',1,'is_dlist_contains(DLIST **dlist, DLIST *entry): dlist.c']]], 5 | ['is_5fdlist_5fempty',['is_dlist_empty',['../group__lib__dlist.html#gab73eef8e151278ca477f085a289e67af',1,'is_dlist_empty(DLIST **dlist): dlist.c'],['../group__lib__dlist.html#gab73eef8e151278ca477f085a289e67af',1,'is_dlist_empty(DLIST **dlist): dlist.c']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /doc/html/search/all_6b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/all_6b.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['keyboard',['KEYBOARD',['../structKEYBOARD.html',1,'']]], 4 | ['keyboard_5fcreate_5fparams',['KEYBOARD_CREATE_PARAMS',['../structKEYBOARD__CREATE__PARAMS.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/all_6c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/all_6c.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['license',['LICENSE',['../md_LICENSE.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/all_6d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/all_6f.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/all_6f.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['overview',['overview',['../md_overview.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/all_70.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/all_70.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['pend_5fswitch_5fcontext',['pend_switch_context',['../group__arch__porting.html#ga45badc3e8457d98796b5d8553c462f74',1,'thread_private.h']]], 4 | ['pool_5fallocate',['pool_allocate',['../group__memory.html#gad36c32164d33c59d97b9221a5bf93826',1,'pool_allocate(char *name, int size): mem.c'],['../group__memory.html#gad36c32164d33c59d97b9221a5bf93826',1,'pool_allocate(char *name, int size): mem.c']]], 5 | ['pool_5ffree',['pool_free',['../group__memory.html#gaafc8db4766ed5b09a8792d26bd4123e0',1,'pool_free(HANDLE pool): mem.c'],['../group__memory.html#gaafc8db4766ed5b09a8792d26bd4123e0',1,'pool_free(HANDLE pool): mem.c']]], 6 | ['pool_5fselect',['pool_select',['../group__memory.html#ga525c323d9abc148daf3c2fb0d0856689',1,'pool_select(HANDLE pool): mem.c'],['../group__memory.html#ga525c323d9abc148daf3c2fb0d0856689',1,'pool_select(HANDLE pool): mem.c']]], 7 | ['pool_5fselect_5fglobal',['pool_select_global',['../group__memory.html#ga02cc5a64ae9e783bf9aa4af0c9a4467a',1,'pool_select_global(): mem.c'],['../group__memory.html#ga02cc5a64ae9e783bf9aa4af0c9a4467a',1,'pool_select_global(): mem.c']]], 8 | ['printf',['printf',['../group__lib__printf.html#ga28abc837a69aa861f839321a9772d077',1,'printf(char *fmt,...): printf.c'],['../group__lib__printf.html#ga28abc837a69aa861f839321a9772d077',1,'printf(char *fmt,...): printf.c']]], 9 | ['profiling',['profiling',['../group__profiling.html',1,'']]] 10 | ]; 11 | -------------------------------------------------------------------------------- /doc/html/search/all_71.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/all_72.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/all_72.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['ring_20buffer',['ring buffer',['../group__lib__rb.html',1,'']]], 4 | ['rb',['RB',['../structRB.html',1,'']]], 5 | ['rb_5fblock',['RB_BLOCK',['../structRB__BLOCK.html',1,'']]], 6 | ['rb_5fblock_5fget',['rb_block_get',['../group__lib__rb__block.html#gaa5e0454df29120b4fdcbc1dfd16c34d2',1,'rb_block.h']]], 7 | ['rb_5fblock_5fheader',['RB_BLOCK_HEADER',['../structRB__BLOCK__HEADER.html',1,'']]], 8 | ['rb_5fblock_5finit',['rb_block_init',['../group__lib__rb__block.html#gaed5dec01b9419cb2b5727887e24eaaae',1,'rb_block.h']]], 9 | ['rb_5fblock_5fis_5fempty',['rb_block_is_empty',['../group__lib__rb__block.html#gac79b7ef906219e849b06bd0bddf4d650',1,'rb_block.h']]], 10 | ['rb_5fblock_5fis_5ffull',['rb_block_is_full',['../group__lib__rb__block.html#ga1a8f72107800970c81ef8c1c35e0a86b',1,'rb_block.h']]], 11 | ['rb_5fblock_5fput',['rb_block_put',['../group__lib__rb__block.html#ga8026d505508eecd196ffaf8988c79001',1,'rb_block.h']]], 12 | ['rb_5fget',['rb_get',['../group__lib__rb.html#ga5ec1ed9e549dc598b6be2cda1dd357ee',1,'rb.h']]], 13 | ['rb_5fheader',['RB_HEADER',['../structRB__HEADER.html',1,'']]], 14 | ['rb_5finit',['rb_init',['../group__lib__rb.html#ga5cf41e698545d614eea8c6f21c6ad4c3',1,'rb.h']]], 15 | ['rb_5fis_5fempty',['rb_is_empty',['../group__lib__rb.html#gaa91577a2970fab25ba20eecc833bc737',1,'rb.h']]], 16 | ['rb_5fis_5ffull',['rb_is_full',['../group__lib__rb.html#ga37a39a9e5af366355c6c1d8b5451849f',1,'rb.h']]], 17 | ['rb_5fput',['rb_put',['../group__lib__rb.html#gab21bfa2c087c52ac43faa5944e1a4aee',1,'rb.h']]] 18 | ]; 19 | -------------------------------------------------------------------------------- /doc/html/search/all_73.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/all_74.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/all_75.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/all_75.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['uart_5fbaud',['UART_BAUD',['../structUART__BAUD.html',1,'']]], 4 | ['uart_5fcb',['UART_CB',['../structUART__CB.html',1,'']]], 5 | ['uart_5fhw',['UART_HW',['../structUART__HW.html',1,'']]], 6 | ['unalign_5fdlist',['UNALIGN_DLIST',['../group__lib__dlist.html#ga70e746947667120216525ea1415d5a50',1,'dlist.h']]], 7 | ['us_5fto_5ftime',['us_to_time',['../group__lib__time.html#gac199a79611b5a8f1c08025e0dd30b763',1,'us_to_time(int us, TIME *time): time.c'],['../group__lib__time.html#gac199a79611b5a8f1c08025e0dd30b763',1,'us_to_time(int us, TIME *time): time.c']]], 8 | ['usec',['usec',['../structTIME.html#a33e87c739b759ccb212e4e889c6b08ca',1,'TIME']]], 9 | ['user_20provided_20functions',['user provided functions',['../group__user__provided.html',1,'']]] 10 | ]; 11 | -------------------------------------------------------------------------------- /doc/html/search/all_77.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/all_77.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['write_5fhandler',['WRITE_HANDLER',['../group__lib__printf.html#gaedf2a68c89a03e22fe51f09a7c72b98e',1,'printf.h']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/classes_5f.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/classes_5f.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['_5fdlist',['_DLIST',['../struct__DLIST.html',1,'']]], 4 | ['_5fslist',['_SLIST',['../struct__SLIST.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/classes_63.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/classes_63.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['console',['CONSOLE',['../structCONSOLE.html',1,'']]], 4 | ['console_5fheader',['CONSOLE_HEADER',['../structCONSOLE__HEADER.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/classes_64.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/classes_64.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['dlist_5fenum',['DLIST_ENUM',['../structDLIST__ENUM.html',1,'']]], 4 | ['dma_5ffull_5ftypedef',['DMA_FULL_TypeDef',['../structDMA__FULL__TypeDef.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/classes_65.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/classes_65.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['event',['EVENT',['../structEVENT.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/classes_6b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/classes_6b.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['keyboard',['KEYBOARD',['../structKEYBOARD.html',1,'']]], 4 | ['keyboard_5fcreate_5fparams',['KEYBOARD_CREATE_PARAMS',['../structKEYBOARD__CREATE__PARAMS.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/classes_6d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/classes_6d.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['mem_5fpool',['MEM_POOL',['../structMEM__POOL.html',1,'']]], 4 | ['mem_5fpool_5fentry',['MEM_POOL_ENTRY',['../structMEM__POOL__ENTRY.html',1,'']]], 5 | ['mem_5fpool_5fstat',['MEM_POOL_STAT',['../structMEM__POOL__STAT.html',1,'']]], 6 | ['mutex',['MUTEX',['../structMUTEX.html',1,'']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /doc/html/search/classes_71.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/classes_71.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['queue',['QUEUE',['../structQUEUE.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/classes_72.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/classes_72.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['rb',['RB',['../structRB.html',1,'']]], 4 | ['rb_5fblock',['RB_BLOCK',['../structRB__BLOCK.html',1,'']]], 5 | ['rb_5fblock_5fheader',['RB_BLOCK_HEADER',['../structRB__BLOCK__HEADER.html',1,'']]], 6 | ['rb_5fheader',['RB_HEADER',['../structRB__HEADER.html',1,'']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /doc/html/search/classes_73.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/classes_73.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['semaphore',['SEMAPHORE',['../structSEMAPHORE.html',1,'']]], 4 | ['sw_5ftimer',['SW_TIMER',['../structSW__TIMER.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/classes_74.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/classes_74.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['thread',['THREAD',['../structTHREAD.html',1,'']]], 4 | ['thread_5fcall',['THREAD_CALL',['../structTHREAD__CALL.html',1,'']]], 5 | ['time',['TIME',['../structTIME.html',1,'']]], 6 | ['timer',['TIMER',['../structTIMER.html',1,'']]], 7 | ['tm',['tm',['../structtm.html',1,'']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /doc/html/search/classes_75.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/classes_75.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['uart_5fbaud',['UART_BAUD',['../structUART__BAUD.html',1,'']]], 4 | ['uart_5fcb',['UART_CB',['../structUART__CB.html',1,'']]], 5 | ['uart_5fhw',['UART_HW',['../structUART__HW.html',1,'']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /doc/html/search/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexeyk13/mkernel/df756a9ed1bcd20ea7e82375f7329d68ae1c9a06/doc/html/search/close.png -------------------------------------------------------------------------------- /doc/html/search/enums_65.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/enums_65.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['error_5fcode',['ERROR_CODE',['../group__error.html#ga4db9ee29f2ff83c71567c12f6bfbf28c',1,'error.h']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/files_67.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/files_67.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['gettingstarted_2emd',['gettingstarted.md',['../gettingstarted_8md.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/files_72.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/files_72.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['readme_2emd',['README.md',['../README_8md.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/functions_61.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/functions_61.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['application_5finit',['application_init',['../group__user__provided.html#ga30548166a2f46e9b006b93f10d2c1eca',1,'application_init(): main.c'],['../group__user__provided.html#ga30548166a2f46e9b006b93f10d2c1eca',1,'application_init(void): main.c']]], 4 | ['atou',['atou',['../group__lib__printf.html#ga91e75980e7d28e4f27d7fb56bcf7a8ae',1,'atou(char *buf, int size): printf.c'],['../group__lib__printf.html#ga91e75980e7d28e4f27d7fb56bcf7a8ae',1,'atou(char *buf, int size): printf.c']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/functions_64.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/functions_65.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/functions_66.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/functions_66.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['fatal_5ferror',['fatal_error',['../group__error.html#gaadb946f614ff7c1d5a303697c660a726',1,'fatal_error(ERROR_CODE ec, const char *name): error.c'],['../group__error.html#gaadb946f614ff7c1d5a303697c660a726',1,'fatal_error(ERROR_CODE ec, const char *name): error.c']]], 4 | ['fatal_5ferror_5faddress',['fatal_error_address',['../group__error.html#ga8cb9ba70072e0fcec77ee44c8ea13bf3',1,'fatal_error_address(ERROR_CODE ec, unsigned int address): error.c'],['../group__error.html#ga8cb9ba70072e0fcec77ee44c8ea13bf3',1,'fatal_error_address(ERROR_CODE ec, unsigned int address): error.c']]], 5 | ['format',['format',['../group__lib__printf.html#ga1daa4cbd90e3c33fb5e65e5e2a460b01',1,'format(WRITE_HANDLER write_handler, void *write_param, char *fmt, va_list va): printf.c'],['../group__lib__printf.html#ga1daa4cbd90e3c33fb5e65e5e2a460b01',1,'format(WRITE_HANDLER write_handler, void *write_param, char *fmt, va_list va): printf.c']]], 6 | ['free',['free',['../group__memory.html#gafbedc913aa4651b3c3b4b3aecd9b4711',1,'free(void *ptr): mem.c'],['../group__memory.html#gafbedc913aa4651b3c3b4b3aecd9b4711',1,'free(void *ptr): mem.c']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /doc/html/search/functions_67.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/functions_67.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['get_5fsys_5ftime',['get_sys_time',['../group__lib__time.html#gafed71163cdc28c8bd79ed4322d7020f4',1,'get_sys_time(): sys_time.c'],['../group__lib__time.html#gafed71163cdc28c8bd79ed4322d7020f4',1,'get_sys_time(): sys_time.c']]], 4 | ['get_5fuptime',['get_uptime',['../group__lib__time.html#gae01c254fbc317020aaab8bac8cbcda0b',1,'get_uptime(TIME *uptime): sys_time.c'],['../group__lib__time.html#gae01c254fbc317020aaab8bac8cbcda0b',1,'get_uptime(TIME *uptime): sys_time.c']]], 5 | ['gmtime',['gmtime',['../group__lib__time.html#ga1140f64812abee9fc56ac5b08dc2c8c5',1,'gmtime(time_t time, struct tm *ts): time.c'],['../group__lib__time.html#ga1140f64812abee9fc56ac5b08dc2c8c5',1,'gmtime(time_t time, struct tm *ts): time.c']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /doc/html/search/functions_68.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/functions_68.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['halt',['halt',['../group__debug.html#gade0430439247877006d7df950f94918a',1,'dbg.h']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/functions_69.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/functions_69.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['idle_5ftask',['idle_task',['../group__user__provided.html#ga72b95d7bf14c8b40e3df1b5c0a647a29',1,'idle_task(void): main.c'],['../group__user__provided.html#ga72b95d7bf14c8b40e3df1b5c0a647a29',1,'idle_task(void): main.c']]], 4 | ['is_5fdlist_5fcontains',['is_dlist_contains',['../group__lib__dlist.html#ga92f22783f8831c0b70c4ff3233e4691a',1,'is_dlist_contains(DLIST **dlist, DLIST *entry): dlist.c'],['../group__lib__dlist.html#ga92f22783f8831c0b70c4ff3233e4691a',1,'is_dlist_contains(DLIST **dlist, DLIST *entry): dlist.c']]], 5 | ['is_5fdlist_5fempty',['is_dlist_empty',['../group__lib__dlist.html#gab73eef8e151278ca477f085a289e67af',1,'is_dlist_empty(DLIST **dlist): dlist.c'],['../group__lib__dlist.html#gab73eef8e151278ca477f085a289e67af',1,'is_dlist_empty(DLIST **dlist): dlist.c']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /doc/html/search/functions_6d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/functions_70.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/functions_70.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['pend_5fswitch_5fcontext',['pend_switch_context',['../group__arch__porting.html#ga45badc3e8457d98796b5d8553c462f74',1,'thread_private.h']]], 4 | ['pool_5fallocate',['pool_allocate',['../group__memory.html#gad36c32164d33c59d97b9221a5bf93826',1,'pool_allocate(char *name, int size): mem.c'],['../group__memory.html#gad36c32164d33c59d97b9221a5bf93826',1,'pool_allocate(char *name, int size): mem.c']]], 5 | ['pool_5ffree',['pool_free',['../group__memory.html#gaafc8db4766ed5b09a8792d26bd4123e0',1,'pool_free(HANDLE pool): mem.c'],['../group__memory.html#gaafc8db4766ed5b09a8792d26bd4123e0',1,'pool_free(HANDLE pool): mem.c']]], 6 | ['pool_5fselect',['pool_select',['../group__memory.html#ga525c323d9abc148daf3c2fb0d0856689',1,'pool_select(HANDLE pool): mem.c'],['../group__memory.html#ga525c323d9abc148daf3c2fb0d0856689',1,'pool_select(HANDLE pool): mem.c']]], 7 | ['pool_5fselect_5fglobal',['pool_select_global',['../group__memory.html#ga02cc5a64ae9e783bf9aa4af0c9a4467a',1,'pool_select_global(): mem.c'],['../group__memory.html#ga02cc5a64ae9e783bf9aa4af0c9a4467a',1,'pool_select_global(): mem.c']]], 8 | ['printf',['printf',['../group__lib__printf.html#ga28abc837a69aa861f839321a9772d077',1,'printf(char *fmt,...): printf.c'],['../group__lib__printf.html#ga28abc837a69aa861f839321a9772d077',1,'printf(char *fmt,...): printf.c']]] 9 | ]; 10 | -------------------------------------------------------------------------------- /doc/html/search/functions_71.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/functions_72.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/functions_72.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['rb_5fblock_5fget',['rb_block_get',['../group__lib__rb__block.html#gaa5e0454df29120b4fdcbc1dfd16c34d2',1,'rb_block.h']]], 4 | ['rb_5fblock_5finit',['rb_block_init',['../group__lib__rb__block.html#gaed5dec01b9419cb2b5727887e24eaaae',1,'rb_block.h']]], 5 | ['rb_5fblock_5fis_5fempty',['rb_block_is_empty',['../group__lib__rb__block.html#gac79b7ef906219e849b06bd0bddf4d650',1,'rb_block.h']]], 6 | ['rb_5fblock_5fis_5ffull',['rb_block_is_full',['../group__lib__rb__block.html#ga1a8f72107800970c81ef8c1c35e0a86b',1,'rb_block.h']]], 7 | ['rb_5fblock_5fput',['rb_block_put',['../group__lib__rb__block.html#ga8026d505508eecd196ffaf8988c79001',1,'rb_block.h']]], 8 | ['rb_5fget',['rb_get',['../group__lib__rb.html#ga5ec1ed9e549dc598b6be2cda1dd357ee',1,'rb.h']]], 9 | ['rb_5finit',['rb_init',['../group__lib__rb.html#ga5cf41e698545d614eea8c6f21c6ad4c3',1,'rb.h']]], 10 | ['rb_5fis_5fempty',['rb_is_empty',['../group__lib__rb.html#gaa91577a2970fab25ba20eecc833bc737',1,'rb.h']]], 11 | ['rb_5fis_5ffull',['rb_is_full',['../group__lib__rb.html#ga37a39a9e5af366355c6c1d8b5451849f',1,'rb.h']]], 12 | ['rb_5fput',['rb_put',['../group__lib__rb.html#gab21bfa2c087c52ac43faa5944e1a4aee',1,'rb.h']]] 13 | ]; 14 | -------------------------------------------------------------------------------- /doc/html/search/functions_73.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/functions_74.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/functions_75.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/functions_75.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['us_5fto_5ftime',['us_to_time',['../group__lib__time.html#gac199a79611b5a8f1c08025e0dd30b763',1,'us_to_time(int us, TIME *time): time.c'],['../group__lib__time.html#gac199a79611b5a8f1c08025e0dd30b763',1,'us_to_time(int us, TIME *time): time.c']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/groups_61.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/groups_61.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['architecture_20porting',['architecture porting',['../group__arch__porting.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/groups_62.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/groups_62.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['block_20based_20ring_20buffer',['block based ring buffer',['../group__lib__rb__block.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/groups_64.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/groups_64.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['data_20queue',['data queue',['../group__data__queue.html',1,'']]], 4 | ['debug_20routines',['debug routines',['../group__debug.html',1,'']]], 5 | ['dual_2dlinked_20list',['dual-linked list',['../group__lib__dlist.html',1,'']]], 6 | ['dynamic_20memory_20management',['dynamic memory management',['../group__memory.html',1,'']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /doc/html/search/groups_65.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/groups_65.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['error_20handling',['error handling',['../group__error.html',1,'']]], 4 | ['event',['event',['../group__event.html',1,'']]], 5 | ['embedded_20stdio',['embedded stdio',['../group__lib__printf.html',1,'']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /doc/html/search/groups_67.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/groups_67.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['group',['group',['../group__group.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/groups_6d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/groups_6d.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['message_20queue',['message queue',['../group__message__queue.html',1,'']]], 4 | ['mutex',['mutex',['../group__mutex.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/groups_70.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/groups_70.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['profiling',['profiling',['../group__profiling.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/groups_72.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/groups_72.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['ring_20buffer',['ring buffer',['../group__lib__rb.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/groups_73.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/groups_73.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['single_2dlinked_20list',['single-linked list',['../group__lib__slist.html',1,'']]], 4 | ['semaphore',['semaphore',['../group__semaphore.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/groups_74.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/groups_74.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['time',['time',['../group__lib__time.html',1,'']]], 4 | ['thread',['thread',['../group__thread.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/groups_75.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/groups_75.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['user_20provided_20functions',['user provided functions',['../group__user__provided.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/mag_sel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexeyk13/mkernel/df756a9ed1bcd20ea7e82375f7329d68ae1c9a06/doc/html/search/mag_sel.png -------------------------------------------------------------------------------- /doc/html/search/nomatches.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
No Matches
10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /doc/html/search/pages_61.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/pages_61.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['about',['About',['../about.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/pages_67.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/pages_67.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['getting_20started',['Getting started',['../gettingstarted.html',1,'']]], 4 | ['getting_20started',['Getting started',['../md_gettingstarted.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/pages_6c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/pages_6c.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['license',['LICENSE',['../md_LICENSE.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/pages_6d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/pages_6d.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['main_20index',['Main index',['../index.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/pages_6f.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/pages_6f.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['overview',['overview',['../md_overview.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/pages_70.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/pages_70.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['preparing_20project',['Preparing project',['../md_getting_started.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/search_l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexeyk13/mkernel/df756a9ed1bcd20ea7e82375f7329d68ae1c9a06/doc/html/search/search_l.png -------------------------------------------------------------------------------- /doc/html/search/search_m.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexeyk13/mkernel/df756a9ed1bcd20ea7e82375f7329d68ae1c9a06/doc/html/search/search_m.png -------------------------------------------------------------------------------- /doc/html/search/search_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexeyk13/mkernel/df756a9ed1bcd20ea7e82375f7329d68ae1c9a06/doc/html/search/search_r.png -------------------------------------------------------------------------------- /doc/html/search/typedefs_74.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/typedefs_74.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['time_5ft',['time_t',['../group__lib__time.html#gaec517130c026730881898750d76e596f',1,'time.h']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/typedefs_77.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/typedefs_77.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['write_5fhandler',['WRITE_HANDLER',['../group__lib__printf.html#gaedf2a68c89a03e22fe51f09a7c72b98e',1,'printf.h']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/variables_73.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/variables_73.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['sec',['sec',['../structTIME.html#ae20ab46a7dffdcafcc04a9b60da22395',1,'TIME']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/variables_74.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/variables_74.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['tm_5fhour',['tm_hour',['../structtm.html#a21deb39e67c581ba8375ff359b6dfd5c',1,'tm']]], 4 | ['tm_5fmday',['tm_mday',['../structtm.html#a6180a2005daeefbcb5b6fded54d11452',1,'tm']]], 5 | ['tm_5fmin',['tm_min',['../structtm.html#a71b78c7727eb5a8cf3ae056a95d21a81',1,'tm']]], 6 | ['tm_5fmon',['tm_mon',['../structtm.html#aa2a6035fc874cd365ca939457c170207',1,'tm']]], 7 | ['tm_5fsec',['tm_sec',['../structtm.html#a9371d5fce72a727d2e437fe0838c495a',1,'tm']]], 8 | ['tm_5fyear',['tm_year',['../structtm.html#af9a71b1efea265a855ab0869185395a5',1,'tm']]] 9 | ]; 10 | -------------------------------------------------------------------------------- /doc/html/search/variables_75.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
Loading...
11 |
12 | 15 |
Searching...
16 |
No Matches
17 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/search/variables_75.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['usec',['usec',['../structTIME.html#a33e87c739b759ccb212e4e889c6b08ca',1,'TIME']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexeyk13/mkernel/df756a9ed1bcd20ea7e82375f7329d68ae1c9a06/doc/html/sync_off.png -------------------------------------------------------------------------------- /doc/html/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexeyk13/mkernel/df756a9ed1bcd20ea7e82375f7329d68ae1c9a06/doc/html/sync_on.png -------------------------------------------------------------------------------- /doc/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexeyk13/mkernel/df756a9ed1bcd20ea7e82375f7329d68ae1c9a06/doc/html/tab_a.png -------------------------------------------------------------------------------- /doc/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexeyk13/mkernel/df756a9ed1bcd20ea7e82375f7329d68ae1c9a06/doc/html/tab_b.png -------------------------------------------------------------------------------- /doc/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexeyk13/mkernel/df756a9ed1bcd20ea7e82375f7329d68ae1c9a06/doc/html/tab_h.png -------------------------------------------------------------------------------- /doc/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexeyk13/mkernel/df756a9ed1bcd20ea7e82375f7329d68ae1c9a06/doc/html/tab_s.png -------------------------------------------------------------------------------- /doc/html/tabs.css: -------------------------------------------------------------------------------- 1 | .tabs, .tabs2, .tabs3 { 2 | background-image: url('tab_b.png'); 3 | width: 100%; 4 | z-index: 101; 5 | font-size: 13px; 6 | font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; 7 | } 8 | 9 | .tabs2 { 10 | font-size: 10px; 11 | } 12 | .tabs3 { 13 | font-size: 9px; 14 | } 15 | 16 | .tablist { 17 | margin: 0; 18 | padding: 0; 19 | display: table; 20 | } 21 | 22 | .tablist li { 23 | float: left; 24 | display: table-cell; 25 | background-image: url('tab_b.png'); 26 | line-height: 36px; 27 | list-style: none; 28 | } 29 | 30 | .tablist a { 31 | display: block; 32 | padding: 0 20px; 33 | font-weight: bold; 34 | background-image:url('tab_s.png'); 35 | background-repeat:no-repeat; 36 | background-position:right; 37 | color: #283A5D; 38 | text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); 39 | text-decoration: none; 40 | outline: none; 41 | } 42 | 43 | .tabs3 .tablist a { 44 | padding: 0 10px; 45 | } 46 | 47 | .tablist a:hover { 48 | background-image: url('tab_h.png'); 49 | background-repeat:repeat-x; 50 | color: #fff; 51 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 52 | text-decoration: none; 53 | } 54 | 55 | .tablist li.current a { 56 | background-image: url('tab_a.png'); 57 | background-repeat:repeat-x; 58 | color: #fff; 59 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 60 | } 61 | -------------------------------------------------------------------------------- /drv_if/rand.h: -------------------------------------------------------------------------------- 1 | #ifndef RAND_H 2 | #define RAND_H 3 | 4 | void srand(); 5 | unsigned int rand(); 6 | 7 | #endif // RAND_H 8 | -------------------------------------------------------------------------------- /drv_if/rcc.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef RCC_H 28 | #define RCC_H 29 | 30 | /* 31 | - reset 32 | - clock 33 | */ 34 | 35 | #include "types.h" 36 | 37 | typedef enum { 38 | RESET_REASON_UNKNOWN = 0, 39 | RESET_REASON_STANBY, 40 | RESET_REASON_WATCHDOG, 41 | RESET_REASON_SOFTWARE, 42 | RESET_REASON_POWERON, 43 | RESET_REASON_PIN_RST 44 | } RESET_REASON; 45 | 46 | extern unsigned long set_core_freq(unsigned long desired_freq); 47 | extern RESET_REASON get_reset_reason(); 48 | extern void reset(); 49 | 50 | extern unsigned long _core_freq; 51 | //for delay initialization 52 | extern unsigned long _core_cycles_us; 53 | extern unsigned long _core_cycles_ms; 54 | 55 | #endif // RCC_H 56 | -------------------------------------------------------------------------------- /drv_if/rtc.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef RTC_H 28 | #define RTC_H 29 | 30 | #include "dev.h" 31 | #include "time.h" 32 | 33 | typedef void (*RTC_HANDLER)(RTC_CLASS); 34 | 35 | extern void rtc_enable(RTC_CLASS rtc); 36 | extern void rtc_disable(RTC_CLASS rtc); 37 | extern void rtc_enable_second_tick(RTC_CLASS rtc, RTC_HANDLER callback, int priority); 38 | extern void rtc_disable_second_tick(RTC_CLASS rtc); 39 | 40 | extern time_t rtc_get(RTC_CLASS rtc); 41 | extern void rtc_set(RTC_CLASS rtc, time_t time); 42 | 43 | #endif // RTC_H 44 | -------------------------------------------------------------------------------- /drv_if/timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef TIMER_H 28 | #define TIMER_H 29 | 30 | /* 31 | hw delay timer 32 | */ 33 | 34 | #include "dev.h" 35 | 36 | #define TIMER_FLAG_ONE_PULSE_MODE (1 << 0) 37 | 38 | typedef void (*TIMER_HANDLER)(TIMER_CLASS); 39 | 40 | extern void timer_enable(TIMER_CLASS timer, TIMER_HANDLER handler, int priority, unsigned int flags); 41 | extern void timer_disable(TIMER_CLASS timer); 42 | extern void timer_start(TIMER_CLASS timer, unsigned int time_us); 43 | extern void timer_stop(TIMER_CLASS timer); 44 | extern unsigned int timer_elapsed(TIMER_CLASS timer); 45 | 46 | #endif // TIMER_H 47 | -------------------------------------------------------------------------------- /drv_if/usb.h: -------------------------------------------------------------------------------- 1 | #ifndef USB_H 2 | #define USB_H 3 | 4 | #include "types.h" 5 | #include "dev.h" 6 | #include "usb_desc.h" 7 | 8 | typedef enum { 9 | EP_OUT0 = 0x0, 10 | EP_OUT1, 11 | EP_OUT2, 12 | EP_OUT3, 13 | EP_OUT4, 14 | EP_OUT5, 15 | EP_OUT6, 16 | EP_OUT7, 17 | EP_OUT8, 18 | EP_OUT9, 19 | EP_OUT10, 20 | EP_OUT11, 21 | EP_OUT12, 22 | EP_OUT13, 23 | EP_OUT14, 24 | EP_OUT15, 25 | EP_IN0 = 0x80, 26 | EP_IN1, 27 | EP_IN2, 28 | EP_IN3, 29 | EP_IN4, 30 | EP_IN5, 31 | EP_IN6, 32 | EP_IN7, 33 | EP_IN8, 34 | EP_IN9, 35 | EP_IN10, 36 | EP_IN11, 37 | EP_IN12, 38 | EP_IN13, 39 | EP_IN14, 40 | EP_IN15 41 | } EP_CLASS; 42 | 43 | #define IS_EP_IN(ep) ((ep) & 0x80) 44 | #define IS_EP_OUT(ep) (((ep) & 0x80) == 0) 45 | #define EP_NUM(ep) ((ep) & 0x7f) 46 | #define EP_IN(ep) ((ep) | 0x80) 47 | #define EP_OUT(ep) ((ep) & 0x7f) 48 | 49 | typedef enum { 50 | EP_TYPE_CONTROL = 0, 51 | EP_TYPE_ISOCHRON, 52 | EP_TYPE_BULK, 53 | EP_TYPE_INTERRUPT 54 | } EP_TYPE_CLASS; 55 | 56 | typedef enum { 57 | USB_LOW_SPEED = 0, 58 | USB_FULL_SPEED, 59 | USB_HIGH_SPEED, 60 | USB_SUPER_SPEED 61 | } USB_SPEED; 62 | 63 | typedef void (*USB_HANDLER)(void*); 64 | typedef void (*USB_EP_HANDLER)(EP_CLASS, void*); 65 | 66 | typedef struct { 67 | USB_HANDLER usbd_on_reset; 68 | USB_HANDLER usbd_on_suspend; 69 | USB_HANDLER usbd_on_resume; 70 | USB_HANDLER usbd_on_setup; 71 | }USBD_CALLBACKS; 72 | 73 | typedef struct { 74 | const USBD_CALLBACKS* cb; 75 | void* param; 76 | const USB_DESCRIPTORS_TYPE* descriptors; 77 | }USB_ENABLE_DEVICE_PARAMS; 78 | 79 | //requests to hw driver 80 | void usb_enable_device(USB_CLASS idx, USB_ENABLE_DEVICE_PARAMS* params, int priority); 81 | void usb_disable(USB_CLASS idx); 82 | void usb_set_address(USB_CLASS idx, uint8_t address); 83 | USB_SPEED usb_get_current_speed(USB_CLASS idx); 84 | 85 | void usb_ep_enable(USB_CLASS idx, EP_CLASS ep, USB_EP_HANDLER cb, void* param, int max_packet_size, EP_TYPE_CLASS type); 86 | void usb_ep_disable(USB_CLASS idx, EP_CLASS ep); 87 | void usb_ep_stall(USB_CLASS idx, EP_CLASS ep); 88 | void usb_ep_clear_stall(USB_CLASS idx, EP_CLASS ep); 89 | bool usb_ep_is_stall(USB_CLASS idx, EP_CLASS ep); 90 | 91 | void usb_read(USB_CLASS idx, EP_CLASS ep, char* buf, int size); 92 | void usb_write(USB_CLASS idx, EP_CLASS ep, char* buf, int size); 93 | 94 | #endif // USB_DD_H 95 | -------------------------------------------------------------------------------- /drv_if/wdt.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef WDT_H 28 | #define WDT_H 29 | 30 | #include "dev.h" 31 | 32 | extern void wdt_enable(WDT_CLASS wdt, int timeout_ms); 33 | extern void wdt_disable(WDT_CLASS wdt); 34 | extern void wdt_kick(WDT_CLASS wdt); 35 | 36 | #endif // WDT_H 37 | -------------------------------------------------------------------------------- /example/stm32f2/config/config.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_H 2 | #define CONFIG_H 3 | 4 | //------------------------------------- GPIO ------------------------------------------------------------------- 5 | #define LED_PIN GPIO_B7 6 | 7 | #endif // CONFIG_H 8 | -------------------------------------------------------------------------------- /example/stm32f2/main.c: -------------------------------------------------------------------------------- 1 | #include "gpio_user.h" 2 | #include "config.h" 3 | #include "dbg.h" 4 | #include "thread.h" 5 | #include "sys_time.h" 6 | 7 | void test_thread1(void* param) 8 | { 9 | printf("test thread1 started\n\r"); 10 | TIME uptime; 11 | for (;;) 12 | { 13 | get_uptime(&uptime); 14 | printf("uptime: %02d:%02d.%03d\n\r", uptime.sec / 60, uptime.sec % 60, uptime.usec / 1000); 15 | sleep_ms(1000); 16 | } 17 | } 18 | 19 | void test_thread2(void* param) 20 | { 21 | printf("test thread2 started\n\r"); 22 | bool on = false; 23 | for (;;) 24 | { 25 | on ? led_on() : led_off(); 26 | on = !on; 27 | sleep_ms(500); 28 | } 29 | } 30 | 31 | void application_init(void) 32 | { 33 | gpio_user_init(); 34 | 35 | thread_create_and_run("TEST1", 64, 20, test_thread1, NULL); 36 | thread_create_and_run("TEST2", 64, 30, test_thread2, NULL); 37 | } 38 | 39 | void idle_task(void) 40 | { 41 | for (;;) {} 42 | } 43 | -------------------------------------------------------------------------------- /example/stm32f2/mod/gpio_user/gpio_user.c: -------------------------------------------------------------------------------- 1 | #include "gpio_user.h" 2 | #include "gpio.h" 3 | #include "config.h" 4 | 5 | void gpio_user_init() 6 | { 7 | gpio_enable_pin(LED_PIN, PIN_MODE_OUT); 8 | led_off(); 9 | } 10 | 11 | void led_on() 12 | { 13 | gpio_set_pin(LED_PIN, false); 14 | } 15 | 16 | void led_off() 17 | { 18 | gpio_set_pin(LED_PIN, true); 19 | } 20 | -------------------------------------------------------------------------------- /example/stm32f2/mod/gpio_user/gpio_user.h: -------------------------------------------------------------------------------- 1 | #ifndef GPIO_USER_H 2 | #define GPIO_USER_H 3 | 4 | void gpio_user_init(); 5 | void led_on(); 6 | void led_off(); 7 | 8 | #endif // GPIO_USER_H 9 | -------------------------------------------------------------------------------- /example/stm32f2usbreader/config/config.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_H 2 | #define CONFIG_H 3 | 4 | //------------------------------------- GPIO ------------------------------------------------------------------- 5 | #define LED1_PIN GPIO_B14 6 | #define LED2_PIN GPIO_B15 7 | 8 | #endif // CONFIG_H 9 | -------------------------------------------------------------------------------- /example/stm32f2usbreader/main.c: -------------------------------------------------------------------------------- 1 | #include "gpio_user.h" 2 | #include "config.h" 3 | #include "gpio_user.h" 4 | #include "gpio.h" 5 | #include "sd_card.h" 6 | #include "storage.h" 7 | #include "usbd.h" 8 | #include "usb_msc.h" 9 | #include "usb_desc_user.h" 10 | #include "printf.h" 11 | 12 | #include "gpio_stm32.h" 13 | 14 | const SCSI_DESCRIPTOR _scsi_descriptor = { 15 | 0x00, 16 | "My company", 17 | "Flash cardreader", 18 | "0.1", 19 | "MY_CMPNY Flash cardreader" 20 | }; 21 | 22 | SD_CARD* _sd_card; 23 | STORAGE_HOST_CB _storage_cb; 24 | 25 | USBD* _usbd; 26 | USB_MSC* _msc; 27 | USBD_STATE_CB _state_cb; 28 | 29 | void io_monitor(void* param, STORAGE_STATE state) 30 | { 31 | switch (state) 32 | { 33 | case STORAGE_STATE_IDLE: 34 | led_off(LED_2); 35 | break; 36 | default: 37 | led_on(LED_2); 38 | break; 39 | } 40 | } 41 | 42 | void usb_state_changed(USBD_STATE state, USBD_STATE prior_state, void* param) 43 | { 44 | switch (state) 45 | { 46 | case USBD_STATE_CONFIGURED: 47 | led_on(LED_1); 48 | printf("USB plugged\n\r"); 49 | break; 50 | case USBD_STATE_SUSPENDED: 51 | if (prior_state == USBD_STATE_CONFIGURED) 52 | { 53 | led_off(LED_1); 54 | printf("USB unplugged\n\r"); 55 | } 56 | break; 57 | default: 58 | break; 59 | } 60 | } 61 | 62 | void application_init(void) 63 | { 64 | gpio_user_init(); 65 | 66 | _sd_card = sd_card_create(SDIO_1, SDIO_IRQ_PRIORITY); 67 | 68 | _storage_cb.state_changed = io_monitor; 69 | _storage_cb.media_state_changed = NULL; 70 | _storage_cb.param = NULL; 71 | storage_register_handler(sd_card_get_storage(_sd_card), &_storage_cb); 72 | 73 | _usbd = usbd_create(USB_1, _p_usb_descriptors, USB_IRQ_PRIORITY); 74 | _state_cb.state_handler = usb_state_changed; 75 | _state_cb.param = NULL; 76 | usbd_register_state_callback(_usbd, &_state_cb); 77 | _msc = usb_msc_create(_usbd, 1, sd_card_get_storage(_sd_card), (P_SCSI_DESCRIPTOR)&_scsi_descriptor); 78 | } 79 | 80 | void idle_task(void) 81 | { 82 | for (;;) 83 | { 84 | __WFI(); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /example/stm32f2usbreader/mod/gpio_user/gpio_user.c: -------------------------------------------------------------------------------- 1 | #include "gpio_user.h" 2 | #include "gpio.h" 3 | #include "config.h" 4 | 5 | const GPIO_CLASS LED_PINS[] = {LED1_PIN, LED2_PIN}; 6 | 7 | void gpio_user_init() 8 | { 9 | int i; 10 | for (i = 0; i < LED_MAX; ++i) 11 | { 12 | gpio_enable_pin(LED_PINS[i], PIN_MODE_OUT); 13 | led_off(i); 14 | } 15 | } 16 | 17 | void gpio_user_disable() 18 | { 19 | int i; 20 | for (i = 0; i < LED_MAX; ++i) 21 | { 22 | led_off(i); 23 | gpio_disable_pin(LED_PINS[i]); 24 | } 25 | } 26 | 27 | void led_on(LEDS led) 28 | { 29 | gpio_set_pin(LED_PINS[led], false); 30 | } 31 | 32 | void led_off(LEDS led) 33 | { 34 | gpio_set_pin(LED_PINS[led], true); 35 | } 36 | -------------------------------------------------------------------------------- /example/stm32f2usbreader/mod/gpio_user/gpio_user.h: -------------------------------------------------------------------------------- 1 | #ifndef GPIO_USER_H 2 | #define GPIO_USER_H 3 | 4 | typedef enum { 5 | LED_1 = 0, 6 | LED_2, 7 | LED_MAX 8 | } LEDS; 9 | 10 | 11 | void gpio_user_init(); 12 | void gpio_user_disable(); 13 | void led_on(LEDS led); 14 | void led_off(LEDS led); 15 | 16 | #endif // GPIO_USER_H 17 | -------------------------------------------------------------------------------- /example/stm32f2usbreader/mod/usb_desc_user/usb_desc_user.h: -------------------------------------------------------------------------------- 1 | #ifndef USB_DESC_USER_H 2 | #define USB_DESC_USER_H 3 | 4 | #include "usb_desc.h" 5 | 6 | extern const P_USB_DESCRIPTORS_TYPE _p_usb_descriptors; 7 | 8 | #endif // USB_DESC_USER_H 9 | -------------------------------------------------------------------------------- /lib/rand.c: -------------------------------------------------------------------------------- 1 | #include "rand.h" 2 | #include "delay.h" 3 | #include "sys_timer.h" 4 | #include "hw_config.h" 5 | #include "memmap.h" 6 | 7 | #ifndef HW_RAND 8 | 9 | static unsigned int _rand __attribute__ ((section (".sys_bss"))) = 0; 10 | 11 | void srand() 12 | { 13 | _rand = 0x30d02149; 14 | int i; 15 | for (i = 0; i < 0x100; ++i) 16 | _rand ^= *((unsigned int *)(SYSTEM_POOL_BASE + i)); 17 | TIME uptime; 18 | get_uptime(&uptime); 19 | _rand ^= uptime.usec; 20 | rand(); 21 | } 22 | 23 | unsigned int rand() 24 | { 25 | _rand = _rand * 0x1b8365e9 + 0x6071d; 26 | TIME uptime; 27 | get_uptime(&uptime); 28 | _rand ^= uptime.usec; 29 | return _rand; 30 | } 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /mod/console/console.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef CONSOLE_H 28 | #define CONSOLE_H 29 | 30 | #include "dev.h" 31 | #include "event.h" 32 | #include "mutex.h" 33 | #include "rb.h" 34 | #include "uart.h" 35 | 36 | typedef struct { 37 | UART_CLASS port; 38 | unsigned int uart_mode; 39 | HANDLE rx_event; 40 | char* rx_buf; 41 | int size_max; 42 | }CONSOLE_HEADER; 43 | 44 | typedef struct { 45 | CONSOLE_HEADER h; 46 | RB tx_buf; 47 | }CONSOLE; 48 | 49 | CONSOLE* console_create(UART_CLASS port, int tx_size, int priority); 50 | void console_destroy(CONSOLE* console); 51 | void console_write(CONSOLE* console, char* buf, int size); 52 | void console_writeln(CONSOLE* console, char* buf); 53 | void console_putc(CONSOLE* console, char c); 54 | void console_push(CONSOLE* console); 55 | int console_read(CONSOLE* console, char* buf, int size_max); 56 | int console_readln(CONSOLE* console, char* buf, int size_max); 57 | char console_getc(CONSOLE* console); 58 | 59 | #endif // CONSOLE_H 60 | -------------------------------------------------------------------------------- /mod/dbg_console/dbg_console.c: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include "dbg_console.h" 28 | #include "sys_call.h" 29 | #include "sys_calls.h" 30 | #include "types.h" 31 | #include "printf.h" 32 | 33 | void printf_handler(void* param, const char *const buf, unsigned int size) 34 | { 35 | dbg_write(buf, size); 36 | } 37 | 38 | void dbg_write(const char* const buf, int size) 39 | { 40 | sys_call(DBG_WRITE, (unsigned int)buf, (unsigned int)size, 0); 41 | } 42 | 43 | void dbg_push() 44 | { 45 | sys_call(DBG_PUSH, 0, 0, 0); 46 | } 47 | -------------------------------------------------------------------------------- /mod/dbg_console/dbg_console.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef DBG_CONSOLE_H 28 | #define DBG_CONSOLE_H 29 | 30 | /* 31 | dbg_console.h: debug console module 32 | */ 33 | 34 | 35 | void dbg_write(const char *const buf, int size); 36 | void dbg_push(); 37 | 38 | #endif // DBG_CONSOLE_H 39 | -------------------------------------------------------------------------------- /mod/dbg_console/dbg_console_private.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef DBG_CONSOLE_PRIVATE_H 28 | #define DBG_CONSOLE_PRIVATE_H 29 | 30 | void dbg_console_create(); 31 | void dbg_console_destroy(); 32 | 33 | unsigned int svc_dbg_handler(unsigned int num, unsigned int param1, unsigned int param2); 34 | 35 | #endif // DBG_CONSOLE_PRIVATE_H 36 | -------------------------------------------------------------------------------- /mod/scsi/scsi.h: -------------------------------------------------------------------------------- 1 | #ifndef SCSI_H 2 | #define SCSI_H 3 | 4 | #include "scsi_defs.h" 5 | #include "storage.h" 6 | #include "kernel_config.h" 7 | 8 | typedef struct { 9 | uint8_t scsi_device_type; 10 | const char* const vendor; 11 | const char* const product; 12 | const char* const revision; 13 | const char* const device_id; 14 | }SCSI_DESCRIPTOR, *P_SCSI_DESCRIPTOR; 15 | 16 | typedef struct { 17 | SCSI_CMD cmd; 18 | SCSI_DESCRIPTOR* descriptor; 19 | STORAGE* storage; 20 | SCSI_ERROR error_queue[SCSI_ERROR_BUF_SIZE]; 21 | uint8_t error_head, error_tail; 22 | }SCSI; 23 | 24 | SCSI* scsi_create(STORAGE* storage, SCSI_DESCRIPTOR* descriptor); 25 | void scsi_destroy(SCSI* scsi); 26 | void scsi_reset(SCSI* scsi); 27 | 28 | bool scsi_cmd(SCSI* scsi, char* cmd_buf, uint8_t cmd_size); 29 | 30 | #endif // SCSI_H 31 | -------------------------------------------------------------------------------- /mod/scsi/scsi_io.h: -------------------------------------------------------------------------------- 1 | #ifndef SCSI_IO_H 2 | #define SCSI_IO_H 3 | 4 | #include "types.h" 5 | #include "scsi.h" 6 | 7 | bool scsi_read(SCSI* scsi, unsigned long address, unsigned long sectors_count); 8 | bool scsi_write(SCSI* scsi, unsigned long address, unsigned long sectors_count); 9 | bool scsi_verify(SCSI* scsi, unsigned long address, unsigned long sectors_count); 10 | 11 | 12 | #endif // SCSI_IO_H 13 | -------------------------------------------------------------------------------- /mod/scsi/scsi_page.h: -------------------------------------------------------------------------------- 1 | #ifndef SCSI_PAGE_H 2 | #define SCSI_PAGE_H 3 | 4 | #include "scsi.h" 5 | 6 | void scsi_fill_error_page(SCSI* scsi, uint8_t code, uint16_t asq); 7 | void scsi_fill_capacity_page(SCSI* scsi); 8 | void scsi_fill_format_capacity_page(SCSI* scsi); 9 | void scsi_fill_standart_inquiry_page(SCSI* scsi); 10 | 11 | void scsi_fill_evpd_page_00(SCSI* scsi); 12 | void scsi_fill_evpd_page_80(SCSI* scsi); 13 | void scsi_fill_evpd_page_83(SCSI* scsi); 14 | 15 | void scsi_fill_sense_page_1c(SCSI* scsi); 16 | void scsi_fill_sense_page_3f(SCSI* scsi); 17 | 18 | #endif // SCSI_PAGE_H 19 | -------------------------------------------------------------------------------- /mod/scsi/scsi_private.h: -------------------------------------------------------------------------------- 1 | #ifndef SCSI_PRIVATE_H 2 | #define SCSI_PRIVATE_H 3 | 4 | void scsi_error(SCSI* scsi, uint8_t code, uint16_t asq); 5 | 6 | #endif // SCSI_PRIVATE_H 7 | -------------------------------------------------------------------------------- /mod/sd_card/sd_card.c: -------------------------------------------------------------------------------- 1 | #include "sd_card.h" 2 | #include "sd_card_defs.h" 3 | #include "sdio.h" 4 | #include "sd_card_cmd.h" 5 | #include 6 | #include "dbg.h" 7 | #include "kernel_config.h" 8 | #include "gpio.h" 9 | #include "event.h" 10 | #include "mem_private.h" 11 | #include "error.h" 12 | 13 | static const SDIO_CB _sdio_cb = { 14 | sd_card_on_read_complete, 15 | sd_card_on_write_complete, 16 | sd_card_on_error 17 | }; 18 | 19 | static const STORAGE_DEVICE_DESCRIPTOR _storage_device_descriptor = { 20 | STORAGE_DEVICE_FLAG_REMOVABLE, 21 | SD_CARD_SECTOR_SIZE 22 | }; 23 | 24 | static const STORAGE_DRIVER_CB _storage_cb = { 25 | sd_card_check_media, 26 | //on_cancel_io 27 | NULL, 28 | //on_storage_prepare_read 29 | NULL, 30 | sd_card_read_blocks, 31 | //on_storage_read_done 32 | NULL, 33 | //on_storage_prepare_read 34 | NULL, 35 | sd_card_write_blocks, 36 | //on_storage_write_done 37 | NULL, 38 | //on_write_cache 39 | NULL, 40 | sd_card_stop 41 | }; 42 | 43 | SD_CARD* sd_card_create(SDIO_CLASS port, int priority) 44 | { 45 | SD_CARD* sd_card = (SD_CARD*)sys_alloc(sizeof(SD_CARD)); 46 | if (sd_card) 47 | { 48 | sd_card->storage = storage_create(&_storage_device_descriptor, (P_STORAGE_DRIVER_CB)&_storage_cb, (void*)sd_card); 49 | sd_card->data_event = event_create(); 50 | 51 | sd_card->card_present = false; 52 | sd_card->port = port; 53 | sdio_enable(port, (P_SDIO_CB)&_sdio_cb, sd_card, priority); 54 | 55 | gpio_enable_pin(SD_CARD_CD_PIN, PIN_MODE_IN_PULLUP); 56 | } 57 | else 58 | error(ERROR_MEM_OUT_OF_SYSTEM_MEMORY, "SD_CARD"); 59 | return sd_card; 60 | } 61 | 62 | void sd_card_destroy(SD_CARD* sd_card) 63 | { 64 | storage_destroy(sd_card->storage); 65 | event_destroy(sd_card->data_event); 66 | sdio_disable(sd_card->port); 67 | gpio_disable_pin(SD_CARD_CD_PIN); 68 | sys_free(sd_card); 69 | } 70 | 71 | void sd_card_disable(SD_CARD* sd_card) 72 | { 73 | event_destroy(sd_card->data_event); 74 | gpio_disable_pin(SD_CARD_CD_PIN); 75 | sdio_disable(sd_card->port); 76 | } 77 | 78 | STORAGE* sd_card_get_storage(SD_CARD *sd_card) 79 | { 80 | return sd_card->storage; 81 | } 82 | -------------------------------------------------------------------------------- /mod/sd_card/sd_card.h: -------------------------------------------------------------------------------- 1 | #ifndef SD_CARD_H 2 | #define SD_CARD_H 3 | 4 | #include "dev.h" 5 | #include "storage.h" 6 | #include "sd_card_defs.h" 7 | #include "sdio.h" 8 | #include "scsi.h" 9 | 10 | typedef struct { 11 | //first field will be aligned 4 12 | uint32_t sdio_cmd_response[4]; 13 | char cmd_buf[64]; 14 | volatile bool futex; 15 | SDIO_CLASS port; 16 | STORAGE* storage; 17 | STORAGE_STATUS status; 18 | bool writing; 19 | STORAGE_MEDIA_DESCRIPTOR media; 20 | bool card_present; 21 | HANDLE data_event; 22 | //raw response data 23 | //card registers 24 | SDIO_CARD_TYPE card_type; 25 | uint16_t rca; 26 | }SD_CARD; 27 | 28 | SD_CARD* sd_card_create(SDIO_CLASS port, int priority); 29 | void sd_card_destroy(SD_CARD* sd_card); 30 | 31 | STORAGE* sd_card_get_storage(SD_CARD* sd_card); 32 | 33 | #endif // SD_CARD_H 34 | -------------------------------------------------------------------------------- /mod/sd_card/sd_card_cmd.h: -------------------------------------------------------------------------------- 1 | #ifndef SD_CARD_CMD_H 2 | #define SD_CARD_CMD_H 3 | 4 | #include "sd_card.h" 5 | #include "sdio.h" 6 | 7 | //callbacks from abstract storage 8 | bool sd_card_check_media(void* param); 9 | void sd_card_stop(void* param); 10 | STORAGE_STATUS sd_card_read_blocks(void* param, unsigned long addr, char* buf, unsigned long blocks_count); 11 | STORAGE_STATUS sd_card_write_blocks(void* param, unsigned long addr, char* buf, unsigned long blocks_count); 12 | 13 | void sd_card_on_read_complete(SDIO_CLASS port, void* param); 14 | void sd_card_on_write_complete(SDIO_CLASS port, void* param); 15 | void sd_card_on_error(SDIO_CLASS port, void* param, SDIO_ERROR error); 16 | 17 | #endif // SD_CARD_CMD_H 18 | -------------------------------------------------------------------------------- /mod/sw_timer/sw_timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | M-Kernel - embedded RTOS 3 | Copyright (c) 2011-2012, Alexey Kramarenko 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 are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef SW_TIMER_H 28 | #define SW_TIMER_H 29 | 30 | #include "types.h" 31 | #include "time.h" 32 | 33 | typedef void (*SW_TIMER_HANDLER)(void*); 34 | 35 | HANDLE sw_timer_create(SW_TIMER_HANDLER handler, void* param); 36 | void sw_timer_destroy(HANDLE handle); 37 | void sw_timer_start(HANDLE handle, TIME* timeout); 38 | void sw_timer_start_ms(HANDLE handle, unsigned int timeout_ms); 39 | void sw_timer_start_us(HANDLE handle, unsigned int timeout_us); 40 | void sw_timer_stop(HANDLE handle); 41 | 42 | void sw_timer_init(); 43 | 44 | #endif // SW_TIMER_H 45 | -------------------------------------------------------------------------------- /mod/usb_msc/usb_msc.h: -------------------------------------------------------------------------------- 1 | #ifndef USB_MSC_H 2 | #define USB_MSC_H 3 | 4 | #include "dev.h" 5 | #include "scsi.h" 6 | #include "usbd.h" 7 | 8 | #define CBW_SIZE 31 9 | #define CSW_SIZE 13 10 | #define CBW_MAGIC 0x43425355 11 | #define MAX_CB_SIZE 0x10 12 | 13 | #define CSW_STATUS_OK 0 14 | #define CSW_STATUS_FAILED 1 15 | #define CSW_STATUS_ERROR 2 16 | 17 | #define MSC_RESET 0xff 18 | #define MSC_GET_MAX_LUN 0xfe 19 | 20 | typedef enum { 21 | MSC_STATE_CBW = 0, 22 | MSC_STATE_DATA, 23 | MSC_STATE_CSW, 24 | MSC_STATE_CSW_SENT 25 | }MSC_STATE; 26 | 27 | #pragma pack(push, 1) 28 | 29 | typedef struct { 30 | uint32_t dCBWSignature; 31 | uint32_t dCBWTag; 32 | uint32_t dCBWDataTransferLength; 33 | uint8_t bmCBWFlags; 34 | uint8_t bCBWLUN; 35 | uint8_t bCBWCBLength; 36 | uint8_t CBWCB[16]; 37 | }CBW; 38 | 39 | typedef struct { 40 | uint32_t dCSWSignature; 41 | uint32_t dCSWTag; 42 | uint32_t dCSWDataResidue; 43 | uint8_t bCSWStatus; 44 | }CSW; 45 | 46 | #pragma pack(pop) 47 | 48 | typedef struct { 49 | USBD* usbd; 50 | EP_CLASS ep_num; 51 | int ep_size, block_size; 52 | HANDLE event, thread, queue; 53 | MSC_STATE state; 54 | SCSI* scsi; 55 | unsigned int scsi_requested, scsi_transferred; 56 | bool transfer_completed; 57 | char* current_buf; 58 | CBW cbw; 59 | uint8_t csw_status; 60 | USBD_SETUP_CB setup_cb; 61 | USBD_STATE_CB state_cb; 62 | } USB_MSC; 63 | 64 | USB_MSC* usb_msc_create(USBD* usbd, EP_CLASS ep_num, STORAGE *storage, SCSI_DESCRIPTOR* scsi_descriptor); 65 | void usb_msc_destroy(USB_MSC* msc); 66 | void usb_msc_reset(USB_MSC* msc); 67 | 68 | #endif // USB_MSC_H 69 | -------------------------------------------------------------------------------- /mod/usb_msc/usb_msc_io.h: -------------------------------------------------------------------------------- 1 | #ifndef USB_MSC_IO_H 2 | #define USB_MSC_IO_H 3 | 4 | #include "usb.h" 5 | 6 | void on_msc_received(EP_CLASS ep, void *param); 7 | void on_msc_sent(EP_CLASS ep, void* param); 8 | void usb_msc_thread(void* param); 9 | 10 | void on_storage_buffer_filled(void* param, unsigned int size); 11 | void on_storage_request_buffers(void* param, unsigned int size); 12 | 13 | #endif // USB_MSC_IO_H 14 | -------------------------------------------------------------------------------- /mod/usbd/usbd_core.h: -------------------------------------------------------------------------------- 1 | #ifndef USBD_CORE_H 2 | #define USBD_CORE_H 3 | 4 | /* 5 | processes USB device standart requests 6 | */ 7 | 8 | #include "types.h" 9 | #include "dev.h" 10 | #include "usbd.h" 11 | 12 | void usbd_inform_state_changed(USBD* usbd); 13 | bool usbd_device_request(USBD* usbd); 14 | bool usbd_interface_request(USBD* usbd); 15 | bool usbd_endpoint_request(USBD* usbd); 16 | //callback, that informs about STATUS stage of SETUP is complete 17 | void usbd_request_completed(USBD* usbd); 18 | 19 | #endif // USBD_CORE_H 20 | -------------------------------------------------------------------------------- /mod/usbd/usbd_core_io.h: -------------------------------------------------------------------------------- 1 | #ifndef USBD_CORE_IO_H 2 | #define USBD_CORE_IO_H 3 | 4 | void usbd_on_in_writed(EP_CLASS ep, void* param); 5 | void usbd_on_out_readed(EP_CLASS ep, void* param); 6 | void usbd_on_setup(void* param); 7 | 8 | #endif // USBD_CORE_IO_H 9 | --------------------------------------------------------------------------------