================ Design Overview ================ The functionality of the library is separated into the following layers: 1. **Protocol Layer**: The protocol layer handles the binary packing and unpacking of data according to the protocol defined in the ICD for the Band 5 down-converter. The base class `BaseB5dcProtocol` implements the low-level packing/unpacking operations. `B5dcProtocol` implements the additional request/response routines to complete the protocol. 2. **Interface Layer**: The interface layer generate commands based on the interface file (fpg) from reading and writing to registers. The register names and addresses are mapped to methods which are associated with the B5dcProtocol. The interface layer is implemented in `B5dcInterface` class. As an example, the interface class exposes the register ``spi_rfcm_frequency`` as a method ``set_spi_rfcm_frequency(val: int):`` to set the register and a method ``spi_rfcm_frequency() -> int:`` to get the frequency from the device. 3. **Device Layer**: The device layer uses the `B5dcInterface` to configure the B5DC and read the state of the device. This layer is implemented in `B5dcDevice` class. It consists of: * ``B5dcSensor(...)``: handles reading of useful state information. * ``B5dcDeviceConfigureAttenuation(...)``: handles setting of attenuation. * ``B5dcDeviceConfigureFrequency(...)``: handles setting of frequency. The image below illustrates the connection between the classes. .. image:: ../images/b5dc-design.png :width: 30% :align: center :alt: B5DC Design