20 unsigned short rxData;
21 unsigned int debug =
FALSE;
22 unsigned short retryCount = 3000;
56 int MSC_CTRL_LO = (options.
drdy_pol & 0x01) << 1 |
61 int MSC_CTRL_HI = (options.
self_test & 0x01) << 2 |
65 int SMPL_CTRL_HI = options.
dout_rate & 0xFF;
68 int FILTER_CTRL_LO = (options.
filter_sel & 0x1F);
71 int UART_CTRL_LO = (options.
uart_auto & 0x01) |
74 int UART_CTRL_HI = options.
baud_rate & 0x01;
104 int DLT_CTRL_HI = (options.
dlt_ovf_en & 0x01) << 1;
107 printf(
"%d: %d\n%d: %d\n%d: %d\n%d: %d\n%d: %d\n%d: %d\n%d: %d\n%d: %d\n%d: %d\n",
135 }
while((rxData & 0x0020) == 0x0020 && (retryCount != 0));
137 if (retryCount == 0){
138 printf(
"\r\n...Error: Filter busy bit did not return to 0b.");
166 unsigned short rxData;
167 unsigned int debug =
FALSE;
168 unsigned short retryCount = 3000;
170 printf(
"%d: %d\n%d: %d\n%d: %d\n%d: %d\n%d: %d\n%d: %d\n%d: %d\n%d: %d\n%d: %d\n",
188 }
while((rxData & 0x0400) == 0x0000 && (retryCount != 0));
192 printf(
"\r\n...Error: Stuck in Sampling Mode.");
218 }
while((rxData & 0x0020) == 0x0020 && (retryCount != 0));
220 if (retryCount == 0){
221 printf(
"\r\n...Error: Filter busy bit did not return to 0b.");
249 unsigned int debug =
TRUE;
250 printf(
"\r\nRegister Dump:\r\n");
#define ADDR_BURST_CTRL2_HI
#define CMD_EN_BRSTDATA_HI
#define EPSON_FILTER_DELAY
int sensorInitOptions(struct EpsonOptions options)
#define ADDR_BURST_CTRL1_HI
#define ADDR_SMPL_CTRL_HI
#define CMD_EN_BRSTDATA_LO
#define ADDR_MODE_CTRL_HI
#define ADDR_MODE_CTRL_LO
void seDelayMicroSecs(uint32_t micros)
unsigned short registerRead16(unsigned char, unsigned char, unsigned int)
void registerWriteByte(unsigned char, unsigned char, unsigned char, unsigned int)
#define ADDR_UART_CTRL_LO
#define ADDR_FILTER_CTRL_LO
void seDelayMS(uint32_t millis)
#define ADDR_BURST_CTRL1_LO