You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
1.4 KiB
82 lines
1.4 KiB
#pragma once
|
|
#include "uappbase/base.hpp"
|
|
#include "ucomponents/eeprom/m24m02_i2c_eeprom.hpp"
|
|
|
|
namespace iflytop {
|
|
|
|
class ID {
|
|
public:
|
|
ZGPIO ID0;
|
|
ZGPIO ID1;
|
|
ZGPIO ID2;
|
|
ZGPIO ID3;
|
|
ZGPIO ID4;
|
|
};
|
|
|
|
class AppHardware {
|
|
private:
|
|
/* data */
|
|
public:
|
|
ZGPIO MOTO_POWER_EN;
|
|
ZGPIO MOTO1_CSN;
|
|
ZGPIO MOTO2_CSN;
|
|
ZGPIO MOTO3_CSN;
|
|
ZGPIO MOTO4_CSN;
|
|
ZGPIO MOTO1_DRV_ENN;
|
|
ZGPIO MOTO2_DRV_ENN;
|
|
ZGPIO MOTO3_DRV_ENN;
|
|
ZGPIO MOTO4_DRV_ENN;
|
|
|
|
ZGPIO MOTOR1_REF_L;
|
|
ZGPIO MOTOR1_REF_R;
|
|
ZGPIO MOTOR2_REF_L;
|
|
ZGPIO MOTOR2_REF_R;
|
|
ZGPIO MOTOR3_REF_L;
|
|
ZGPIO MOTOR3_REF_R;
|
|
ZGPIO MOTOR4_REF_L;
|
|
ZGPIO MOTOR4_REF_R;
|
|
|
|
TMC51X0 MOTO1;
|
|
TMC51X0 MOTO2;
|
|
TMC51X0 MOTO3;
|
|
TMC51X0 MOTO4;
|
|
|
|
ID id;
|
|
|
|
ZGPIO IO_OUT1;
|
|
ZGPIO IO_OUT2;
|
|
|
|
ZGPIO BLE_CONNECTED_STATE;
|
|
|
|
UART_HandleTypeDef* tjcUart;
|
|
ZGPIO TJC_UART_CH_SEL_PIN;
|
|
ZGPIO TJC_UART_CH_EN_PIN;
|
|
|
|
UART_HandleTypeDef* remoteContolerUart;
|
|
|
|
M24M02_I2C_EEPROM eeprom;
|
|
|
|
bool hardwareInitedOK = false;
|
|
;
|
|
|
|
static AppHardware* ins() {
|
|
static AppHardware instance;
|
|
return &instance;
|
|
}
|
|
|
|
void initialize();
|
|
TMC51X0* getPump(int32_t index) {
|
|
if (index == 0) return &MOTO1;
|
|
if (index == 1) return &MOTO2;
|
|
if (index == 2) return &MOTO3;
|
|
if (index == 3) return &MOTO4;
|
|
ZASSERT(false);
|
|
return nullptr;
|
|
}
|
|
|
|
bool isHardInitOk();
|
|
|
|
void setTJCScreenInDownloadMode();
|
|
};
|
|
|
|
} // namespace iflytop
|