2015-09-23 12:52:07 -03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Util.h"
|
|
|
|
|
2016-07-29 16:14:02 -03:00
|
|
|
namespace Linux {
|
|
|
|
|
2023-06-01 09:38:09 -03:00
|
|
|
enum class LINUX_BOARD_TYPE: int {
|
|
|
|
RPI_ZERO_1=0,
|
|
|
|
RPI_2_3_ZERO2=1,
|
|
|
|
RPI_4=2,
|
|
|
|
ALLWINNWER_H616=100,
|
|
|
|
UNKNOWN_BOARD=999
|
|
|
|
};
|
|
|
|
|
2016-07-29 16:14:02 -03:00
|
|
|
class UtilRPI : public Util {
|
2015-09-23 12:52:07 -03:00
|
|
|
public:
|
2015-10-20 18:13:25 -03:00
|
|
|
UtilRPI();
|
2015-09-23 22:49:38 -03:00
|
|
|
|
2015-10-20 18:13:25 -03:00
|
|
|
static UtilRPI *from(AP_HAL::Util *util) {
|
|
|
|
return static_cast<UtilRPI*>(util);
|
2015-09-23 22:49:38 -03:00
|
|
|
}
|
|
|
|
|
2015-09-23 12:52:07 -03:00
|
|
|
/* return the Raspberry Pi version */
|
2023-06-01 09:38:09 -03:00
|
|
|
LINUX_BOARD_TYPE detect_linux_board_type() const;
|
2015-09-23 12:52:07 -03:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// Called in the constructor once
|
2023-06-01 09:38:09 -03:00
|
|
|
void _get_board_type_using_peripheral_base();
|
2015-09-23 12:52:07 -03:00
|
|
|
|
|
|
|
private:
|
2023-06-01 09:38:09 -03:00
|
|
|
LINUX_BOARD_TYPE _linux_board_version = LINUX_BOARD_TYPE::UNKNOWN_BOARD;
|
2015-09-23 12:52:07 -03:00
|
|
|
};
|
2016-07-29 16:14:02 -03:00
|
|
|
|
|
|
|
}
|