⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 comp.lyx

📁 CNC 的开放码,EMC2 V2.2.8版
💻 LYX
📖 第 1 页 / 共 3 页
字号:
CONDITION An expression involving the variable \emph on personality\emph default  which is nonzero when the pin or parameter should be created\layout DescriptionSIZE A number that gives the size of an array. The array items are numbered from 0 to \emph on SIZE\emph default -1.\layout DescriptionMAXSIZE\SpecialChar ~:\SpecialChar ~CONDSIZE A number that gives the maximum size of the array followed by an expression involving the variable \emph on personality\emph default  and which always evaluates to less than \emph on MAXSIZE\emph default . When the array is created its size will be \emph on CONDSIZE\emph default .\layout DescriptionDOC A string that documents the item. String can be a C-style \begin_inset Quotes eld\end_inset double quoted\begin_inset Quotes erd\end_inset  string, like \family typewriter "Selects the desired edge: TRUE means falling, FALSE means rising"\family default  or a Python-style \begin_inset Quotes eld\end_inset triple quoted\begin_inset Quotes erd\end_inset  string, which may include embedded newlines and quote characters, such as:\begin_deeper \layout LyX-Codeparam rw bit zot=TRUE\newline """The effect of this parameter, also known as "the orb of zot",\newline will require at least two paragraphs to explain.\newline \newline Hopefully these paragraphs have allowed you to understand "zot" \newline better.""";\layout StandardThe documentation string is in \begin_inset Quotes eld\end_inset groff -man\begin_inset Quotes erd\end_inset  format. For more information on this markup format, see \family typewriter groff_man(7)\family default . Remember that comp interprets backslash escapes in strings, so for instance to set the italic font for the word \emph on example\emph default , write \family typewriter "\backslash \backslash fIexample\backslash \backslash fB"\family default .\end_deeper \layout DescriptionTYPE One of the HAL types: \family typewriter bit\family default , \family typewriter signed\family default , \family typewriter unsigned\family default , or \family typewriter float\family default . The old names \family typewriter s32\family default  and \family typewriter u32\family default  may also be used, but \family typewriter signed\family default  and \family typewriter unsigned\family default  are preferred.\layout DescriptionPINDIRECTION One of the following: \family typewriter in\family default , \family typewriter out\family default , or \family typewriter io\family default . A component sets a value for an \family typewriter out\family default  pin, it reads a value from an \family typewriter in\family default  pin, and it may read or set the value of an \family typewriter io\family default  pin.\layout DescriptionPARAMDIRECTION One of the following: \family typewriter r\family default  or \family typewriter rw\family default . A component sets a value for a \family typewriter r\family default  parameter, and it may read or set the value of a \family typewriter rw\family default  parameter.\layout DescriptionSTARTVALUE Specifies the initial value of a pin or parameter. If it is not specified, then the default is \family typewriter 0\family default  or \family typewriter FALSE\family default , depending on the type of the item.\layout Descriptionfp Indicates that the function performs floating-point calculations.\layout Descriptionnofp Indicates that it only performs integer calculations. If neither is specified, \family typewriter fp\family default  is assumed. Neither comp nor gcc can detect the use of floating-point calculations in functions that are tagged \family typewriter nofp\family default .\layout DescriptionOPT,\SpecialChar ~VALUE Depending on the option name OPT, the valid VALUEs vary. The currently defined options are:\begin_deeper \layout Descriptionoption\SpecialChar ~singleton\SpecialChar ~yes (default: no)\begin_deeper \layout StandardDo not create a \family typewriter count\family default  module parameter, and always create a single instance. With \family typewriter singleton\family default , items are named \family typewriter component-name.item-name\family default  and without \family typewriter singleton\family default , items for numbered instances are named \family typewriter component-name.<num>.item-name\family default .\end_deeper \layout Descriptionoption\SpecialChar ~default_count\SpecialChar ~\emph on number\emph default  (default: 1)\begin_deeper \layout StandardNormally, the module parameter \family typewriter count\family default  defaults to 0. If specified, the \family typewriter count\family default  will default to this value instead.\end_deeper \layout Descriptionoption\SpecialChar ~count_function\SpecialChar ~yes (default: no)\begin_deeper \layout StandardNormally, the number of instances to create is specified in the module parameter \family typewriter count\family default ; if \family typewriter count_function\family default  is specified, the value returned by the function \family typewriter int get_count(void)\family default  is used instead, and the \family typewriter count\family default  module parameter is not defined.\end_deeper \layout Descriptionoption\SpecialChar ~rtapi_app\SpecialChar ~no (default: yes)\begin_deeper \layout StandardNormally, the functions \family typewriter rtapi_app_main\family default  and \family typewriter rtapi_app_exit\family default  are automatically defined. With \family typewriter option rtapi_app no\family default , they are not, and must be provided in the C code.\layout StandardWhen implementing your own \family typewriter rtapi_app_main\family default , call the function \family typewriter int export(char *prefix, long extra_arg)\family default  to register the pins, parameters, and functions for \family typewriter prefix\family default .\end_deeper \layout Descriptionoption\SpecialChar ~data\SpecialChar ~\emph on type\emph default  (default: none) \series bold \noun on deprecated\begin_deeper \layout StandardIf specified, each instance of the component will have an associated data block of \emph on type\emph default  (which can be a simple type like \family typewriter float\family default  or the name of a type created with \family typewriter typedef\family default ).\layout StandardIn new components, \emph on variable\emph default  should be used instead.\end_deeper \end_deeper \layout Descriptionoption\SpecialChar ~extra_setup\SpecialChar ~yes (default: no)\begin_deeper \begin_deeper \layout StandardIf specified, call the function defined by \family typewriter EXTRA_SETUP\family default  for each instance. If using the automatically defined \family typewriter rtapi_app_main\family default , \family typewriter extra_arg\family default  is the number of this instance. \end_deeper \layout Descriptionoption\SpecialChar ~extra_cleanup\SpecialChar ~yes (default: no)\begin_deeper \layout StandardIf specified, call the function defined by \family typewriter EXTRA_CLEANUP\family default  from the automatically defined \family typewriter rtapi_app_exit\family default , or if an error is detected in the automatically defined \family typewriter rtapi_app_main\family default .\end_deeper \layout Descriptionoption\SpecialChar ~userspace\SpecialChar ~yes (default: no)\begin_deeper \layout StandardIf specified, this file describes a userspace component, rather than a real one. A userspace component may not have functions defined by the \family typewriter function\family default  directive. Instead, after all the instances are constructed, the C function \family typewriter user_mainloop()\family default  is called. When this function returns, the component exits. Typically, \family typewriter user_mainloop()\family default  will use \family typewriter FOR_ALL_INSTS()\family default  to perform the update action for each instance, then sleep for a short time. Another common action in \family typewriter user_mainloop()\family default  may be to call the event handler loop of a GUI toolkit.\end_deeper \layout Descriptionoption\SpecialChar ~userinit\SpecialChar ~yes (default: no)\begin_deeper \layout StandardIf specified, the function \family typewriter userinit(argc,argv)\family default  is called before \family typewriter rtapi_app_main()\family default  (and thus before the call to \family typewriter hal_init()\family default ). This function may process the commandline arguments or take other actions. Its return type is \family typewriter void\family default ; it may call \family typewriter exit()\family default  if it wishes to terminate rather than create a hal component (for instance, because the commandline arguments were invalid).\end_deeper \layout StandardIf an option's VALUE is not specified, then it is equivalent to specifying \family typewriter option \SpecialChar \ldots{} yes\family default . The result of assigning an inappropriate value to an option is undefined. The result of using any other option is undefined.\end_deeper \layout DescriptionLICENSE Specify the license of the module, for the documentation and for the MODULE_LICENSE() module declaration.\layout SectionPer-instance data storage\layout Descriptionvariable\SpecialChar ~\emph on CTYPE\SpecialChar ~NAME\emph default ;\layout Descriptionvariable\SpecialChar ~\emph on CTYPE\SpecialChar ~NAME\emph default [\emph on SIZE\emph default ];\layout Descriptionvariable\SpecialChar ~\emph on CTYPE\SpecialChar ~NAME\emph default \SpecialChar ~=\SpecialChar ~\emph on DEFAULT\emph default ;\layout Descriptionvariable\SpecialChar ~\emph on CTYPE\SpecialChar ~NAME\emph default [\emph on SIZE\emph default ]\SpecialChar ~=\SpecialChar ~\emph on DEFAULT\emph default ;\begin_deeper \layout StandardDeclare a per-instance variable \emph on NAME\emph default  of type \emph on CTYPE\emph default , optionally as an array of \emph on SIZE\emph default  items, and optionally with a default value \emph on DEFAULT\emph default . Items with no \emph on DEFAULT\emph default  are initialized to all-bits-zero. \emph on CTYPE\emph default  is a simple one-word C type, such as \family typewriter float\family default , \family typewriter u32\family default , \family typewriter s32\family default , etc.\newline Access to array variables uses square brackets.\end_deeper \layout StandardC++-style one-line comments (\family typewriter // \SpecialChar \ldots{}\family default ) and C-style multi-line comments (\family typewriter /* \SpecialChar \ldots{} */\family default ) are both supported in the declaration section.\layout SectionOther restrictions on comp files\layout StandardThough HAL permits a pin, a parameter, and a function to have the same name, comp does not.\layout SectionConvenience Macros\layout StandardBased on the items in the declaration section, \emph on comp\emph default  creates a C structure called \family typewriter struct state\family default . However, instead of referring to the members of this structure (e.g., \family typewriter *(inst->name)\family default ), they will generally be referred to using the macros below. The details of \family typewriter struct state\family default  and these macros may change from one version of \emph on comp\emph default  to the next.\layout DescriptionFUNCTION(name) Use this macro to begin the definition of a realtime function which was previously declared with '\family typewriter function NAME\family default '.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -