USRP Hardware Driver and USRP Manual  Version: 003.010.001.HEAD-0-g929e3b32
UHD and USRP Manual
dboard_eeprom.h
Go to the documentation of this file.
1 //
2 // Copyright 2015 Ettus Research LLC
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 //
17 
18 #ifndef INCLUDED_UHD_USRP_DBOARD_EEPROM_H
19 #define INCLUDED_UHD_USRP_DBOARD_EEPROM_H
20 
21 #include <uhd/config.h>
22 #include <uhd/error.h>
23 
24 #ifdef __cplusplus
26 #include <string>
27 
28 struct uhd_dboard_eeprom_t {
29  uhd::usrp::dboard_eeprom_t dboard_eeprom_cpp;
30  std::string last_error;
31 };
32 
33 extern "C" {
34 #else
35 struct uhd_dboard_eeprom_t;
36 #endif
37 
39 
45 typedef struct uhd_dboard_eeprom_t* uhd_dboard_eeprom_handle;
46 
49  uhd_dboard_eeprom_handle* h
50 );
51 
53 
58  uhd_dboard_eeprom_handle* h
59 );
60 
63  uhd_dboard_eeprom_handle h,
64  char* id_out,
65  size_t strbuffer_len
66 );
67 
70  uhd_dboard_eeprom_handle h,
71  const char* id
72 );
73 
76  uhd_dboard_eeprom_handle h,
77  char* serial_out,
78  size_t strbuffer_len
79 );
80 
83  uhd_dboard_eeprom_handle h,
84  const char* serial
85 );
86 
89  uhd_dboard_eeprom_handle h,
90  int* revision_out
91 );
92 
95  uhd_dboard_eeprom_handle h,
96  int revision
97 );
98 
101  uhd_dboard_eeprom_handle h,
102  char* error_out,
103  size_t strbuffer_len
104 );
105 
106 #ifdef __cplusplus
107 }
108 #endif
109 
110 #endif /* INCLUDED_UHD_USRP_DBOARD_EEPROM_H */
UHD_API uhd_error uhd_dboard_eeprom_free(uhd_dboard_eeprom_handle *h)
Safely destroy the given handle.
UHD_API uhd_error uhd_dboard_eeprom_get_serial(uhd_dboard_eeprom_handle h, char *serial_out, size_t strbuffer_len)
Get the daughterboard&#39;s serial.
UHD_API uhd_error uhd_dboard_eeprom_set_revision(uhd_dboard_eeprom_handle h, int revision)
Set the daughterboard&#39;s revision.
uhd_error
UHD error codes.
Definition: error.h:31
UHD_API uhd_error uhd_dboard_eeprom_get_id(uhd_dboard_eeprom_handle h, char *id_out, size_t strbuffer_len)
Get the ID associated with the given daughterboard as a string hex representation.
struct uhd_dboard_eeprom_t * uhd_dboard_eeprom_handle
A C-level interface for interacting with a daughterboard EEPROM.
Definition: dboard_eeprom.h:45
Definition: dboard_eeprom.hpp:28
UHD_API uhd_error uhd_dboard_eeprom_get_revision(uhd_dboard_eeprom_handle h, int *revision_out)
Get the daughterboard&#39;s revision (not always present)
UHD_API uhd_error uhd_dboard_eeprom_set_serial(uhd_dboard_eeprom_handle h, const char *serial)
Set the daughterboard&#39;s serial.
UHD_API uhd_error uhd_dboard_eeprom_make(uhd_dboard_eeprom_handle *h)
Create handle for a USRP daughterboard EEPROM.
#define UHD_API
Definition: config.h:73
UHD_API uhd_error uhd_dboard_eeprom_set_id(uhd_dboard_eeprom_handle h, const char *id)
Set the daughterboard ID using a string hex representation.
UHD_API uhd_error uhd_dboard_eeprom_last_error(uhd_dboard_eeprom_handle h, char *error_out, size_t strbuffer_len)
Get the last error reported by the handle.