#ifndef LIB_H
#define LIB_H

#include "display.h"
#include "flash.h"
#include "pixelstream.h"

#include <hardware/spi.h>
#include <pico/binary_info.h>

bi_decl(bi_program_feature_group(0x1111, 0, "Display Pinout"));
bi_decl(bi_ptr_int32(0x1111, 0, DISPLAY_SCK, 2));
bi_decl(bi_ptr_int32(0x1111, 0, DISPLAY_TX, 3));
bi_decl(bi_ptr_int32(0x1111, 0, DISPLAY_CS, 5));
bi_decl(bi_ptr_int32(0x1111, 0, DISPLAY_DC, 4));

bi_decl(bi_program_feature_group(0x1111, 1, "Flash Pinout"));
bi_decl(bi_ptr_int32(0x1111, 1, FLASH_SCK, 10));
bi_decl(bi_ptr_int32(0x1111, 1, FLASH_TX, 11));
bi_decl(bi_ptr_int32(0x1111, 1, FLASH_RX, 12));
bi_decl(bi_ptr_int32(0x1111, 1, FLASH_CS, 9));
bi_decl(bi_ptr_int32(0x1111, 1, FLASH_IO_2, 13));
bi_decl(bi_ptr_int32(0x1111, 1, FLASH_IO_3, 14));

bi_decl(bi_program_feature_group(0x1111, 2, "Buttons"));
bi_decl(bi_ptr_int32(0x1111, 2, BUTTON_LEFT, 15));
bi_decl(bi_ptr_int32(0x1111, 2, BUTTON_MIDDLE, 16));
bi_decl(bi_ptr_int32(0x1111, 2, BUTTON_RIGHT, 17));

namespace lib::detail
{

spi_inst_t* get_spi_instance(uint8_t gpio);

}

#endif // LIB_H
