找回密码
 注册
搜索
查看: 30533|回复: 86

[讨论] 免费 KAL Programming Guide

[复制链接]
发表于 2008-7-25 15:50:22 | 显示全部楼层 |阅读模式
KAL Programming Guide
Revision History....................................................................................................................................................... 2
1 Overview.......................................................................................................................................................... 8
2 Fundamental Data Types ............................................................................................................................... 9
3 Task Management......................................................................................................................................... 10
3.1 Description ............................................................................................................................................... 10
3.2 Data Structures and Data Types ............................................................................................................... 12
3.3 Task Management API .............................................................................................................................. 15
kal_activate_hisr .................................................................................................................................................... 15
kal_change_priority ............................................................................................................................................... 15
kal_create_hisr....................................................................................................................................................... 15
kal_get_my_task_index......................................................................................................................................... 15
kal_get_mytask_priority........................................................................................................................................ 16
kal_get_task_self_id .............................................................................................................................................. 16
kal_if_hisr ............................................................................................................................................................... 16
kal_sleep_task........................................................................................................................................................ 16
stack_change_priority_by_module_ID ................................................................................................................. 16
3.4 Customization........................................................................................................................................... 17
4 Task Synchronization Management............................................................................................................. 20
4.1 Description ............................................................................................................................................... 20
4.1.1 Event group........................................................................................................................................ 20
4.2 Data structures and Data Types................................................................................................................ 21
4.3 Task Synchronization APIs........................................................................................................................ 22
4.3.1 MUTEX .............................................................................................................................................. 22
kal_create_mutex................................................................................................................................................... 22
kal_take_mutex ...................................................................................................................................................... 22
kal_give_mutex ...................................................................................................................................................... 22
4.3.2 Semaphore......................................................................................................................................... 22
kal_create_sem ...................................................................................................................................................... 22
kal_take_sem.......................................................................................................................................................... 22
kal_give_sem.......................................................................................................................................................... 23
4.3.3 Event group........................................................................................................................................ 23
kal_create_event_group........................................................................................................................................ 23
kal_set_eg_events ................................................................................................................................................. 23
kal_retrieve_eg_events ......................................................................................................................................... 23
4.4 Example ................................................................................................................................................... 24
5 Task Communication Management.............................................................................................................. 25
5.1 Data Structures and Data Types ............................................................................................................... 25
5.1.1 Access behavior of local parameter and peer buffer ........................................................................... 27
5.2 Task Communication APIs ........................................................................................................................ 28
allocate_ilm ............................................................................................................................................................ 28
append_to_peer_buff ............................................................................................................................................ 28
cancel_ilm............................................................................................................................................................... 28
construct_local_para............................................................................................................................................. 28
construct_peer_buff .............................................................................................................................................. 29
free_ilm ................................................................................................................................................................... 29
free_local_para....................................................................................................................................................... 29
free_local_para....................................................................................................................................................... 30
hold_local_para...................................................................................................................................................... 30
get_local_para_ptr ................................................................................................................................................. 30
get_pdu_ptr ............................................................................................................................................................ 30
hold_peer_buff ....................................................................................................................................................... 30
msg_get_ext_queue_info...................................................................................................................................... 30
msg_get_ext_queue_length.................................................................................................................................. 31
msg_send_ext_queue ........................................................................................................................................... 31
msg_send_int_queue ............................................................................................................................................ 31
prepend_to_peer_buff ........................................................................................................................................... 31
receive_msg_ext_q................................................................................................................................................ 32
receive_msg_int_q................................................................................................................................................. 32
remove_hdr_of_peer_buff..................................................................................................................................... 32
remove_tail_of_peer_buff ..................................................................................................................................... 32
update_peer_buff_hdr ........................................................................................................................................... 32
5.3 Example ................................................................................................................................................... 34
6 Timer Management ....................................................................................................................................... 36
6.1 Descriptions.............................................................................................................................................. 36
6.1.1 KAL timer ........................................................................................................................................... 36
6.1.2 Stack timer ......................................................................................................................................... 36
6.1.3 Event scheduler ................................................................................................................................. 37
6.2 Data Structures and Data Types ............................................................................................................... 38
6.2.1 KAL timer ........................................................................................................................................... 38
6.2.2 Stack timer ......................................................................................................................................... 38
6.2.3 Event scheduler ................................................................................................................................. 39
6.3 APIs.......................................................................................................................................................... 41
6.3.1 KAL timer ........................................................................................................................................... 41
kal_cancel_timer .................................................................................................................................................... 41
kal_create_timer..................................................................................................................................................... 41
kal_delete_timer..................................................................................................................................................... 41
kal_get_time ........................................................................................................................................................... 41
kal_get_time_remaining ........................................................................................................................................ 41
kal_get_timer_statistics ........................................................................................................................................ 41
kal_set_timer.......................................................................................................................................................... 41
6.3.2 Stack timer ......................................................................................................................................... 42
stack_deinit_timer ................................................................................................................................................. 42
stack_init_timer...................................................................................................................................................... 42
stack_is_time_out_valid........................................................................................................................................ 42
stack_process_time_out ....................................................................................................................................... 42
stack_start_timer ................................................................................................................................................... 42
stack_stop_timer ................................................................................................................................................... 43
stack_timer_status ................................................................................................................................................ 43
6.3.3 Event scheduler ................................................................................................................................. 43
evshed_cancel_event ............................................................................................................................................ 43
evshed_delete_all_events..................................................................................................................................... 43
evshed_get_rem_time ........................................................................................................................................... 44
evshed_resume_all_events................................................................................................................................... 44
evshed_set_event .................................................................................................................................................. 44
evshed_suspend_all_events................................................................................................................................. 44
evshed_timer_handler........................................................................................................................................... 44
new_evshed............................................................................................................................................................ 44
6.4 Examples.................................................................................................................................................. 46
7 Memory Management ................................................................................................................................... 48
7.1 Descriptions.............................................................................................................................................. 48
7.1.1 Control buffer ..................................................................................................................................... 48
7.1.2 ADM................................................................................................................................................... 51
7.1.3 System memory and debug memory .................................................................................................. 51
7.2 Data Structures and Data Types ............................................................................................................... 53
7.2.1 Control buffer ..................................................................................................................................... 53
7.2.2 ADM................................................................................................................................................... 55
7.3 Memory management APIs ....................................................................................................................... 57
7.3.1 Control buffer ..................................................................................................................................... 57
get_ctrl_buffer........................................................................................................................................................ 57
free_ctrl_buffer....................................................................................................................................................... 57
kal_query_ctrlbuf_max_consumption .................................................................................................................. 57
7.3.2 ADM................................................................................................................................................... 57
kal_adm_create ...................................................................................................................................................... 57
kal_adm_delete ...................................................................................................................................................... 57
kal_adm_alloc ........................................................................................................................................................ 58
kal_adm_free .......................................................................................................................................................... 58
kal_adm_get_max_alloc_size ............................................................................................................................... 58
kal_adm_get_total_left_size.................................................................................................................................. 58
7.3.3 System and debug memory ................................................................................................................ 58
kal_sys_mem_query_freesize............................................................................................................................... 58
kal_debug_mem_query_freesize.......................................................................................................................... 59
7.4 Examples.................................................................................................................................................. 60
8 Utility APIs..................................................................................................................................................... 61
8.1 Memory operation..................................................................................................................................... 61
kal_mem_cmp ........................................................................................................................................................ 61
kal_mem_cpy ......................................................................................................................................................... 61
kal_mem_set .......................................................................................................................................................... 61
8.2 Boot mode querying ................................................................................................................................. 61
stack_query_boot_mode....................................................................................................................................... 61
8.3 Multi-bytes string processing ..................................................................................................................... 61
kal_dchar_strlen .................................................................................................................................................... 61
kal_dchar_strcpy ................................................................................................................................................... 62
kal_dchar_strncpy ................................................................................................................................................. 62
kal_dchar_strcmp .................................................................................................................................................. 62
kal_dchar_strncmp................................................................................................................................................ 62
kal_dchar_strcat .................................................................................................................................................... 62
kal_dchar_strncat .................................................................................................................................................. 62
kal_dchar_strchr .................................................................................................................................................... 63
kal_dchar_strrchr................................................................................................................................................... 63
kal_dchar2char....................................................................................................................................................... 63
kal_wsprintf............................................................................................................................................................ 63
kal_wstrlen ............................................................................................................................................................. 63
kal_wstrcpy ............................................................................................................................................................ 63
kal_wstrncpy .......................................................................................................................................................... 64
kal_wstrcmp ........................................................................................................................................................... 64
kal_wstrncmp......................................................................................................................................................... 64
kal_wstrcat ............................................................................................................................................................. 64
kal_wstrncat ........................................................................................................................................................... 64
kal_wstrchr............................................................................................................................................................. 65
kal_wstrrchr............................................................................................................................................................ 65
8.4 Reentrance functions................................................................................................................................ 65
kal_strtok_r............................................................................................................................................................. 65
kal_gmtime_r.......................................................................................................................................................... 65
8.5 Exception handling ................................................................................................................................... 65
ASSERT .................................................................................................................................................................. 65
EXT_ASSERT ......................................................................................................................................................... 65
【文件名】:08725@52RD_KAL_Programming_Guide.pdf
【格 式】:pdf
【大 小】:799K
【简 介】:
【目 录】:


[br]<p align=right><font color=red>+3 RD币</font></p>
发表于 2009-8-20 17:30:44 | 显示全部楼层
感谢
十分感谢
点评回复

使用道具 举报

发表于 2009-8-21 10:53:41 | 显示全部楼层
太感谢楼主了。
[em05][em05]
点评回复

使用道具 举报

发表于 2009-8-22 22:43:18 | 显示全部楼层
灰常感谢锕!!!
点评回复

使用道具 举报

发表于 2009-8-26 15:11:46 | 显示全部楼层
好东西啊~~~太感谢LZ了~~~~~
点评回复

使用道具 举报

发表于 2009-8-27 15:27:47 | 显示全部楼层
多谢楼主分享,正在找这个东东 谢谢
点评回复

使用道具 举报

发表于 2009-8-31 12:11:41 | 显示全部楼层
非常感谢楼主分享这么好的资料
点评回复

使用道具 举报

发表于 2009-9-1 21:20:24 | 显示全部楼层
[em05]谢谢啊![em01]
点评回复

使用道具 举报

发表于 2009-9-4 12:47:48 | 显示全部楼层
感谢共享,还是免费的好啊
点评回复

使用道具 举报

发表于 2009-9-17 13:45:49 | 显示全部楼层
谢谢楼主了,正需要,看看
点评回复

使用道具 举报

发表于 2009-9-18 08:30:45 | 显示全部楼层
太感谢楼主了[em05][em06]
点评回复

使用道具 举报

发表于 2009-9-18 13:12:50 | 显示全部楼层
[em14]楼主您人太好啦!
点评回复

使用道具 举报

发表于 2009-9-18 14:33:27 | 显示全部楼层
谢谢, 谢谢楼主,辛苦了!!!!!!!!!!!!1
点评回复

使用道具 举报

发表于 2009-9-21 23:42:26 | 显示全部楼层
[em07]
点评回复

使用道具 举报

发表于 2009-9-22 23:02:30 | 显示全部楼层
千言万语汇成一句话:谢谢楼主
点评回复

使用道具 举报

发表于 2009-9-23 17:10:35 | 显示全部楼层
楼主好人
点评回复

使用道具 举报

发表于 2009-9-29 12:58:26 | 显示全部楼层
支持,楼主的无私奉献精神[em08]
点评回复

使用道具 举报

发表于 2009-10-11 15:16:24 | 显示全部楼层
太感谢LZ了
点评回复

使用道具 举报

发表于 2009-10-16 09:07:28 | 显示全部楼层

太感激你了,楼主

这么好的资料,难找啊
点评回复

使用道具 举报

发表于 2009-10-16 10:25:16 | 显示全部楼层
好东西,感谢楼主!
点评回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2024-12-23 04:05 , Processed in 0.073885 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表