|
NetBurner 3.5.7
PDF Version |
Typedefs | |
| typedef void(* | serRxIdleCallback_t) (int portnum) |
| Callback type for serial port receive-idle detection. | |
| typedef void(* | serTxCompCallback_t) (int portnum, uint32_t bytesSinceLast) |
| Callback type for serial port transmit-complete notification. | |
Functions | |
| serTxCompCallback_t | RegisterTxEmptyCallback (int fd, serTxCompCallback_t pFunc) |
| Register a transmit-complete callback. | |
| serRxIdleCallback_t | RegisterSerIdleCallback (int fd, int num_bits, serRxIdleCallback_t pFunc) |
| Register a receive-idle callback. | |
Callback types and registration functions for serial port interrupt-driven events such as transmit-complete and receive-idle detection.
| typedef void(* serRxIdleCallback_t) (int portnum) |
#include <serial.h>
Callback type for serial port receive-idle detection.
Called from the serial port ISR when the line has been idle (no data received) for the configured number of bit times.
| portnum | The UART port number that detected idle |
| typedef void(* serTxCompCallback_t) (int portnum, uint32_t bytesSinceLast) |
#include <serial.h>
Callback type for serial port transmit-complete notification.
Called from the serial port ISR when the last character has been transmitted and the shift register is empty.
| portnum | The UART port number that completed transmission |
| bytesSinceLast | Number of bytes transmitted since the last callback invocation |
| serRxIdleCallback_t RegisterSerIdleCallback | ( | int | fd, |
| int | num_bits, | ||
| serRxIdleCallback_t | pFunc ) |
#include <serial.h>
Register a receive-idle callback.
Registers a callback function to be invoked from the serial port ISR when the receive line has been idle for the specified number of bit times. This is useful for detecting the end of a message in protocols that use inter-character gaps as frame delimiters (e.g. Modbus RTU). Pass nullptr to unregister a previously registered callback.
Expand for Example Usage
| fd | The file descriptor of the serial port |
| num_bits | The number of idle bit times before the callback fires |
| pFunc | Pointer to the callback function, or nullptr to unregister |
nullptr if none was registered | serTxCompCallback_t RegisterTxEmptyCallback | ( | int | fd, |
| serTxCompCallback_t | pFunc ) |
#include <serial.h>
Register a transmit-complete callback.
Registers a callback function to be invoked from the serial port ISR when the last character has been transmitted and the transmitter shift register is empty. Pass nullptr to unregister a previously registered callback.
Expand for Example Usage
| fd | The file descriptor of the serial port |
| pFunc | Pointer to the callback function, or nullptr to unregister |
nullptr if none was registered