Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Solar cells MPTT monitoring. More...
#include <stdbool.h>
#include "modules/energy/MPPT.h"
#include "firmwares/fixedwing/main_fbw.h"
#include "mcu_periph/i2c.h"
#include "mcu_periph/uart.h"
#include "pprzlink/messages.h"
#include "modules/datalink/downlink.h"
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 | 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 |
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... | |
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] |
Solar cells MPTT monitoring.
Definition in file MPPT.c.
|
static |
Definition at line 80 of file MPPT.c.
References i2c_transaction::buf, data_index, DefaultChannel, DefaultDevice, i2c_transmit(), MPPT_data, MPPT_IBAT_INDEX, MPPT_ICONV_INDEX, MPPT_ITOTAL_INDEX, MPPT_SLAVE_ADDR, MPPT_status, MPPT_STATUS_ASKING, mppt_trans, NB_DATA, and NB_I2C_DATA.
Referenced by MPPT_periodic().
void MPPT_init | ( | void | ) |
Definition at line 73 of file MPPT.c.
References MPPT_mode, MPPT_status, and MPPT_STATUS_IDLE.
void MPPT_periodic | ( | void | ) |
Definition at line 97 of file MPPT.c.
References i2c_transaction::buf, data_index, i2c_receive(), i2c_transmit(), I2CTransSuccess, MPPT_ask(), MPPT_data, MPPT_mode, MPPT_MODE_ADDR, MPPT_SLAVE_ADDR, MPPT_status, MPPT_STATUS_ASKING, MPPT_STATUS_IDLE, MPPT_STATUS_READING, MPPT_STATUS_WRITING, mppt_trans, NB_I2C_DATA, and i2c_transaction::status.
|
static |
Definition at line 70 of file MPPT.c.
Referenced by MPPT_ask(), and MPPT_periodic().
Definition at line 71 of file MPPT.c.
Referenced by MPPT_ask(), and MPPT_periodic().
uint8_t MPPT_mode |
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 60 of file MPPT.c.
Referenced by MPPT_init(), and MPPT_periodic().
|
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 1 of file MPPT.c.
Referenced by MPPT_ask(), and MPPT_periodic().