MakeBlock Drive Updated Updated library for MakeBlock Ranger

Loading...
Searching...
No Matches
MeEEPROM.h
Go to the documentation of this file.
1
32#ifndef ME_EEPROM_H
33#define ME_EEPROM_H
34#include <Arduino.h>
35#include <stdbool.h>
36#include "MeConfig.h"
37#include "MePort.h"
38
39#define EEPROM_START_POS 0
40
41//0x00 - 0x34 (26*2 = 52)
42#define EEPROM_IF_HAVEPID_CHECK1 0xAB
43#define EEPROM_IF_HAVEPID_CHECK2 0xCD
44#define EEPROM_CHECK_START 0xAB
45#define EEPROM_CHECK_MID 0xCD
46#define EEPROM_CHECK_END 0xEF
47
48#define ON_BOARD_ENCODER_SLOT0_PARTITION_CHECK EEPROM_START_POS //
49#define ON_BOARD_ENCODER_SLOT0_START_ADDR ON_BOARD_ENCODER_SLOT0_PARTITION_CHECK + 2 //Partition checksum
50#define ON_BOARD_ENCODER_SLOT0_PID_ADDR ON_BOARD_ENCODER_SLOT0_START_ADDR + 1 //start data
51#define ON_BOARD_ENCODER_SLOT0_RATIO_ADDR ON_BOARD_ENCODER_SLOT0_PID_ADDR + 16 //pids data, 4 float
52#define ON_BOARD_ENCODER_SLOT0_PLUS_ADDR ON_BOARD_ENCODER_SLOT0_RATIO_ADDR + 4 //ratio0 data
53#define ON_BOARD_ENCODER_SLOT0_END_ADDR ON_BOARD_ENCODER_SLOT0_PLUS_ADDR + 2 //plus data
54
55#define ON_BOARD_ENCODER_SLOT1_PARTITION_CHECK ON_BOARD_ENCODER_SLOT0_END_ADDR + 1 //end data
56#define ON_BOARD_ENCODER_SLOT1_START_ADDR ON_BOARD_ENCODER_SLOT1_PARTITION_CHECK + 2 //Partition checksum
57#define ON_BOARD_ENCODER_SLOT1_PID_ADDR ON_BOARD_ENCODER_SLOT1_START_ADDR + 1 //start data
58#define ON_BOARD_ENCODER_SLOT1_RATIO_ADDR ON_BOARD_ENCODER_SLOT1_PID_ADDR + 16 //pids data, 4 float
59#define ON_BOARD_ENCODER_SLOT1_PLUS_ADDR ON_BOARD_ENCODER_SLOT1_RATIO_ADDR + 4 //ratio0 data
60#define ON_BOARD_ENCODER_SLOT0_END_ADDR ON_BOARD_ENCODER_SLOT0_PLUS_ADDR + 2 //plus data
61
62//0x50 - 0x70
63#define BALANCED_CAR_PARTITION_CHECK 0x50
64#define BALANCED_CAR_START_ADDR BALANCED_CAR_PARTITION_CHECK + 2 //Partition checksum
65#define BALANCED_CAR_NATURAL_BALANCE BALANCED_CAR_START_ADDR + 1 //start data
66#define BALANCED_CAR_ANGLE_PID_ADDR BALANCED_CAR_NATURAL_BALANCE + 4 //Natural balance angle 4
67#define BALANCED_CAR_SPEED_PID_ADDR BALANCED_CAR_ANGLE_PID_ADDR + 12 //PID 4*3
68#define BALANCED_CAR_DIR_PID_ADDR BALANCED_CAR_SPEED_PID_ADDR + 12 //PID 4*3
69#define BALANCED_CAR_END_ADDR BALANCED_CAR_DIR_PID_ADDR + 4 //only P
70
71//0x80 - 0x90
72#define AURIGA_MODE_PARTITION_CHECK 0x80
73#define AURIGA_MODE_START_ADDR AURIGA_MODE_PARTITION_CHECK + 2 //Partition checksum
74#define AURIGA_MODE_CONFIGURE AURIGA_MODE_START_ADDR + 1 //start data
75#define AURIGA_MODE_END_ADDR AURIGA_MODE_CONFIGURE + 1 //auriga mode
76
77//0x90 - 0xa0
78#define MEGAPI_MODE_PARTITION_CHECK 0x90
79#define MEGAPI_MODE_START_ADDR MEGAPI_MODE_PARTITION_CHECK + 2 //Partition checksum
80#define MEGAPI_MODE_CONFIGURE MEGAPI_MODE_START_ADDR + 1 //start data
81#define MEGAPI_MODE_END_ADDR MEGAPI_MODE_CONFIGURE + 1
82
83#endif
MeConfig.h
Configuration file of library.
MePort.h
Header for MePort.cpp module.