The char
Receiver List module provides a simple way of keeping a list of character receivers and processing a single character through the receivers.
This module was developed as a helper to the UART Module UART Module but it has use in any situation where multiple moldules may want to process characters which are received.
- Author
- Anthony Merlino
-
Michael Muhlbaier
typedef void(* charReceiver_t) (char) |
AA 7/10
The charReceiver_t is used to create a synonym for a pointer to a function that accepts a single argument of type char.
The receiver function will be passed a received character to be processed via CharReceiverList_Run()
- Todo:
- Atharva A. Document this structure (when done change this line to "@todo MM check <your names> documentation"
Adds character to the character receive list.
Add (i.e. register) a receiver to the list of character receivers. This receiver will be run whenever CharReceiverList_Run() is called.
- Parameters
-
rList | pointer to char receiver list |
receiver | function pointer to receiver function (function must have no return value and char input parameter) |
- Warning
- KC 8/10
Initialize receiver list
List initialized to have no receivers and to allow a maximum of max_size receivers to be added to the list.
- Parameters
-
rList | Pointer to charReciverList_t data type to be initialized |
receiver_array | Pointer to charReciever_t array |
max_size | Maximum size of the receiver list |
- Warning
- DB 7/10
- Parameters
-
- Todo:
- Matthew D. Document this function (when done change this line to "@todo MM check <your names> documentation"
Passes the char c into and runs the functions pointed to by receivers in the struct rList.
- Parameters
-
rList | pointer to list of character receivers |
c | character to be processed by all receivers |
VC 9/10