Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/libraries/AP_EFI/AP_EFI_Serial_Lutan.h
Views: 1798
/*1This program is free software: you can redistribute it and/or modify2it under the terms of the GNU General Public License as published by3the Free Software Foundation, either version 3 of the License, or4(at your option) any later version.56This program is distributed in the hope that it will be useful,7but WITHOUT ANY WARRANTY; without even the implied warranty of8MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9GNU General Public License for more details.1011You should have received a copy of the GNU General Public License12along with this program. If not, see <http://www.gnu.org/licenses/>.13*/14/*15support for Lutan serial EFI16*/17#pragma once1819#include "AP_EFI_config.h"2021#if AP_EFI_SERIAL_LUTAN_ENABLED2223#include "AP_EFI.h"24#include "AP_EFI_Backend.h"2526class AP_EFI_Serial_Lutan: public AP_EFI_Backend {2728public:29// Constructor with initialization30AP_EFI_Serial_Lutan(AP_EFI &_frontend);3132// Update the state structure33void update() override;3435private:36AP_HAL::UARTDriver *port;37void send_request(void);3839union {40struct PACKED {41// fields from channels in LUTAN-MS2.ini42uint16_t length;43uint8_t flags;44uint16_t seconds;45uint16_t pulseWidth1; // ms, scale 0.00066646uint16_t pulseWidth2; // ms, scale 0.00066647uint16_t rpm;48int16_t advance; // deg, scale 0.149uint8_t squirt_flags;50uint8_t engine_flags;51uint8_t afrtgt1;52uint8_t afrtgt2;53uint8_t wbo2_en1;54uint8_t wbo2_en2;55int16_t barometer; // kPa, scale 0.156int16_t map; // kPa, scale 0.157int16_t mat; // degF, scale 0.158int16_t coolant; // degF, scale 0.159int16_t tps; // %, scale 0.160int16_t batteryVoltage; // V, scale 0.161int16_t afr1; // scale 0.162int16_t afr2; // scale 0.163uint16_t knock; // %, scale 0.164int16_t egoCorrection1; // %, scale 0.165int16_t egoCorrection2; // %, scale 0.166int16_t airCorrection; // %, scale 0.167int16_t warmupEnrich; // %, scale 0.168int16_t accelEnrich; // ms, scale 0.169int16_t tpsfuelcut; // %70int16_t baroCorrection; // %, scale 0.171int16_t gammaEnrich; // %72int16_t veCurr1; // %, scale 0.173int16_t veCurr2; // %, scale 0.174int16_t iacstep;75int16_t idleDC; // scale 0.39276int16_t coldAdvDeg; // deg, scale 0.177int16_t TPSdot; // %/s, scale 0.178int16_t MAPdot; // kPa/s79int16_t dwell; // ms, scale 0.066680} data;81uint8_t pkt[400];82};83uint16_t pkt_nbytes;84uint32_t last_request_ms;85uint32_t last_recv_ms;86};8788#endif // AP_EFI_SERIAL_LUTAN_ENABLED899091