/alps/pcitool

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to pcilib.h

  • Committer: Suren A. Chilingaryan
  • Date: 2011-07-09 03:33:18 UTC
  • Revision ID: csa@dside.dyndns.org-20110709033318-2k7vk5s5p5u7btem
Support dynamic registers, support register offsets and multiregisters (bitmasks), list NWL DMA registers

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
typedef uint8_t pcilib_bar_t;                   /**< Type holding the PCI Bar number */
30
30
typedef uint8_t pcilib_register_t;              /**< Type holding the register ID within the Bank */
31
 
typedef uint8_t pcilib_register_addr_t;         /**< Type holding the register ID within the Bank */
 
31
typedef uint32_t pcilib_register_addr_t;        /**< Type holding the register ID within the Bank */
32
32
typedef uint8_t pcilib_register_bank_t;         /**< Type holding the register bank number */
33
33
typedef uint8_t pcilib_register_bank_addr_t;    /**< Type holding the register bank number */
34
34
typedef uint8_t pcilib_register_size_t;         /**< Type holding the size in bits of the register */
53
53
typedef enum {
54
54
    PCILIB_REGISTER_R = 1,
55
55
    PCILIB_REGISTER_W = 2,
56
 
    PCILIB_REGISTER_RW = 3
 
56
    PCILIB_REGISTER_RW = 3,
 
57
    PCILIB_REGISTER_W1C = 4,            /**< writting 1 resets the flag */
 
58
    PCILIB_REGISTER_RW1C = 5
57
59
} pcilib_register_mode_t;
58
60
 
59
61
typedef enum {
72
74
 
73
75
typedef enum {
74
76
    PCILIB_REGISTER_STANDARD = 0,
75
 
    PCILIB_REGISTER_FIFO
 
77
    PCILIB_REGISTER_FIFO,
 
78
    PCILIB_REGISTER_BITS
76
79
} pcilib_register_type_t;
77
80
 
78
81
#define PCILIB_BAR_DETECT               ((pcilib_bar_t)-1)
126
129
    pcilib_register_size_t offset;
127
130
    pcilib_register_size_t bits;
128
131
    pcilib_register_value_t defvalue;
 
132
    pcilib_register_value_t rwmask;     /**< 1 - read before write bits, 0 - zero should be written to preserve value */
129
133
    pcilib_register_mode_t mode;
130
134
    pcilib_register_type_t type;
131
135
    
185
189
    pcilib_event_api_description_t *event_api;
186
190
} pcilib_model_description_t;
187
191
 
188
 
#ifndef _PCILIB_PCI_C
189
 
extern pcilib_model_description_t pcilib_model[];
190
 
#endif /* ! _PCILIB_PCI_C */
191
 
 
192
192
int pcilib_set_error_handler(void (*err)(const char *msg, ...), void (*warn)(const char *msg, ...));
193
193
 
194
194
pcilib_model_t pcilib_get_model(pcilib_t *ctx);