#include #include "pico/stdlib.h" #include "hardware/spi.h" #include "hardware/dma.h" #include "hardware/pio.h" #include "hardware/timer.h" #include "epd0.h" #include "epd/epd_4p2mono.h" /* Function Declarations */ static bool timer_callback(repeating_timer_t *timer); /* Function Definitions */ static inline void spi_cs_assert() { gpio_put(EPD0_PIN_CS, 0); } static inline void spi_cs_deassert() { gpio_put(EPD0_PIN_CS, 1); } static inline void spi_write_byte(uint8_t b) { spi_cs_assert(); spi_write_blocking(EPD0_SPI_PORT, &b, 1); spi_cs_deassert(); } static inline void spi_read_busy() { do { spi_write_byte(0x71); } while (gpio_get(EPD0_PIN_BUSY)); } int main() { repeating_timer_t timer; stdio_init_all(); epd0_init(); epd_4p2mono_init(&epd0); epd_4p2mono_clear(&epd0); epd_4p2mono_testpattern(&epd0); epd_4p2mono_testimg(&epd0); // Timer example code - This example fires off the callback after 2000ms add_repeating_timer_ms(2000, timer_callback, NULL, &timer); for(;;); return 0; } static bool timer_callback(repeating_timer_t *timer) { // Put your timeout handler code in here puts("Hello, world!"); return true; }