Provides the common functions for declaring, defining, configuring, reading, and writing IO data in an object-oriented fashion, so that lower-level functions do not directly read, write, or change IO port data.
Custom datatype that must be defined as the standard port register bit-width. For the C32 this is an unsigned char.
InputT is a custom structure containing all of the information necessary for reading data from an input port.
DirPort – type C32Register - holder for the pointer to the direction register
Port – type C32Register - holder for the pointer to the data register
BitMask - type C32Register - defines which bits are configured as an input
OutputT is a custom structure containing all of the information necessary for readingand writing data to an output port.
DirPort – type C32Register - holder for the pointer to the direction register
Port – type C32Register - holder for the pointer to the data register
BitMask - type C32Register - defines which bits are configured as an output.
These functions create input variables and possibly configure bits for each port. They return type InputT with Input configuration data.
BitMask - type C32Register - the configuration for each bit. 1 means that bit will be configured/used as an input.
These functions create output variables and possibly configure bits for each port and return type OutputT with Output configuration data.
BitMask - type C32Register - the configuration for each bit. 1 means that bit will be configured/used as an output
InputRead() reads the value of input bits located in the configured Input variable. InputRead() only returns the value of bits configured in Input, and sets all other bits to zero, in type C32Register
Input - type InputT - holds configuration data
OutputRead() reads the value of output bits located in the configured Output variable. OutputRead() only returns the value of bits configured in Output, and sets all other bits to zero, in type C32Register
Output- type OutputT - holds configuration data
This function takes 2 variables an OutputT and a number of type and returns nothing
It writes the value in the second variable into the output indicated
InputConfig is a module function for modifying direction registers on configurable IO ports. Returns type InputT with Input configuration data.
DirPort - type C32Register - the pointer to the direction register
Port - type C32Register - the pointer to the data register
BitMask - type C32Register - the configuration for each bit. 1 means that bit will be configured/used as an input
OutputConfig is a module function for modifying direction registers on configurable IO ports. Returns type OutputT with Output configuration data.
DirPort - type C32Register - the pointer to the direction register
Port - type C32Register - the pointer to the data register
BitMask - type C32Register - the configuration for each bit. 1 means that bit will be configured/used as an output
Create variable Input of type InputT
Update the internal memory of Input with pointers for port E.
Set the bitmask for Input equal to BitMask
Return Input
return the result of InputConfig with pointers for port T and BitMask
Return the result of InputConfig with pointers for port M and BitMask
Create variable Input of type InputT
Update the internal memory of Input with pointers for port AD.
Set the bitmask for Input equal to BitMask
Return Input
Return the result of OutputConfig with pointers for port T and BitMask
Return the result of OutputConfig with pointers for port M and BitMask
Create variable Output of type OutputT
Update the internal memory of Output with pointers for port AD
Set output.bitmask equal to BitMask.
Return Output
Create variable Input of type InputT
Set internal variables equal to input variables
Modify the port's direction register with 0's in the bitmasked locations
Return Input
Create variable Output of type OutputT
Set internal variables equal to input variables
Modify the port's direction register with 1's in the bitmasked locations
Return Output
Return the data register bitmasked with Input.BitMask
Return the data register bitmasked with Output.BitMask
Create temporary variables a and b of type C32Register
Set a equal to the bits we want to change
Set b equal to the bits we don't want to change
Bitwise-or a and b together and set the data register equal to that value.