The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers.    


Datasheet Search Engine   
 
Part # or Description: • 5V RS232 Driver • 2SC5066* • "Real Time Clock" • "USB connector" • "blue led" 5mm • 10 watt zener diode • 2N3055* motorola
 
Search Tip: Try entering the part number only. Include a wildcard (eg. lm317* or 1n4148*)

 

 

Custom Builder M3T-PD308SIM User's Manual Rev. 1.00 2003 REJ


Datasheet Thumbnail

  

Download PDF



Top Searches for this datasheet



CB308SIM V.1.11
Custom Builder M3T-PD308SIM
User's Manual
Rev. 1.00 2003 REJ10J0048-0100Z
Microsoft, MS-DOS, Windows, Windows registered trademarks Microsoft Corporation U.S. other countries. registered trademarks International Business Machines Corporation. Intel Pentium registered trademarks Intel Corporation. Adobe, Acrobat, Acrobat Reader trademarks Adobe Systems Incorporated. other brand product names trademarks, registered trademarks service marks their respective holders. Keep safety first your circuit designs! Renesas Technology Corporation Renesas Solutions Corporation maximum effort into making semiconductor products better more reliable, there always possibility that trouble occur with them. Trouble with semiconductors lead personal injury, fire property damage. Remember give consideration safety when making your circuit designs, with appropriate measures such placement substitutive, auxiliary circuits, (ii) nonflammable material (iii) prevention against malfunction mishap. Notes regarding these materials These materials intended reference assist customers selection Renesas Technology product best suited customer's application; they convey license under intellectual property rights, other rights, belonging Renesas Technology Corporation, Renesas Solutions Corporation third party. Renesas Technology Corporation Renesas Solutions Corporation assume responsibility damage, infringement third-party's rights, originating product data, diagrams, charts, programs, algorithms, circuit application examples contained these materials. information contained these materials, including product data, diagrams, charts, programs algorithms represents information products time publication these materials, subject change Renesas Technology Corporation Renesas Solutions Corporation without notice product improvements other reasons. therefore recommended that customers contact Renesas Technology Corporation, Renesas Solutions Corporation authorized Renesas Technology product distributor latest product information before purchasing product listed herein. information described here contain technical inaccuracies typographical errors. Renesas Technology Corporation Renesas Solutions Corporation assume responsibility damage, liability, other loss rising from these inaccuracies errors. Please also attention information published Renesas Technology Corporation Renesas Solutions Corporation various means, including Renesas home page (http://www.renesas.com). When using information contained these materials, including product data, diagrams, charts, programs, algorithms, please sure evaluate information total system before making final decision applicability information products. Renesas Technology Corporation Renesas Solutions Corporation assume responsibility damage, liability other loss resulting from information contained herein. Renesas Technology semiconductors designed manufactured device system that used under circumstances which human life potentially stake. Please contact Renesas Technology Corporation, Renesas Solutions Corporation authorized Renesas Technology product distributor when considering product contained herein specific purposes, such apparatus systems transportation, vehicular, medical, aerospace, nuclear, undersea repeater use. prior written approval Renesas Technology Corporation Renesas Solutions Corporation necessary reprint reproduce whole part these materials. these products technologies subject Japanese export control restrictions, they must exported under license from Japanese government cannot imported into country other than approved destination. diversion reexport contrary export control laws regulations Japan and/or country destination prohibited. Please contact Renesas Technology Corporation Renesas Solutions Corporation further details these materials products contained therein.
inquiries about contents this document product, fill text file installer generates following directory email your local distributor. Renesas Tools Homepage http://www.renesas.com/en/tools
CB308SIM SETTING CB308SIM FEATURES CB308SIM CB308SIM 2.1. 2.2. 2.3. 2.4. SAME USER INTERFACE AVAILABLE WITH PD308SIM DEVELOPMENT ENVIRONMENT WHERE PROGRAMMING, BUILDING, DEBUGGING CREATION CUSTOM COMMAND CUSTOM WINDOW PROGRAMS PD308SIM'S REGISTER, MEMORY, DUMP, SCRIPT WINDOWS
INTEGRATED
FUNCTION EACH WINDOW. WINDOW 3.1. CB308SIM WINDOW
3.1.1. 3.1.2.
3.2. 3.3. 3.4. 3.5. 3.6.
Menu Tool Bar.11 Menu Menu Menu Menu Menu
PROJECT WINDOW MESSAGE WINDOW EDITOR WINDOW LOCAL WINDOW GLOBAL WINDOW
3.2.1. 3.3.1. 3.4.1. 3.5.1. 3.6.1.
METHOD CREATING PROGRAM CREATING 4.1. CREATING CUSTOM COMMAND PROGRAM
4.1.1. 4.1.2. 4.1.3. 4.1.4. 4.1.5.
4.2.
Creating Project Custom Command Program.14 Creating Source File Source File Project.18 Building Project Execution Example Custom Command Program.20 Creating Project Custom Window Program Editing Automatically Created Framework Source File Execution Example Custom Window Program
CREATING CUSTOM WINDOW PROGRAM.21
4.2.1. 4.2.2. 4.2.3.
4.3.
USING SETUP DIALOG BOX.25
4.3.1. 4.3.2. 4.3.3. 4.3.4.
Project Setup Area.25 Source File Setup Area.26 Include File Library File Search Path Setup Area Library Setup Area.28
PROGRAMMING LANGUAGE SPECIFICATIONS LANGUAGE REFERENCE 6.1. STANDARD FUNCTIONS (STDLIB.LIB)
6.1.1. 6.1.2. 6.1.3. 6.1.4. 6.1.5. 6.1.6. 6.1.7. 6.1.8. 6.1.9. 6.1.10. 6.1.11. 6.1.12. 6.1.13. 6.1.14. 6.1.15. 6.1.16. 6.1.17. 6.1.18. 6.1.19.
6.2.
malloc: Allocate memory from heap area.31 free: Release area allocated malloc() function.31 strlen: length character string strcat: Concatenate character strings strcmp: Compare character strings strcpy: Copy character string.32 strtoi: Convert character string into value gets: Input character string (from Script Window) exit: Terminate program execution fopen: Open file fclose: Close file.34 fseek: Move file pointer fgetc: Input character (from file).34 fputc: Output character file) fgets: Input character string (from file).35 fputs: Output character string file) printf: Output characters with format Script Window) sprintf: Output characters with format memory) fprintf: Output characters with format file) _cpu_go: Execute program free-run mode _cpu_gb: Execute program with break.39 _cpu_stop: Stop program execution.39 _cpu_reset: Reset target _cpu_src_step: Execute program source line time _cpu_step: Execute program instruction time.40 _cpu_src_over: Execute program source line time including
SYSTEM CALL FUNCTIONS DEBUGGER OPERATION (SYSTEM.LIB)
6.2.1. 6.2.2. 6.2.3. 6.2.4. 6.2.5. 6.2.6. 6.2.7.
subroutines.40
6.2.8. 6.2.9. time 6.2.10. time 6.2.11. 6.2.12. 6.2.13. 6.2.14. 6.2.15. 6.2.16. 6.2.17. 6.2.18. 6.2.19. 6.2.20. 6.2.21. 6.2.22. 6.2.23. 6.2.24. 6.2.25. 6.2.26. 6.2.27. 6.2.28. 6.2.29. 6.2.30. 6.2.31. 6.2.32. 6.2.33. 6.2.34. 6.2.35. 6.2.36. 6.2.37. 6.2.38. 6.2.39. 6.2.40. 6.2.41.
_cpu_over: Execute program instruction time including subroutines41 _cpu_src_return: Return from current calling routine source line _cpu_return: Return from current calling routine instruction _cpu_wait: Wait until program execution stops _reg_get_reg: register value.42 _reg_put_reg: register value.42 _reg_get_pc: program counter value _reg_put_pc: program counter value.44 _reg_clear_cache: Clear register cache.44 _mem_get: memory value _mem_put: memory value.44 _mem_get_endian: memory value with endian attached.45 _mem_put_endian: memory value with endian attached.45 _mem_fill: Fill memory _mem_move: Transfer memory block.46 _mem_clear_cache: Clear memory cache _break_set: Set/enable software break _break_get: settings software breaks _break_reset: Clear software break.47 _break_reset_all: Clear software breaks.48 _break_disable: Disable software break.48 _break_disable_all: Disable software breaks.48 _break_enable_all: Enable software breaks _break_search: attribute software break settings _rram_clear: Clear monitor memory _rram_get_area: monitor area.49 _rram_set_area: monitor area _rram_get_size: size monitor area _rram_get_data: monitor data _info_check_run: Check execution status _info_service: information service contents _info_cpu: information.51 _info_get_map: information _info_check_map: Check mapped area.52
6.2.42. 6.2.43. 6.2.44. 6.2.45. 6.2.46. 6.2.47. 6.2.48. 6.2.49. 6.2.50. 6.2.51. 6.2.52. 6.2.53. 6.2.54. 6.2.55. 6.2.56. 6.2.57. 6.2.58. 6.2.59. 6.2.60. 6.2.61. 6.2.62. 6.2.63. 6.2.64. 6.2.65. 6.2.66. 6.2.67. 6.2.68. 6.2.69. 6.2.70. 6.2.71. 6.2.72. 6.2.73. 6.2.74. 6.2.75. 6.2.76. 6.2.77.
_info_get_suffix: load file extension.52 _info_set_suffix: load file extension _scope_set_obj: scope object file name _scope_set_addr: scope address.53 _sym_add_sym: Enter symbols _sym_val2sym: symbol value _sym_sym2val: value symbol _sym_add_bit: Enter symbols _sym_val2bit: symbol address number _sym_bit2val: address number symbol _line_addr2line: source line address.56 _line_line2addr: address source line.56 _src_get_name: list source file names _obj_get_name: list object file names _obj_addr2obj: object file name address.57 _func_get_name: list function names _exp_eval: Evaluate assembler expression _scri_echo_on: Turn output script window _scri_echo_off: Turn output script window.60 _c_exp_eval: Evaluate C-language expression _get_shared_mem: shared variable _set_shared_mem: shared variable.62 _delete_shared_mem: Delete shared variable _get_err_msg: PD308SIM's error message statement.63 _get_tick_count: elapsed time since Windows startup _get_time: current system date time.64 _disp_src_line: Change contents displayed program window.64 _rtt_get_range: data range _rtt_get_disasm: disassembled analysis result data.65 _rtt_get_bus: bus-mode display character string data.66 _rtt_check_isfetch: Check fetch cycle data _rtt_get_data: data _rtt_clear_cache: Clear real-time trace (RTT) cache _cv_get_data: coverage data.68 _cv_set_data: coverage data _cv_get_base: base address coverage range
6.2.78. 6.2.79. 6.2.80. 6.2.81. 6.2.82. 6.2.83.
6.3.
_cv_set_base: base address coverage range.69 _cv_clear_data: Clear coverage data _cv_clear_cache: Clear coverage cache.70 _syscom: Execute PD308SIM's script command.70 _doscom: Execute command.70 List Simulator Errors _win_printf: Output text with format included _win_puts: Output character string custom window _win_set_cursor: cursor position _win_set_color: text color.74 _win_set_bkcolor: background color _win_column2dot: Convert cursor coordinates into pixel coordinates.75 _draw_text_out: Output character string custom window _draw_set_color: text color _draw_set_bkcolor: background color _draw_set_bkmode: background mode _draw_set_font: font.78 _draw_get_char_size: font size.78 _draw_line: Draw line _draw_fill_rect: Fill rectangle _draw_frame_rect: Draw rectangle _draw_invert_rect: Reverse rectangle color _draw_arc: Draw ellipse.82 _draw_pie: Draw sector _win_redraw: Redraw custom window.84 _win_redraw_clear: Redraw custom window.84 _win_redraw_item: Redraw control item _win_show_window: Show/hide control item.84 _win_set_window_title: title custom window _win_enable_window: Enable/disable control item _win_button_create: Create button _win_button_set_text: Change button text _win_hscroll_range: scroll range horizontal scroll _win_hscroll_pos: position horizontal scroll _win_vscroll_range: scroll range vertical scroll
SYSTEM CALL FUNCTIONS WINDOW OPERATION (WINLIB.LIB).72
6.3.1. 6.3.2. 6.3.3. 6.3.4. 6.3.5. 6.3.6. 6.3.7. 6.3.8. 6.3.9. 6.3.10. 6.3.11. 6.3.12. 6.3.13. 6.3.14. 6.3.15. 6.3.16. 6.3.17. 6.3.18. 6.3.19. 6.3.20. 6.3.21. 6.3.22. 6.3.23. 6.3.24. 6.3.25. 6.3.26. 6.3.27. 6.3.28. 6.3.29.
6.3.30. 6.3.31. 6.3.32. 6.3.33. 6.3.34. 6.3.35. 6.3.36. 6.3.37. 6.3.38. 6.3.39. 6.3.40.
6.4.
_win_vscroll_pos: position vertical scroll _win_statusbar_create: Create status _win_statusbar_set_pane: items status _win_statusbar_set_text: text status bar.87 _win_dialog: Create input dialog _win_message_box: Create message box.88 _win_filedialog: Create file selection dialog _win_set_window_pos: position custom window _win_set_window_size: size custom window _win_timer_set: system timer _win_timer_kill: Reset system timer.92 Specifications Data Passed Handle Functions OnChar Handle Function OnCommand Handle Function.95 OnCreate Handle Function.95 OnDestroy Handle Function.95 OnDraw Handle Function.95 OnEvent Handle Function OnHScroll Handle Function OnKeyDown Handle Function.98 OnKeyUp Handle Function .101 OnLButtonDblClk Handle Function .102 OnLButtonDown Handle Function .102 OnLButtonUp Handle Function .103 OnMouseMove Handle Function .103 OnRButtonDblClk Handle Function .104 OnRButtonDown Handle Function .104 OnRButtonUp Handle Function.105 OnSize Handle Function .106 OnTimer Handle Function .106 OnVScroll Handle Function .107
HANDLE FUNCTIONS CUSTOM WINDOW
6.4.1. 6.4.2. 6.4.3. 6.4.4. 6.4.5. 6.4.6. 6.4.7. 6.4.8. 6.4.9. 6.4.10. 6.4.11. 6.4.12. 6.4.13. 6.4.14. 6.4.15. 6.4.16. 6.4.17. 6.4.18. 6.4.19. 6.4.20.
1.Setting CB308SIM
CB308SIM same PD308SIM. procedure setting PD308SIM detailed "Setup/Functional Outline" part PD308SIM V.3.00 User's Manual.
2.Features CB308SIM
CB308SIM provides environment using PD308SIM's customize function create exclusive script commands (hereafter called "custom command program") exclusive windows (hereafter called "custom window program"). custom command custom window programs thus created CB308SIM entered PD308SIM expand functions. following shows features CB308SIM: same user interface available with PD308SIM supported. development environment where programming, building, debugging integrated provided. Creation custom command custom window programs supported. PD308SIM's Register, Memory, Dump, Script Windows supported.
Each feature detailed sections below.
CB308SIM uses same graphical interface design PD308SIM, making possible CB308SIM easily same PD308SIM.
2.1.Same user interface available with PD308SIM
CB308SIM allows control series operations from creating source files building debugging them. windows supported CB308SIM include Project, Message, Editor, Local, Global Windows. Each these windows allows manage projects, display build result other status, edit source file, display local global symbols.
2.2.Development environment debugging integrated
where
programming,
building,
CB308SIM allows type program going create specified from dialog that opened when creating project. this select custom command custom window program created.
2.3.Creation custom command custom window programs
Among windows available with PD308SIM, CB308SIM supports Register, Memory, Dump, Script Windows. These windows used when creating custom command custom window programs. Note: macro script commands cannot used Script Window.
2.4.PD308SIM's Register, Memory, Dump, Script Windows
3.Function Each Window
CB308SIM Window
Figure shows window structure CB308SIM.
Project Window Local Window
Message Window
Editor Window
Global Window
Figure Window structure CB308SIM outline features functions each window CB308SIM explained below.
CB308SIM Window main window CB308SIM. This what opens first when start CB308SIM. 3.1.1.Menu Tables below show menu structure CB308SIM Window. Table Structure Menu (CB308SIM Window) (1/2) Items pull-down menu Function [N]ew Create source/header file. [S]ource/Header. Create project. [P]roject. Open source/project. [O]pen. Save source file. [S]ave Save file after assigning name. Save [A]s. Close source file. [C]lose Terminate CB308SIM. E[x]it Delete specified range. C[u]t Copy specified range clipboard. [C]opy Paste text from clipboard into position. [P]aste Search specified character string. [F]ind [I]nit. Open Init dialog box. [P]ath. Open Path dialog box. Execute command. [G]o Execute Come command. [C]ome Execute Step command. [S]tep Execute Over command. [O]ver Execute Return command. Retur[n] Execute Animate command. [A]nimate Open Break dialog box. [B]reak Point. Break Point clear breakpoint. [S]et Open Break dialog box. [L]ist. Reset program. [R]eset Stop program execution. [S]top Built current project. B[u]ild Rebuild current project. R[e]Build Changed window that focus. (Refer sections that follow.)
3.1.CB308SIM Window
Menu item [F]ile
[E]dit
[E]nviron [D]ebug
[O]ption
Menu item [W]indow
[H]elp
Table Structure Menu (CB308SIM Window) (2/2) Items pull-down menu Function Display windows another. [C]ascade Display windows side side. [T]ile Line icons. [A]rrange Icon Open PD308SIM's Register Window. [R]egister Window Open PD308SIM's Memory Window. M[e]mory Window Open PD308SIM's Dump Window. [D]ump Window Open PD308SIM's Script Window. Scr[i]pt Window [I]ndex Open table contents online help. [A]bout. Display version CB308SIM.
3.1.2.Tool Table shows tool structure CB308SIM Window. Table Structure Tool (CB308SIM Window) Function Corresponding menu Execute command [Debug]-[Go] Execute Come command Execute Step command Execute Over command Execute Return command Stop program execution Set/clear breakpoint Reset program Open Break dialog Build project Rebuild project [Debug]-[Come] [Debug]-[Step] [Debug]-[Over] [Debug]-[Return] [Debug]-[Stop] [Debug]-[Break Point]-[Set] [Debug]-[Reset] [Debug]-[Break Point.] [Debug]-[Build] [Debug]-[ReBuild]
Button
This window used manage source files custom command custom window programs created CB308SIM. source file displayed this window opened Editor Window example, double-clicking mouse button. 3.2.1.Menu Table shows menu structure Option menu Project Window. Table Menu Structure Option Menu (Project Window) Menu item Items pull-down menu Function Open Setup dialog box. [O]ption [S]et source file project. [A]dd File. Delete source file from project. [D]el File
3.2.Project Window
This window used display compile link error when building project other messages during debugging. These messages initialized when start building project. When compile error displayed, point line error double- single-click mouse button select Then choose [Option] [Jump] from menu display corresponding source file Editor Window, with cursor moved line error. 3.3.1.Menu Table shows menu structure Option menu Message Window. Table Menu Structure Option Menu (Message Window) Items pull-down menu Function [J]ump Display lines error.
3.3.Message Window
Menu item [O]ption
This window used edit source file. Multiple instances this window opened time, with source file name displayed title each window. Editor Window provides versatile editing functions, allowing input delete characters, paste from clipboard, load save file. During debugging, furthermore, breakpoint line shown next execution line shown blue. breakpoint line next execution line overlap, they displayed yellow. 3.4.1.Menu Option menu Editor Window does have submenu.
3.4.Editor Window
This window used display local variables their values function that corresponds program counter during debugging. This window opened when start debugging program closed when finish debugging. 3.5.1.Menu Option menu Local Window does have submenu.
3.5.Local Window
This window used display global variables their values during debugging. This window opened when start debugging program closed when finish debugging. 3.6.1.Menu Option menu Global Window does have submenu.
3.6.Global Window
4.Method Creating Program
This section explains CB308SIM create custom command custom window program using simple program example.
following shows procedure creating custom command program using CB308SIM. Create project custom command program. Write source file. source file project. Build project. Debug correct source file necessary. Repeat steps until program operates properly.
4.1.Creating Custom Command Program
table below shows specifications custom command program created this section. Program name Parameter Function m_reset None Display program counter value before reset. Reset target MCU. Display program counter value after reset.
4.1.1.Creating Project Custom Command Program Choose [File]-[New]-[Project.] from CB308SIM Window menu. dialog shown below will appear.
Figure Target Select dialog Choose "Custom Command" press "OK" button. file selection dialog will open, input project name press "Save" button. file name extension omitted.) diagram below shows example where "m_reset" input name sample custom command program created this section.
Figure Dialog selecting project name created Project Window showing created project file name project setup dialog opened.
Figure Setup dialog
Figure Project Window Setup dialog opened from Option menu Project Window change settings time want. this example, only press "Cancel" button Setup dialog leave intact. details Setup dialog box, refer Section 4.3, "Using Setup Dialog Box". Thus, with above, project file named "m_reset.prj" created.
4.1.2.Creating Source File Choose [File]-[New]-[Source/Header.] from CB308SIM Window menu. Editor Window shown below will appear.
Figure Blank Editor Window Move focus this Editor Window choose [File]-[Save As.] from CB308SIM Window menu bring Save dialog box. When this dialog opens, input file name press "Save" button. Specify ".m" source file name extension.
Figure Save dialog name have input Save dialog displayed title Editor Window.
Figure Editor Window with name shown title
Write custom command source program this Editor Window.
Figure Editor Window with source program written details about programming language specifications, refer Section "Programming Language Specifications". details about library function specifications, refer Section "Reference". asterisk file name title indicates that changes have been made this file. Thus, with above, custom command source file named "m_reset.m" created.
4.1.3.Add Source File Project build source file created preceding section, need project. Choose [Option]-[Add File.] from Project Window menu bring "Add source" dialog box. When this dialog opens, choose file name want added project press Open button. source file name thus added displayed Project Window.
Figure "Add Source" dialog
Figure Project Window with source file added Thus, with above, source file "m_reset.m" added project. also source files project using Setup dialog box. details Setup dialog box, refer Section 4.3, "Using Setup Dialog Box". 4.1.4.Building Project operation create custom command program custom window program file processing source files added project referred "build" "rebuild." difference between "build" "rebuild" that among source files added project, only those which have been modified since program file created previously processed former, whereas source files added project processed latter. execute Build, choose [Debug]-[Build] from Window menu press Build button tool bar. execute Rebuild, choose [Debug]-[ReBuild] from Window menu press Rebuild button tool bar.
Figure Message Window when succeeded building Thus, with above, custom command program file generated CB308SIM providing that error found source program settings Setup dialog box. this example, include file library file search paths remain default value (current directory) because only pressed "Cancel" button Setup dialog that opened when creating project. Therefore, project built following process described above, message will displayed Message Window indicating that include files cannot opened.
Figure Message Window when error occurred when building this case, click error message line displayed Message Window then choose [Option]-[Jump] double-click error message line. corresponding source line will displayed Editor Window, with cursor moved that line. example here, Build operation successfully executed setting include file library file search paths properly. details Setup dialog box, refer Section 4.3, "Using Setup Dialog Box".
4.1.5.Execution Example Custom Command Program following shows execution example m_reset command program that created example above. execute command program, press button CB308SIM Window tool bar.
Figure Execution example custom command program "m_reset.p" this example, will that address before reset 40404H address after reset F0000H. Output from custom command programs into Script Window. Therefore, Script Window open, there means verifying output from custom command programs.
following shows procedure creating custom window program using CB308SIM. Create project custom window program. Edit framework source file generated CB308SIM. Build project. Debug correct source file necessary. Repeat steps until program operates properly.
4.2.Creating Custom Window Program
table below shows specifications custom window program created this section. Program name dump1000 Function Dump bytes beginning with address 1000H. 4.2.1.Creating Project Custom Window Program Choose [File]-[New]-[Project.] from CB308SIM Window menu. dialog shown below will appear.
Figure Target Select dialog Choose "Custom Window" press "OK" button. file selection dialog will open, input project name press "Save" button. file name extension omitted.) diagram below shows example where "dump1000" input name sample custom window program created this section.
Figure Dialog selecting project name created When dialog prompting your confirmation whether create framework shown below appears, enter "Yes".
Figure Dialog confirmation framework generation enter "No" here, CB308SIM does automatically create framework. Project Window showing created project file name project setup dialog opened.
Figure Setup dialog
Figure Project Window Setup dialog opened from Option menu Project Window change settings time want. this example, only press "Cancel" button Setup dialog leave intact. details Setup dialog box, refer Section 4.3, "Using Setup Dialog Box". When creating project custom window program, framework source file automatically generated CB308SIM. this example, file "dump1000.m" automatically generated. Programming custom window program accomplished editing this framework source file. Thus, with above, project file "dump1000.prj" framework source file "dump1000.m" created.
4.2.2.Editing Automatically Created Framework Source File framework source file automatically created CB308SIM contains description handle functions that correspond window events. details about handle functions, refer Section 6.4, "Handle Functions Custom Window". handle functions treated example here: OnDraw OnEvent. OnDraw function called when area hidden some other window need displayed. OnEvent function called when change debugger status required such when target's memory value been modified. When OnDraw function called, dump1000 gets bytes memory values starting from address 1000H convert them into character strings display window. write this series processing, edit internal statements OnDraw function. Furthermore, when OnEvent function called, dump1000 calls OnDraw function update window display. Note: delete functions written framework source file. Loss function this file makes impossible build project correctly. There limit functions that added file. diagram below shows Editor Window displaying OnDraw function that been edited "dump1000" custom window program.
Figure Editor Window displaying OnDraw function dump1000 method building project custom window program same used custom command programs. Refer Section 4.1.4, "Building Project".
4.2.3.Execution Example Custom Window Program following shows execution example dump1000 window program that created example above. execute window program, press button CB308SIM Window tool bar.
Figure Execution example custom window program "dump1000.p" this example, will that bytes beginning with address 1000H displayed dump form. When area hidden some other window need displayed, custom window program calls OnDraw function; when debugger status need updated such when target memory contents have been changed, calls OnEvent function. Therefore, dump1000 custom window program display automatically updated when hidden part displayed target memory contents changed.
Setup dialog provided setting project. This dialog opened choosing [Option]-[Set up.] from CB308SIM Window menu double-clicking project file name displayed Project Window.
Project setup area Library setup area
4.3.Using Setup Dialog
Source file setup area
Include file library file search path setup area
Figure Structure Setup dialog 4.3.1.Project Setup Area This area comprised following three fields:
Project type setup/display field Target file name setup/display field
Runtime parameter setup/display field
Figure Structure project setup field
4.3.1.1.Project Type Setup/Display Field following project types here. Custom Command Create custom command program. Custom Window Create custom window program project type have displayed this field startup routines libraries that will combined during building selected depending project type choose program created. change project type only affects selection startup routines libraries that will combined during building. 4.3.1.2.Target File Name Setup/Display Field program file name here that want created when building. file name have displayed this field. 4.3.1.3.Runtime Parameter Setup/Display Field This field appears when specified "Custom Command" project type. parameters this field that want passed when debugging custom command program. parameters here passed arguments argc argv main() function following manner: argc Number parameters argv Pointer array address that contains pointers areas where character strings specified parameters stored parameters have displayed this field. 4.3.2.Source File Setup Area This area comprised following five fields:
File name setup/display field 3.Refer button
file display/delete file select field 4.Add button 5.Delete button
Figure Structure source file setup area
4.3.2.1.File Name Setup/Display Field source file name this field that want added project. source file here added project press "Add" button source file name displayed file display/delete file select field. source file names added project listed press "Add" button. 4.3.2.2.Add File Display/Delete File Select Field source file names added project listed this field. unnecessary source file deleted from project selecting file name this field clicking with mouse pressing "Delete" button. 4.3.2.3.Refer Button source file names added project listed this field. unnecessary source file deleted from project selecting file name this field clicking with mouse pressing "Delete" button. 4.3.2.4.Add Button This button adds source file that entered file name setup/display field project. When source file, CB308SIM checks file exists. specified source file does exist already been added project, file added. 4.3.2.5.Delete Button This button deletes source file from project that have selected clicking with mouse file display/delete file select field. file deleted unless there source file selected. 4.3.3.Include File Library File Search Path Setup Area This area comprised following four fields:
1.Include file search path setup/display field Default include path setup button
Library file search path setup/display field
Default library path setup button
Figure Structure include file library file search path setup area
4.3.3.1.Include File Search Path Setup/Display Field directory this field that want searched file when inclusion file specified #include <filename> source file. Normally, specify directory where system include files stored. system include files installed include directory that located below directory where CB308SIM installed. include file search path have displayed this field. 4.3.3.2.Default Include Path Setup Button This button sets directory that include file search path setup/display field default path used CB308SIM when creating project. When create project with CB308SIM after setting default path with this button, directory have used include file search path. 4.3.3.3.Library File Search Path Setup/Display Field directory this field that want searched library file linked when building project. Normally, specify directory where system library files stored. system library files installed directory that located below directory where CB308SIM installed. library file search path have displayed this field. 4.3.3.4.Default Library Path Setup Button This button sets directory that library file search path setup/display field default path used CB308SIM when creating project. When create project with CB308SIM after setting default path with this button, directory have used library file search path. 4.3.4.Library Setup Area This area comprised following five fields:
Library name setup/display field Refer button
library display/delete library select field 4.Add button 5.Delete button
Figure Structure library setup area
4.3.4.1.Library Name Setup/Display Field this field, library file name that added project system library that want linked when building project. library file here added project press "Add" button library file name displayed library display/delete library select field. library file names added project listed press "Add" button. 4.3.4.2.Add Library Display/Delete Library Select Field library file names added project listed this field. unnecessary library file deleted from project selecting file name this field clicking with mouse pressing "Delete" button. 4.3.4.3.Refer Button This button allows library file project without having input file name from keyboard. When press "Refer" button, file selection dialog opens. library file name choose this dialog input library name setup/display field. proceed press "Add" button project. 4.3.4.4.Add Button This button adds library file that entered library name setup/display field project. When library file, CB308SIM checks file exists. specified library file does exist already been added project (including system libraries), file added. 4.3.4.5.Delete Button This button deletes library file from project that have selected clicking with mouse library display/delete library select field. file deleted unless there library file selected.
5.Programming Language Specifications
programming language which programs written CB308SIM subset language, subject following restrictions compared general language. Types struct, union, enum nonexistent. Variables that involve initialization cannot declared. Example: static storage class nonexistent. storage class specifier that used extern only. types that used char, int, pointer, array only. Example: char 1Byte 4Byte char *str; 4Byte 4Byte Types char signed types signed unsigned specifiers cannot used). Parameter lists cannot written prototype declaration functions. Example: foo(int); Error foo2(char *str); Error Arguments function definitions written manner similar ANSI standards. Example: func( Although parameter types checked when calling function, type function's return value checked. Variables cannot declared intra-function local block. Example: func() Error preprocessor cannot expand macros accompanied parameters. define expressions. Example: #define FUNC(A) Error #define label Error preprocessor pseudo-instruction allows only specified operand.
6.Reference
stdlib.lib provides standard functions that used custom command custom window programs. prototype declaration each function written stdlib.h. Function name Description malloc Allocate memory from heap area. free Release area allocated malloc. strlen length character string. strcat Concatenate character strings. strcmp Compare character strings. strcpy Copy character string. strtoi Convert character string into value. gets Input character string (from Script Window). exit Terminate program execution. fopen Open file. fclose Close file. fseek Move file pointer. fgetc Input character (from file). fputc Output character file). fgets Input character string (from file). fputs Output character string file). printf Output characters with format Script Window). sprintf Output characters with format memory). fprintf Output characters with format file). 6.1.1.malloc: Allocate memory from heap area Function name: char *malloc(int size) Parameter: size Number allocated bytes Returned value: char Allocated area NULL Error Description: This function allocates area size bytes from heap area returns beginning address area. returns NULL there area that allocated. 6.1.2.free: Release area allocated malloc() function Function name: free(char Parameter: char Area released Returned value: Succeeded Error Description: This function releases area allocated malloc() function.
6.1.Standard Functions (stdlib.lib)
6.1.3.strlen: length character string Function name: strlen(char Parameter: char Character string Returned value: Character string length character string Description: This function returns length 6.1.4.strcat: Concatenate character strings Function name: char *strcat(char *s1, char *s2) Parameter: char Character string which added char Character string added Returned value: char Character string which added Description: This function concatenates character string returns 6.1.5.strcmp: Compare character strings Function name: strcmp(char *s1, char *s2) Parameter: char Character string char Character string Returned value: Positive number Negative number Description: This function compares character string character string returns positive number negative number 6.1.6.strcpy: Copy character string Function name: char *strcpy(char *s1, char *s2) Parameter: char Destination char Source Returned value: char Destination Description: This function copies character string including returns
6.1.7.strtoi: Convert character string into value Function name: strtoi(char *str, radix, *value) Parameter: char *str Character string radix Conversion radix *value Converted value Returned value: TURE Succeeded FALSE Error Description: This function converts character string specified into numeric value value whose radix specified radix conversion succeeded, converted value stored *value. values listed below specified radix Value radix Description begins with converted hexadecimal value; begins with converted octal value. Otherwise, converted decimal value. converted octal value. converted decimal value. converted hexadecimal value. 6.1.8.gets: Input character string (from Script Window) Function name: char *gets(char Parameter: char Destination which stored Returned value: char Destination which stored NULL Error Description: This function reads line from input area Script Window stores new-line character line replaced with return value stored NULL returned error occurred. 6.1.9.exit: Terminate program execution Function name: exit(int stat) Parameter: stat Program's return value Returned value: Always Description: This function terminates program execution returns control PD308SIM. stat operation assumed have been processed normally. stat error assumed error message bearing number that macro_err displayed Script Window.
6.1.10.fopen: Open file Function name: Parameter: char Returned value: NULL Description:
fopen(char *filename, char *attr) char *filename File name *attr Open mode File descpritor Error This function opens file specified filename mode specified attr. succeeded, return value file descpriptor. fclose(int File descriptor TRUE Succeeded Error This function closes file specified
6.1.11.fclose: Close file Function name: Parameter: Returned value: FALSE Description:
6.1.12.fseek: Move file pointer Function name: fseek(int pos, org) Parameter: File descriptor Distance file pointer moved Base point Returned value: TRUE Succeeded FALSE Error Description: This function moves current position file specified which file written read. distance movement specified offset from base point Beginning file; Current position; file). 6.1.13.fgetc: Input character (from file) Function name: fgetc(int Parameter: File descriptor Returned value: read value FALSE Error Description: This function reads byte from file pointer's current position file specified 6.1.14.fputc: Output character file) Function name: fputc(char Parameter: char Output character File descriptor Returned value: TURE Succeeded FALSE Error Description: This function outputs byte specified file pointer's current position file specified
6.1.15.fgets: Input character string (from file) Function name: fgets (char *str, Parameter: char *str Area which store input character string Maximum number characters input File descriptor Returned value: char Area which store input character string NULL Error Description: This function reads line from file pointer's current position file specified stores area specified str. 6.1.16.fputs: Output character string file) Function name: fputs (char *str, Parameter: char *str Area which store output character string File descriptor Returned value: TURE Succeeded FALSE Error Description: This function outputs character string stored area specified file pointer's current position file specified 6.1.17.printf: Output characters with format Script Window) Function name: printf(char *format, Parameter: char *format Format Variable parameter Returned value: Positive number Number characters output Negative numberError Description: This function outputs characters Script Window after converting them under control format return value indicates number characters written window. negative number returned error occurred. 6.1.18.sprintf: Output characters with format memory) Function name: sprintf(char char *format, Parameter: char Output address char *format Format Variable parameter Returned value: Positive number Number characters output Negative numberError Description: This function outputs characters address specified after converting them under control format added output. return value indicates number characters written memory (not including negative number returned error occurred.
6.1.19.fprintf: Output characters with format file) Function name: fprintf(int char *format, Parameter: File descriptor char *format Format Variable parameter Returned value: Positive number Number characters output Negative numberError Description: This function outputs characters file specified after converting them under control format return value indicates number characters written file. negative number returned error occurred.
system.lib provides system call functions that used custom command custom window programs. prototype declaration each function written system.h. Function name Description _cpu_go Execute program free-run mode _cpu_gb Execute program with break _cpu_stop Stop program execution _cpu_reset Reset target _cpu_src_step Execute program source line time _cpu_step Execute program instruction time _cpu_src_over Execute program source line time including subroutines _cpu_over Execute program instruction time including subroutines _cpu_src_return Return from current calling routine source line time _cpu_return Return from current calling routine instruction time _cpu_wait Wait until program execution stops _reg_get_reg register value _reg_put_reg register value _reg_get_pc program counter value _reg_put_pc program counter value _reg_clear_cache Clear register cache _mem_get memory value _mem_put memory value _mem_get_endian memory value with endian attached _mem_put_endian memory value with endian attached _mem_fill Fill memory _mem_move Transfer memory block _mem_clear_cache Clear memory cache _break_set Set/enable software break _break_get settings software breaks _break_reset Clear software break _break_reset_all Clear software breaks _break_disable Disable software break _break_disable_all Disable software breaks _break_enable_all Enable software breaks _break_search attribute software break settings _rram_clear Clear monitor memory _rram_get_area monitor area _rram_set_area monitor area _rram_get_size size monitor area _rram_get_data monitor data _info_check_run Check execution status _info_service information service contents
6.2.System Call Functions Debugger Operation (system.lib)
Function name _info_cpu _info_get_map _info_check_map _info_get_suffix _info_set_suffix _scope_set_obj _scope_set_addr _sym_add_sym _sym_val2sym _sym_sym2val _sym_add_bit _sym_val2bit _sym_bit2val _line_addr2line _line_line2addr _src_get_name _obj_get_name _obj_addr2obj _func_get_name _exp_eval _scri_echo_on _scri_echo_off _c_exp_eval _get_shared_mem _set_shared_mem _delete_shared_mem _get_err_msg _get_tick_count _get_time _disp_src_line _rtt_get_range _rtt_get_disasm _rtt_get_bus _rtt_check_isfetch _rtt_get_data _rtt_clear_cache _cv_get_data _cv_set_data _cv_clear_data _cv_clear_cache _syscom _doscom
Description information information Check mapped area load file extension load file extension scope object file name scope address Enter symbols symbol value value symbol Enter symbols symbol address number address number symbol source line address address source line list source file names list object file names object file name address list function names Evaluate assembler expression Turn output script window Turn output script window Evaluate C-language expression shared variable shared variable Delete shared variable PD308SIM's error message statement elapsed time since Windows startup current system date time Change contents displayed program window data range disassembled analysis result data bus-mode display character string data Check fetch cycle data data Clear real-time trace (RTT) cache coverage data coverage data Clear coverage data Clear coverage cache Execute PD308SIM's script command Execute command
error occurs, error number written "Error" item global variable macro_err. details about Simulator errors, refer Section 6.2.71, "Simulator Error List". custom command programs, FALSE returned from main() function, error message corresponding error number that macro_err displayed Script Window (for PD308SIM) Error dialog (for CB308SIM). 6.2.1._cpu_go: Execute program free-run mode Function name: _cpu_go() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function starts executing target program from current free-run mode. Error: Simulator error 6.2.2._cpu_gb: Execute program with break Function name: _cpu_gb() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function starts executing target program from current with breaks included. Error: Simulator error 6.2.3._cpu_stop: Stop program execution Function name: _cpu_stop() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function stops execution target program. Error: Simulator error
6.2.4._cpu_reset: Reset target Function name: _cpu_reset() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function reset target CPU. Error: ER_IN1_RUNNING Cannot reset because executing program. Other Simulator error 6.2.5._cpu_src_step: Execute program source line time Function name: _cpu_src_step() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function starts executing target program, source line time, beginning with current Error: Simulator error 6.2.6._cpu_step: Execute program instruction time Function name: _cpu_step() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function starts executing target program, instruction time, beginning with current Error: Simulator error 6.2.7._cpu_src_over: Execute program source line time including subroutines Function name: _cpu_src_over() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function starts executing target program, source line time including subroutines, beginning with current Error: Simulator error
6.2.8._cpu_over: Execute program instruction time including subroutines Function name: _cpu_over() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function starts executing target program, instuction time including subroutines, beginning with current Error: Simulator error 6.2.9._cpu_src_return: Return from current calling routine source line time Function name: _cpu_src_return() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function causes program execution return from current calling routine, source line time. Error: Simulator error 6.2.10._cpu_return: Return from current calling routine instruction time Function name: _cpu_return() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function causes program execution return from current calling routine, instruction time. Error: Simulator error 6.2.11._cpu_wait: Wait until program execution stops Function name: _cpu_wait() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function stops execution custom command custom window program until target program stops. Error: Simulator error
6.2.12._reg_get_reg: register value Function name: _reg_get_reg(int *reg, regno) Parameter: *reg Register value regno Register number Returned value: TRUE Succeeded FALSE Error Description: This function gets value register specified regno. CB308SIM, regno defined follows: regno Register IN1_REG_0_Rx Front register IN1_REG_0_Ax Front register IN1_REG_0_FB Front register IN1_REG_0_SB Front register IN1_REG_1_Rx Back register IN1_REG_1_Ax Back register IN1_REG_1_FB Back register IN1_REG_1_SB Back register IN1_REG_USP register IN1_REG_ISP register IN1_REG_FLG register IN1_REG_PC Program counter IN1_REG_INTB INTB register IN1_REG_SVF register IN1_REG_SVP register IN1_REG_VCT register IN1_REG_DMDx register IN1_REG_DCTx register IN1_REG_DRCx register IN1_REG_DMAx register IN1_REG_DSAx register IN1_REG_DRAx register Error: Simulator error 6.2.13._reg_put_reg: register value Function name: _reg_put_reg(int reg, regno) Parameter: Register value Returned value: TRUE Succeeded FALSE Error Description: This function sets value register specified regno. definition regno here same _reg_get_reg() function. Error: ER_IN1_DATA_OUTRANGE Data range invalid. Other Simulator error 6.2.14._reg_get_pc: program counter value Function name: _reg_get_pc(int *pc) Parameter: Program counter value Returned value: TRUE Succeeded FALSE Error
Description: Error:
This function gets program counter value. Simulator error
6.2.15._reg_put_pc: program counter value Function name: _reg_put_pc(int Parameter: Program counter value Returned value: TRUE Succeeded FALSE Error Description: This function sets program counter value. Error: ER_IN1_ADDR_OUTRANGE Address range invalid Other Simulator error 6.2.16._reg_clear_cache: Clear register cache Function name: _reg_clear_cache() Parameter: None Returned value: TRUE Return value always TRUE. Description: This function clears register cache. 6.2.17._mem_get: memory value Function name: _mem_get(int addr, size, char *data) Parameter: addr Address size Number bytes obtained char *data Location where obtained data stored Returned value: TRUE Succeeded FALSE Error Description: This function stores size bytes data from addr into data Error: ER_IN1_ADDR_OUTRANGE Address range invalid. Other Simulator error 6.2.18._mem_put: memory value Function name: _mem_put(int addr, size, char *data) Parameter: addr Address size Number bytes char *data data Returned value: TRUE Succeeded FALSE Error Description: This function sets data data from addr into size bytes memory. Error: ER_IN1_ADDR_OUTRANGE Address range invalid. Other Simulator error
6.2.19._mem_get_endian: memory value with endian attached Function name: _mem_get_endian(int addr, num, size, *data) Parameter: addr Address Number data entries size Size data entry *data Location where obtained data stored Returned value: TRUE Succeeded FALSE Error Description: This function stores entries data data size size bytes from addr into data[] according endian. Numerals specified size Error: ER_IN1_ADDR_OUTRANGE Address range invalid. ER_IN1_DATA_RANGE size Other Simulator error 6.2.20._mem_put_endian: memory value with endian attached Function name: _mem_put_endian(int addr, num, size, *data) Parameter: addr Address Number data entries size Size data entry *data data Returned value: TRUE Succeeded FALSE Error Description: This function sets entries data data size size bytes from data[] into memory locations beginning with addr according endian Error: ER_IN1_ADDR_OUTRANGE Address range invalid. ER_IN1_DATA_RANGE size Other Simulator error
6.2.21._mem_fill: Fill memory Function name: _mem_fill(int start, end, data, size) Parameter: start Start address address data Filled data size Size data entry Returned value: TRUE Succeeded FALSE Error Description: This function fills memory area from start with data data data size size bytes. Error: ER_IN1_ADDR_OUTRANGE Address range invalid. ER_IN1_DATA_RANGE size Other Simulator error 6.2.22._mem_move: Transfer memory block Function name: _mem_move(int start, end, top) Parameter: start Start address address Beginning address destination transfer Returned value: TRUE Succeeded FALSE Error Description: This function transfers data addresses from start area beginning with top. Error: ER_IN1_ADDR_OUTRANGE Address range invalid. Other Simulator error 6.2.23._mem_clear_cache: Clear memory cache Function name: _mem_clear_cache() Parameter: None Returned value: TRUE Return value always TRUE. Description: This function clears cache buffer module that gets cached memory.
6.2.24._break_set: Set/enable software break Function name: _break_set(int addr) Parameter: addr address Returned value: TRUE Succeeded FALSE Error Description: This function sets software breakpoint addr This function also used re-enable breakpoint that been disabled _break_disable() _break_disable_all() Error: ER_IN1_ADDR_OUTRANGE Address range invalid. ER_IN1_BP_FULL Breakpoints full. Other Simulator error 6.2.25._break_get: settings software breaks Function name: _break_get(int *addr, *attr, mode) Parameter: *addr Address *attr Setup attribute mode Search start mode IN1_FIRST First breakpoint IN1_NEXT Second following breakpoints Returned value: TRUE Succeeded FALSE Error Description: This function stores breakpoint address *addr. breakpoint setup attributes shown below stored *attr. IN1_ENABLE_SBRK Enabled IN1_DISABLE_SBRK Disabled Error: ER_IN1_BP_NOTFOUND breakpoint found. Other Simulator error 6.2.26._break_reset: Clear software break Function name: _break_reset(int addr) Parameter: addr Address Returned value: TRUE Succeeded FALSE Error Description: This function clears breakpoint addr. Error: ER_IN1_ADDR_OUTRANGE Address range invalid. ER_IN1_BP_NOTFOUND breakpoint found. Other Simulator error
6.2.27._break_reset_all: Clear software breaks Function name: _break_reset_all() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function clears breakpoints. Error: Other Simulator error 6.2.28._break_disable: Disable software break Function name: _break_disable(int addr) Parameter: addr Address Returned value: TRUE Succeeded FALSE Error Description: This function disables breakpoint addr. Error: ER_IN1_ADDR_OUTRANGE Address range invalid. ER_IN1_BP_NOTFOUND breakpoint found. Other Simulator error 6.2.29._break_disable_all: Disable software breaks Function name: _break_disable_all() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function disables breakpoints set. Error: Other Simulator error 6.2.30._break_enable_all: Enable software breaks Function name: _break_enable_all() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function enables breakpoints set. Error: Other Simulator error
6.2.31._break_search: attribute software break settings Function name: _break_search(int addr, *attr) Parameter: addr Address *attr Setup attribute Returned value: TRUE Succeeded FALSE Error Description: This function gets setup attribute breakpoint addr. following breakpoint setup attributes stored *attr. IN1_ENABLE_SBRK Enabled IN1_DISABLE_SBRK Disabled Error: ER_IN1_BP_NOTFOUND breakpoint found. Other Simulator error 6.2.32._rram_clear: Clear monitor memory Function name: _rram_clear() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function initializes access states monitor memory. Error: ER_IN1_RUNNING Cannot cleard because program executing. Other Simulator error 6.2.33._rram_get_area: monitor area Function name: _rram_get_area(int *addr) Parameter: *addr Beginning address Returned value: TRUE Succeeded FALSE Error Description: This function stores beginning address monitor memory *addr. Error: Simulator error 6.2.34._rram_set_area: monitor area Function name: _rram_set_area(int addr) Parameter: addr Beginning address Returned value: TRUE Succeeded FALSE Error Description: This function sets beginning address monitor area addr. Error: ER_IN1_ADDR_OUTRANGE Address range invalid. Other Simulator error
6.2.35._rram_get_size: size monitor area Function name: _rram_get_size(int *size) Parameter: *size size monitor area Returned value: TRUE Return value always TRUE. Description: This function sets size monitor area *size. 6.2.36._rram_get_data: monitor data Function name: _rram_get_data(int addr, size, char *data, char *attr) Parameter: addr Beginning address size Number bytes char *data Data char *attr Access state Returned value: TRUE Succeeded FALSE Error Description: This function gets size bytes data (*data) beginning with addr access state (*attr) from monitor. access states shown below stored *attr. IN1_RRAM_READ Read IN1_RRAM_WRITE Write IN1_RRAM_NONE access Error: ER_IN1_ADDR_OUTRANGE Address range invalid. Other Simulator error 6.2.37._info_check_run: Check execution status Function name: _info_check_run(int *status) Parameter: *status Execution state Returned value: TRUE Succeeded FALSE Error Description: This function stores execution state target program *status. following execution status stored *status. IN1_RUN_CPU Under execution IN1_STOP_CPU Idle Error: Simulator error
6.2.38._info_service: information service contents Function name: _info_service(int flag, *status) Parameter: flag Service content *status Availability support TRUE Supported FALSE supported Returned value: TRUE Return value always TRUE. Description: This function gets information service contents supported PD308SIM. flag, specify following service contents. IN1_SUPPORT_BITSYM Support symbol IN1_SUPPORT_C Support C-language debugging IN1_SUPPORT_RAMMONITOR Support real-time monitor function IN1_SUPPORT_RTT Support real-time trace IN1_SUPPORT_CV Support coverage measurement IN1_SUPPORT_PROTCT Support protected break IN1_SUPPORT_EVENT Support hardware event 6.2.39._info_cpu: information Function name: _info_cpu(int flag, *status) Parameter: flag Content information *status information IN1_BIG_ENDIAN endian IN1_LITTLE_ENDIAN Little endian Other Value corresponding flag Returned value: TRUE Return value always TRUE. Description: This function gets information target CPU. flag specify following information. IN1_ADDRSIZE Number bytes required storing address value IN1_MAXADDR Maximum value address IN1_ADDRCOLM Number digits with which address values displayed hexadecimal IN1_ENDIAN Endian target IN1_HWORD_SIZE Length bytes half-word IN1_WORD_SIZE Length bytes word IN1_DWORD_SIZE Length bytes double-word IN1_LWORD_SIZE Length bytes long-word IN1_MAXDATA Maximum value data IN1_MAXSTACK Maximum value stack IN1_MAX_OBJ Maximum length bytes instruction
6.2.40._info_get_map: information Function name: _info_get_map(int *start, *end, mode) Parameter: *start Start address *end address mode Search start mode IN1_FIRST First IN1_NEXT Second following maps Returned value: TRUE Succeeded FALSE Error Description: This function gets information. start addresses mapped area stored *start *end, respectively. Error: IN1_MAP_END more 6.2.41._info_check_map: Check mapped area Function name: _info_check_map(int start, end, *status, *erradr) Parameter: start Start address address *status Check result *erraddr Error address Returned value: TRUE Succeeded FALSE Error Description: This function checks address range from start mapped area. address range from start entirely mapped area, TRUE stored *status. address range from start contains unmapped area, FALSE stored *status address first unmapped area found searching from start stored erraddr. Error: ER_IN1_ADDR_OUTRANGE Address range invalid. Other Simulator error 6.2.42._info_get_suffix: load file extension Function name: _info_get_suffix(char *suffix, mode) Parameter: char *suffix Obtained extension mode Mode Returned value: TRUE Return value always TRUE. Description: This function gets file suffix that added file selection dialog when downloading target program mode specified mode mode, specify following attributes. IN1_LOAD Symbol program files IN1_SYM Symbol file IN1_ROM Program file
6.2.43._info_set_suffix: load file extension Function name: _info_set_suffix(char *suffix, mode) Parameter: char *suffix Extension mode Mode Returned value: TRUE Return value always TRUE. Description: This function sets file suffix that added file selection dialog when downloading target program mode specified mode mode specify following attributes. IN1_LOAD Symbol program files IN1_SYM Symbol file IN1_ROM Program file 6.2.44._scope_set_obj: scope object file name Function name: _scope_set_obj(char *name) Parameter: char *name Object file name Returned value: TRUE Succeeded FALSE Error Description: This function sets current scope object file name. Error: ER_SCOPE_NOTFOUND scope found that corresponds specified object file name. 6.2.45._scope_set_addr: scope address Function name: _scope_set_addr(int addr) Parameter: addr Address Returned value: TRUE Succeeded FALSE Error Description: This function sets current scope address. Error: ER_IN1_ADDR_OUTRANGE Address range invalid.
6.2.46._sym_add_sym: Enter symbols Function name: _sym_add_sym(int mode, char *name, value) Parameter: mode Search mode char *name Symbol value Value Returned value: TRUE Succeeded FALSE Error Description: This function enters symbol label) name global symbol label). mode specify following types. LOAD_SYMBOL Symbol first LOAD_LABEL Label first Error: ER_LOAD_ILLEGAL_CHAR Character string contains character that cannot used symbol label. ER_LOAD_MULTIDEFINE global symbol label) same name already exists. 6.2.47._sym_val2sym: symbol value Function name: _sym_val2sym(int mode, value, char *symbol) Parameter: mode Search mode value Value char *symbol Area which symbol stored Returned value: TRUE Succeeded FALSE Corresponding symbol could found. Description: This function searches symbol character string that corresponds value value stores symbol mode specify priorities search shown below. LOAD_SYMBOL Symbol first LOAD_LABEL Label first table below shows priorities search each mode. Searched symbol first Searched label first Local symbol Local label (within scope) (within scope) Global symbol Global label Local label Local symbol (within scope) (within scope) Global label Global symbol Local symbol Local label (outside scope) (outside scope) Local label Local symbol (outside scope) (outside scope)
6.2.48._sym_sym2val: value symbol Function name: _sym_sym2val(int mode, char *symbol, *value) Parameter: mode Search mode char *symbol Symbol *value Value Returned value: TRUE Succeeded FALSE Symbol could found. Description: This function searches value that corresponds symbol character string symbol stores *value specified mode here same _sym_val2sym(). Error: ER_LOAD_SYMBOL_NOTFOUND Symbol cannot found. 6.2.49._sym_add_bit: Enter symbols _sym_add_bit: Function name: _sym_add_bit(char *bitsym, addr, bit) Parameter: char *bitsym Symbol addr Address number Returned value: TRUE Succeeded FALSE Error Description: This function enters symbol bitsym global symbol. Error: ER_LOAD_ILLEGAL_CHAR Character string contains character that cannot used symbol. ER_LOAD_MULTIDEFINE global symbol same name already exists. ER_LOAD_ADDR_OUTRANGE Address range invalid. ER_LOAD_BIT_OUTRANGE number range invalid. 6.2.50._sym_val2bit: symbol address number _sym_val2bit: Function name: _sym_val2bit(int addr, bit, char *bitsym) Parameter: addr Address number char *bitsym Area which symbol stored Returned value: TRUE Succeeded FALSE Corresponding symbol could found. Description: This function searches symbol character string that corresponds address stores *bitsym
6.2.51._sym_bit2val: address number symbol _sym_bit2val: Function name: _sym_sym2val(char *bitsym, *addr, *bit) Parameter: char *bitsym symbol *addr Address *bit number Returned value: TRUE Succeeded FALSE symbol could found. Description: This function searches address number that corresponds symbol character string bitsym stores *addr *bit Error: ER_LOAD_SYMBOL_NOTFOUND symbol cannot found. 6.2.52._line_addr2line: source line address Function name: _sym_addr2line(int addr, *line, char *filename) Parameter: addr Address *line Line number char *filename Area where file name stored Returned value: TRUE Succeeded FALSE Source line information cannot found. Description: This function gets line number (*line) that corresponds address addr file name (filename). Error: ER_LOAD_FILE_NOTFOUND File cannot found. ER_LOAD_SRCINF_NOTFOUND Source information cannot found. 6.2.53._line_line2addr: address source line Function name: _sym_line2addr(char *filename, line, *addr) Parameter: char *filename File name line Line number *addr Address Returned value: TRUE Succeeded FALSE Source line information cannot found. Description: This function gets address (*addr) that corresponds line (line) file (filename). Error: ER_LOAD_LINE_NOTFOUND Line information cannot found.
6.2.54._src_get_name: list source file names Function name: _src_get_name(char *objname, char *srcname, mode) Parameter: char *objname Object file name char *srcname Area where source file name stored mode Search start mode LOAD_FIRST First source file name LOAD_NEXT Second following source file names Returned value: TRUE Succeeded FALSE Source file name cannot found. Description: This function gets list source file names object file objname NULL specified object, list source file names object files obtained. 6.2.55._obj_get_name: list object file names Function name: _obj_get_name(char *objname, mode) Parameter: char *objname Area where object file name stored mode Search start mode LOAD_FIRST First source file name LOAD_NEXT Second following source file names Returned value: TRUE Succeeded FALSE Object file name cannot found. Description: This function gets list object file names. 6.2.56._obj_addr2obj: object file name address Function name: _obj_addr2obj(int addr, char *objname) Parameter: addr Address char *objname Area where object file name stored Returned value: TRUE Succeeded FALSE Corresponding object file name cannot found. Description: This function gets object file name objname that contains address addr.
6.2.57._func_get_name: list function names Function name: _func_get_name(char *objname, char *funcname, mode) Parameter: char *objname Object file name char *funcname Area where function name stored mode Search start mode LOAD_FIRST First function name LOAD_NEXT Second following function names Returned value: TRUE Succeeded FALSE Function name cannot found. Description: This function gets list function names object file objname NULL specified objname, FALSE returned.
6.2.58._exp_eval: Evaluate assembler expression Function name: _exp_eval(char *exp, radix, mode, *value) Parameter: char *exp Assembler expression radix Radix mode Priorities which symbols (labels) evaluated *value Area where analysis result stored Returned value: TRUE Succeeded FALSE Error Description: This function evaluates assembler expression (exp) stores evaluation result *value. radix, specify radices constants shown below. EXP_DEC Decimal EXP_HEX Hexadecimal EXP_DEFAULT Value RADIX command used mode specify priorities symbol (label) evaluation shown below. EXP_SYMBOL Symbol first EXP_LABEL Label first Error: ER_EXP_SYNTAX Syntax error ER_EXP_ZERO Divide-by-0 error ER_EXP_LPAR Left parenthesis missing ER_EXP_SIZE Incorrect size specifier ER_EXP_STRING Character string terminated ER_EXP_LINE Incorrect line number specified ER_EXP_VALUE Incorrect constant value specified ER_EXP_UNDEF_SYMBOL Symbol defined ER_EXP_PREFIX Incorrect radix constant specified ER_EXP_OVER Constant value range ER_EXP_UNDEF_MACRO Macro constant defined ER_EXP_ILLEGAL_MACRO Register name used macro variable name ER_EXP_OUTOF_MACRO Limit number macro constants exceeded
6.2.59._scri_echo_on: Turn output script window Function name: _scri_echo_on() Parameter: None Returned value: TRUE Return value always TRUE. Description: This function turns output Script Window default, Script Window enabled output. 6.2.60._scri_echo_off: Turn output script window Function name: _scri_echo_off() Parameter: None Returned value: TRUE Return value always TRUE. Description: This function turns output Script Window off.
6.2.61._c_exp_eval: Evaluate C-language expression Function name: _c_exp_eval(char *exp, *value1, *value2, char *type, char *str, char *misc) Parameter: char *exp C-language expression *value1 Analysis result *value2 Analysis result char *type Character string showing type analysis result char *str Character string showing analysis result char *misc Character string showing added information analysis result Returned value: TRUE Succeeded FALSE Error Description: This function analyzes C-language expression specified current scope. analysis result 64-bit value, with low-order bits stored *value1 high-order bits stored *value2. type name analysis result stored type analysis result stored after being converted into character string. analysis result that indicates ordinary value such function, addition information stored misc. information stored type str, misc output display using printf() function same possible with script command "print". Error: ER_CEXP_NOT_FOUND Symbol cannot found. ER_CEXP_SYNTAX_ERROR Syntax error. ER_CEXP_NO_SCOPE Scope cannot found. ER_CEXP_NO_SYMBOL Symbol cannot found. ER_CEXP_NO_FUNC Function cannot found. ER_CEXP_RIGHT_WRONG Right-side expression inappropriate. ER_CEXP_DEF_TYPE Copying different type structure (union) inhibited. ER_CEXP_CANT_ASSIGN Cannot substituted. ER_CEXP_NO_TYPE Type cannot found. ER_CEXP_CANT_FLOAT Floating-point operation supported. ER_CEXP_CANT_P_TO_P Specified operation cannot performed between pointer types. ER_CEXP_CANT_SUB_PSpecified operation cannot performed pointer type. ER_CEXP_CANT_P Subtraction pointer variable cannot performed. ER_CEXP_0_DIV Divide-by-0 attempted. ER_CEXP_UNKNOWN_OP Invalid operator used. ER_CEXP_BROKEN_TYPE Type information broken. ER_CEXP_LEFT_POINT Left-side value must pointer variable.
ER_CEXP_LEFT_STRUCT
Left-side value must structure (union) type. ER_CEXP_NO_MEMBER Member cannot found. ER_CEXP_LEFT_STRUCT_REF Left-side value must refarence structure (union) type. ER_CEXP_LEFT_WRONG Left-side value inappropriate. ER_CEXP_VAL_NUM Operand must numeric value. ER_CEXP_CANT_MIN Specified operand cannot signinverted. ER_CEXP_CANT_REF Address value cannot obtained. ER_CEXP_LEFT_ARRAY Array variable inappropriate. ER_CEXP_RIGHT_NUM Element numbers array inappropriate. ER_CEXP_NOT_POINT Operand address. ER_CEXP_CANT_CAST_REG Cast operation variables supported. ER_CEXP_CANT_CAST Specified type cast inappropriate. ER_CEXP_CAST_NOT_SUPPORT Cast operation specified type supported. 6.2.62._get_shared_mem: shared variable Function name: _get_shared_mem(char *name, char *value) Parameter: char *name Name shared variable char *value Value shared variable Returned value: TRUE Succeeded FALSE Shared variable cannot found. Description: This function searches shared variable specified name stores value (character string) value. shared variable means variable that used common custom command custom window programs. name value shared variable character string used similar manner environment variables found several operation systems. name value shared variable used bytes. 6.2.63._set_shared_mem: shared variable Function name: _set_shared_mem(char *name, char *value) Parameter: char *name Name shared variable char *value Value shared variable Returned value: TRUE Return value always TRUE. Description: This function sets shared variable specified name value specified value value shared variable that already been set, previously value changed value specified value. shared variable defined, variable area allocated.
6.2.64._delete_shared_mem: Delete shared variable Function name: _delete_shared_mem(char *name) Parameter: char *name Name shared variable Returned value: TRUE Return value always TRUE. Description: This function deletes shared variable that specified name shared variable defined, nothing performed. 6.2.65._get_err_msg: PD308SIM's error message statement Function name: _get_err_msg(int err_no, char *msg) Parameter: err_no Error number char *msg Error message statement Returned value: TRUE Succeeded FALSE Error Error message statement corresponding error number cannot found. Description: This function gets PD308SIM's error message statement that corresponds error number specified err_no. 6.2.66._get_tick_count: elapsed time since Windows startup get_tick_count: Function name: _get_tick_count() Parameter: None Returned value: Elapsed time since Windows startup Description: This function gets elapsed time since Windows started
6.2.67._get_time: current system date time _get_time: Function name: _get_time(int *year, *month, *dayOfWeek, *day, *hour, *minute, *secont, *milliseconds) Parameter: *year Location where current year stored *month Location where current month (112) stored *dayOfWeek Location where current week (e.g., Sunday stored *day Location where current (1-31) stored *hour Location where current time hours (1-24) stored *minute Location where current time minutes (0-59) stored *second Location where current time seconds (0-59) stored *milliseconds Location where current time milliseconds (0-999) stored Returned value: TRUE Return value always TRUE. Description: This function gets current date time system stores them locations specified each parameter. NULL specified parameter, information corresponding that parameter stored. 6.2.68._disp_src_line: Change contents displayed program window _disp_src_line: Function name: disp_src_line(int lineno, char *filename, addr) Parameter: lineno Line number char *filename File name addr Address Returned value: TRUE Succeeded FALSE Error Description: This function updates contents displayed PD308SIM's program window. selected line selected (specified lineno filename) displayed program window source mode. selected line selected source file cannot displayed, file displayed disassemble mode beginning with address specified addr
6.2.69. _rtt_get_range: data range Function name: _rtt_get_range(int *s_cycle, *e_cycle) Parameter: *s_cycle Start cycle *e_cycle cycle Returned value: TRUE Succeeded FALSE Error Description: This function gets range trace data from start cycles data that referenced. Error: ER_IN2_NONE_RTT Referencible trace data cannot found. Other Simulator error 6.2.70. _rtt_get_disasm: disassembled analysis result data Function name: _rtt_get_disasm(int *cycle, *next_cycle, char *buffer, *count) Parameter: *cycle Analysis start/analysis result cycle *next_cycle Next fetch cycle char *buffer Area where character string representing analysis result stored *count Number instructions fetched Returned value: TRUE Succeeded FALSE Error Description: This function searches fetch cycle beginning with cycle specified *cycle and, when found, stores fetch cycle *cycle disassembles instruction before storing _buffer_. next fetch cycle stored *next_cycle. number instructions fetched found fetch cycle stored *count. more than instruction fetched, these instructions disassembled results stored _buffer_ after separating them with new-line code. Error: ER_IN2_NONE_RTT Referencible trace data cannot found. ER_IN2_CYCLE_OUTRANGE Specified cycle value range. Other Simulator error
6.2.71. _rtt_get_bus: bus-mode display character string data Function name: _rtt_get_bus(int cycle, char *buffer) Parameter: cycle Cycle char *buffer Area where character string stored Returned value: TRUE Succeeded FALSE Error Description: This function converts trace data cycle specified _cycle_ into character string display purpose stores result buffer. Error: ER_IN2_NONE_RTT Referencible trace data cannot found. ER_IN2_CYCLE_OUTRANGE Specified cycle value range. Other Simulator error 6.2.72. _rtt_check_isfetch: Check fetch cycle data Function name: _rtt_check_isfetch(int cycle, *addr1, *addr2, *count) Parameter: cycle Check cycle *addr1 Fetch address *addr2 Fetch address *count Number instructions fetched Return value: TRUE Succeeded FALSE Error Description: This function checks cycle specified _cycle_ fetch cycle. fetch cycle, stored *count. fetch cycle, number instructions fetched stored _*count_ address from which first instruction fetched address from which second instruction fetched stored *addr1 *addr2, respectively. Error: ER_IN2_NONE_RTT Referencible trace data cannot found. ER_IN2_CYCLE_OUTRANGE Specified cycle value range. Other Simulator error
6.2.73. _rtt_get_data: data Function name: _rtt_get_data(int cycle, *addr, *data, *attr, *acsize, *intflag, *intendflag, *ms, *us) Parameter: cycle Cycle *addr Value address *data Value data *attr Access attribute *acsize Access size *intflag Interruption occurrence flag *intendflag Interruption completion flag Hours Minutes Seconds Milliseconds Microseconds Returned value: TRUE Succeeded FALSE Error Description: This function gets data cycle specified cycle. value address that data stored *addr *data, respectively. next access attribute housed *attr. IN2_AC_CODE_READ time cord Read IN2_AC_DATA_READ time data Read IN2_AC_DATA_WRITE time data Write IN2_AC_OTHER Indistinct next access size housed *acsize. IN2_TRACE_SIZE_BYTE Byte access IN2_TRACE_SIZE_WORD Word access TRUE housed time interruption completion with when occursto *intflag, *intendflag each interruption FALSE housed time except time hours, minutes, seconds, milliseconds,and microseconds since program execution started stored *s,*ms, *us, respectively. Error: ER_IN2_NONE_RTT ER_IN2_CYCLE_OUTRANGE Other Referencible trace data cannot found. Specified cycle value range. Simulator error
6.2.74. _rtt_clear_cache: Clear real-time trace (RTT) cache Function name: _rtt_clear_cache() Parameter: None Returned value: TRUE Return value always TRUE. Description: This function clears real-time trace (RTT) cache.
6.2.75. _cv_get_data: coverage data Function name: _cv_get_data(int saddr, eaddr, *rsaddr, *readdr, char *data) Parameter: saddr Start address data obtained eaddr address data obtained *rsaddr Start address data actually obtained *readdr address data actually obtained char *data Coverage data obtained Returned value: TRUE Succeeded FALSE Error Description: This function stores coverage data that includes address range specified s_addr e_addr area specified _data_. However, since data bytes addresses from each 8-byte alignment stored byte _data_, happen that greater range data than addresses specified s_addr e_addr actually stored. example, addresses from specified, data addresses from actually stored. start addresses actually obtained data stored *rs_addr *re_addr, respectively. Note that values stored *rs_addr *re_addr obtained calculation using formula below. *rs_addr s_addr *re_addr e_addr _data_, specify array greater than e_addr s_addr format coverage data stored byte _data_ follows: (Upper row: offset; Lower row: address offset) example, s_addr 0x400, coverage results addresses offset amount corresponding each stored _data[0]_ shown below. (Upper row: offset; Lower row: Address) Consequently, memory accessed every other byte beginning with s_addr, coverage data stored shown below. (Upper row: offset; Lower row: Coverage measurement result) data stored data[0] 01010101B, i.e., 0x55.
Error:
ER_IN2_ADDR_OUTRANGE ER_IN2_RUNNING Other
Specified address range. Cannot obtained because program executing. Simulator error
6.2.76. _cv_set_data: coverage data Function name: _cv_set_data(int s_addr, e_addr, char *data) Parameter: s_addr start address e_addr address char *data coverage data Returned value: TRUE Succeeded FALSE Error Description: This function sets coverage data stored area specified _data_ range addresses specified s_addr e_addr. However, since coverage data stored byte _data_ bytes addresses, specify values s_addr e_addr increments bytes. format _data_ same _cv_get_data() function described above. Error: ER_IN2_ADDR_OUTRANGE Specified address range. ER_IN2_RUNNING Cannot because program executing. Other Simulator error 6.2.77. _cv_get_base: base address coverage range Function name: _cv_get_base(int *base) Parameter: *base Base address obtained Returned value: TRUE Return value always TRUE. Description: This function stores base address coverage range *base. 6.2.78. _cv_set_base: base address coverage range Function name: _cv_set_base(int base) Parameter: base base address Returned value: TRUE Succeeded FALSE Error Description: This function sets base address coverage range specified _base_ after clearing coverage data. base address specified increments range 0x00000 0xfffff. address value greater than 0xc0000 specified, rounded 0xc0000. Error: ER_IN2_RUNNING Cannot because program executing. Other Simulator error
6.2.79. _cv_clear_data: Clear coverage data Function name: _cv_clear_data() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function clears coverage data. Error: ER_IN2_RUNNING Cannot cleared because program executing. Other Simulator error 6.2.80. _cv_clear_cache: Clear coverage cache Function name: _cv_clear_cache() Parameter: None Returned value: TRUE Return value always TRUE. Description: This function clears coverage cache. 6.2.81._syscom: Execute PD308SIM's script command Function name: _syscom(char *command) Parameter: char *command Character string PD308SIM script command Returned value: TRUE Succeeded FALSE Error Description: This function executes character string specified command script command PD308SIM. script command that dumps range addresses from 1000H 1FFFH, example, specify this function follows: _syscom("DumpByte 1000, 1FFF"); 6.2.82._doscom: Execute command Function name: _doscom(char *command) Parameter: char *command Character string command Returned value: TRUE Succeeded FALSE Error Description: This function executes character string specified command command. command that redirects output result file after specifying option command DOS, specify this function follows: _doscom("DIR TMP");
6.2.83.List Simulator Errors table below lists error numbers that stored global variable macro_err when system call function returns FALSE. Error number ER_IN2_MCU_RESET ER_IN2_ERROR_2 ER_IN2_ERROR_3 ER_IN2_ERROR_4 ER_IN2_ERROR_5 ER_IN2_ERROR_6 ER_IN2_ERROR_7 ER_IN2_ARG_ERROR ER_IN2_ERROR_9 ER_IN2_ERROR_A ER_IN2_ERROR_B ER_IN2_ERROR_G ER_IN2_ERROR_H ER_IN2_ERROR_I ER_IN2_ERROR_M ER_IN2_MCU_RUN Description Target reset. Checksum error found received data Specified data does exist. Target program executing. Target program idle. Measurement already been stopped. Measurement already being executed. Argument error. Measurement completed. trace data found specified cycle. Trace data nonexistent. Number points exceeds valid range. break set. source line information loaded. Function range setting. Target execution error.
winlib.lib provides window-operating functions that used custom window programs. prototype declaration each function written winlib.h. Function name _win_printf _win_puts _win_set_cursor _win_set_color _win_set_bkcolor _win_column2dot _draw_text_out _draw_set_color _draw_set_bkcolor _draw_set_bkmode _draw_set_font _draw_get_char_size _draw_line _draw_fill_rect _draw_frame_rect _draw_invert_rect _draw_arc _draw_pie _win_redraw _win_redraw_clear _win_redraw_item _win_show_window _win_set_window_title _win_enable_window _win_button_create _win_button_set_text _win_hscroll_range _win_hscroll_pos _win_vscroll_range _win_vscroll_pos _win_statusbar_create _win_statusbar_set_pane _win_statusbar_set_text _win_dialog _win_message_box _win_filedialog _win_set_window_pos _win_set_window_size _win_timer_set _win_timer_kill Description Output text with format included Output character string custom window cursor position text color background color Convert cursor coordinates into pixel coordinates Output character string custom window text color background color background mode font font size Draw line Fill rectangle Draw rectangle Reverse rectangle color Draw ellipse Draw sector Redraw custom window Redraw custom window Redraw control item Show/hide control item title custom window Enable/disable control item Create button Change button text scroll range horizontal scroll position horizontal scroll scroll range vertical scroll position vertical scroll Create status items status text status Create input dialog Create message Create file selection dialog position custom window size custom window system timer Reset system timer
6.3.System Call Functions Window Operation (winlib.lib)
6.3.1._win_printf: Output text with format included Function name: _win_printf(char *format Parameter: char *forma Format Variable parameter Returned value: Number characters output Description: This function outputs characters cursor position custom window after converting them under control format using text color specified _win_set_color() function background color specified _win_set_bkcolor() function. cursor position immediately following last character that output. cursor position desired place using _win_set_cursor() function. Note that only character font FIXED_SYS used. 6.3.2._win_puts: Output character string custom window Function name: _win_puts(char *str) Parameter: char *str Output character string Returned value: TRUE Return value always TRUE. Description: This function outputs character string specified cursor position customer window using text color specified _win_set_color() function background color specified _win_set_bkcolor() function. cursor position immediately following last character that output. cursor position desired place using _win_set_cursor() function. Note that only character font FIXED_SYS used. 6.3.3._win_set_cursor: cursor position Function name: _win_set_cursor(int Parameter: Specified column cursor Specified column cursor Returned value: TRUE Return value always TRUE. Description: This function moves cursor position specified cursor position defined with origin upper left corner client area custom window, columns increasing from there right columns increasing from there bottom. character output column.
6.3.4._win_set_color: text color _win_set_color: _win_set_color(int color) Parameter: color Text color Returned value: Previous text color Description: This function sets color specified color text. text color specified this function used when character string output using _win_printf() _win_puts() functions. color specify color constants listed below. Color constant Color COLOR_BLACK Black COLOR_BLUE Blue COLOR_GREEN Green COLOR_CYAN blue COLOR_RED COLOR_MAGENDA Purple COLOR_YELLOW Yellow COLOR_WHITE White COLOR_GRAY Gray COLOR_DKBLUE Dark blue COLOR_DKGREEN Dark green COLOR_DKCYAN Dark blue COLOR_DKRED Dark COLOR_DKMAGENDA Dark purple COLOR_DKYELLOW Dark yellow COLOR_LTGRAY Light gray
6.3.5._win_set_bkcolor: background color win_set_bkcolor: Function name: _win_set_bkcolor(int color) Parameter: color Background color text Returned value: Previous background color Description: This function sets color specified color current background. text color specified this function used when character string output using _win_printf() _win_puts() functions. color specify color constants listed below. Color constant Color COLOR_BLACK Black COLOR_BLUE Blue COLOR_GREEN Green COLOR_CYAN blue COLOR_RED COLOR_MAGENDA Purple COLOR_YELLOW Yellow COLOR_WHITE White COLOR_GRAY Gray COLOR_DKBLUE Dark blue COLOR_DKGREEN Dark green COLOR_DKCYAN Dark blue COLOR_DKRED Dark COLOR_DKMAGENDA Dark purple COLOR_DKYELLOW Dark yellow COLOR_LTGRAY Light gray 6.3.6._win_column2dot: Convert cursor coordinates into pixel coordinates Function name: _win_column2dot(int xcol, ycol, *xpix, *ypix) Parameter: xcol column ycol column *xpix pixel coordinate column position *ypix pixel coordinate column position Returned value: TRUE Return value always TRUE. Description: This function converts cursor coordinates specified xcol ycol into pixel coordinates stores them *xpix *ypix.
6.3.7._draw_text_out: Output character string custom window Function name: _draw_text_out(int char *str) Parameter: Logical coordinate start point text Logical coordinate start point text char *str Pointer character string drawn Returned value: TRUE Return value always TRUE. Description: Using currently selected font, this function writes character string specified position using text color specified _draw_set_color() function background color specified _draw_set_bkcolor() function. 6.3.8._draw_set_color: text color Function name: _draw_set_color(int color) Parameter: color Text color Returned value: Previous text color Description: This function sets color specified color text. text color specified this function used when character string output using _draw_text_out() function. color specify color constants listed below. Color constant Color COLOR_BLACK Black COLOR_BLUE Blue COLOR_GREEN Green COLOR_CYAN blue COLOR_RED COLOR_MAGENDA Purple COLOR_YELLOW Yellow COLOR_WHITE White COLOR_GRAY Gray COLOR_DKBLUE Dark blue COLOR_DKGREEN Dark green COLOR_DKCYAN Dark blue COLOR_DKRED Dark COLOR_DKMAGENDA Dark purple COLOR_DKYELLOW Dark yellow COLOR_LTGRAY Light gray
6.3.9._draw_set_bkcolor: background color Function name: _draw_set_bkcolor(int color) Parameter: color Background color text Returned value: Previous background color Description: This function sets color specified color current background. background color specified this function used when character string output using _draw_text_out() function. color specify color constants listed below. Color constant Color COLOR_BLACK Black COLOR_BLUE Blue COLOR_GREEN Green COLOR_CYAN blue COLOR_RED COLOR_MAGENDA Purple COLOR_YELLOW Yellow COLOR_WHITE White COLOR_GRAY Gray COLOR_DKBLUE Dark blue COLOR_DKGREEN Dark green COLOR_DKCYAN Dark blue COLOR_DKRED Dark COLOR_DKMAGENDA Dark purple COLOR_DKYELLOW Dark yellow COLOR_LTGRAY Light gray background mode "Fill" mode, system fills space between style-specified lines, space between brushed hatch lines, background character cells with background color. 6.3.10._draw_set_bkmode: background mode Function name: _draw_set_bkmode(int flag) Parameter: flag mode Returned value: TRUE Return value always TRUE. Description: This function sets background mode. Specify whether want area filled with background color before drawing text. TRUE specified flag, background filled with current background color (default). FALSE specified flag, background changed before drawing text.
6.3.11._draw_set_font: font Function name: _draw_set_font(int size, font) Parameter: size Font size font Font constant Returned value: TRUE Return value always TRUE. Description: This function specifies size style current drawing font. font specify some following font constants combined with Font constant Font style FONT_FIXED_SYS "FixedSys" FONT_MINTYO mincho" FONT_GOTHIC Gothic"" FONT_TIMESNEWROMAN "Times Roman" FONT_CENTURY "Century" FONT_ARIAL "Arial" FONT_BOLD Bold FONT_ITALIC Italic 6.3.12._draw_get_char_size: font size Function name: _draw_get_char_size(int *pWidth, *pHeight) Parameter: *pWidth Location where character width stored *pHeight Location where character height stored Returned value: TRUE Return value always TRUE. Description: This function gets size font character currently being set.
6.3.13._draw_line: Draw line Function name: _draw_line(int color) Parameter: Starting coordinate line Starting coordinate line Ending coordinate line coordinate line color Color line Returned value: TRUE Return value always TRUE. Description: This function draws line with specified color between specified coordinate points. color specify color constants shown below. Color constant Color COLOR_BLACK Black COLOR_BLUE Blue COLOR_GREEN Green COLOR_CYAN blue COLOR_RED COLOR_MAGENDA Purple COLOR_YELLOW Yellow COLOR_WHITE White COLOR_GRAY Gray COLOR_DKBLUE Dark blue COLOR_DKGREEN Dark green COLOR_DKCYAN Dark blue COLOR_DKRED Dark COLOR_DKMAGENDA Dark purple COLOR_DKYELLOW Dark yellow COLOR_LTGRAY Light gray
6.3.14._draw_fill_rect: Fill rectangle Function name: _draw_fill_rect(int color) Parameter: Upper left coordinate rectangle Upper left coordinate rectangle Lower right coordinate rectangle Lower right coordinate rectangle color Color with which fill Returned value: TRUE Return value always TRUE. Description: This function draws rectangle filled with specified color with upper left lower right corners specified coordinates. color specify color constants shown below. Color constant Color COLOR_BLACK Black COLOR_BLUE Blue COLOR_GREEN Green COLOR_CYAN blue COLOR_RED COLOR_MAGENDA Purple COLOR_YELLOW Yellow COLOR_WHITE White COLOR_GRAY Gray COLOR_DKBLUE Dark blue COLOR_DKGREEN Dark green COLOR_DKCYAN Dark blue COLOR_DKRED Dark COLOR_DKMAGENDA Dark purple COLOR_DKYELLOW Dark yellow COLOR_LTGRAY Light gray
6.3.15._draw_frame_rect: Draw rectangle Function name: _draw_frame_rect(int color) Parameter: Upper left coordinate rectangle Upper left coordinate rectangle Lower right coordinate rectangle Lower right coordinate rectangle color Color rectangle Returned value: TRUE Return value always TRUE. Description: This function draws lines form rectangle filled with specified color with upper left lower right corners specified coordinates. color specify color constants shown below. Color constant Color COLOR_BLACK Black COLOR_BLUE Blue COLOR_GREEN Green COLOR_CYAN blue COLOR_RED COLOR_MAGENDA Purple COLOR_YELLOW Yellow COLOR_WHITE White COLOR_GRAY Gray COLOR_DKBLUE Dark blue COLOR_DKGREEN Dark green COLOR_DKCYAN Dark blue COLOR_DKRED Dark COLOR_DKMAGENDA Dark purple COLOR_DKYELLOW Dark yellow COLOR_LTGRAY Light gray 6.3.16._draw_invert_rect: Reverse rectangle color Function name: _draw_invert_rect(int Parameter: Upper left coordinate rectangle Upper left coordinate rectangle Lower right coordinate rectangle Lower right coordinate rectangle Returned value: TRUE Return value always TRUE. Description: This function reverses color rectangle with upper left lower right corners specified coordinates.
6.3.17._draw_arc: Draw ellipse Function name: _draw_arc(int color) Parameter: Upper left coordinate boundary rectangle (logical unit) Upper left coordinate boundary rectangle (logical unit) Lower right coordinate boundary rectangle (logical unit) Lower right coordinate boundary rectangle (logical unit) coordinate starting point draw (logical unit) coordinate starting point draw (logical unit) coordinate ending point draw (logical unit) coordinate ending point draw (logical unit) color Color Returned value: TRUE Succeeded FALSE Error Description: This function draws ellipse. Specify coordinates boundary rectangle (x1, (x2, starting point (x3, ending point (x4, arc. starting ending points need line arc. line that links specified starting point center boundary rectangle calculated starting point calculated from ending point calculated same way. color specify color constants shown below. Color constant Color COLOR_BLACK Black COLOR_BLUE Blue COLOR_GREEN Green COLOR_CYAN blue COLOR_RED COLOR_MAGENDA Purple COLOR_YELLOW Yellow COLOR_WHITE White COLOR_GRAY Gray COLOR_DKBLUE Dark blue COLOR_DKGREEN Dark green COLOR_DKCYAN Dark blue COLOR_DKRED Dark COLOR_DKMAGENDA Dark purple COLOR_DKYELLOW Dark yellow COLOR_LTGRAY Light gray
6.3.18._draw_pie: Draw sector Function name: _draw_pie(int framecolor, paintcolor) Parameter: Upper left coordinate boundary rectangle (logical unit) Upper left coordinate boundary rectangle (logical unit) Lower right coordinate boundary rectangle (logical unit) Lower right coordinate boundary rectangle (logical unit) coordinate starting point draw sector (logical unit) coordinate starting point draw sector (logical unit) coordinate ending point draw sector (logical unit) coordinate ending point draw sector (logical unit) framecolor Color framing line sector paintcolor Color with which fill sector Returned value: TRUE Succeeded FALSE Error Description: This function draws sector. Define circumferential circle sector boundary rectangle ellipse (x1, (x2, y2). framecolor paintcolor, specify following color constants. Color constant Color COLOR_BLACK Black COLOR_BLUE Blue COLOR_GREEN Green COLOR_CYAN blue COLOR_RED COLOR_MAGENDA Purple COLOR_YELLOW Yellow COLOR_WHITE White COLOR_GRAY Gray COLOR_DKBLUE Dark blue COLOR_DKGREEN Dark green COLOR_DKCYAN Dark blue COLOR_DKRED Dark COLOR_DKMAGENDA Dark purple COLOR_DKYELLOW Dark yellow COLOR_LTGRAY Light gray
6.3.19._win_redraw: Redraw custom window _win_redraw: redraw Function name: _win_redraw() Parameter: None Returned value: TRUE Return value always TRUE. Description: This function redraws custom window without erasing display. 6.3.20._win_redraw_clear: Redraw custom window _win_redraw_clear: redraw_clear Function name: _win_redraw_clear() Parameter: None Returned value: TRUE Return value always TRUE. Description: This function redraws custom window after erasing display. 6.3.21._win_redraw_item: Redraw control item _win_redraw_item: redraw_item Function name: _win_redraw_item(int handle) Parameter: handle Handle control item Returned value: TRUE Return value always TRUE. Description: This function redraws control item specified (e.g., button).
handle
6.3.22._win_show_window: Show/hide control item Function name: _win_show_window(int handle, flag) Parameter: handle Handle control item flag TRUE: Displayed FALSE: displayed Returned value: TRUE Return value always TRUE. Description: This function specifies whether display control item specified handle (e.g., button). specified control item displayed when TRUE specified flag displayed when FALSE specified. 6.3.23._win_set_window_title: title custom window Function name: _win_set_window_title(char *title) Parameter: char *title Window title Returned value: TRUE Return value always TRUE. Description: This function sets character string specified title custom window.
title
6.3.24._win_enable_window: Enable/disable control item Function name: _win_enable_window(int handle, flag) Parameter: handle Handle control item flag TRUE: Enabled FALSE: Disabled Returned value: TRUE Return value always TRUE. Description: This function specifies state control item specified handle (e.g., button). specified control item enabled when TRUE specified flag disabled when FALSE specified. When disabled, control item displayed gray.
6.3.25._win_button_create: Create button Function name: _win_button_create(int x1,int y1,int x2,int char *str,int Parameter: Upper left coordinate button Upper left coordinate button Lower right coordinate button Lower right coordinate button char *str Button control text Button control Returned value: Handle button Description: This function creates button area specified that displays text specified surface. control specified sent message handler argument OnCommand() handle function when button clicked. 6.3.26._win_button_set_text: Change button text Function name: _win_button_set_text(int handle. char *text) Parameter: handle Handle button char *text Button control text Returned value: TRUE Succeeded FALSE Error Description: This function changes text displayed button specified handle that specified text. 6.3.27._win_hscroll_range: scroll range horizontal scroll Function name: _win_hscroll_range(int min, max) Parameter: Minimum scroll position horizontal scroll Maximum scroll position horizontal scroll Returned value: TRUE Return value always TRUE. Description: This function specifies minimum maximum scroll positions horizontal scroll custom window. specified both max, horizontal scroll displayed. default, horizontal scroll hidden, with both parameters recommended scroll range 100. 6.3.28._win_hscroll_pos: position horizontal scroll Function name: _win_hscroll_pos(int pos) Parameter: position horizontal scroll Returned value: TRUE Return value always TRUE. Description: This function sets current position horizontal scroll custom window redraws scroll make position horizontal scroll box. position must within scroll range.
6.3.29._win_vscroll_range: scroll range vertical scroll Function name: _win_vscroll_range(int min, max) Parameter: Minimum scroll position vertical scroll Maximum scroll position vertical scroll Returned value: TRUE Return value always TRUE. Description: This function specifies minimum maximum scroll positions vertical scroll custom window. specified both max, vertical scroll displayed. default, vertical scroll hidden, with both parameters recommended scroll range 100. 6.3.30._win_vscroll_pos: position vertical scroll Function name: _win_vscroll_pos(int pos) Parameter: position vertical scroll Returned value: TRUE Return value always TRUE. Description: This function sets current position vertical scroll custom window redraws scroll make position vertical scroll box. position must within scroll range. 6.3.31._win_statusbar_create: Create status Function name: _win_statusbar_create(int cnt) Parameter: Number items status Returned value: TRUE Return value always TRUE. Description: This function creates status bottom custom window. cnt, number items this status bar.
6.3.32._win_statusbar_set_pane: items status Function name: _win_statusbar_set_pane(int index, style, size) Parameter: index Index number status item style Style item size Size item pixels) Returned value: TRUE Return value always TRUE. Description: This function sets style specified style size specified size item created status that specified index style, specify styles shown below. Style Description SBPS_NOBORDERS Does have boundary line round pane. SBPS_POPOUT boundary line displayed inverse video with text raised surface. SBPS_DISABLED Does draw text. SBPS_NORMAL Neither stretched inverted. Does have boundary line either. SBPS_STRETCH Stretches pane fill unused space. Only pane this style allowed status bar. This style combined with some other style using 6.3.33._win_statusbar_set_text: text status Function name: _win_statusbar_set_text(tint index, char *text) Parameter: index Index number status item char *text Text displayed status Returned value: TRUE Return value always TRUE. Description: This function sets text displayed status item. 6.3.34._win_dialog: Create input dialog Function name: _win_dialog(char *str, char *buf) Parameter: char *str Character string message displayed char *buf Location where obtained character string stored Returned value: TRUE button pressed FALSE Cancel button pressed Description: This function opens input dialog gets line character string.
6.3.35._win_message_box: Create message Function name: _win_message_box(char *str, char *title, style) Parameter: char *str Message displayed char *title Title message style Operation content message Returned value: Execution result functions shown below Value Meaning sufficient memory IDABORT [Stop] button selected IDCANCEL [Cancel] button selected IDIGNORE [Ignore] button selected IDNO [No] button selected IDOK [OK] button selected IDRETRY [Retry] button selected IDYES [Yes] button selected Description: This function creates message box. style, specify following styles combined with Style Description MB_ABORTRETRYIGNORE Message contains three pushbuttons: [Stop], [Retry], [Ignore]. MB_APPLMODAL Operation PD308SIM/CB308SIM stopped until message responded (default). MB_DEFBUTTON1 First button default. first button always default unless MB_DEFBUTTON2 MB_DEBUTTON3 specified. MB_DEFBUTTON2 Second button default. MB_DEFBUTTON3 Third button default. MB_ICONEXCLAMATION Exclamation mark icon displayed message box. MB_ICONHAND Same MB_ICONSTOP. MB_ICONINFORMATION Icon with lowercase circle displayed message box. MB_ICONQUESTION Question mark icon displayed message box. MB_ICONSTOP [STOP] icon displayed message box. MB_OK Message contains [OK] pushbutton. MB_OKCANCEL Message contains [OK] [Cancel] pushbuttons. MB_RETRYCANCEL Message contains [Retry] [Cancel] pushbuttons MB_SYSTEMMODAL applications suspended until user responds message box. this message inform serious potentially dangerous errors (e.g., memory shortage) that require immediate corrective action.
Style(continued from Description preceding page) MB_YESNO Message contains pushbuttons: [Yes] [No]. MB_YESNOCANCEL Message contains three pushbuttons: [Yes], [No], [Cancel]. 6.3.36._win_filedialog: Create file selection dialog Function name _win_filedialog(char *title, openFileDialog, char *defExt, char *defFileName, flags, char *filter, char *fileName) Parameter: char *title Title dialog openFileDialog Specification open save char *defExt Default file name extension char *defFileName Default file name flags Flag customize dialog char *filter Specify filter char *fileName Destination where acquired file name store Returned value: TRUE button pressed. FALSE Cancel button pressed. Description: This function creates file selection dialog gets selected file name. title specify title dialog box. openFileDialog, specify TRUE when building dialog "Open file" FALSE when building dialog "Save file after giving name." defExt specify file name extension want automatically added when file name input file name edit without adding extension. extension added specify NULL here. defFileName, specify file name that displayed first file name entering edit box. file name displayed specify NULL here. flags specify styles shown below combining them with Flag OFN_ALLOWMULTISELECT Description This flag specifies that multiple choices selected "File name" list box. (When create dialog using private template, LBS_EXTENDEDSEL value must specified definition "File name" list box.)
Flag OFN_CREATEPROMPT
OFN_FILEMUSTEXIST
OFN_HIDEREADONLY OFN_NOCHANGEDIR OFN_NONETWORKBUTTON OFN_NOREADONLYRETURN
OFN_NOTESTFILECREATE
OFN_OVERWRITEPROMPT
Description This flag specifies that specified file cannot found, user asked confirm whether file need created dialog function. (This flag sets OFN_PATHMUSTEXIST OFN_FILEMUSTEXIST flags automatically.) This flag specifies that user only input existing file name "File name" entry field. invalid file name input "File name" entry field user when this flag set, dialog function displays warning message box. When this flag set, OFN_PATHMUSTEXIST also. This flag turns (hides) [Read-only] check box. This flag directs dialog reset current directory that selected when calling dialog box. This flag turns [Network] button disable from being used. This flag specifies that [Read-only] check returned file checked, that file placed write-protected directory. This flag specifies that file created before closing dialog box. This flag must application saves file network-shared point that "Created corrected." application sets this flag, library does longer check whether file writeprotected, disk capacity available, drive door open, whether network protected. Once file closed while this state, cannot reopened. Therefore, applications that this flag must handle files with caution. selected file already exists, this flag causes dialog "Saving file after giving name" generate message box. user must confirm whether file overwritten.
Flag OFN_PATHMUSTEXIST
OFN_READONLY
Description This flag specifies that user only input valid path. invalid path input "File name" entry field user when this flag set, dialog function displays warning message box. When creating dialog box, this flag ensures that [Read-only] check default checked. also indicates status [Read-only] check when dialog closed.
filter, specify pair character strings specify filters that identify file using format shown below. example below, filters (*.m;*.h) (*.*) specified. "Files(*.m;*.h)|*.m;*.h|All Files(*.*)|*.*||" Once filters specified, file list displays only selected ones, with others gone. selected file name stored FileName. multiple files selected cases when selection multiple files allowed, space character stored delimiter. 6.3.37._win_set_window_pos: position custom window Function name: _win_set_window_pos(int Parameter: left-side position custom window upper-side position custom window Returned value: TRUE Succeeded FALSE Error Description: This function changes position custom window. 6.3.38._win_set_window_size: size custom window Function name: _win_set_window_size(int Parameter: width custom window height custom window Returned value: TRUE Succeeded FALSE Error Description: This function changes size custom window.
6.3.39._win_timer_set: system timer _win_timer_set: Function name: _win_timer_set(int nId, nElapse) Parameter: Timer identifier other than nElapse Ti

Other recent searches


SC2608B - SC2608B   SC2608B Datasheet
QS9000 - QS9000   QS9000 Datasheet
PRBG0256DD-A - PRBG0256DD-A   PRBG0256DD-A Datasheet
PA1856 - PA1856   PA1856 Datasheet
MT352 - MT352   MT352 Datasheet
MT352 - MT352   MT352 Datasheet
GP1N - GP1N   GP1N Datasheet
MT352 - MT352   MT352 Datasheet
GP1Q - GP1Q   GP1Q Datasheet
MT352 - MT352   MT352 Datasheet
GP2Q - GP2Q   GP2Q Datasheet
DS1742 - DS1742   DS1742 Datasheet
CFAH1202A-GGH-JT - CFAH1202A-GGH-JT   CFAH1202A-GGH-JT Datasheet
BC859 - BC859   BC859 Datasheet
1SR154-400 - 1SR154-400   1SR154-400 Datasheet
1SR154-600 - 1SR154-600   1SR154-600 Datasheet
1N4933 - 1N4933   1N4933 Datasheet
1N4937 - 1N4937   1N4937 Datasheet

 

Privacy Policy | Disclaimer
© 2012 Datasheet Archive