#include <CCamacModule.h>

class CCamacModule {`CCamacModule(unsigned int branch, unsigned int crate, unsigned int slot);`

`const unsigned long Read(unsigned int f, unsigned int a);`

`const void Write(unsigned int f, unsigned int a, unsigned long d);`

`const unsigned short Control(unsigned int f, unsigned int a);`

`const unsigned long* MakePointer(unsigned int f, unsigned int a, bool isshort = false);`

`const unsigned long* MakePointer(unsigned int c, unsigned int n, unsigned int a, unsigned int f, bool isshort = false);`

`static bool ValidBranch(unsigned int branch);`

`static bool ValidCrate(unsigned int crate));`

`static bool ValidSlot(unsigned int slot);`

`static bool ValidSubaddress(unsigned int a);`

`static bool ValidFunction(unsigned int f);`

`static bool isRead(unsigned int f);`

`static bool isWrite(unsigned int f);`

`static bool isControl(unsigned int f);`

}

Provides support for a generic CAMAC module. Constructing a
`CCamacModule`

object creates an object that can
perform generic manipulations on a single CAMAC module in the system.

CAMAC modules are conceptually quite simple. Modules are addressed by
crate slot.
They can have a function code
(operation) directed at them. Function codes `0-7`
represent read operations, Functtion codes `16-23` represent
write operations and `8-15,24-31` represent non data transfer
(control) operations.

The function code can be qualified by any of 16 subaddresses. Subaddresses generally represent channels or functional targets within the device.

Constructs a

`CCamacModule`

. The module that will be controlled by this objedct is described by the`branch, crate`

and`slot`

parameters of the constructor. As usual for CAMAC systems at the NSCL, the`branch`

parameter implies a VME crate number.Performs a read operation on the module.

`f`

is the function code of the read and must be in the range`0-7`inclusive.`a`

is the subaddress to which the function is directed and must be in the range`0-15`. The return value of the function is the data provided by the module.Writes data to the module. The function code and subaddress are provided by the

`f`

and`a`

parameters respectively. The data to write is`d`

.`f`

must be in the range`16-23`inclusive while`a`

must be in the range`0-15`inclusive.Performs a control function on the device. The function code

`f`

must be in one of the ranges`8-15`or`24-31`inclusive. The subaddress`a`must be in the range`0-15`inclusive.This is a convenience function that returns

`true`if`branch`

is a valid CAMAC branch number.Returns true if the

`crate`

is a valid CAMAC crate.Returns

`true`if`slot`

is a valid CAMAC slot number. This function recognizes that crates have 'pseudo' slots that actually address the controller.Returns

`true`if`a`

is a valid module subaddress.Returns

`true`if the function`f`

is a valid function code.Returns

`true`if the function`f`

is a valid Read operation.Returns

`true`if the function`f`

is a valid CAMAC write function code.Returns

`true`if the function`f`

is a valid CAMAC control function code (non data transfer).