|
|
|
Bean
AsynchroSerial
|
Asynchronous serial communication
Events are functions called when some important event occurred and its processing starts.
|
Events:
-
EventModule
- Name of the user module (without extension), where the events from this bean are placed.
-
BeforeNewSpeed
- This event is called when the CPU speed mode is being changed (using CPU methods) - before the change. The event is enabled only if speed modes are supported in the target CPU bean (more than one speed mode).
ANSIC prototype: void BeforeNewSpeed(void)
-
AfterNewSpeed
- This event is called when the CPU speed mode is being changed (using CPU methods) - after the change. The event is enabled only if speed modes are supported in the target CPU bean (more than one speed mode).
ANSIC prototype: void AfterNewSpeed(void)
-
OnError
- This event is called when a channel error (not the error returned by a given method) occurs. The errors can be read using GetError method.
ANSIC prototype: void OnError(void)
- Priority - OnError priority Default value is based on the interrupt priority defined in property Interrupt Error priority. For details see description below of the page.
-
OnRxChar
- This event is called after a correct character is received.
DMA mode: If DMA controller is available on the selected CPU and the receiver is configured to use DMA controller then this event is disabled. Only OnFullRxBuf method can be used in DMA mode.
ANSIC prototype: void OnRxChar(void)
- Priority - OnRxChar priority Default value is based on the interrupt priority defined in property Interrupt RxD priority. For details see description below of the page.
-
OnRxCharExt
- This event is called after a correct character is received. The last received character is passed as a parameter of the event function.
Nevertheless, the last received character is placed in the external buffer of the bean.
This event is identical in function with the OnRxChar event with a parameter added. It is not recommended to use both OnRxChar and OnRxCharExt events at the same time.
DMA mode:
If DMA controller is available on the selected CPU and the receiver is configured to use DMA controller then this event is disabled. Only OnFullRxBuf method can be used in DMA mode.
ANSIC prototype: void OnRxCharExt(%'ModuleName'_TComData Chr)
- Chr:BeanName_TComData - The last character correctly received.
- Priority - Priority of the event routine. For details see description below of the page.
-
OnTxChar
- This event is called after a character is placed to the output buffer of the serial peripheral. This event can be used to determine when the bean is ready to accept new data. If the specific peripheral uses a double-buffering scheme the last character can be still being transmitted when the OnTxChar event is invoked.
DMA mode: If DMA controller is available on the selected CPU and the transmitter is configured to use DMA controller then this event is disabled. Only OnFreeTxBuf method can be used in DMA mode.
ANSIC prototype: void OnTxChar(void)
- Priority - OnTxChar priority Default value is based on the interrupt priority defined in property Interrupt TxD priority. For details see description below of the page.
-
OnFullRxBuf
- This event is called when the input buffer is full.
This event is available only if non-zero length of the input buffer is defined. DMA mode: If DMA controller is available on selected CPU and receiver is configured to use DMA controller then this event is enabled and can be used to detect the end of DMA transfer.
ANSIC prototype: void OnFullRxBuf(void)
- Priority - OnFullRxBuf priority Default value is based on the interrupt priority defined in property Interrupt RxD priority. For details see description below of the page.
-
OnFreeTxBuf
- This event is called after the last character in the output buffer is transmitted.
This event is available only if non-zero length of the output buffer is defined. DMA mode: If DMA controller is available on the selected CPU and the transmitter is configured to use DMA controller then this event is enabled and can be used to detect the end of DMA transfer.
ANSIC prototype: void OnFreeTxBuf(void)
- Priority - OnFreeTxBuf priority Default value is based on the interrupt priority defined in property Interrupt TxD priority. For details see description below of the page.
-
OnBreak
- This event is called when a break occurs on the input channel.
This event is available only if property Break signal is enabled.
ANSIC prototype: void OnBreak(void)
- Priority - OnBreak priority Default value is based on the interrupt priority defined in property Interrupt Error priority. For details see description below of the page.
- Events for Freescale HC08, HCS08, HCS12 and HCS12X derivatives.
-
OnIdle
- This event is called when a receive input idle.
This event is available only if property Receiver is enabled.
ANSIC prototype: void OnIdle(void)
- Priority - OnIdle priority Default value is based on the interrupt priority defined in property Interrupt RxD priority. For details see description below of the page.
- Events for Freescale HCS08, HC08, HCS12, HCS12X and 56800 derivatives.
- Event is not supported for SLIC module on Freescale HC08 QL3/4 derivatives.
-
OnTxComplete
- This event indicates that the transmitter is finished transmitting all data, preamble, and break characters and is idle. It can be used to determine when it is safe to switch a line driver (e.g. in RS-485 applications).
This event is available only if property Transmitter is enabled.
ANSIC prototype: void OnTxComplete(void)
- Priority - Priority of the event routine. Default value is based on the interrupt priority defined in property Interrupt TxD priority. For details see description below of the page.
- Events for Freescale HCS12X derivatives.
-
OnRxActiveEdge
- This event is called when an active edge on the receiver input is detected.
The method EnableRxEdgeDetect is used to permit invocation of this event.
The method DisableRxEdgeDetect is used to forbid invocation of this event.
This event is available only when the Active edge detection property is enabled.
ANSIC prototype: void OnRxActiveEdge(void)
- Priority - Priority of the event routine. Default value is based on the interrupt priority defined in property Interrupt RxD priority. For details see description below of the page.
For each generated event it is possible to set:
|
|
|
Processor ExpertTM and Embedded BeansTM are registered trademarks of UNIS, Ltd.
©1997-2005, UNIS, Ltd.
|
|
|