KM3NeT CLB
2.0
KM3NeT CLB v2 Embedded Software
|
This driver encapsulates the functionality of the CPLD on the octopus board. More...
Go to the source code of this file.
Enumerations | |
enum | OCReg { ocRegOn = 0, ocRegFault = 4, ocRegClkEn = 8 } |
Octopus CPLD registers. More... | |
Functions | |
bool | ocRead (I2C_Device *dev, uint8_t addr, OCReg reg, uint32_t *value) |
Reads one of the CPLD registers. More... | |
bool | ocWrite (I2C_Device *dev, uint8_t addr, OCReg reg, uint32_t value) |
Writes one of the CPLD registers. More... | |
static bool | ocWakeUp (I2C_Device *dev, uint8_t addr) |
Wakes up the octopus board, apparently it needs it. More... | |
This driver encapsulates the functionality of the CPLD on the octopus board.
Though on the CPLD each registers byte can be read separately this driver groups all 3 bytes into one 32 bit register. Thus when reading the ocRegFault register the fault status of all 20 channels is returned in one 32 bit integer, where each bit position corresponds to its respective channel.
Definition in file octocpld.h.
enum OCReg |
Octopus CPLD registers.
Enumerator | |
---|---|
ocRegOn |
PMT On register. |
ocRegFault |
Fault register. |
ocRegClkEn |
Clock enable. |
Definition at line 37 of file octocpld.h.
bool ocRead | ( | I2C_Device * | dev, |
uint8_t | addr, | ||
OCReg | reg, | ||
uint32_t * | value | ||
) |
Reads one of the CPLD registers.
dev | The I2C device |
addr | The I2C address |
reg | The CPLD register (ocRegOn, ocRegFault or orRegClkEn) |
value | A pointer to a 32 bit integer to fill as bit mask. |
true | Success |
false | Failure |
Definition at line 18 of file octocpld.c.
|
inlinestatic |
Wakes up the octopus board, apparently it needs it.
dev |
Definition at line 76 of file octocpld.h.
bool ocWrite | ( | I2C_Device * | dev, |
uint8_t | addr, | ||
OCReg | reg, | ||
uint32_t | value | ||
) |
Writes one of the CPLD registers.
dev | The I2C device |
addr | The I2C address |
reg | The CPLD register (ocRegOn, ocRegFault or orRegClkEn) |
value | A 32bit integer as bitmask, where each bit corresponds to its channel |
true | Success |
false | Failure |
Definition at line 31 of file octocpld.c.