Nordic Semiconductor nRF5 AirFuel SDK
version 2.2.0
|
#include <math.h>
#include "ptu_power_ctl.h"
#include "ptu_test_mux.h"
#include "ptu_registry.h"
#include "nrf_assert.h"
Go to the source code of this file.
Functions | |
API implementation | |
void | ptu_power_ctrl_adjust (void) |
Perform power control adjustments. | |
uint32_t | ptu_power_ctrl_set_poweramp_input (uint16_t level) |
Perform power control adjustments. More... | |
void | ptu_power_ctrl_set_disable_power_amplifier_adjustments (bool val) |
Enable/Disable adjustments of power amplifier (I_TX_COIL). More... | |
void | ptu_power_ctrl_set_itx_val (ptu_tester_command_t cmd) |
Handle PTU tester power adjustment command. More... | |
Static functions and variables | |
enum | power_transfer_substates_t { POWER_TRANSFER_SUBSTATE_1_OPTIMAL, POWER_TRANSFER_SUBSTATE_2_LOW, POWER_TRANSFER_SUBSTATE_3_HIGH } |
Definition of power transfer substates. More... | |
static bool | m_itx_adj_disabled = false |
static power_transfer_substates_t | m_substate |
static uint16_t | m_conn_handle_dominant |
static void | m_find_vrect_high_and_min (ptu_reg_item_t const *p_reg_item, uint16_t *p_vrect_high, uint16_t *p_vrect_min) |
Inspect registry item and find the current value of VRECT_MIN and VRECT_HIGH. More... | |
static void | m_update_power_amplifier_adjustment_step_size (ptu_reg_item_t const *p_reg_item, bool *p_reduced_positive_step_size, bool *p_reduced_negative_step_size) |
Inspect registry item and see if reduced step size is allowed for increase and/or decrease. More... | |
static void | m_update_power_amplifier_adjustment_step_size_for_dominant_pru (ptu_reg_item_t const *p_dominant_pru_reg_item, bool *p_reduced_positive_step_size, bool *p_reduced_negative_step_size) |
Inspect registry item for dominant PRU and see if reduced step size is allowed for negative and positive changes. More... | |
static void | m_pru_scan_all (bool *p_reduced_positive_step_size, bool *p_reduced_negative_step_size, bool *p_increased_step_size) |
Scan through dynamic and static parameters received from all connected PRUs. More... | |
static uint32_t | m_get_step_size (bool reduced_step_size, bool increased_step_size) |
Find step size to be used given permissions to use reduced and/or increased step size. More... | |
static uint32_t | m_poweramp_input_step_up (bool reduced_positive_step_size, bool increased_step_size) |
Increase PTU poweramp output. More... | |
static uint32_t | m_poweramp_input_step_down (bool reduced_negative_step_size, bool increased_step_size) |
Decrease PTU poweramp output. More... | |
Definition of power transfer substates.
Definition at line 28 of file ptu_power_ctl.c.
|
static |
Inspect registry item and find the current value of VRECT_MIN and VRECT_HIGH.
If the registry item has set the optional dynamic values of these variables, these should be used.
[in] | p_reg_item | Pointer to registry item to inspect. |
[out] | p_vrect_high | Pointer to vrect_high value. |
[out] | p_vrect_min | Pointer to vrect_min value. |
Definition at line 49 of file ptu_power_ctl.c.
|
static |
Inspect registry item and see if reduced step size is allowed for increase and/or decrease.
Will only set input parameters to true, never false.
[in] | p_reg_item | Pointer to registry item to inspect. |
[out] | p_reduced_positive_step_size | Pointer to bool saying whether positive step size should be reduced. |
[out] | p_reduced_negative_step_size | Pointer to bool saying whether negative step size should be reduced. |
Definition at line 74 of file ptu_power_ctl.c.
|
static |
Inspect registry item for dominant PRU and see if reduced step size is allowed for negative and positive changes.
Will only set input parameters to true, never false.
[in] | p_dominant_pru_reg_item | Pointer to dominant PRU registry item to inspect. |
[out] | p_reduced_positive_step_size | Pointer to bool saying whether positive step size should be reduced. |
[out] | p_reduced_negative_step_size | Pointer to bool saying whether negative step size should be reduced. |
Definition at line 101 of file ptu_power_ctl.c.
|
static |
Scan through dynamic and static parameters received from all connected PRUs.
Update following variables:
[out] | p_reduced_positive_step_size | Pointer to bool saying whether positive step size should be reduced |
[out] | p_reduced_negative_step_size | Pointer to bool saying whether negative step size should be reduced |
[out] | p_increased_step_size | Pointer to bool saying whether increased step size is allowed |
Definition at line 129 of file ptu_power_ctl.c.
|
static |
Find step size to be used given permissions to use reduced and/or increased step size.
reduced_step_size | Is reduced step size allowed? |
increased_step_size | Is increased step size allowed? |
Definition at line 200 of file ptu_power_ctl.c.
|
static |
Increase PTU poweramp output.
reduced_positive_step_size | Is step size reduced? |
increased_step_size | Is step size increased? |
Definition at line 221 of file ptu_power_ctl.c.
|
static |
Decrease PTU poweramp output.
reduced_negative_step_size | Is step size reduced? |
increased_step_size | Is step size increased? |
NRF_SUCCESS | if successful, otherwise an error code will be returned. |
Definition at line 255 of file ptu_power_ctl.c.
|
static |
Have we been told by PRU to only adjust poweramp input by test commands?
Definition at line 36 of file ptu_power_ctl.c.
|
static |
Current substate. Updated by pru_scan_all()
Definition at line 38 of file ptu_power_ctl.c.
|
static |
Handle to dominant PRU. Updated by pru_scan_all()
Definition at line 40 of file ptu_power_ctl.c.