📄 apps.oscilloscope.oscilloscopem.nc.html
字号:
<html><head><title>Component: OscilloscopeM</title></head><body><table BORDER="0" CELLPADDING="3" CELLSPACING="0" width="100%"><tr><td><font size="-1"><b><font color="blue"><a href="apps_p.html">Apps</a></font></b> <b><a href="components_p.html">Components</a></b> <b><a href="interfaces_p.html">Interfaces</a></b> <b><a href="allfiles_p.html">All Files</a></b> <b><a href="index.html">Source Tree</a></b> </font></td><td align="right"><font size="-1">source: <b><a href="apps.Oscilloscope.OscilloscopeM.nc.source">apps.Oscilloscope.OscilloscopeM.nc</a></b></font></td></tr></table><hr><h1 align="center">Component: OscilloscopeM</h1><p> This module implements the OscilloscopeM component, which periodically takes sensor readings and sends a group of readings over the UART. BUFFER_SIZE defines the number of readings sent in a single packet. The Yellow LED is toggled whenever a new packet is sent, and the red LED is turned on when the sensor reading is above some constant value.<p><table BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><tr BGCOLOR="#CCCCFF"><td><h3>Required Interfaces</h3></td></tr></table><ul><li> <a href="tos.interfaces.Timer.nc.html">Timer</a> <li> <a href="tos.interfaces.Leds.nc.html">Leds</a> <li> <a href="tos.interfaces.StdControl.nc.html">StdControl</a> SensorControl<li> <a href="tos.interfaces.ADC.nc.html">ADC</a> <li> <a href="tos.interfaces.StdControl.nc.html">StdControl</a> CommControl<li> <a href="tos.interfaces.SendMsg.nc.html">SendMsg</a> DataMsg<li> <a href="tos.interfaces.ReceiveMsg.nc.html">ReceiveMsg</a> ResetCounterMsg</ul><table BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><tr BGCOLOR="#CCCCFF"><td><h3>Provided Interfaces</h3></td></tr></table><ul><li> <a href="tos.interfaces.StdControl.nc.html">StdControl</a> </ul><table BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><tr BGCOLOR="#CCCCFF"><td><h3>Variables</h3></td></tr></table><ul><li> uint8_t packetReadingNumber<li> uint16_t readingNumber<li> TOS_Msg msg[2]<li> uint8_t currentMsg</ul><table BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><tr BGCOLOR="#CCCCFF"><td><h3>Function Index</h3></td></tr></table><ul><li> command result_t <a href="tos.interfaces.StdControl.nc.html#command result_t StdControl.init(void)"><b>StdControl.init</b> </a>(void)<menu> Used to initialize this component.</menu><p><li> command result_t <a href="#command result_t StdControl.start(void)"><b>StdControl.start</b> </a>(void)<menu> Starts the SensorControl and CommControl components.</menu><p><li> command result_t <a href="#command result_t StdControl.stop(void)"><b>StdControl.stop</b> </a>(void)<menu> Stops the SensorControl and CommControl components.</menu><p><li> task void <b>dataTask</b>(void)<li> async event result_t <a href="#async event result_t ADC.dataReady(uint16_t data)"><b>ADC.dataReady</b> </a>(uint16_t data)<menu> Signalled when data is ready from the ADC.</menu><p><li> event result_t <a href="#event result_t DataMsg.sendDone(TOS_MsgPtr sent, result_t success)"><b>DataMsg.sendDone</b> </a>(TOS_MsgPtr sent, result_t success)<menu> Signalled when the previous packet has been sent.</menu><p><li> event result_t <a href="#event result_t Timer.fired(void)"><b>Timer.fired</b> </a>(void)<menu> Signalled when the clock ticks.</menu><p><li> event TOS_MsgPtr <a href="#event TOS_MsgPtr ResetCounterMsg.receive(TOS_MsgPtr m)"><b>ResetCounterMsg.receive</b> </a>(TOS_MsgPtr m)<menu> Signalled when the reset message counter AM is received.</menu><p></ul><table BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><tr BGCOLOR="#CCCCFF"><td><h3>Function Descriptions</h3></td></tr></table> <a name="command result_t StdControl.start(void)"></a> <h4>StdControl.start</h4> command result_t <a href="tos.interfaces.StdControl.nc.html#command result_t StdControl.start(void)"><b>StdControl.start</b> </a>(void)<P><menu> Starts the SensorControl and CommControl components. <table border="0" cellpadding="0"><tr valign="top"><td><b>Returns:</b></td><td> Always returns SUCCESS.</td></tr></table></menu><hr> <a name="command result_t StdControl.stop(void)"></a> <h4>StdControl.stop</h4> command result_t <a href="tos.interfaces.StdControl.nc.html#command result_t StdControl.stop(void)"><b>StdControl.stop</b> </a>(void)<P><menu> Stops the SensorControl and CommControl components. <table border="0" cellpadding="0"><tr valign="top"><td><b>Returns:</b></td><td> Always returns SUCCESS.</td></tr></table></menu><hr> <a name="async event result_t ADC.dataReady(uint16_t data)"></a> <h4>ADC.dataReady</h4> async event result_t <a href="tos.interfaces.ADC.nc.html#async event result_t ADC.dataReady(uint16_t data)"><b>ADC.dataReady</b> </a>(uint16_t data)<P><menu> Signalled when data is ready from the ADC. Stuffs the sensor reading into the current packet, and sends off the packet when BUFFER_SIZE readings have been taken. <table border="0" cellpadding="0"><tr valign="top"><td><b>Returns:</b></td><td> Always returns SUCCESS.</td></tr></table></menu><hr> <a name="event result_t DataMsg.sendDone(TOS_MsgPtr sent, result_t success)"></a> <h4>DataMsg.sendDone</h4> event result_t <a href="tos.interfaces.SendMsg.nc.html#event result_t DataMsg.sendDone(TOS_MsgPtr sent, result_t success)"><b>DataMsg.sendDone</b> </a>(TOS_MsgPtr sent, result_t success)<P><menu> Signalled when the previous packet has been sent. <table border="0" cellpadding="0"><tr valign="top"><td><b>Returns:</b></td><td> Always returns SUCCESS.</td></tr></table></menu><hr> <a name="event result_t Timer.fired(void)"></a> <h4>Timer.fired</h4> event result_t <a href="tos.interfaces.Timer.nc.html#event result_t Timer.fired(void)"><b>Timer.fired</b> </a>(void)<P><menu> Signalled when the clock ticks. <table border="0" cellpadding="0"><tr valign="top"><td><b>Returns:</b></td><td> The result of calling ADC.getData().</td></tr></table></menu><hr> <a name="event TOS_MsgPtr ResetCounterMsg.receive(TOS_MsgPtr m)"></a> <h4>ResetCounterMsg.receive</h4> event TOS_MsgPtr <a href="tos.interfaces.ReceiveMsg.nc.html#event TOS_MsgPtr ResetCounterMsg.receive(TOS_MsgPtr m)"><b>ResetCounterMsg.receive</b> </a>(TOS_MsgPtr m)<P><menu> Signalled when the reset message counter AM is received. <table border="0" cellpadding="0"><tr valign="top"><td><b>Returns:</b></td><td> The free TOS_MsgPtr. </td></tr></table></menu>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -