Root/tools/include/atrf.h

Source at commit 49e7c83796bc04941e9dbcec69bc0751563ff4d4 created 2 years 6 months ago.
By Werner Almesberger, atusb/: use ""VDD" symbol from kicad-libs
1/*
2 * include/atrf.h - ATRF access functions library
3 *
4 * Written 2010-2011, 2013 by Werner Almesberger
5 * Copyright 2010-2011, 2013 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    atrf_at86rf230 = 1,
22    atrf_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, int pulse);
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
55void atrf_sram_write(struct atrf_dsc *dsc, uint8_t addr, uint8_t value);
56uint8_t atrf_sram_read(struct atrf_dsc *dsc, uint8_t addr);
57
58int atrf_interrupt_wait(struct atrf_dsc *dsc, int timeout_ms);
59
60/* HardMAC operations */
61
62void atrf_rx_mode(struct atrf_dsc *dsc, int on);
63int atrf_rx(struct atrf_dsc *dsc, void *buf, int size, int timeout_ms,
64    uint8_t *lqi);
65void atrf_tx(struct atrf_dsc *dsc, const void *buf, int size);
66
67#endif /* !ATRF_H */
68

Archive Download this file



interactive