Nordic Semiconductor nRF5 AirFuel SDK  version 2.2.0
pru_sensors.c File Reference
#include <stdint.h>
#include <string.h>
#include "pru_sensors.h"
#include "pru_hw_config.h"
#include "pru_test_mux.h"
#include "nrf_error.h"
#include "nrf_assert.h"

Go to the source code of this file.

Functions

API implementation
void pru_sensors_init (pru_sm_handler_t sm_handler)
 Initialize sensors and read default values. More...
 
void pru_sensors_read_all (void)
 Read PRU sensors.
 
const pru_sensor_data_tpru_sensors_data_get (void)
 Get the latest data from the PRU sensors. More...
 
uint32_t pru_sensor_alerts_get (bool *new_alert_occured, pru_alert_t *p_pru_alert)
 Extract alerts from the latest data read from PRU sensors. More...
 
void pru_sensors_gen_evts (void)
 Generate PRU state machine events from sensor data. More...
 

Variables

Static functions and variables
static pru_sensor_data_t m_pru_sensor_data
 
static uint32_t m_hv_counter = 0
 
static pru_alert_t m_prev_alerts
 
static pru_sm_handler_t m_signal_handler
 

Variable Documentation

pru_sensor_data_t m_pru_sensor_data
static

The latest version of the sensor data

Definition at line 30 of file pru_sensors.c.

uint32_t m_hv_counter = 0
static

Counter for how many sensor measurements have ticked over [ms].

Definition at line 31 of file pru_sensors.c.

pru_alert_t m_prev_alerts
static

Previously returned alerts from pru_sensor_alerts_get().

Definition at line 32 of file pru_sensors.c.

pru_sm_handler_t m_signal_handler
static

State machine event handler.

Definition at line 33 of file pru_sensors.c.