CPLD: Introduce Config type to clean up programming interface.

Hide the details of how the CPLD data is stored.
This commit is contained in:
Jared Boone
2017-06-02 16:54:24 -07:00
parent 76c2cc77af
commit a3483a8394
4 changed files with 21 additions and 10 deletions

View File

@@ -28,14 +28,27 @@
namespace portapack {
namespace cpld {
struct Config {
const std::array<uint16_t, 3328>& block_0;
const std::array<uint16_t, 512>& block_1;
};
namespace rev_20150901 {
extern const std::array<uint16_t, 3328> block_0;
extern const std::array<uint16_t, 512> block_1;
const Config config { block_0, block_1 };
} /* namespace rev_20150901 */
namespace rev_20170522 {
extern const std::array<uint16_t, 3328> block_0;
extern const std::array<uint16_t, 512> block_1;
const Config config { block_0, block_1 };
} /* namespace rev_20170522 */
} /* namespace cpld */