Dependencies:   mbed

Committer:
nucho
Date:
Mon Aug 01 14:45:42 2011 +0000
Revision:
1:ab3c75cf5906
Parent:
0:a70ea71286b6

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nucho 0:a70ea71286b6 1 #ifndef RTNO_HEADER_INCLUDED
nucho 0:a70ea71286b6 2 #define RTNO_HEADER_INCLUDED
nucho 0:a70ea71286b6 3
nucho 0:a70ea71286b6 4 /*******************************************
nucho 0:a70ea71286b6 5 * RTno.h
nucho 0:a70ea71286b6 6 * @author Yuki Suga
nucho 0:a70ea71286b6 7 * @copyright Yuki Suga (ysuga.net) Nov, 10th, 2010.
nucho 0:a70ea71286b6 8 * @license LGPLv3
nucho 0:a70ea71286b6 9 *****************************************/
nucho 0:a70ea71286b6 10
nucho 0:a70ea71286b6 11
nucho 0:a70ea71286b6 12 //#define BAUDRATE 19200
nucho 0:a70ea71286b6 13
nucho 0:a70ea71286b6 14 #define RTC_OK 0
nucho 0:a70ea71286b6 15 #define RTC_ERROR -1
nucho 0:a70ea71286b6 16
nucho 0:a70ea71286b6 17 #include "BasicDataType.h"
nucho 0:a70ea71286b6 18 #include "InPort.h"
nucho 0:a70ea71286b6 19 #include "OutPort.h"
nucho 0:a70ea71286b6 20
nucho 0:a70ea71286b6 21
nucho 0:a70ea71286b6 22 extern "C" {
nucho 0:a70ea71286b6 23 void addInPort(InPortBase& inPort);
nucho 0:a70ea71286b6 24 void addOutPort(OutPortBase& outPort);
nucho 0:a70ea71286b6 25 }
nucho 0:a70ea71286b6 26
nucho 0:a70ea71286b6 27 struct config_str {
nucho 0:a70ea71286b6 28 struct default_str {
nucho 0:a70ea71286b6 29 long baudrate;
nucho 0:a70ea71286b6 30 } _default;
nucho 0:a70ea71286b6 31 };
nucho 0:a70ea71286b6 32
nucho 0:a70ea71286b6 33 struct exec_cxt_str {
nucho 0:a70ea71286b6 34 struct periodic_str {
nucho 0:a70ea71286b6 35 long type;
nucho 0:a70ea71286b6 36 } periodic;
nucho 0:a70ea71286b6 37 };
nucho 0:a70ea71286b6 38
nucho 0:a70ea71286b6 39 #define ProxySynchronousExecutionContext 1
nucho 0:a70ea71286b6 40
nucho 0:a70ea71286b6 41 extern exec_cxt_str exec_cxt;
nucho 0:a70ea71286b6 42
nucho 0:a70ea71286b6 43 extern config_str conf;
nucho 0:a70ea71286b6 44
nucho 0:a70ea71286b6 45
nucho 0:a70ea71286b6 46 extern "C" {
nucho 0:a70ea71286b6 47 void rtcconf(void);
nucho 0:a70ea71286b6 48 };
nucho 0:a70ea71286b6 49
nucho 0:a70ea71286b6 50 namespace RTno {
nucho 0:a70ea71286b6 51 extern "C" {
nucho 0:a70ea71286b6 52 // setup function is defined in RTno.cpp
nucho 0:a70ea71286b6 53 void setup();
nucho 0:a70ea71286b6 54
nucho 0:a70ea71286b6 55 // loop fuction is defined in RTno.cpp
nucho 0:a70ea71286b6 56 void loop();
nucho 0:a70ea71286b6 57
nucho 0:a70ea71286b6 58 // These call-back funcitons should be defined in user program code.
nucho 0:a70ea71286b6 59 // Use RTno_template.pde to create your own project.
nucho 0:a70ea71286b6 60
nucho 0:a70ea71286b6 61 /**
nucho 0:a70ea71286b6 62 * onInitialize()
nucho 0:a70ea71286b6 63 * This function is called when RTno is initialized.
nucho 0:a70ea71286b6 64 * RTno is usually initialized when the RTno-proxy is launched.
nucho 0:a70ea71286b6 65 */
nucho 0:a70ea71286b6 66 int onInitialize();
nucho 0:a70ea71286b6 67
nucho 0:a70ea71286b6 68 /**
nucho 0:a70ea71286b6 69 * onActivated()
nucho 0:a70ea71286b6 70 * This function is called when RTno is activated.
nucho 0:a70ea71286b6 71 * RTno is usually activated by RT System Editor or other tools for OpenRTM-aist.
nucho 0:a70ea71286b6 72 */
nucho 0:a70ea71286b6 73 int onActivated();
nucho 0:a70ea71286b6 74
nucho 0:a70ea71286b6 75 /**
nucho 0:a70ea71286b6 76 * onExecute()
nucho 0:a70ea71286b6 77 * This function is periodically called when the RTno-proxy is active.
nucho 0:a70ea71286b6 78 */
nucho 0:a70ea71286b6 79 int onExecute();
nucho 0:a70ea71286b6 80
nucho 0:a70ea71286b6 81 /**
nucho 0:a70ea71286b6 82 * onDeactivated()
nucho 0:a70ea71286b6 83 * This function is called when RTno is deactivated.
nucho 0:a70ea71286b6 84 * RTno is usually deactivated by RT System Editor or other tools for OpenRTM-aist.
nucho 0:a70ea71286b6 85 */
nucho 0:a70ea71286b6 86 int onDeactivated();
nucho 0:a70ea71286b6 87
nucho 0:a70ea71286b6 88 /**
nucho 0:a70ea71286b6 89 * onError
nucho 0:a70ea71286b6 90 * This function is called when RTno is error.
nucho 0:a70ea71286b6 91 * [DANGEROUS] This function is periodically called in very short interval.
nucho 0:a70ea71286b6 92 */
nucho 0:a70ea71286b6 93 int onError();
nucho 0:a70ea71286b6 94
nucho 0:a70ea71286b6 95 /**
nucho 0:a70ea71286b6 96 * onReset
nucho 0:a70ea71286b6 97 * This function is called when RTno is reset.
nucho 0:a70ea71286b6 98 * RTno is usually reset by RT System Editor or other tools for OpenRTM-aist.
nucho 0:a70ea71286b6 99 */
nucho 0:a70ea71286b6 100 int onReset();
nucho 0:a70ea71286b6 101 };// extern "C"
nucho 0:a70ea71286b6 102 };
nucho 0:a70ea71286b6 103
nucho 0:a70ea71286b6 104
nucho 0:a70ea71286b6 105 #endif
nucho 0:a70ea71286b6 106