IEEE 802.15.4 subsystem
Sign in or create your account | Project List | Help
IEEE 802.15.4 subsystem Git Source Tree
Root/
Source at commit 624caeb00652f6118dc64698b7dad6fa3e5bdcc2 created 7 years 6 days ago. By Werner Almesberger, atusb/: use VR, POWERED, and LED 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 | |
19 | enum atrf_chip_id { |
20 | atrf_unknown_chip = 0, |
21 | atrf_at86rf230 = 1, |
22 | atrf_at86rf231 = 2, |
23 | }; |
24 | |
25 | |
26 | struct atrf_dsc; |
27 | |
28 | |
29 | void *atrf_usb_handle(struct atrf_dsc *dsc); /* hack for atrf-id */ |
30 | void *atrf_ben_regs(struct atrf_dsc *dsc); /* hack for atrf-xtal */ |
31 | |
32 | const char *atrf_default_driver_name(void); |
33 | struct atrf_dsc *atrf_open(const char *spec); |
34 | void atrf_close(struct atrf_dsc *dsc); |
35 | const char *atrf_driver_spec(struct atrf_dsc *dsc, int last); |
36 | |
37 | int atrf_error(struct atrf_dsc *dsc); |
38 | int atrf_clear_error(struct atrf_dsc *dsc); |
39 | |
40 | void atrf_reset(struct atrf_dsc *dsc); |
41 | void atrf_reset_rf(struct atrf_dsc *dsc); |
42 | |
43 | enum atrf_chip_id atrf_identify(struct atrf_dsc *dsc); |
44 | |
45 | int atrf_test_mode(struct atrf_dsc *dsc); |
46 | int atrf_slp_tr(struct atrf_dsc *dsc, int on, int pulse); |
47 | int atrf_set_clkm(struct atrf_dsc *dsc, int mhz); |
48 | |
49 | void atrf_reg_write(struct atrf_dsc *dsc, uint8_t reg, uint8_t value); |
50 | uint8_t atrf_reg_read(struct atrf_dsc *dsc, uint8_t reg); |
51 | |
52 | void atrf_buf_write(struct atrf_dsc *dsc, const void *buf, int size); |
53 | int atrf_buf_read(struct atrf_dsc *dsc, void *buf, int size); |
54 | |
55 | void atrf_sram_write(struct atrf_dsc *dsc, uint8_t addr, uint8_t value); |
56 | uint8_t atrf_sram_read(struct atrf_dsc *dsc, uint8_t addr); |
57 | |
58 | int atrf_interrupt_wait(struct atrf_dsc *dsc, int timeout_ms); |
59 | |
60 | /* HardMAC operations */ |
61 | |
62 | void atrf_rx_mode(struct atrf_dsc *dsc, int on); |
63 | int atrf_rx(struct atrf_dsc *dsc, void *buf, int size, int timeout_ms, |
64 | uint8_t *lqi); |
65 | void atrf_tx(struct atrf_dsc *dsc, const void *buf, int size); |
66 | |
67 | #endif /* !ATRF_H */ |
68 |