5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
28 // TODO create a Board class with all these functions
112 FactoryInstalledPots
,
117 MultiposPotsPositions
,
120 FactoryInstalledSwitches
,
131 struct SwitchPosition
{
132 SwitchPosition(unsigned int index
, unsigned int position
):
138 unsigned int position
;
145 Q_DECLARE_TR_FUNCTIONS(Boards
)
149 Boards(Board::Type board
)
154 void setBoardType(const Board::Type
& board
);
155 Board::Type
getBoardType() const { return m_boardType
; }
157 const uint32_t getFourCC() const { return getFourCC(m_boardType
); }
158 const int getEEpromSize() const { return getEEpromSize(m_boardType
); }
159 const int getFlashSize() const { return getFlashSize(m_boardType
); }
160 const Board::SwitchInfo
getSwitchInfo(unsigned index
) const { return getSwitchInfo(m_boardType
, index
); }
161 const int getCapability(Board::Capability capability
) const { return getCapability(m_boardType
, capability
); }
162 const QString
getAnalogInputName(unsigned index
) const { return getAnalogInputName(m_boardType
, index
); }
163 const bool isBoardCompatible(Board::Type board2
) const { return isBoardCompatible(m_boardType
, board2
); }
165 static uint32_t getFourCC(Board::Type board
);
166 static const int getEEpromSize(Board::Type board
);
167 static const int getFlashSize(Board::Type board
);
168 static const Board::SwitchInfo
getSwitchInfo(Board::Type board
, unsigned index
);
169 static const int getCapability(Board::Type board
, Board::Capability capability
);
170 static const QString
getAxisName(int index
);
171 static const QString
getAnalogInputName(Board::Type board
, unsigned index
);
172 static const bool isBoardCompatible(Board::Type board1
, Board::Type board2
);
173 static const QString
getBoardName(Board::Type board
);
177 Board::Type m_boardType
;
180 // temporary aliases for transition period, use Boards class instead.
181 #define getBoardCapability(b__, c__) Boards::getCapability(b__, c__)
182 #define getEEpromSize(b__) Boards::getEEpromSize(b__)
183 #define getSwitchInfo(b__, i__) Boards::getSwitchInfo(b__, i__)
185 #define IS_9X(board) (board==Board::BOARD_STOCK || board==Board::BOARD_M128)
186 #define IS_STOCK(board) (board==Board::BOARD_STOCK)
187 #define IS_M128(board) (board==Board::BOARD_M128)
188 #define IS_2560(board) (board==Board::BOARD_GRUVIN9X || board==Board::BOARD_MEGA2560)
189 #define IS_SKY9X(board) (board==Board::BOARD_SKY9X || board==Board::BOARD_9XRPRO || board==Board::BOARD_AR9X)
190 #define IS_9XRPRO(board) (board==Board::BOARD_9XRPRO)
191 #define IS_TARANIS_XLITE(board) (board==Board::BOARD_TARANIS_XLITE)
192 #define IS_TARANIS_X7(board) (board==Board::BOARD_TARANIS_X7)
193 #define IS_TARANIS_X9(board) (board==Board::BOARD_TARANIS_X9D || board==Board::BOARD_TARANIS_X9DP || board==Board::BOARD_TARANIS_X9E)
194 #define IS_TARANIS_X9D(board) (board==Board::BOARD_TARANIS_X9D || board==Board::BOARD_TARANIS_X9DP)
195 #define IS_TARANIS_PLUS(board) (board==Board::BOARD_TARANIS_X9DP || board==Board::BOARD_TARANIS_X9E)
196 #define IS_TARANIS_X9E(board) (board==Board::BOARD_TARANIS_X9E)
197 #define IS_TARANIS(board) (IS_TARANIS_X9(board) || IS_TARANIS_X7(board) || IS_TARANIS_XLITE(board))
198 #define IS_TARANIS_SMALL(board) (board==Board::BOARD_TARANIS_X7 || board==Board::BOARD_TARANIS_XLITE)
199 #define IS_TARANIS_NOT_X9E(board) (IS_TARANIS(board) && !IS_TARANIS_X9E(board))
200 #define IS_HORUS_X12S(board) (board==Board::BOARD_X12S)
201 #define IS_HORUS_X10(board) (board==Board::BOARD_X10)
202 #define IS_HORUS(board) (IS_HORUS_X12S(board) || IS_HORUS_X10(board))
203 #define IS_HORUS_OR_TARANIS(board) (IS_HORUS(board) || IS_TARANIS(board))
204 #define IS_STM32(board) (IS_TARANIS(board) || IS_HORUS(board))
205 #define IS_ARM(board) (IS_STM32(board) || IS_SKY9X(board))
206 #define HAS_LARGE_LCD(board) (IS_HORUS(board) || IS_TARANIS_X9(board))