29 #define PRMS_THRS_MIN_MV 800
30 #define PRMS_THRS_MAX_MV 2400
31 #define PRMS_HV_MIN_V -700
32 #define PRMS_HV_MAX_V -1500
34 #define E_PRMS_ID_FAULT ( E_PRMS + 1 )
35 #define E_PRMS_ID_FAULT_DESCR "PROMiS ID inconsistent"
45 #define PRMS_THRS_MV2DAC(MV) \
46 RESCALE(MV, PRMS_THRS_MIN_MV, PRMS_THRS_MAX_MV, 0, 255)
54 #define PRMS_THRS_DAC2MV(BYTE) \
55 RESCALE(BYTE, 0, 255, PRMS_THRS_MIN_MV, PRMS_THRS_MAX_MV)
65 #define PRMS_HV_V2DAC(V) \
66 RESCALE(V, PRMS_HV_MIN_V, PRMS_HV_MAX_V, 0, 255)
74 #define PRMS_HV_DAC2V(V) \
75 RESCALE(V, 0, 255, PRMS_HV_MIN_V, PRMS_HV_MAX_V)
bool prmsChainTest(I2C_Device *dev, uint8_t addr)
Executes a chain test.
Structure defines OpenCores I2C Device.
bool prmsID(I2C_Device *dev, uint8_t addr, uint8_t *id)
Returns the burned ID of the PROMiS device.
bool prmsGetConfig(I2C_Device *dev, uint8_t addr, PrmsConfig *cfg)
Gets the configuration from the PROMiS device.
uint8_t threshold
threshold DAC value
bool anaBuf
Analog buffer.
bool prmsSetConfig(I2C_Device *dev, uint8_t addr, PrmsConfig *cfg)
Sets the configuration on the PROMiS device.
uint8_t highVolt
high voltage DAC value
bool highVoltOn
High voltage on.
bool prmsHighVolt(I2C_Device *dev, uint8_t addr, bool enable)
Enables/Disables the high voltage.
bool prmsStatus(I2C_Device *dev, uint8_t addr, PrmsStatus *status)
Returns the status of the PROMiS device.
OpenCores I2C device driver.