File: xtrx_octo_api.h

package info (click to toggle)
libxtrx 0.0.1%2Bgit20191219.98458ce-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, trixie
  • size: 544 kB
  • sloc: ansic: 6,598; cpp: 1,857; makefile: 9
file content (43 lines) | stat: -rw-r--r-- 971 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef XTRX_OCTO_API_H_
#define XTRX_OCTO_API_H_

#include <xtrx_api.h>

/** @file xtrx_octo_api.h
 *
 * Public API & constant for OCTO boards
 */

enum xtrx_octo_fe_regs {
    XTRX_OCTO_OSC_DAC  = XTRX_FE_CUSTOM_0 + 0x100,
    XTRX_OCTO_CAL_PATH = XTRX_FE_CUSTOM_0 + 0x101,
};

/**
 * @brief xtrx_octo_set_cal_path
 * @param dev
 * @param cal
 * @return 0 on success, -errno  otherwise
 */
static inline int xtrx_octo_set_cal_path(struct xtrx_dev* dev,
                                         bool cal)
{
    return xtrx_val_set(dev, XTRX_RX, XTRX_CH_ALL,
                        (xtrx_val_t)XTRX_OCTO_CAL_PATH, (uint64_t)cal);
}

/**
 * @brief xtrx_octo_set_osc_dac
 * @param dev
 * @param value
 * @return
 */
static inline int xtrx_octo_set_osc_dac(struct xtrx_dev* dev,
                                        uint16_t value)
{
    return xtrx_val_set(dev, XTRX_RX, XTRX_CH_ALL,
                        (xtrx_val_t)XTRX_OCTO_CAL_PATH, (uint64_t)value);
}


#endif