Skip to content

Commit 2f96cc9

Browse files
committed
firmware: post-rebase fixes
1 parent 7310183 commit 2f96cc9

4 files changed

Lines changed: 204 additions & 157 deletions

File tree

firmware/common/max283x.c

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,34 @@ void max283x_rx(max283x_driver_t* const drv)
385385
}
386386
}
387387

388+
/* Set MAX2831 receiver high-pass filter corner frequency in Hz */
389+
void max283x_set_rx_hpf_frequency(
390+
max283x_driver_t* const drv,
391+
const max283x_rx_hpf_freq_t freq)
392+
{
393+
#if !defined(PRALINE)
394+
(void) freq;
395+
#endif
396+
397+
switch (drv->type) {
398+
#if defined(PRALINE) || defined(UNIVERSAL)
399+
case MAX2831_VARIANT:
400+
max2831_set_rx_hpf_frequency(
401+
&drv->drv.max2831,
402+
(max2831_rx_hpf_freq_t) freq);
403+
break;
404+
#endif
405+
#if !defined(PRALINE) || defined(UNIVERSAL)
406+
case MAX2837_VARIANT:
407+
// unsupported
408+
break;
409+
case MAX2839_VARIANT:
410+
// unsupported
411+
break;
412+
#endif
413+
}
414+
}
415+
388416
void max283x_tx_calibration(max283x_driver_t* const drv)
389417
{
390418
switch (drv->type) {
@@ -395,10 +423,10 @@ void max283x_tx_calibration(max283x_driver_t* const drv)
395423
#endif
396424
#if !defined(PRALINE) || defined(UNIVERSAL)
397425
case MAX2837_VARIANT:
398-
// unsupported - uses max283x_set_mode
426+
// unsupported - use max283x_set_mode instead
399427
break;
400428
case MAX2839_VARIANT:
401-
// unsupported - uses max283x_set_mode
429+
// unsupported - use max283x_set_mode instead
402430
break;
403431
#endif
404432
}
@@ -414,10 +442,10 @@ void max283x_rx_calibration(max283x_driver_t* const drv)
414442
#endif
415443
#if !defined(PRALINE) || defined(UNIVERSAL)
416444
case MAX2837_VARIANT:
417-
// unsupported - uses max283x_set_mode
445+
// unsupported - use max283x_set_mode instead
418446
break;
419447
case MAX2839_VARIANT:
420-
// unsupported - uses max283x_set_mode
448+
// unsupported - use max283x_set_mode instead
421449
break;
422450
#endif
423451
}

firmware/common/max283x.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ typedef enum {
5252
MAX283x_MODE_CLKOUT,
5353
} max283x_mode_t;
5454

55+
typedef enum {
56+
MAX283x_RX_HPF_100_HZ = 0,
57+
MAX283x_RX_HPF_4_KHZ = 1,
58+
MAX283x_RX_HPF_30_KHZ = 2,
59+
MAX283x_RX_HPF_600_KHZ = 3,
60+
} max283x_rx_hpf_freq_t;
61+
5562
typedef enum {
5663
#if defined(PRALINE) || defined(UNIVERSAL)
5764
MAX2831_VARIANT,
@@ -113,6 +120,13 @@ bool max283x_set_txvga_gain(max283x_driver_t* const drv, const uint32_t gain_db)
113120

114121
void max283x_tx(max283x_driver_t* const drv);
115122
void max283x_rx(max283x_driver_t* const drv);
123+
124+
/* Set MAX2831 receiver high-pass filter corner frequency in Hz */
125+
void max283x_set_rx_hpf_frequency(
126+
max283x_driver_t* const drv,
127+
const max283x_rx_hpf_freq_t freq);
128+
129+
/* Perform MAX2831 TX and RX calibration. */
116130
void max283x_tx_calibration(max283x_driver_t* const drv);
117131
void max283x_rx_calibration(max283x_driver_t* const drv);
118132

0 commit comments

Comments
 (0)