embeddedlibrary
reusable software modules for embedded systems

Data Structures

struct  charReceiverList_t
 

Typedefs

typedef void(* charReceiver_t) (char)
 
typedef struct charReceiverList_t charReceiverList_t
 

Functions

void CharReceiverList_Init (charReceiverList_t *rList, charReceiver_t *receiver_array, uint16_t max_size)
 
void CharReceiverList_Add (charReceiverList_t *rList, charReceiver_t receiver)
 Adds character to the character receive list. More...
 
void CharReceiverList_Remove (charReceiverList_t *rList, charReceiver_t receiver)
 
void CharReceiverList_Run (charReceiverList_t *rList, char c)
 

Detailed Description

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 Documentation

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"

Function Documentation

void CharReceiverList_Add ( charReceiverList_t rList,
charReceiver_t  receiver 
)

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
rListpointer to char receiver list
receiverfunction pointer to receiver function (function must have no return value and char input parameter)
Warning
KC 8/10
void CharReceiverList_Init ( charReceiverList_t rList,
charReceiver_t receiver_array,
uint16_t  max_size 
)

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
rListPointer to charReciverList_t data type to be initialized
receiver_arrayPointer to charReciever_t array
max_sizeMaximum size of the receiver list
Warning
DB 7/10
void CharReceiverList_Remove ( charReceiverList_t rList,
charReceiver_t  receiver 
)
Parameters
rList
receiver
Todo:
Matthew D. Document this function (when done change this line to "@todo MM check <your names> documentation"
void CharReceiverList_Run ( charReceiverList_t rList,
char  c 
)

Passes the char c into and runs the functions pointed to by receivers in the struct rList.

Parameters
rListpointer to list of character receivers
ccharacter to be processed by all receivers

VC 9/10