diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2018-01-16 14:50:13 +0100 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-01-23 05:25:08 -0800 |
commit | 96a7e9fe8120e81a40fe7fe208d17cff80f1a4b9 (patch) | |
tree | b1a31df59d7be459162f03e67bc3548ad3a61b6e /include/ec_commands.h | |
parent | a70227296b701212142ec93c4e03d3547ca8d390 (diff) | |
download | chrome-ec-96a7e9fe8120e81a40fe7fe208d17cff80f1a4b9.tar.gz |
fpsensor: update interface
Update the FP MCU interface to include a few convenient diagnostics
functions for factory testing.
It's mostly backward compatible, but overall this interface never
shipped in anything, so not a big deal regardless.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=none
BUG=b:71986991
TEST=ectool --name=cros_fp fpinfo && ectool --name=cros_fp fpcheckpixels
CQ-DEPEND=CL:*546799
Change-Id: Ic641f891ace02d79af9339cf6cb59a2960e506a7
Reviewed-on: https://chromium-review.googlesource.com/873924
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'include/ec_commands.h')
-rw-r--r-- | include/ec_commands.h | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h index e1573e85b9..10ac439215 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -4674,22 +4674,45 @@ struct __ec_align2 ec_params_fp_sensor_config { #define FP_MODE_FINGER_UP (1<<2) /* Capture the current finger image */ #define FP_MODE_CAPTURE (1<<3) +/* Capture types defined in bits [30..28] */ +#define FP_MODE_CAPTURE_TYPE_SHIFT 28 +#define FP_MODE_CAPTURE_TYPE_MASK 0x7 +/* Full blown vendor-defined capture (produces 'frame_size' bytes) */ +#define FP_CAPTURE_VENDOR_FORMAT 0 +/* Simple raw image capture (produces width x height x bpp bits) */ +#define FP_CAPTURE_SIMPLE_IMAGE 1 +/* Self test pattern (e.g. checkerboard) */ +#define FP_CAPTURE_PATTERN0 2 +/* Self test pattern (e.g. inverted checkerboard) */ +#define FP_CAPTURE_PATTERN1 3 +/* Extracts the capture type from the sensor 'mode' word */ +#define FP_CAPTURE_TYPE(mode) (((mode) >> FP_MODE_CAPTURE_TYPE_SHIFT) \ + & FP_MODE_CAPTURE_TYPE_MASK) /* special value: don't change anything just read back current mode */ #define FP_MODE_DONT_CHANGE (1<<31) struct __ec_align4 ec_params_fp_mode { uint32_t mode; /* as defined by FP_MODE_ constants */ - /* TBD */ }; struct __ec_align4 ec_response_fp_mode { uint32_t mode; /* as defined by FP_MODE_ constants */ - /* TBD */ }; /* Retrieve Fingerprint sensor information */ #define EC_CMD_FP_INFO 0x0403 +/* Number of dead pixels detected on the last maintenance */ +#define FP_ERROR_DEAD_PIXELS(errors) ((errors) & 0x3FF) +/* No interrupt from the sensor */ +#define FP_ERROR_NO_IRQ (1 << 12) +/* SPI communication error */ +#define FP_ERROR_SPI_COMM (1 << 13) +/* Invalid sensor Hardware ID */ +#define FP_ERROR_BAD_HWID (1 << 14) +/* Sensor initialization failed */ +#define FP_ERROR_INIT_FAIL (1 << 15) + struct __ec_align2 ec_response_fp_info { /* Sensor identification */ uint32_t vendor_id; @@ -4702,9 +4725,10 @@ struct __ec_align2 ec_response_fp_info { uint16_t width; uint16_t height; uint16_t bpp; + uint16_t errors; /* see FP_ERROR_ flags above */ }; -/* Get the last captured finger frame: TODO: will be AES-encrypted */ +/* Get the last captured finger frame */ #define EC_CMD_FP_FRAME 0x0404 struct __ec_align4 ec_params_fp_frame { |