Root/tools/include/atrf.h

Source at commit 2961482cac72ca292ad95a4e6bf53500014279b4 created 8 years 11 months ago.
By Werner Almesberger, tools: atrf-id option -s to retrieve driver spec, with necessary infrastructure
1/*
2 * include/atrf.h - ATRF access functions library
3 *
4 * Written 2010-2011 by Werner Almesberger
5 * Copyright 2010-2011 Werner Almesberger
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#ifndef ATRF_H
14#define ATRF_H
15
16#include <stdint.h>
17
18
19enum atrf_chip_id {
20    atrf_unknown_chip = 0,
21    artf_at86rf230 = 1,
22    artf_at86rf231 = 2,
23};
24
25
26struct atrf_dsc;
27
28
29void *atrf_usb_handle(struct atrf_dsc *dsc); /* hack for atrf-id */
30void *atrf_ben_regs(struct atrf_dsc *dsc); /* hack for atrf-xtal */
31
32const char *atrf_default_driver_name(void);
33struct atrf_dsc *atrf_open(const char *spec);
34void atrf_close(struct atrf_dsc *dsc);
35const char *atrf_driver_spec(struct atrf_dsc *dsc, int last);
36
37int atrf_error(struct atrf_dsc *dsc);
38int atrf_clear_error(struct atrf_dsc *dsc);
39
40void atrf_reset(struct atrf_dsc *dsc);
41void atrf_reset_rf(struct atrf_dsc *dsc);
42
43enum atrf_chip_id atrf_identify(struct atrf_dsc *dsc);
44
45int atrf_test_mode(struct atrf_dsc *dsc);
46int atrf_slp_tr(struct atrf_dsc *dsc, int on);
47int atrf_set_clkm(struct atrf_dsc *dsc, int mhz);
48
49void atrf_reg_write(struct atrf_dsc *dsc, uint8_t reg, uint8_t value);
50uint8_t atrf_reg_read(struct atrf_dsc *dsc, uint8_t reg);
51
52void atrf_buf_write(struct atrf_dsc *dsc, const void *buf, int size);
53int atrf_buf_read(struct atrf_dsc *dsc, void *buf, int size);
54
55int atrf_interrupt(struct atrf_dsc *dsc);
56
57#endif /* !ATRF_H */
58

Archive Download this file



interactive