Paparazzi UAS  v4.2.2_stable-4-gcc32f65
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
MPPT.c File Reference
#include <stdbool.h>
#include "MPPT.h"
#include "firmwares/fixedwing/main_fbw.h"
#include "mcu_periph/i2c.h"
#include "mcu_periph/uart.h"
#include "messages.h"
#include "subsystems/datalink/downlink.h"
+ Include dependency graph for MPPT.c:

Go to the source code of this file.

Macros

#define MPPT_SLAVE_ADDR   0x40
 
#define NB_I2C_DATA   8
 
#define MPPT_MODE_ADDR   0xf
 
#define DOWNLINK_DEVICE   DOWNLINK_AP_DEVICE
 0: VBat (mV) 1: IBat (mA) 2: PBat (mW) 3: VSol (mV) 4: ISol (mA) 5: PSol (mW) 6: IConv (mA) 7: PConv (mW) More...
 
#define MPPT_STATUS_IDLE   0
 
#define MPPT_STATUS_WRITING   1
 
#define MPPT_STATUS_ASKING   2
 
#define MPPT_STATUS_READING   3
 

Functions

void MPPT_init (void)
 
static void MPPT_ask (void)
 
void MPPT_periodic (void)
 

Variables

struct i2c_transaction mppt_trans
 
uint8_t MPPT_mode
 
static uint8_t MPPT_status
 A value different from 0 is a request from this mode. More...
 
static uint8_t data_index = 0xff
 
static int16_t MPPT_data [NB_DATA]
 

Macro Definition Documentation

#define DOWNLINK_DEVICE   DOWNLINK_AP_DEVICE

0: VBat (mV) 1: IBat (mA) 2: PBat (mW) 3: VSol (mV) 4: ISol (mA) 5: PSol (mW) 6: IConv (mA) 7: PConv (mW)

9: IBat + IConv

Definition at line 54 of file MPPT.c.

#define MPPT_MODE_ADDR   0xf

Definition at line 34 of file MPPT.c.

Referenced by MPPT_periodic().

#define MPPT_SLAVE_ADDR   0x40

Definition at line 32 of file MPPT.c.

Referenced by MPPT_ask(), and MPPT_periodic().

#define MPPT_STATUS_ASKING   2

Definition at line 66 of file MPPT.c.

Referenced by MPPT_ask(), and MPPT_periodic().

#define MPPT_STATUS_IDLE   0

Definition at line 64 of file MPPT.c.

Referenced by MPPT_init(), and MPPT_periodic().

#define MPPT_STATUS_READING   3

Definition at line 67 of file MPPT.c.

Referenced by MPPT_periodic().

#define MPPT_STATUS_WRITING   1

Definition at line 65 of file MPPT.c.

Referenced by MPPT_periodic().

#define NB_I2C_DATA   8

Definition at line 33 of file MPPT.c.

Referenced by MPPT_ask(), and MPPT_periodic().

Function Documentation

static void MPPT_ask ( void  )
static
void MPPT_init ( void  )

Definition at line 73 of file MPPT.c.

void MPPT_periodic ( void  )

Definition at line 95 of file MPPT.c.

Variable Documentation

uint8_t data_index = 0xff
static

Definition at line 70 of file MPPT.c.

Referenced by MPPT_ask(), and MPPT_periodic().

int16_t MPPT_data[NB_DATA]
static

Definition at line 71 of file MPPT.c.

Referenced by MPPT_ask(), and MPPT_periodic().

uint8_t MPPT_mode

Definition at line 60 of file MPPT.c.

Referenced by MPPT_init(), and MPPT_periodic().

uint8_t MPPT_status
static

A value different from 0 is a request from this mode.

Definition at line 63 of file MPPT.c.

Referenced by MPPT_ask(), MPPT_init(), and MPPT_periodic().

struct i2c_transaction mppt_trans

Definition at line 36 of file MPPT.c.

Referenced by MPPT_ask(), and MPPT_periodic().