This commit adds the ioctls necessary to configure the LMS, Si5338, and VCTCXO.
The FX3's second endpoint is configured to receive and transmit things over
UART. At the other end of the UART is the Nios II core in the FPGA. The Nios
core simply parses the read or write operation and sends it to the appropriate
device.
NB: At least a 16byte URB has to be sent to the FX3 for it to send data on UART
due to a minimum buffer count enforced by the GPIF's DMA controller.
The UART packet format is as follows:
Byte 0) "Magic" byte is 'N'
Byte 1) Indicates the direction and intended device of each subsequent
operation. Count is number of struct uart_cmd data structures that
will be transferred.
// | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |$
// | dir | dev | cnt |$
Byte 2..N) The following byte pairs are struct uart_cmd, which consist of
addresses and values;
struct uart_cmd {$
unsigned char addr;$
unsigned char data;$
};$
As an example, if you are looking to write 0xC0 to register 0x30 on the Si5338,
the UART packet you would have to send would have to look like this:
Byte 0) 'N'
Byte 1) UART_PKT_MODE_DIR_WRITE | UART_PKT_DEV_SI5338 | 0x01;$
Byte 2) 0x30$
Byte 3) 0xC0$
Before sending this packet to the second endpoint, the packet would have to be
zero padded to the nearest 16 byte boundary.