Nordic Semiconductor nRF5 AirFuel SDK  version 2.2.0
pru_sensors.h
Go to the documentation of this file.
1 /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
2  *
3  * The information contained herein is property of Nordic Semiconductor ASA.
4  * Terms and conditions of usage are described in detail in NORDIC
5  * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
6  *
7  * Licensees are granted free, non-transferable use of the information. NO
8  * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
9  * the file.
10  */
11 
19 #ifndef __PRU_SENSORS_H__
20 #define __PRU_SENSORS_H__
21 
22 #include "pru.h"
23 
24 
26 typedef struct
27 {
28  uint16_t vrect;
29  uint16_t irect;
30  uint16_t vout;
31  uint16_t iout;
32  int16_t temperature;
33  uint8_t over_voltage :1;
34  uint8_t over_current :1;
35  uint8_t over_temperature :1;
36  uint8_t sustained_high_voltage :1;
37  uint8_t wired_charge_detect :1;
38  uint8_t charge_port :1;
39  uint8_t charge_complete :1;
40  uint8_t power_adjusted :1;
42 
43 /******************************************************************************/
46 /******************************************************************************/
47 
48 
53 void pru_sensors_init(pru_sm_handler_t pru_sm_handler);
54 
55 
58 void pru_sensors_read_all(void);
59 
65 
66 
74 uint32_t pru_sensor_alerts_get(bool * new_alert_occured, pru_alert_t * p_pru_alert);
75 
76 
85 uint32_t pru_sensors_board_read_all(pru_sensor_data_t * p_sensor_data);
86 
87 
91 void pru_sensors_gen_evts(void);
92 
95 #endif /* __PRU_SENSORS_H__ */
96 
uint32_t pru_sensors_board_read_all(pru_sensor_data_t *p_sensor_data)
Read PRU HW specific sensors.
int16_t temperature
Definition: pru_sensors.h:32
void pru_sensors_gen_evts(void)
Generate PRU state machine events from sensor data.
Definition: pru_sensors.c:190
void pru_sensors_read_all(void)
Read PRU sensors.
Definition: pru_sensors.c:51
PRU Alert Parameter structure.
Definition: wpt.h:145
void pru_sensors_init(pru_sm_handler_t pru_sm_handler)
Initialize sensors and read default values.
Definition: pru_sensors.c:42
const pru_sensor_data_t * pru_sensors_data_get(void)
Get the latest data from the PRU sensors.
Definition: pru_sensors.c:146
Definition of PRU reporting data.
Definition: pru_sensors.h:26
void(* pru_sm_handler_t)(pru_sm_signal_type_t evt)
Definition: pru.h:31
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.
Definition: pru_sensors.c:151