You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.6 KiB
C
67 lines
1.6 KiB
C
/* Hello World Example
|
|
|
|
This example code is in the Public Domain (or CC0 licensed, at your option.)
|
|
|
|
Unless required by applicable law or agreed to in writing, this
|
|
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
CONDITIONS OF ANY KIND, either express or implied.
|
|
*/
|
|
#include <stdio.h>
|
|
#include "sdkconfig.h"
|
|
#include "freertos/FreeRTOS.h"
|
|
#include "freertos/task.h"
|
|
#include "esp_system.h"
|
|
#include "esp_spi_flash.h"
|
|
|
|
#include "driver/gpio.h"
|
|
|
|
#include "display.h"
|
|
#include "text.h"
|
|
|
|
#ifdef CONFIG_IDF_TARGET_ESP32
|
|
#define CHIP_NAME "ESP32"
|
|
#endif
|
|
|
|
#ifdef CONFIG_IDF_TARGET_ESP32S2BETA
|
|
#define CHIP_NAME "ESP32-S2 Beta"
|
|
#endif
|
|
|
|
|
|
void app_main(void)
|
|
{
|
|
printf("Hello world!\n");
|
|
|
|
put_line(fb, 2, "429 Amalienplatz", 1, 1);
|
|
|
|
gpio_config_t io_conf;
|
|
//disable interrupt
|
|
io_conf.intr_type = GPIO_INTR_DISABLE;
|
|
//set as output mode
|
|
io_conf.mode = GPIO_MODE_OUTPUT;
|
|
//bit mask of the pins that you want to set,e.g.GPIO18/19
|
|
io_conf.pin_bit_mask =
|
|
(1ULL<<GPIO_LAT)|(1ULL<<GPIO_OE)|(1ULL<<GPIO_CLK)
|
|
|(1ULL<<GPIO_R1)|(1ULL<<GPIO_G1)|(1ULL<<GPIO_B1)|(1ULL<<GPIO_R2)|(1ULL<<GPIO_G2)|(1ULL<<GPIO_B2)
|
|
|(1ULL<<GPIO_A)|(1ULL<<GPIO_B)|(1ULL<<GPIO_C)|(1ULL<<GPIO_D)|(1ULL<<GPIO_E);
|
|
//disable pull-down mode
|
|
io_conf.pull_down_en = 0;
|
|
//disable pull-up mode
|
|
io_conf.pull_up_en = 0;
|
|
//configure GPIO with the given settings
|
|
gpio_config(&io_conf);
|
|
|
|
gpio_set_level(GPIO_OE, 0);
|
|
|
|
write_bits(1,0,0,1,0,0);
|
|
for(uint8_t i=0;i<128;i++){
|
|
clock();
|
|
}
|
|
latch();
|
|
gpio_set_level(GPIO_OE, 1);
|
|
gpio_set_level(GPIO_OE, 0);
|
|
|
|
for (;;) {
|
|
display_cycle();
|
|
}
|
|
}
|