#ifndef DRV_PAD_AFE_QSPI_H #define DRV_PAD_AFE_QSPI_H /* $Id: drvPadBpm.h,v 1.1 2013/02/09 01:30:05 scondam Exp $ */ /* Public Interface to AFE control via QSPI driver */ #ifdef __cplusplus extern "C" { #endif #include /* Chip-select mask for AFE */ #define AFE_CS_DFLT 0xe extern int drvPadAfeCS; /* Issue a soft calibration cycle; * - send CAL trigger on QSPI (using chip levels from 'cs') * typically, 0xe can be used to select the first device * only (active low). * - delay for 'dely' loops (depends * on processor) * - send ADC trigger * * *** All of this runs with INTERRUPTS DISABLED *** */ void drvPadAfeSoftCal(int dely, int cs, int trig_pin, int irq_pin); #define AFE_REG_CSR_CALM_RED 0 #define AFE_REG_CSR_CALM_GRN 1 #define AFE_REG_CSR_CALM_BOTH 2 #define AFE_REG_CSR_CALM_NONE 3 int drvPadAfeGetCalm(void); /* Check if a CAL trigger has arrived; if 'do_reset' is nonzero then * the flag is reset */ int drvPadAfeGotCalt(int do_reset); /* Toggle calibrator from GRN <-> RED * RETURNS: new state, -1 if not in soft toggle mode, * -2 if old state was not GRN nor RED or for other errors. */ int drvPadAfeCalToggle(void); int padGetTriggerRate(); int padGetCurrentIntrCount(); #ifdef __cplusplus } #endif #endif