summaryrefslogtreecommitdiffstats
path: root/registers.h
blob: d98a3fea9256452314ada7c7e1120687ad729348 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef _PCIDEV_CMOSIS_H
#define _PCIDEV_CMOSIS_H

#include <pcilib/bank.h>

#include "version.h"

enum ipecamera_protocol_s {
    PCIDEV_PROTOCOL_DEFAULT = PCILIB_REGISTER_PROTOCOL0,
};

pcilib_register_bank_context_t* pcidev_regfile_open(pcilib_t *ctx, pcilib_register_bank_t bank, const char* model, const void *args);
void pcidev_regfile_close(pcilib_t *ctx, pcilib_register_bank_context_t *reg_bank_ctx);
int pcidev_register_read(pcilib_t *ctx, pcilib_register_bank_context_t *bank, pcilib_register_addr_t addr, pcilib_register_value_t *value);
int pcidev_register_write(pcilib_t *ctx, pcilib_register_bank_context_t *bank, pcilib_register_addr_t addr, pcilib_register_value_t value);


# ifdef _PCIDEV_MODEL_C
static const pcilib_register_protocol_api_description_t pcidev_protocol_api =
    { PCIDEV_VERSION, pcidev_regfile_open, pcidev_regfile_close, NULL, pcidev_register_read, pcidev_register_write };

static const pcilib_register_protocol_description_t pcidev_protocols[] = {
    {PCIDEV_PROTOCOL_DEFAULT,	&pcidev_protocol_api, NULL, NULL, "pcidev", "Dummy register protocol sample"},
    { 0 }
};

static const pcilib_register_bank_description_t pcidev_banks[] = {
    { 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL }
};

static const pcilib_register_range_t pcidev_ranges[] = {
    {0, 0, 0, 0}
};
# endif /* _PCIDEV_MODEL_C */

#endif /* _PCIDEV_CMOSIS_H */