no-OS
hmc630x.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef _HMC630X_H_
40 #define _HMC630X_H_
41 
42 #include <stdbool.h>
43 #include <stdint.h>
44 #include "no_os_util.h"
45 #include "no_os_gpio.h"
46 
47 /* Code the row on highest 8 (of 16) bits and the field mask on lowest 8 bits. */
48 #define HMC630X_PARAM(row, mask) (((((uint16_t)row) << 8)) | (mask))
49 #define HMC630X_ROW(param) ((param) >> 8)
50 #define HMC630X_MASK(param) ((param) & 0xff)
51 
52 /* ROW0 */
53 #define HMC6301_LNA_PWRDWN HMC630X_PARAM(0, NO_OS_BIT(7))
54 #define HMC6301_BBAMP_PWRDN_I HMC630X_PARAM(0, NO_OS_BIT(6))
55 #define HMC6301_BBAMP_PWRDN_Q HMC630X_PARAM(0, NO_OS_BIT(5))
56 #define HMC6301_DIVIDER_PWRDN HMC630X_PARAM(0, NO_OS_BIT(4))
57 #define HMC6301_MIXER_PWRDN HMC630X_PARAM(0, NO_OS_BIT(3))
58 #define HMC6301_IFMIXER_PWRDN_I HMC630X_PARAM(0, NO_OS_BIT(2))
59 #define HMC6301_TRIPLER_PWRDN HMC630X_PARAM(0, NO_OS_BIT(1))
60 #define HMC6301_IFVGA_PWRDN HMC630X_PARAM(0, NO_OS_BIT(0))
61 
62 /* ROW1 */
63 #define HMC6300_PA_SEL_VGBS HMC630X_PARAM(1, NO_OS_GENMASK(7, 4))
64 #define HMC6300_PA_SEL_VREF HMC630X_PARAM(1, NO_OS_GENMASK(3, 0))
65 
66 #define HMC6301_IPC_PWRDWN HMC630X_PARAM(1, NO_OS_BIT(7))
67 #define HMC6301_IFMIX_PWRDN_Q HMC630X_PARAM(1, NO_OS_BIT(6))
68 #define HMC6301_IF_BGMUX_PWRDN HMC630X_PARAM(1, NO_OS_BIT(5))
69 #define HMC6301_ASK_PWRDN HMC630X_PARAM(1, NO_OS_BIT(4))
70 #define HMC6301_BBAMP_ATTEN1 HMC630X_PARAM(1, NO_OS_GENMASK(3, 2))
71 #define HMC6301_BBAMP_SELL_ASK HMC630X_PARAM(1, NO_OS_BIT(1))
72 #define HMC6301_BBAMP_SIGSHORT HMC630X_PARAM(1, NO_OS_BIT(0))
73 
74 /* ROW2 */
75 #define HMC6300_PA_SEL_ALC_DAC HMC630X_PARAM(2, NO_OS_GENMASK(7, 4))
76 #define HMC6300_PA_SEP_PA_PWRDWN_FAST HMC630X_PARAM(2, NO_OS_BIT(3))
77 #define HMC6300_PA_PWRDWN_FAST HMC630X_PARAM(2, NO_OS_BIT(2))
78 #define HMC6300_PA_SE_SEL HMC630X_PARAM(2, NO_OS_BIT(1))
79 #define HMC6300_POWER_DET_PWRDN HMC630X_PARAM(2, NO_OS_BIT(0))
80 
81 #define HMC6301_BBAMP_ATTENFI HMC630X_PARAM(2, NO_OS_GENMASK(7, 5))
82 #define HMC6301_BBAMP_ATTENFQ HMC630X_PARAM(2, NO_OS_GENMASK(4, 2))
83 #define HMC6301_BBAMP_ATTEN2 HMC630X_PARAM(2, NO_OS_GENMASK(1, 0))
84 
85 /* ROW3 */
86 #define HMC6300_DRIVER_BIAS HMC630X_PARAM(3, NO_OS_GENMASK(7, 5))
87 #define HMC6300_DRIVER_BIAS2 HMC630X_PARAM(3, NO_OS_GENMASK(4, 2))
88 #define HMC6300_EN_IFMIX_HICG HMC630X_PARAM(3, NO_OS_BIT(1))
89 #define HMC6300_EN_TEMPFLASH HMC630X_PARAM(3, NO_OS_BIT(0))
90 
91 #define HMC6301_BBAMP_SELBW HMC630X_PARAM(3, NO_OS_GENMASK(7, 6))
92 #define HMC6301_BBAMP_SELFASTREC HMC630X_PARAM(3, NO_OS_GENMASK(5, 4))
93 #define HMC6301_BG_MONITOR_SEL HMC630X_PARAM(3, NO_OS_GENMASK(3, 2))
94 #define HMC6301_IF_REFSEL HMC630X_PARAM(3, NO_OS_BIT(1))
95 #define HMC6301_LNA_REFSEL HMC630X_PARAM(3, NO_OS_BIT(0))
96 
97 /* ROW4 */
98 #define HMC6300_DRIVER_PWRDN HMC630X_PARAM(4, NO_OS_BIT(7))
99 #define HMC6300_UPMIXER_PWRDN HMC630X_PARAM(4, NO_OS_BIT(6))
100 #define HMC6300_IFVGA_PWRDN HMC630X_PARAM(4, NO_OS_BIT(5))
101 #define HMC6300_DIVIDER_PWRDN HMC630X_PARAM(4, NO_OS_BIT(4))
102 #define HMC6300_PA_PWRDN HMC630X_PARAM(4, NO_OS_BIT(3))
103 #define HMC6300_RFVGA_PWRDN HMC630X_PARAM(4, NO_OS_BIT(2))
104 #define HMC6300_TRIPLER_PWRDN HMC630X_PARAM(4, NO_OS_BIT(1))
105 #define HMC6300_IF_UPMIXER_PWRDN HMC630X_PARAM(4, NO_OS_BIT(0))
106 
107 #define HMC6301_IFVGA_BIAS HMC630X_PARAM(4, NO_OS_GENMASK(7, 5))
108 #define HMC6301_IFVGA_TUNE HMC630X_PARAM(4, NO_OS_GENMASK(4, 1))
109 #define HMC6301_ENDIGVGA HMC630X_PARAM(4, NO_OS_BIT(0))
110 
111 /* ROW5 */
112 #define HMC6300_TRIPLER_BIAS_HIGH HMC630X_PARAM(5, NO_OS_GENMASK(7, 0))
113 
114 #define HMC6301_IFVGA_VGA_ADJ HMC630X_PARAM(5, NO_OS_GENMASK(7, 4))
115 #define HMC6301_RFMIX_TUNE HMC630X_PARAM(5, NO_OS_GENMASK(3, 0))
116 
117 /* ROW6 */
118 #define HMC6300_TRIPLER_BIAS_LOW HMC630X_PARAM(6, NO_OS_GENMASK(7, 2))
119 
120 #define HMC6301_TRIPLER_BIAS_HIGH HMC630X_PARAM(6, NO_OS_GENMASK(7, 0))
121 
122 /* ROW7 */
123 #define HMC6300_IFVGA_VGA_ADJ HMC630X_PARAM(7, NO_OS_GENMASK(7, 4))
124 #define HMC6300_IFVGA_TUNE HMC630X_PARAM(7, NO_OS_GENMASK(3, 0))
125 
126 #define HMC6301_TRIPLER_BIAS_LOW HMC630X_PARAM(7, NO_OS_GENMASK(7, 2))
127 #define HMC6301_BBAMP_SELFM HMC630X_PARAM(7, NO_OS_BIT(1))
128 #define HMC6301_FM_PWRDN HMC630X_PARAM(7, NO_OS_BIT(0))
129 
130 /* ROW8 */
131 #define HMC6300_IFVGA_BIAS HMC630X_PARAM(8, NO_OS_GENMASK(7, 4))
132 #define HMC6300_IF_UPMIXER_TUNE HMC630X_PARAM(8, NO_OS_GENMASK(3, 0))
133 
134 #define HMC6301_LNA_BIAS HMC630X_PARAM(8, NO_OS_GENMASK(7, 5))
135 #define HMC6301_LNA_GAIN HMC630X_PARAM(8, NO_OS_GENMASK(4, 3))
136 #define HMC6301_IFVGA_Q_CNTRL HMC630X_PARAM(8, NO_OS_GENMASK(2, 0))
137 
138 /* ROW9*/
139 #define HMC6300_IFVGA_Q_CNTRL HMC630X_PARAM(9, NO_OS_GENMASK(7, 5))
140 
141 #define HMC6301_ENANAV_LNA HMC630X_PARAM(9, NO_OS_BIT(7))
142 #define HMC6301_ENBAR_TEMPS HMC630X_PARAM(9, NO_OS_BIT(6))
143 #define HMC6301_EN_TEMPFLASH HMC630X_PARAM(9, NO_OS_BIT(5))
144 #define HMC6301_EN_SEP_IFMIX_PWRDN_Q HMC630X_PARAM(9, NO_OS_BIT(4))
145 
146 /* ROW10 */
147 #define HMC6300_ENABLE_FM HMC630X_PARAM(10, NO_OS_BIT(7))
148 #define HMC6300_IF_REFSEL HMC630X_PARAM(10, NO_OS_BIT(6))
149 #define HMC6300_BG_MONITOR HMC630X_PARAM(10, NO_OS_BIT(5))
150 #define HMC6300_ENDIG_IFVGA_GAIN_CONTROL HMC630X_PARAM(10, NO_OS_BIT(4))
151 #define HMC6300_IPC_PWRDN HMC630X_PARAM(10, NO_OS_BIT(3))
152 #define HMC6300_IF_BGMUX_PWRDN HMC630X_PARAM(10, NO_OS_BIT(2))
153 #define HMC6300_UPMIX_CAL_PWRDN HMC630X_PARAM(10, NO_OS_BIT(1))
154 #define HMC6300_TEMPSENSOR_PWRDN HMC630X_PARAM(10, NO_OS_BIT(0))
155 
156 /* ROW11 */
157 #define HMC6300_RFVGAGAIN HMC630X_PARAM(11, NO_OS_GENMASK(7, 4))
158 #define HMC6300_ENRFVGA_ANA HMC630X_PARAM(11, NO_OS_BIT(3))
159 #define HMC6300_RFVGA_ICTRL HMC630X_PARAM(11, NO_OS_GENMASK(2, 0))
160 
161 /* ROW12 */
162 #define HMC6300_UPMIX_CAL HMC630X_PARAM(12, NO_OS_GENMASK(7, 0))
163 
164 /* ROW16 */
165 #define HMC630X_BYP_SYNTH_LDO HMC630X_PARAM(16, NO_OS_BIT(7))
166 #define HMC630X_EN_CPSHORT HMC630X_PARAM(16, NO_OS_BIT(6))
167 #define HMC630X_EN_CPCMFB HMC630X_PARAM(16, NO_OS_BIT(5))
168 #define HMC630X_EN_CP_DUMP HMC630X_PARAM(16, NO_OS_BIT(4))
169 #define HMC630X_EN_CPTRIST HMC630X_PARAM(16, NO_OS_BIT(3))
170 #define HMC630X_EN_CP HMC630X_PARAM(16, NO_OS_BIT(2))
171 #define HMC630X_EN_SYNTH_LDO HMC630X_PARAM(16, NO_OS_BIT(1))
172 #define HMC630X_ENBAR_SYNTHBG HMC630X_PARAM(16, NO_OS_BIT(0))
173 
174 /* ROW17 */
175 #define HMC630X_EN_LOCKD_CLK HMC630X_PARAM(17, NO_OS_BIT(7))
176 #define HMC630X_EN_TEST_DIVOUT HMC630X_PARAM(17, NO_OS_BIT(6))
177 #define HMC630X_EN_VTUNE_FLASH HMC630X_PARAM(17, NO_OS_BIT(5))
178 #define HMC630X_EN_REBUF_DC HMC630X_PARAM(17, NO_OS_BIT(4))
179 #define HMC630X_EN_REFBUF HMC630X_PARAM(17, NO_OS_BIT(3))
180 #define HMC630X_EN_STICK_DIV HMC630X_PARAM(17, NO_OS_BIT(2))
181 #define HMC630X_EN_FBDIV_CML2CMOS HMC630X_PARAM(17, NO_OS_BIT(1))
182 #define HMC630X_EN_FBDIV HMC630X_PARAM(17, NO_OS_BIT(0))
183 
184 /* ROW18 */
185 #define HMC630X_EN_NB250M HMC630X_PARAM(18, NO_OS_BIT(6))
186 #define HMC630X_BYP_VCO_LDO HMC630X_PARAM(18, NO_OS_BIT(5))
187 #define HMC630X_EN_EXTLO HMC630X_PARAM(18, NO_OS_BIT(4))
188 #define HMC630X_EN_VCOPK HMC630X_PARAM(18, NO_OS_BIT(3))
189 #define HMC630X_EN_VCO HMC630X_PARAM(18, NO_OS_BIT(2))
190 #define HMC630X_EN_VCO_REG HMC630X_PARAM(18, NO_OS_BIT(1))
191 #define HMC630X_ENBAR_VCOGB HMC630X_PARAM(18, NO_OS_BIT(0))
192 
193 /* ROW19 */
194 #define HMC630X_REFSEL_SYNTHBG HMC630X_PARAM(19, NO_OS_BIT(1))
195 #define HMC630X_MUXREF HMC630X_PARAM(19, NO_OS_BIT(0))
196 
197 /* ROW20 */
198 #define HMC630X_FBDIV_CODE HMC630X_PARAM(20, NO_OS_GENMASK(6, 0))
199 
200 /* ROW21 */
201 #define HMC630X_REFSEL_VCOBG HMC630X_PARAM(21, NO_OS_BIT(4))
202 #define HMC630X_VCO_BIASTRIM HMC630X_PARAM(21, NO_OS_GENMASK(3, 0))
203 
204 /* ROW22 */
205 #define HMC630X_VCO_BANDSEL HMC630X_PARAM(22, NO_OS_GENMASK(6, 0))
206 
207 /* ROW23 */
208 #define HMC630X_ICP_BIASTRIM HMC630X_PARAM(23, NO_OS_GENMASK(7, 5))
209 #define HMC630X_VCO_OFFSET HMC630X_PARAM(23, NO_OS_GENMASK(4, 0))
210 
211 /* ROW24 */
212 #define HMC630X_LOCKDET HMC630X_PARAM(24, NO_OS_BIT(3))
213 #define HMC630X_DN HMC630X_PARAM(24, NO_OS_BIT(2))
214 #define HMC630X_UP HMC630X_PARAM(24, NO_OS_BIT(1))
215 #define HMC630X_CENTER HMC630X_PARAM(24, NO_OS_BIT(0))
216 
217 /* ROW25 */
218 #define HMC630X_VTUNE_FLASHP HMC630X_PARAM(25, NO_OS_GENMASK(7, 0))
219 
220 /* ROW26 */
221 #define HMC630X_VTUNE_FLASHN HMC630X_PARAM(26, NO_OS_GENMASK(7, 0))
222 
223 /* ROW27 */
224 #define HMC630X_TEMPS HMC630X_PARAM(27, NO_OS_GENMASK(4, 0))
225 
226 /* Devices supported by this driver. */
230 };
231 
232 /* Possible values for receiver LNA attenuator. */
238 };
239 
240 /* Possible baseband attenuation values. */
246 };
247 
248 /* Possible baseband fine attenuation adjustment values. */
258 };
259 
260 /* Possible values for the low-pass corner of the baseband amplifiers. */
266 };
267 
268 /* Possible values for the high-pass corner of the baseband amplifiers. */
273  HMC6301_BB_HPC_RESERVED /* Do not use. */
274 };
275 
276 /* Possible values for the external reference clock. */
282 };
283 
284 struct hmc6300_attr {
285  uint8_t rf_attn;
286 };
287 
288 struct hmc6301_attr {
296 };
297 
298 /* Initialization parameters for hmc6300_init(). */
301  enum hmc630x_ref_clk ref_clk; /* Reference clock value. */
302  struct no_os_gpio_init_param en; /* EN GPIO signal of the digital interface. */
304  clk; /* CLK GPIO signal of the digital interface. */
306  data; /* DATA GPIO signal of the digital interface. */
308  scanout; /* SCANOUT GPIO signal of the digital interface. */
309  bool enabled;
310  bool temp_en;
311  uint64_t vco;
312  uint8_t if_attn;
313  union {
314  struct hmc6300_attr tx;
315  struct hmc6301_attr rx;
316  };
317 };
318 
319 struct hmc630x_dev;
320 struct hmc630x_vco;
321 
322 /* Device driver init/remove API. */
323 int hmc630x_init(struct hmc630x_dev **dev, struct hmc630x_init_param *init);
324 int hmc630x_remove(struct hmc630x_dev *dev);
325 enum hmc630x_type hmc630x_type(struct hmc630x_dev *dev);
326 
327 /* Register access API. */
328 int hmc630x_write_row(struct hmc630x_dev *dev, uint8_t row, uint8_t val);
329 int hmc630x_read_row(struct hmc630x_dev *dev, uint8_t row, uint8_t *val);
330 int hmc630x_write(struct hmc630x_dev *dev, uint16_t param, uint8_t val);
331 int hmc630x_read(struct hmc630x_dev *dev, uint16_t param, uint8_t *val);
332 int hmc630x_write_regmap(struct hmc630x_dev *dev, const uint8_t *regmap);
333 int hmc630x_read_regmap(struct hmc630x_dev *dev, uint8_t *regmap);
334 
335 /* hmc6300/hmc6301 API. */
336 int hmc630x_set_temp_en(struct hmc630x_dev *dev, bool enable);
337 int hmc630x_get_temp_en(struct hmc630x_dev *dev, bool *enable);
338 int hmc630x_get_temp(struct hmc630x_dev *dev, uint8_t *temp);
339 int hmc630x_set_enable(struct hmc630x_dev *dev, bool enable);
340 int hmc630x_get_enable(struct hmc630x_dev *dev, bool *enable);
341 int hmc630x_set_if_attn(struct hmc630x_dev *dev, uint8_t attn);
342 int hmc630x_get_if_attn(struct hmc630x_dev *dev, uint8_t *attn);
343 int hmc630x_set_vco(struct hmc630x_dev *dev, uint64_t frequency);
344 int hmc630x_get_vco(struct hmc630x_dev *dev, uint64_t *frequency);
345 int hmc630x_get_avail_vco(struct hmc630x_dev *dev, const uint64_t **avail,
346  uint8_t *avail_num);
347 
348 /* hmc6300-only API. */
349 int hmc6300_set_fm_en(struct hmc630x_dev *dev, bool enable);
350 int hmc6300_get_fm_en(struct hmc630x_dev *dev, bool *enable);
351 int hmc6300_set_rf_attn(struct hmc630x_dev *dev, uint8_t attn);
352 int hmc6300_get_rf_attn(struct hmc630x_dev *dev, uint8_t *attn);
353 
354 /* hmc6301-only API. */
355 int hmc6301_set_lna_gain(struct hmc630x_dev *dev, enum hmc6301_lna_attn gain);
356 int hmc6301_get_lna_gain(struct hmc630x_dev *dev, enum hmc6301_lna_attn *gain);
357 int hmc6301_set_bb_attn(struct hmc630x_dev *dev, enum hmc6301_bb_attn attn1,
358  enum hmc6301_bb_attn attn2);
359 int hmc6301_get_bb_attn(struct hmc630x_dev *dev, enum hmc6301_bb_attn *attn1,
360  enum hmc6301_bb_attn *attn2);
361 int hmc6301_set_bb_attn_fine(struct hmc630x_dev *dev,
362  enum hmc6301_bb_attn_fine attn_i,
363  enum hmc6301_bb_attn_fine attn_q);
364 int hmc6301_get_bb_attn_fine(struct hmc630x_dev *dev,
365  enum hmc6301_bb_attn_fine *attn_i,
366  enum hmc6301_bb_attn_fine *attn_q);
367 int hmc6301_set_bb_lpc_hpc(struct hmc630x_dev *dev, enum hmc6301_bb_lpc lpc,
368  enum hmc6301_bb_hpc hpc);
369 int hmc6301_get_bb_lpc_hpc(struct hmc630x_dev *dev, enum hmc6301_bb_lpc *lpc,
370  enum hmc6301_bb_hpc *hpc);
371 
372 #endif
HMC6300_BITBANG_DELAY_US
#define HMC6300_BITBANG_DELAY_US
Definition: hmc630x.c:52
HMC6301_BBAMP_ATTEN2
#define HMC6301_BBAMP_ATTEN2
Definition: hmc630x.h:83
hmc630x_init_param::rx
struct hmc6301_attr rx
Definition: hmc630x.h:315
hmc630x_set_vco
int hmc630x_set_vco(struct hmc630x_dev *dev, uint64_t frequency)
Definition: hmc630x.c:749
HMC6300_DIVIDER_PWRDN
#define HMC6300_DIVIDER_PWRDN
Definition: hmc630x.h:101
HMC6301_BBAMP_ATTEN1
#define HMC6301_BBAMP_ATTEN1
Definition: hmc630x.h:70
hmc630x_set_if_attn
int hmc630x_set_if_attn(struct hmc630x_dev *dev, uint8_t attn)
Definition: hmc630x.c:681
hmc630x_remove
int hmc630x_remove(struct hmc630x_dev *dev)
Definition: hmc630x.c:260
no_os_alloc.h
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:85
hmc630x_init_param::enabled
bool enabled
Definition: hmc630x.h:309
hmc630x_remove
int hmc630x_remove(struct hmc630x_dev *dev)
Definition: hmc630x.c:260
hmc630x_init_param
Definition: hmc630x.h:299
HMC6301_BB_LPC_1400MHz
@ HMC6301_BB_LPC_1400MHz
Definition: hmc630x.h:262
hmc6301_attr
Definition: hmc630x.h:288
hmc630x_init_param::temp_en
bool temp_en
Definition: hmc630x.h:310
hmc630x_read
int hmc630x_read(struct hmc630x_dev *dev, uint16_t param, uint8_t *value)
Definition: hmc630x.c:436
hmc630x_init
int hmc630x_init(struct hmc630x_dev **dev, struct hmc630x_init_param *init)
Definition: hmc630x.c:115
HMC6300_TRIPLER_PWRDN
#define HMC6300_TRIPLER_PWRDN
Definition: hmc630x.h:104
HMC630X_FRAME_SIZE
#define HMC630X_FRAME_SIZE
Definition: hmc630x.c:50
hmc630x_read
int hmc630x_read(struct hmc630x_dev *dev, uint16_t param, uint8_t *val)
Definition: hmc630x.c:436
hmc6300_attr::rf_attn
uint8_t rf_attn
Definition: hmc630x.h:285
HMC630X_FBDIV_CODE
#define HMC630X_FBDIV_CODE
Definition: hmc630x.h:198
HMC6301_BB_ATTN_18dB
@ HMC6301_BB_ATTN_18dB
Definition: hmc630x.h:245
HMC6301_BB_ATTN_FINE_1dB
@ HMC6301_BB_ATTN_FINE_1dB
Definition: hmc630x.h:254
HMC6301_BBAMP_SELFASTREC
#define HMC6301_BBAMP_SELFASTREC
Definition: hmc630x.h:92
hmc6301_set_lna_gain
int hmc6301_set_lna_gain(struct hmc630x_dev *dev, enum hmc6301_lna_attn gain)
Definition: hmc630x.c:871
hmc6301_attr::bb_attni_fine
enum hmc6301_bb_attn_fine bb_attni_fine
Definition: hmc630x.h:291
hmc6300_get_rf_attn
int hmc6300_get_rf_attn(struct hmc630x_dev *dev, uint8_t *attn)
Definition: hmc630x.c:736
no_os_gpio_get_value
int32_t no_os_gpio_get_value(struct no_os_gpio_desc *desc, uint8_t *value)
Get the value of the specified GPIO.
Definition: no_os_gpio.c:227
hmc6300_set_rf_attn
int hmc6300_set_rf_attn(struct hmc630x_dev *dev, uint8_t attn)
Definition: hmc630x.c:721
hmc6301_get_bb_lpc_hpc
int hmc6301_get_bb_lpc_hpc(struct hmc630x_dev *dev, enum hmc6301_bb_lpc *lpc, enum hmc6301_bb_hpc *hpc)
Definition: hmc630x.c:1008
no_os_delay.h
Header file of Delay functions.
HMC6301_BB_LPC_500MHz
@ HMC6301_BB_LPC_500MHz
Definition: hmc630x.h:264
HMC6301_BB_LPC_200MHz
@ HMC6301_BB_LPC_200MHz
Definition: hmc630x.h:265
HMC6301_BB_ATTN_6dB
@ HMC6301_BB_ATTN_6dB
Definition: hmc630x.h:244
hmc630x_init_param::data
struct no_os_gpio_init_param data
Definition: hmc630x.h:305
HMC630X_ARRAY_ADDRESS_MASK
#define HMC630X_ARRAY_ADDRESS_MASK
Definition: hmc630x.c:45
hmc6301_attr::bb_attnq_fine
enum hmc6301_bb_attn_fine bb_attnq_fine
Definition: hmc630x.h:292
HMC6300_TEMPSENSOR_PWRDN
#define HMC6300_TEMPSENSOR_PWRDN
Definition: hmc630x.h:154
hmc630x_read_row
int hmc630x_read_row(struct hmc630x_dev *dev, uint8_t row, uint8_t *val)
Definition: hmc630x.c:330
HMC6301_BB_HPC_45kHz
@ HMC6301_BB_HPC_45kHz
Definition: hmc630x.h:270
hmc630x_set_vco
int hmc630x_set_vco(struct hmc630x_dev *dev, uint64_t frequency)
Definition: hmc630x.c:749
hmc6301_bb_hpc
hmc6301_bb_hpc
Definition: hmc630x.h:269
NO_OS_GPIO_HIGH
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:123
HMC6300_IFVGA_VGA_ADJ
#define HMC6300_IFVGA_VGA_ADJ
Definition: hmc630x.h:123
HMC630X_VCO_BANDSEL
#define HMC630X_VCO_BANDSEL
Definition: hmc630x.h:205
hmc630x_read_row
int hmc630x_read_row(struct hmc630x_dev *dev, uint8_t row, uint8_t *val)
Definition: hmc630x.c:330
hmc6301_bb_lpc
hmc6301_bb_lpc
Definition: hmc630x.h:261
no_os_calloc
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:60
no_os_gpio_direction_input
int32_t no_os_gpio_direction_input(struct no_os_gpio_desc *desc)
Enable the input direction of the specified GPIO.
Definition: no_os_gpio.c:130
send
int32_t send(struct mqtt_desc *mqtt)
Definition: basic_example.c:252
HMC6301_BB_ATTN_12dB
@ HMC6301_BB_ATTN_12dB
Definition: hmc630x.h:243
hmc6301_bb_attn
hmc6301_bb_attn
Definition: hmc630x.h:241
hmc630x_vco
Definition: hmc630x.c:56
HMC6301_BB_ATTN_FINE_RESERVED1
@ HMC6301_BB_ATTN_FINE_RESERVED1
Definition: hmc630x.h:253
HMC6300_ADDRESS
#define HMC6300_ADDRESS
Definition: hmc630x.c:48
HMC6301_IFMIX_PWRDN_Q
#define HMC6301_IFMIX_PWRDN_Q
Definition: hmc630x.h:67
bool
bool
Definition: common.h:54
hmc630x_get_vco
int hmc630x_get_vco(struct hmc630x_dev *dev, uint64_t *frequency)
Definition: hmc630x.c:817
HMC6300_IFVGA_PWRDN
#define HMC6300_IFVGA_PWRDN
Definition: hmc630x.h:100
hmc6301_attr::bb_attn1
enum hmc6301_bb_attn bb_attn1
Definition: hmc630x.h:289
HMC6301_BB_LPC_300MHz
@ HMC6301_BB_LPC_300MHz
Definition: hmc630x.h:263
HMC6300_UPMIXER_PWRDN
#define HMC6300_UPMIXER_PWRDN
Definition: hmc630x.h:99
NO_OS_GPIO_LOW
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:121
hmc630x_type
enum hmc630x_type hmc630x_type(struct hmc630x_dev *dev)
Definition: hmc630x.c:290
HMC6300_PA_SEP_PA_PWRDWN_FAST
#define HMC6300_PA_SEP_PA_PWRDWN_FAST
Definition: hmc630x.h:76
HMC630X_RW_MASK
#define HMC630X_RW_MASK
Definition: hmc630x.c:46
hmc630x_get_temp
int hmc630x_get_temp(struct hmc630x_dev *dev, uint8_t *temp)
Definition: hmc630x.c:544
hmc6301_get_lna_gain
int hmc6301_get_lna_gain(struct hmc630x_dev *dev, enum hmc6301_lna_attn *gain)
Definition: hmc630x.c:884
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:132
hmc6301_set_bb_attn_fine
int hmc6301_set_bb_attn_fine(struct hmc630x_dev *dev, enum hmc6301_bb_attn_fine attn_i, enum hmc6301_bb_attn_fine attn_q)
Definition: hmc630x.c:940
HMC6301_IFVGA_VGA_ADJ
#define HMC6301_IFVGA_VGA_ADJ
Definition: hmc630x.h:114
hmc630x_dev::scanout
struct no_os_gpio_desc * scanout
Definition: hmc630x.c:70
no_os_field_prep
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
HMC6301_BB_ATTN_FINE_2dB
@ HMC6301_BB_ATTN_FINE_2dB
Definition: hmc630x.h:252
hmc630x_init_param::ref_clk
enum hmc630x_ref_clk ref_clk
Definition: hmc630x.h:301
HMC6301_BB_ATTN_FINE_3dB
@ HMC6301_BB_ATTN_FINE_3dB
Definition: hmc630x.h:256
HMC6301_LNA_GAIN
#define HMC6301_LNA_GAIN
Definition: hmc630x.h:135
HMC630X_ROW
#define HMC630X_ROW(param)
Definition: hmc630x.h:49
hmc6301_get_lna_gain
int hmc6301_get_lna_gain(struct hmc630x_dev *dev, enum hmc6301_lna_attn *gain)
Definition: hmc630x.c:884
hmc630x_init_param::clk
struct no_os_gpio_init_param clk
Definition: hmc630x.h:303
hmc630x_init_param::if_attn
uint8_t if_attn
Definition: hmc630x.h:312
hmc6300_attr
Definition: hmc630x.h:284
hmc6301_set_bb_lpc_hpc
int hmc6301_set_bb_lpc_hpc(struct hmc630x_dev *dev, enum hmc6301_bb_lpc lpc, enum hmc6301_bb_hpc hpc)
Definition: hmc630x.c:988
HMC6301_BBAMP_SELL_ASK
#define HMC6301_BBAMP_SELL_ASK
Definition: hmc630x.h:71
hmc630x.h
hmc6300 and hmc6301 device driver header.
hmc630x_get_avail_vco
int hmc630x_get_avail_vco(struct hmc630x_dev *dev, const uint64_t **avail, uint8_t *avail_num)
Definition: hmc630x.c:858
hmc630x_write
int hmc630x_write(struct hmc630x_dev *dev, uint16_t param, uint8_t value)
Definition: hmc630x.c:419
HMC630X_TEMPS
#define HMC630X_TEMPS
Definition: hmc630x.h:224
hmc630x_dev
Definition: hmc630x.c:63
hmc6300_get_fm_en
int hmc6300_get_fm_en(struct hmc630x_dev *dev, bool *enable)
Definition: hmc630x.c:563
HMC6300_RFVGA_PWRDN
#define HMC6300_RFVGA_PWRDN
Definition: hmc630x.h:103
hmc630x_set_temp_en
int hmc630x_set_temp_en(struct hmc630x_dev *dev, bool enable)
Definition: hmc630x.c:487
HMC6300_RFVGAGAIN
#define HMC6300_RFVGAGAIN
Definition: hmc630x.h:157
hmc630x_get_temp_en
int hmc630x_get_temp_en(struct hmc630x_dev *dev, bool *enable)
Definition: hmc630x.c:512
HMC6301_BB_HPC_350kHz
@ HMC6301_BB_HPC_350kHz
Definition: hmc630x.h:272
hmc630x_read_regmap
int hmc630x_read_regmap(struct hmc630x_dev *dev, uint8_t *regmap)
Definition: hmc630x.c:453
HMC6301_ENBAR_TEMPS
#define HMC6301_ENBAR_TEMPS
Definition: hmc630x.h:142
no_os_gpio_remove
int32_t no_os_gpio_remove(struct no_os_gpio_desc *desc)
Free the resources allocated by no_os_gpio_get().
Definition: no_os_gpio.c:110
HMC6301_BB_ATTN_FINE_RESERVED2
@ HMC6301_BB_ATTN_FINE_RESERVED2
Definition: hmc630x.h:257
HMC6301_ASK_PWRDN
#define HMC6301_ASK_PWRDN
Definition: hmc630x.h:69
HMC6300_REF_CLK_75MHz
@ HMC6300_REF_CLK_75MHz
Definition: hmc630x.h:279
HMC6301_LNA_PWRDWN
#define HMC6301_LNA_PWRDWN
Definition: hmc630x.h:53
HMC6300_REF_CLK_71p42857MHz
@ HMC6300_REF_CLK_71p42857MHz
Definition: hmc630x.h:278
hmc6300_get_rf_attn
int hmc6300_get_rf_attn(struct hmc630x_dev *dev, uint8_t *attn)
Definition: hmc630x.c:736
HMC6300_PA_PWRDN
#define HMC6300_PA_PWRDN
Definition: hmc630x.h:102
HMC6300_ENABLE_FM
#define HMC6300_ENABLE_FM
Definition: hmc630x.h:147
hmc6300_set_rf_attn
int hmc6300_set_rf_attn(struct hmc630x_dev *dev, uint8_t attn)
Definition: hmc630x.c:721
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:102
hmc630x_type
hmc630x_type
Definition: hmc630x.h:227
HMC630X_MASK
#define HMC630X_MASK(param)
Definition: hmc630x.h:50
HMC6301_LNA_ATTN_12dB
@ HMC6301_LNA_ATTN_12dB
Definition: hmc630x.h:236
HMC6300_POWER_DET_PWRDN
#define HMC6300_POWER_DET_PWRDN
Definition: hmc630x.h:79
hmc630x_set_if_attn
int hmc630x_set_if_attn(struct hmc630x_dev *dev, uint8_t attn)
Definition: hmc630x.c:681
hmc6300_set_fm_en
int hmc6300_set_fm_en(struct hmc630x_dev *dev, bool enable)
Definition: hmc630x.c:550
HMC6301_LNA_ATTN_18dB
@ HMC6301_LNA_ATTN_18dB
Definition: hmc630x.h:237
hmc6301_bb_attn_fine
hmc6301_bb_attn_fine
Definition: hmc630x.h:249
hmc6301_get_bb_attn
int hmc6301_get_bb_attn(struct hmc630x_dev *dev, enum hmc6301_bb_attn *attn1, enum hmc6301_bb_attn *attn2)
Definition: hmc630x.c:920
hmc6300_get_fm_en
int hmc6300_get_fm_en(struct hmc630x_dev *dev, bool *enable)
Definition: hmc630x.c:563
hmc630x_vco::fbdiv
uint8_t * fbdiv
Definition: hmc630x.c:58
no_os_gpio_get
int32_t no_os_gpio_get(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Obtain the GPIO decriptor.
Definition: no_os_gpio.c:55
hmc630x_get_enable
int hmc630x_get_enable(struct hmc630x_dev *dev, bool *enable)
Definition: hmc630x.c:625
HMC6301_BB_HPC_1600kHz
@ HMC6301_BB_HPC_1600kHz
Definition: hmc630x.h:271
hmc6301_attr::bb_hpc
enum hmc6301_bb_hpc bb_hpc
Definition: hmc630x.h:295
hmc630x_init_param::type
enum hmc630x_type type
Definition: hmc630x.h:300
HMC6301_ADDRESS
#define HMC6301_ADDRESS
Definition: hmc630x.c:49
hmc630x_get_if_attn
int hmc630x_get_if_attn(struct hmc630x_dev *dev, uint8_t *attn)
Definition: hmc630x.c:701
HMC6301_IF_BGMUX_PWRDN
#define HMC6301_IF_BGMUX_PWRDN
Definition: hmc630x.h:68
hmc630x_init_param::en
struct no_os_gpio_init_param en
Definition: hmc630x.h:302
HMC6300_REF_CLK_154p2857MHz
@ HMC6300_REF_CLK_154p2857MHz
Definition: hmc630x.h:281
HMC6300
@ HMC6300
Definition: hmc630x.h:228
hmc630x_read_regmap
int hmc630x_read_regmap(struct hmc630x_dev *dev, uint8_t *regmap)
Definition: hmc630x.c:453
HMC6301_BB_ATTN_0dB
@ HMC6301_BB_ATTN_0dB
Definition: hmc630x.h:242
no_os_field_get
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
HMC6301_BBAMP_SELBW
#define HMC6301_BBAMP_SELBW
Definition: hmc630x.h:91
HMC6300_PA_PWRDWN_FAST
#define HMC6300_PA_PWRDWN_FAST
Definition: hmc630x.h:77
HMC6301_BB_ATTN_FINE_4dB
@ HMC6301_BB_ATTN_FINE_4dB
Definition: hmc630x.h:251
hmc630x_get_avail_vco
int hmc630x_get_avail_vco(struct hmc630x_dev *dev, const uint64_t **avail, uint8_t *avail_num)
Definition: hmc630x.c:858
hmc6301_set_bb_attn
int hmc6301_set_bb_attn(struct hmc630x_dev *dev, enum hmc6301_bb_attn attn1, enum hmc6301_bb_attn attn2)
Definition: hmc630x.c:897
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:75
hmc630x_write_regmap
int hmc630x_write_regmap(struct hmc630x_dev *dev, const uint8_t *regmap)
Definition: hmc630x.c:383
hmc630x_write
int hmc630x_write(struct hmc630x_dev *dev, uint16_t param, uint8_t val)
Definition: hmc630x.c:419
hmc630x_get_if_attn
int hmc630x_get_if_attn(struct hmc630x_dev *dev, uint8_t *attn)
Definition: hmc630x.c:701
HMC630X_LOCKDET
#define HMC630X_LOCKDET
Definition: hmc630x.h:212
hmc630x_vco::entries
uint8_t entries
Definition: hmc630x.c:59
hmc630x_ref_clk
hmc630x_ref_clk
Definition: hmc630x.h:277
hmc6301_get_bb_attn_fine
int hmc6301_get_bb_attn_fine(struct hmc630x_dev *dev, enum hmc6301_bb_attn_fine *attn_i, enum hmc6301_bb_attn_fine *attn_q)
Definition: hmc630x.c:967
hmc630x_set_temp_en
int hmc630x_set_temp_en(struct hmc630x_dev *dev, bool enable)
Definition: hmc630x.c:487
no_os_udelay
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:120
hmc630x_dev::address
uint8_t address
Definition: hmc630x.c:65
HMC6301_IPC_PWRDWN
#define HMC6301_IPC_PWRDWN
Definition: hmc630x.h:66
NULL
#define NULL
Definition: wrapper.h:64
hmc630x_write_regmap
int hmc630x_write_regmap(struct hmc630x_dev *dev, const uint8_t *regmap)
Definition: hmc630x.c:383
hmc630x_dev::en
struct no_os_gpio_desc * en
Definition: hmc630x.c:67
hmc6301_set_lna_gain
int hmc6301_set_lna_gain(struct hmc630x_dev *dev, enum hmc6301_lna_attn gain)
Definition: hmc630x.c:871
HMC6301_BB_ATTN_FINE_5dB
@ HMC6301_BB_ATTN_FINE_5dB
Definition: hmc630x.h:255
no_os_gpio_set_value
int32_t no_os_gpio_set_value(struct no_os_gpio_desc *desc, uint8_t value)
Set the value of the specified GPIO.
Definition: no_os_gpio.c:203
hmc630x_get_temp
int hmc630x_get_temp(struct hmc630x_dev *dev, uint8_t *temp)
Definition: hmc630x.c:544
hmc6301_get_bb_attn
int hmc6301_get_bb_attn(struct hmc630x_dev *dev, enum hmc6301_bb_attn *attn1, enum hmc6301_bb_attn *attn2)
Definition: hmc630x.c:920
hmc6301_set_bb_attn_fine
int hmc6301_set_bb_attn_fine(struct hmc630x_dev *dev, enum hmc6301_bb_attn_fine attn_i, enum hmc6301_bb_attn_fine attn_q)
Definition: hmc630x.c:940
hmc6301_get_bb_lpc_hpc
int hmc6301_get_bb_lpc_hpc(struct hmc630x_dev *dev, enum hmc6301_bb_lpc *lpc, enum hmc6301_bb_hpc *hpc)
Definition: hmc630x.c:1008
hmc630x_vco::freqs
uint64_t * freqs
Definition: hmc630x.c:57
hmc6301_attr::bb_lpc
enum hmc6301_bb_lpc bb_lpc
Definition: hmc630x.h:294
HMC6301
@ HMC6301
Definition: hmc630x.h:229
hmc630x_dev::data
struct no_os_gpio_desc * data
Definition: hmc630x.c:69
hmc630x_set_enable
int hmc630x_set_enable(struct hmc630x_dev *dev, bool enable)
Definition: hmc630x.c:576
HMC6300_SETTLING_DELAY_MS
#define HMC6300_SETTLING_DELAY_MS
Definition: hmc630x.c:53
HMC6301_BBAMP_ATTENFI
#define HMC6301_BBAMP_ATTENFI
Definition: hmc630x.h:81
HMC6301_BB_ATTN_FINE_0dB
@ HMC6301_BB_ATTN_FINE_0dB
Definition: hmc630x.h:250
no_os_gpio.h
Header file of GPIO Interface.
hmc630x_dev::vco
struct hmc630x_vco vco
Definition: hmc630x.c:66
HMC630X_ADDRESS_MASK
#define HMC630X_ADDRESS_MASK
Definition: hmc630x.c:47
HMC6301_LNA_ATTN_0dB
@ HMC6301_LNA_ATTN_0dB
Definition: hmc630x.h:234
hmc630x_dev::clk
struct no_os_gpio_desc * clk
Definition: hmc630x.c:68
hmc6301_set_bb_lpc_hpc
int hmc6301_set_bb_lpc_hpc(struct hmc630x_dev *dev, enum hmc6301_bb_lpc lpc, enum hmc6301_bb_hpc hpc)
Definition: hmc630x.c:988
hmc6300_set_fm_en
int hmc6300_set_fm_en(struct hmc630x_dev *dev, bool enable)
Definition: hmc630x.c:550
HMC630X_EN_SYNTH_LDO
#define HMC630X_EN_SYNTH_LDO
Definition: hmc630x.h:171
hmc630x_init
int hmc630x_init(struct hmc630x_dev **dev, struct hmc630x_init_param *init)
Definition: hmc630x.c:115
hmc630x_init_param::tx
struct hmc6300_attr tx
Definition: hmc630x.h:314
hmc630x_get_enable
int hmc630x_get_enable(struct hmc630x_dev *dev, bool *enable)
Definition: hmc630x.c:625
no_os_util.h
Header file of utility functions.
hmc630x_init_param::vco
uint64_t vco
Definition: hmc630x.h:311
HMC6300_REF_CLK_142p8571MHz
@ HMC6300_REF_CLK_142p8571MHz
Definition: hmc630x.h:280
hmc630x_dev::type
enum hmc630x_type type
Definition: hmc630x.c:64
HMC6301_BB_HPC_RESERVED
@ HMC6301_BB_HPC_RESERVED
Definition: hmc630x.h:273
hmc630x_get_vco
int hmc630x_get_vco(struct hmc630x_dev *dev, uint64_t *frequency)
Definition: hmc630x.c:817
HMC6300_EN_TEMPFLASH
#define HMC6300_EN_TEMPFLASH
Definition: hmc630x.h:89
HMC6301_BBAMP_ATTENFQ
#define HMC6301_BBAMP_ATTENFQ
Definition: hmc630x.h:82
hmc6301_attr::bb_attn2
enum hmc6301_bb_attn bb_attn2
Definition: hmc630x.h:290
hmc6301_set_bb_attn
int hmc6301_set_bb_attn(struct hmc630x_dev *dev, enum hmc6301_bb_attn attn1, enum hmc6301_bb_attn attn2)
Definition: hmc630x.c:897
hmc630x_write_row
int hmc630x_write_row(struct hmc630x_dev *dev, uint8_t row, uint8_t val)
Definition: hmc630x.c:299
hmc630x_get_temp_en
int hmc630x_get_temp_en(struct hmc630x_dev *dev, bool *enable)
Definition: hmc630x.c:512
no_os_gpio_direction_output
int32_t no_os_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition: no_os_gpio.c:153
hmc6301_attr::lna_attn
enum hmc6301_lna_attn lna_attn
Definition: hmc630x.h:293
HMC6301_LNA_ATTN_6dB
@ HMC6301_LNA_ATTN_6dB
Definition: hmc630x.h:235
hmc6301_lna_attn
hmc6301_lna_attn
Definition: hmc630x.h:233
hmc630x_init_param::scanout
struct no_os_gpio_init_param scanout
Definition: hmc630x.h:307
hmc630x_set_enable
int hmc630x_set_enable(struct hmc630x_dev *dev, bool enable)
Definition: hmc630x.c:576
hmc6301_get_bb_attn_fine
int hmc6301_get_bb_attn_fine(struct hmc630x_dev *dev, enum hmc6301_bb_attn_fine *attn_i, enum hmc6301_bb_attn_fine *attn_q)
Definition: hmc630x.c:967
errno.h
Error macro definition for ARM Compiler.
HMC6300_IF_UPMIXER_PWRDN
#define HMC6300_IF_UPMIXER_PWRDN
Definition: hmc630x.h:105
hmc630x_write_row
int hmc630x_write_row(struct hmc630x_dev *dev, uint8_t row, uint8_t val)
Definition: hmc630x.c:299
HMC6301_EN_TEMPFLASH
#define HMC6301_EN_TEMPFLASH
Definition: hmc630x.h:143
HMC6300_DRIVER_PWRDN
#define HMC6300_DRIVER_PWRDN
Definition: hmc630x.h:98