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.
46 lines
1.3 KiB
46 lines
1.3 KiB
#include <stddef.h>
|
|
#include <stdio.h>
|
|
|
|
#include "base/config_service.hpp"
|
|
#include "base/device_info.hpp"
|
|
#include "spi.h"
|
|
#include "usart.h"
|
|
#include "zsdk/modbus/modbus_block_host.hpp"
|
|
#include "zsdk/pxx_pressure_sensor_driver/pxx_pressure_sensor_bus.hpp"
|
|
#include "zsdk/tmc/ztmc5130.hpp"
|
|
#include "zsdk/zsdk.hpp"
|
|
|
|
void hardware_init();
|
|
|
|
namespace iflytop {
|
|
class Hardware {
|
|
ZSPI m_motor_spi; //
|
|
ModbusBlockHost m_modbusBlockHost; //
|
|
|
|
TMC5130 m_motor[2]; // 蠕动泵控制
|
|
ZGPIO m_sl_mini_ac_ctrl; // 喷液空压机(MINI)
|
|
ZGPIO m_atta_mini_air_compressor_ctrl; // 气密性测试空压机(MINI)
|
|
PXXPressureSensorBus m_pressureSensorBus; // PXX压力传感器总线
|
|
|
|
public:
|
|
static Hardware& ins() {
|
|
static Hardware ins;
|
|
return ins;
|
|
}
|
|
|
|
void init();
|
|
|
|
int32_t motorNum() { return ZARRAY_SIZE(m_motor); }
|
|
TMC5130* motor(int32_t index) {
|
|
if (index < ZARRAY_SIZE(m_motor)) {
|
|
return &m_motor[index];
|
|
}
|
|
return nullptr;
|
|
}
|
|
ZGPIO* sl_mini_ac_ctrl() { return &m_sl_mini_ac_ctrl; }
|
|
ZGPIO* atta_mini_air_compressor_ctrl() { return &m_atta_mini_air_compressor_ctrl; }
|
|
|
|
PXXPressureSensorBus* pressureSensorBus() { return &m_pressureSensorBus; }
|
|
};
|
|
|
|
} // namespace iflytop
|