AD9361 随笔记录 收发器fastlock相关的用户函数

29 篇文章 7 订阅
25 篇文章 49 订阅

代码取自no_os的ad9361_api.c文件。我们先来看看fastlock中发送部分的相关代码:

 


/**
 * Store TX fastlock profile.
 * To create a profile tune the synthesizer (ad9361_set_tx_lo_freq()) and then
 * call this function specifying the target profile number.
 * @param phy The AD9361 state structure.
 * @param profile The profile number (0 - 7).
 * 				  Accepted values:
 * 				   0 - 7
 * @return 0 in case of success, negative error code otherwise.
 */
int32_t ad9361_tx_fastlock_store(struct ad9361_rf_phy *phy, uint32_t profile)
{
	return ad9361_fastlock_store(phy, 1, profile);
}

/**
 * Recall specified TX fastlock profile.
 * When in fastlock pin select mode (init_param->tx_fastlock_pincontrol_enable),
 * the function needs to be called before then the pin-control can be used.
 * @param phy The AD9361 state structure.
 * @param profile The profile number (0 - 7).
 * 				  Accepted values:
 * 				   0 - 7
 * @return 0 in case of success, negative error code otherwise.
 */
int32_t ad9361_tx_fastlock_recall(struct ad9361_rf_phy *phy, uint32_t profile)
{
	return ad9361_fastlock_recall(phy, 1, profile);
}

/**
 * Load TX fastlock profile. A previously saved profile can be loaded in any
 * of the 8 available slots.
 * @param phy The AD9361 state structure.
 * @param profile The profile number (0 - 7).
 * 				  Accepted values:
 * 				   0 - 7
 * @param values Fastlock profile program data.
 * 				 Example:
 * 				  val0,val1,val2,聟,val15
 * @return 0 in case of success, negative error code otherwise.
 */
int32_t ad9361_tx_fastlock_load(struct ad9361_rf_phy *phy, uint32_t profile, uint8_t *values)
{
	return ad9361_fastlock_load(phy, 1, profile, values);
}

/**
 * Save TX fastlock profile. In order to use more than 8 Profiles, an existing
 * profile can be read back and stored by the user application.
 * @param phy The AD9361 state structure.
 * @param profile The profile number (0 - 7).
 * 				  Accepted values:
 * 				   0 - 7
 * @param values Fastlock profile program data.
 * @return 0 in case of success, negative error code otherwise.
 */
int32_t ad9361_tx_fastlock_save(struct ad9361_rf_phy *phy, uint32_t profile, uint8_t *values)
{
	return ad9361_fastlock_save(phy, 1, profile, values);
}

 

 

看到四个函数:ad9361_tx_fastlock_XXX

其中XXX 可以是:load,save,store,recall.

这里我们要知道三个对象:

用户程序USER_APP就是调用这些API函数的用户程序。

AD9361上的存储槽SLOT保存了FASTLOCK的配置。

AD9361的收发器,这个需要被配置。

三个关系如下图:

recall 是将slot制定序号profile的fastlock参数配置在收发器里。其中profile可以是0~7.

save 是将当前收发器fastlock参数的配置保存到profile是制定的slot里。其中profile可以是0~7.

如果我们要保存多于8个fast lock的fastlock参数配置,可以将slot指定序号profile的配置读出来保存在user_app的数据结构里。也就有了load和save.

load 从slot中取出制定profile的fastlock参数配置保存到用户程序。其中profile可以是0~7.

save是将用户程序的fastlock参数配置保存到slot制定的profile里。其中profile可以是0~7.

由于这些参数在从新开机或者上电时候就变得无效了,所以没有保存到文件的必要。如果要保存的fastlock配置不超过8个就可以用不到load和save函数。

 

 

 

 

 

  • 3
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值