Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
Programmable RF Attenuator
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Programmable RF Attenuator
Commits
b8d63d18
Commit
b8d63d18
authored
Nov 10, 2021
by
Juan David González Cobas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add doxy comments
parent
e25f0a08
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
22 deletions
+33
-22
liboasis-usb-att.c
software/lib/liboasis-usb-att.c
+2
-2
liboasis-usb-att.h
software/lib/liboasis-usb-att.h
+7
-9
usb-enum.h
software/lib/usb-enum.h
+24
-11
No files found.
software/lib/liboasis-usb-att.c
View file @
b8d63d18
...
...
@@ -13,8 +13,8 @@
#include "liboasis-usb-att.h"
#include "usb-enum.h"
#define OAU_VENDOR_ID 0x1556
/* CERN USB Vendor ID */
#define OAU_DEVICE_ID 0x0443
/* oau USB Device ID */
#define OAU_VENDOR_ID 0x1556
/*
*<
CERN USB Vendor ID */
#define OAU_DEVICE_ID 0x0443
/*
*<
oau USB Device ID */
#define OAU_MAX_HANDLES 16
...
...
software/lib/liboasis-usb-att.h
View file @
b8d63d18
...
...
@@ -29,16 +29,13 @@ extern "C" {
*/
enum
oau_att_value_enum
{
ATT_ERR
=
-
1
,
/**< Error */
ATT_NONE
=
0x0
,
/**< No attenuation */
ATT_1
=
0x01
,
/**< Attenuator 1: 20dB */
ATT_2
=
0x03
,
/**< Attenuator 1+2: 40dB */
ATT_MINUS_40dB
=
0x0
,
/**< -40dB attn (power-on default) */
ATT_MINUS_20dB
=
0x01
,
/**< -20dB attn */
ATT_
0
dB
=
0x03
,
/**< 0dB attn */
ATT_
ZERO_
dB
=
0x03
,
/**< 0dB attn */
};
/**
* @brief Open a msatt device
* @brief Open a msatt device
by LUN (not implemented)
*
* A board is selected by lun, and a handle is returned for further
* reference to it.
...
...
@@ -70,10 +67,11 @@ int oau_att_close(int fd);
/**
* @brief Get attenuation value for a given channel
*
* Each channel can be on one of these states:
* - No attenuation active (Relay value = 0x0)
* - 20dB attenuation (Relay value = 0x1)
* - 40dB attenuation (Relay value = 0x3)
* Each channel can be in one of these states:
*
* - attenuation -40dB (power-on default) (Relay value = 0x0)
* - attenuation -20dB (Relay value = 0x1)
* - attenuation 0dB (Relay value = 0x3)
*
* @param fd Device handle identifying board
* @param channel Channel [1,2,3,4] on the board to read from
...
...
software/lib/usb-enum.h
View file @
b8d63d18
...
...
@@ -14,22 +14,35 @@
* Released under the GPL v2. (and only v2, not any later version)
*/
/**
* \brief oau_usb_dev - representation of an oattn device in all
* concevable forms
*/
struct
oau_usb_dev
{
int
lun
;
char
busnum
[
6
];
char
devnum
[
6
];
char
portnum
[
6
];
char
busport
[
16
];
char
devno
[
10
];
char
serial
[
48
];
char
path
[
256
];
int
lun
;
/**< logical unit number (not implemented) */
char
busnum
[
6
];
/**< USB bus number (decimal) */
char
devnum
[
6
];
/**< USB dev number (decimal) */
char
portnum
[
6
];
/**< USB port number (decimal) */
char
busport
[
16
];
/**< USB bus-port string (decimal bbb-ppp) */
char
devno
[
10
];
/**< Linux kernel devno (decimal major:minor) */
char
serial
[
48
];
/**< Serial number (e.g. HCCAIAD000-CR000003) */
char
path
[
256
];
/**< Linux sysfs device path */
int
unused
[
4
];
};
/**
* \struct oau_devarray - array of oattn devices detected in the system
*/
struct
oau_devarray
{
int
ndevs
;
struct
oau_usb_dev
*
devs
;
int
ndevs
;
/**< number of devices (i.e. array length) */
struct
oau_usb_dev
*
devs
;
/**< pointer to array of devices */
};
/** oau_display_devarray - auxiliary function to display the
* detected device array table
*/
void
oau_display_devarray
(
struct
oau_devarray
*
ls
);
struct
oau_devarray
*
oau_get_devarray
(
char
*
vendor_id
,
char
*
device_id
);
/** oau_get_devarray - populate library's static table of detected devices
*/
struct
oau_devarray
*
oau_get_devarray
(
unsigned
int
vendor_id
,
unsigned
int
device_id
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment