kopia lustrzana https://github.com/pimoroni/pimoroni-pico
adjustments prior to micropython
rodzic
e85367a961
commit
79eb998183
|
@ -7,4 +7,4 @@ target_sources(${DRIVER_NAME} INTERFACE
|
||||||
target_include_directories(${DRIVER_NAME} INTERFACE ${CMAKE_CURRENT_LIST_DIR})
|
target_include_directories(${DRIVER_NAME} INTERFACE ${CMAKE_CURRENT_LIST_DIR})
|
||||||
|
|
||||||
# Pull in pico libraries that we need
|
# Pull in pico libraries that we need
|
||||||
target_link_libraries(${DRIVER_NAME} INTERFACE pico_stdlib pimoroni_bus hardware_spi hardware_pwm hardware_dma)
|
target_link_libraries(${DRIVER_NAME} INTERFACE pico_stdlib pimoroni_bus hardware_spi hardware_pwm)
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
#include "st7567.hpp"
|
#include "st7567.hpp"
|
||||||
|
#include "hardware/pwm.h"
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include "hardware/dma.h"
|
|
||||||
#include "hardware/pwm.h"
|
|
||||||
|
|
||||||
#define BYTE_TO_BINARY_PATTERN "%c%c%c%c%c%c%c%c"
|
#define BYTE_TO_BINARY_PATTERN "%c%c%c%c%c%c%c%c"
|
||||||
#define BYTE_TO_BINARY(byte) \
|
#define BYTE_TO_BINARY(byte) \
|
||||||
|
|
|
@ -6,7 +6,7 @@ add_executable(
|
||||||
)
|
)
|
||||||
|
|
||||||
# Pull in pico libraries that we need
|
# Pull in pico libraries that we need
|
||||||
target_link_libraries(${OUTPUT_NAME} pico_stdlib hardware_spi hardware_pwm hardware_dma rgbled button pico_display_2 st7567 pico_graphics)
|
target_link_libraries(${OUTPUT_NAME} pico_stdlib gfx_pack pico_graphics)
|
||||||
|
|
||||||
# create map/bin/hex file etc.
|
# create map/bin/hex file etc.
|
||||||
pico_add_extra_outputs(${OUTPUT_NAME})
|
pico_add_extra_outputs(${OUTPUT_NAME})
|
|
@ -5,15 +5,11 @@
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
#include "pico/stdlib.h"
|
#include "pico/stdlib.h"
|
||||||
#include "libraries/pico_graphics/pico_graphics.hpp"
|
|
||||||
#include "libraries/gfx_pack/gfx_pack.hpp"
|
#include "libraries/gfx_pack/gfx_pack.hpp"
|
||||||
#include "drivers/st7567/st7567.hpp"
|
|
||||||
#include "drivers/button/button.hpp"
|
|
||||||
#include "drivers/rgbled/rgbled.hpp"
|
|
||||||
|
|
||||||
using namespace pimoroni;
|
using namespace pimoroni;
|
||||||
|
|
||||||
ST7567 st7567(128, 64, gfx_pack_pins);
|
ST7567 st7567(128, 64, GfxPack::gfx_pack_pins);
|
||||||
PicoGraphics_Pen1Bit graphics(st7567.width, st7567.height, nullptr);
|
PicoGraphics_Pen1Bit graphics(st7567.width, st7567.height, nullptr);
|
||||||
RGBLED backlight_rgb(GfxPack::BL_R, GfxPack::BL_G, GfxPack::BL_B, Polarity::ACTIVE_HIGH);
|
RGBLED backlight_rgb(GfxPack::BL_R, GfxPack::BL_G, GfxPack::BL_B, Polarity::ACTIVE_HIGH);
|
||||||
Button button_a(GfxPack::A);
|
Button button_a(GfxPack::A);
|
||||||
|
|
|
@ -1,11 +1 @@
|
||||||
set(LIB_NAME gfx_pack)
|
include(gfx_pack.cmake)
|
||||||
add_library(${LIB_NAME} INTERFACE)
|
|
||||||
|
|
||||||
target_sources(${LIB_NAME} INTERFACE
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/${LIB_NAME}.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
target_include_directories(${LIB_NAME} INTERFACE ${CMAKE_CURRENT_LIST_DIR})
|
|
||||||
|
|
||||||
# Pull in pico libraries that we need
|
|
||||||
target_link_libraries(${LIB_NAME} INTERFACE pico_stdlib hardware_spi hardware_pwm hardware_dma st7789 pico_graphics)
|
|
|
@ -1,10 +1,11 @@
|
||||||
add_library(pico_display_2 INTERFACE)
|
set(LIB_NAME gfx_pack)
|
||||||
|
add_library(${LIB_NAME} INTERFACE)
|
||||||
|
|
||||||
target_sources(pico_display_2 INTERFACE
|
target_sources(${LIB_NAME} INTERFACE
|
||||||
${CMAKE_CURRENT_LIST_DIR}/pico_display_2.cpp
|
${CMAKE_CURRENT_LIST_DIR}/${LIB_NAME}.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(pico_display_2 INTERFACE ${CMAKE_CURRENT_LIST_DIR})
|
target_include_directories(${LIB_NAME} INTERFACE ${CMAKE_CURRENT_LIST_DIR})
|
||||||
|
|
||||||
# Pull in pico libraries that we need
|
# Pull in pico libraries that we need
|
||||||
target_link_libraries(pico_display_2 INTERFACE pico_stdlib)
|
target_link_libraries(${LIB_NAME} INTERFACE pico_stdlib hardware_spi pimoroni_bus st7567 pico_graphics button rgbled)
|
|
@ -1 +1,9 @@
|
||||||
#include "gfx_pack.hpp"
|
#include "gfx_pack.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
using namespace pimoroni;
|
||||||
|
namespace GfxPack{
|
||||||
|
|
||||||
|
//SPIPins gfx_pack_pins;
|
||||||
|
|
||||||
|
}
|
|
@ -2,14 +2,17 @@
|
||||||
|
|
||||||
#include "pico/stdlib.h"
|
#include "pico/stdlib.h"
|
||||||
#include "common/pimoroni_bus.hpp"
|
#include "common/pimoroni_bus.hpp"
|
||||||
|
#include "drivers/st7567/st7567.hpp"
|
||||||
|
#include "drivers/button/button.hpp"
|
||||||
|
#include "drivers/rgbled/rgbled.hpp"
|
||||||
|
#include "libraries/pico_graphics/pico_graphics.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace pimoroni {
|
namespace pimoroni {
|
||||||
|
|
||||||
SPIPins gfx_pack_pins= {PIMORONI_SPI_DEFAULT_INSTANCE, 17, SPI_DEFAULT_SCK, SPI_DEFAULT_MOSI, PIN_UNUSED, 20, 9};
|
namespace GfxPack{
|
||||||
|
static const SPIPins gfx_pack_pins = {PIMORONI_SPI_DEFAULT_INSTANCE, 17, SPI_DEFAULT_SCK, SPI_DEFAULT_MOSI, PIN_UNUSED, 20, 9};
|
||||||
class GfxPack{
|
|
||||||
|
|
||||||
public:
|
|
||||||
static const int WIDTH = 128;
|
static const int WIDTH = 128;
|
||||||
static const int HEIGHT = 64;
|
static const int HEIGHT = 64;
|
||||||
static const uint8_t A = 12;
|
static const uint8_t A = 12;
|
||||||
|
|
Ładowanie…
Reference in New Issue