feat: introduce pa_setting_t structure for power amplifier configuration

This commit is contained in:
2025-08-15 16:30:23 +08:00
parent 42e6c4d213
commit 70a51cdb5c
2 changed files with 73 additions and 15 deletions

View File

@ -163,6 +163,38 @@ struct packet_params_t {
}
};
struct pa_setting_t {
uint8_t pa_duty_cycle;
uint8_t hp_max;
uint8_t device_sel;
static constexpr pa_setting_t Default22dBm() {
return {0x04, 0x07, 0x00};
}
/**
* @note SetTxParams should be set to +22dBm
*/
static constexpr pa_setting_t Default20dBm() {
return {0x03, 0x05, 0x00};
}
/**
* @note SetTxParams should be set to +22dBm
*/
static constexpr pa_setting_t Default17dBm() {
return {0x02, 0x03, 0x00};
}
/**
* @note SetTxParams should be set to +14dBm
*/
static constexpr pa_setting_t Default14dBm() {
return {0x02, 0x02, 0x00};
}
static constexpr pa_setting_t Default() {
return Default22dBm();
}
};
inline const char *to_str(llcc68::TxRampTime ramp_time) {
switch (ramp_time) {
case llcc68::SET_RAMP_10U: