aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/fx3/b200/b200_vrq.h
blob: d1f79f0ad99b2bd26d90a7450313bc2e9a5ed4a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//
// Copyright 2013-2014 Ettus Research LLC
//

/* This file defines b200 vendor requests handlers, version 1
 */
#ifndef B200_VRQ_H
#define B200_VRQ_H

uint32_t ad9361_transact_spi(const uint32_t bits);

// note: for a write instruction bit 7 from byte 0 is set to 1
#define MAKE_AD9361_WRITE(dest, reg, val) {dest[0] = 0x80 | ((reg >> 8) & 0x3F); \
                                           dest[1] = reg & 0xFF; \
                                           dest[2] = val;}
#define MAKE_AD9361_READ(dest, reg) {dest[0] = (reg >> 8) & 0x3F; \
                                                dest[1] = reg & 0xFF;}

#endif //B200_VRQ_H