diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-07-09 05:33:18 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-07-09 05:33:18 +0200 |
commit | 02924fc49641ca9c000054a7a540b6f1eaa0e8f8 (patch) | |
tree | 986ba532752d7e19d85f77eea57f15579fe913d5 /ipecamera/model.c | |
parent | 80d999195b2b1896fcd1878a44b0ece474fe678c (diff) | |
download | pcitool-02924fc49641ca9c000054a7a540b6f1eaa0e8f8.tar.gz pcitool-02924fc49641ca9c000054a7a540b6f1eaa0e8f8.tar.bz2 pcitool-02924fc49641ca9c000054a7a540b6f1eaa0e8f8.tar.xz pcitool-02924fc49641ca9c000054a7a540b6f1eaa0e8f8.zip |
Support dynamic registers, support register offsets and multiregisters (bitmasks), list NWL DMA registers
Diffstat (limited to 'ipecamera/model.c')
-rw-r--r-- | ipecamera/model.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ipecamera/model.c b/ipecamera/model.c index 23715e3..ddf9ee6 100644 --- a/ipecamera/model.c +++ b/ipecamera/model.c @@ -21,9 +21,9 @@ //#define IPECAMERA_SIMPLIFIED_READOUT #define IPECAMERA_MULTIREAD -static pcilib_register_value_t ipecamera_bit_mask[9] = { 0, 1, 3, 7, 15, 31, 63, 127, 255 }; +//static pcilib_register_value_t ipecamera_bit_mask[9] = { 0, 1, 3, 7, 15, 31, 63, 127, 255 }; -int ipecamera_read(pcilib_t *ctx, pcilib_register_bank_description_t *bank, pcilib_register_addr_t addr, uint8_t bits, pcilib_register_value_t *value) { +int ipecamera_read(pcilib_t *ctx, pcilib_register_bank_description_t *bank, pcilib_register_addr_t addr, pcilib_register_value_t *value) { uint32_t val, tmp[4]; char *wr, *rd; struct timeval start, cur; @@ -107,12 +107,13 @@ retry: return PCILIB_ERROR_VERIFY; } - *value = val&ipecamera_bit_mask[bits]; +// *value = val&ipecamera_bit_mask[bits]; + *value = val&0xFF; return 0; } -int ipecamera_write(pcilib_t *ctx, pcilib_register_bank_description_t *bank, pcilib_register_addr_t addr, uint8_t bits, pcilib_register_value_t value) { +int ipecamera_write(pcilib_t *ctx, pcilib_register_bank_description_t *bank, pcilib_register_addr_t addr, pcilib_register_value_t value) { uint32_t val, tmp[4]; char *wr, *rd; struct timeval start, cur; @@ -196,8 +197,8 @@ retry: return PCILIB_ERROR_VERIFY; } - if ((val&ipecamera_bit_mask[bits]) != value) { - pcilib_error("Value verification failed during register read (CMOSIS %lu, value: %lu != %lu)", addr, val&ipecamera_bit_mask[bits], value); + if ((val&0xFF/*&ipecamera_bit_mask[bits]*/) != value) { + pcilib_error("Value verification failed during register read (CMOSIS %lu, value: %lu != %lu)", addr, val/*&ipecamera_bit_mask[bits]*/, value); return PCILIB_ERROR_VERIFY; } |