Nordic Semiconductor nRF5 AirFuel SDK  version 2.2.0
pru_hal_evkit.c File Reference

Emulated version of PRU hardware. More...

#include <stdbool.h>
#include <stdint.h>
#include "nrf_error.h"
#include "pru_hw_config.h"
#include "pru_hal.h"

Go to the source code of this file.

Macros

#define VRECT_DEFAULT_VAL   0
 
#define IRECT_DEFAULT_VAL   100
 
#define VOUT_DEFAULT_VAL   2000
 
#define IOUT_DEFAULT_VAL   100
 
#define TEMP_DEFAULT_VAL   20
 

Functions

API implementation
uint32_t pru_hal_init (void)
 Initialize the PRU's Hardware abstraction layer. More...
 
uint32_t pru_hal_vrect_get (uint16_t *p_vrect)
 Read the value of VRECT. More...
 
uint32_t pru_hal_irect_get (uint16_t *p_irect)
 Read the value of IRECT. More...
 
uint32_t pru_hal_vout_enable_set (bool enable)
 Enable output to battery. More...
 
uint32_t pru_hal_vout_enable_get (bool *enable)
 Get status of VOUT enable. More...
 
uint32_t pru_hal_vout_get (uint16_t *p_vout)
 Read the voltage output to battery. More...
 
uint32_t pru_hal_iout_get (uint16_t *p_iout)
 Read the value of IOUT. More...
 
uint32_t pru_hal_temperature_get (int16_t *p_temperature)
 Read the temperature. More...
 
uint32_t pru_hal_wired_charge_detect_status_get (bool *p_wired)
 Get the status of whether the PRU is charged by wire. More...
 
uint32_t pru_hal_charge_complete_status_get (bool *p_charge_complete)
 Get the status of whether the PRU is charged. More...
 
uint32_t pru_hal_adj_power_set (ctl_adj_power_t adj_setting)
 Limit maximum power consumed by PRU. More...
 
uint32_t pru_hal_adj_power_get (ctl_adj_power_t *adj_setting)
 Get adjust power setting. More...
 
uint32_t pru_hal_power_adjusted_get (bool *adjusted)
 This function is called by the PRU profile to see if the PRU has limited its power consumption as instructed by previous call to 'pru_hal_adj_power_set()'. More...
 
uint32_t pru_hal_power_adjusted_set (bool adjusted)
 Set power adjusted value. More...
 

Variables

Static functions and variables
static uint32_t m_vrect
 
static uint32_t m_irect
 
static uint32_t m_vout
 
static uint32_t m_iout
 
static int16_t m_temp
 
static bool m_wired_charge_detected
 
static bool m_charge_complete
 
static bool m_vout_enable
 
static ctl_adj_power_t m_power_adj
 
static bool m_power_adjusted
 

Detailed Description

Emulated version of PRU hardware.

Definition in file pru_hal_evkit.c.

Macro Definition Documentation

#define VRECT_DEFAULT_VAL   0

[mV]

Definition at line 25 of file pru_hal_evkit.c.

#define IRECT_DEFAULT_VAL   100

[mA]

Definition at line 26 of file pru_hal_evkit.c.

#define VOUT_DEFAULT_VAL   2000

[mV]

Definition at line 27 of file pru_hal_evkit.c.

#define IOUT_DEFAULT_VAL   100

[mA]

Definition at line 28 of file pru_hal_evkit.c.

#define TEMP_DEFAULT_VAL   20

[deg C]

Definition at line 29 of file pru_hal_evkit.c.

Variable Documentation

uint32_t m_vrect
static

VRECT value

Definition at line 36 of file pru_hal_evkit.c.

uint32_t m_irect
static

IRECT value

Definition at line 37 of file pru_hal_evkit.c.

uint32_t m_vout
static

VOUT value

Definition at line 38 of file pru_hal_evkit.c.

uint32_t m_iout
static

IOUT value

Definition at line 39 of file pru_hal_evkit.c.

int16_t m_temp
static

Temperature value

Definition at line 40 of file pru_hal_evkit.c.

bool m_wired_charge_detected
static

Wired charge detect status

Definition at line 41 of file pru_hal_evkit.c.

bool m_charge_complete
static

Charge complete status

Definition at line 42 of file pru_hal_evkit.c.

bool m_vout_enable
static

VOUT enabled

Definition at line 43 of file pru_hal_evkit.c.

ctl_adj_power_t m_power_adj
static

Power adjust setting

Definition at line 44 of file pru_hal_evkit.c.

bool m_power_adjusted
static

Power adjusted

Definition at line 45 of file pru_hal_evkit.c.