picoprobe working dma not

This commit is contained in:
matthias wagner
2023-05-21 17:31:21 +02:00
parent 2c4cfe8e27
commit 70b67e297b
79 changed files with 12891 additions and 20185 deletions

View File

@@ -8,20 +8,18 @@
const struct tft_config lcd_config = {
.pio = pio0,
.sm = 0,
.gpio_din = PICO_DEFAULT_SPI_TX_PIN,
.gpio_clk = PICO_DEFAULT_SPI_SCK_PIN,
.gpio_cs = PICO_DEFAULT_SPI_CSN_PIN,
.gpio_dc = 26,
.gpio_rst = 22,
.gpio_bl = 20,
.gpio_din = 18,
.gpio_clk = 17,
.gpio_cs = 21,
.gpio_dc = 19,
.gpio_rst = 20,
.gpio_bl = 16,
.width = 320,
.height = 480,
};
int main()
{
stdio_init_all();
set_sys_clock_khz(200 * 1000, true);
uint offset = pio_add_program(lcd_config.pio, &tft_program);
@@ -43,13 +41,21 @@ int main()
tft_init(&lcd_config, dma_chan);
while (true) {
absolute_time_t start = get_absolute_time();
sleep_ms(100);
absolute_time_t start = get_absolute_time();
tft_fill(0b0000000000000000);
tft_fill(0b1111111111111111);
tft_fill(0b0000000000000000);
absolute_time_t end = get_absolute_time();
absolute_time_t end = get_absolute_time();
volatile int64_t diff = absolute_time_diff_us(start, end);
printf("test");
}
return 0;
}
void dled_start(uint pin){
gpio_init(pin);
gpio_set_dir(pin, GPIO_OUT);
gpio_put(pin, 1);
}
void dled_end(uint pin){
gpio_put(pin, 0);
}

View File

@@ -2,4 +2,7 @@
#include "pico/stdlib.h"
#include "tft.h"
#define DLED_PIN 25
#define DLED_PIN 25
void dled_start(uint pin);
void dled_end(uint pin);

View File

@@ -2,8 +2,6 @@
#define TFT_H
#include "hardware/gpio.h"
#include "hardware/spi.h"
#include "hardware/divider.h"
#include "hardware/dma.h"
#include "tft.pio.h"
#include "pico/stdlib.h"