2021-07-02 16:45:29 +00:00
|
|
|
//
|
|
|
|
// Created by jedi on 25.06.21.
|
|
|
|
//
|
2021-07-19 20:31:30 +00:00
|
|
|
|
|
|
|
#include "lux.h"
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include <FreeRTOS.h>
|
|
|
|
#include <task.h>
|
|
|
|
|
|
|
|
#include <esp/spi.h>
|
|
|
|
|
|
|
|
const int signal_led_pin = 2;
|
|
|
|
|
|
|
|
const int cs0 = 15;
|
|
|
|
const int gpio4 = 4;
|
|
|
|
const int gpio5 = 5;
|
|
|
|
|
|
|
|
extern "C" void signal_led(bool state) {
|
2021-07-19 21:31:20 +00:00
|
|
|
gpio_write(signal_led_pin, !state);
|
2021-07-19 20:31:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extern "C" void lux_task(void *pvParameters) {
|
|
|
|
|
|
|
|
gpio_enable(signal_led_pin, GPIO_OUTPUT);
|
|
|
|
gpio_enable(cs0, GPIO_OUTPUT);
|
|
|
|
gpio_enable(gpio4, GPIO_OUTPUT);
|
|
|
|
gpio_enable(gpio5, GPIO_OUTPUT);
|
|
|
|
spi_init(1, SPI_MODE0, SPI_FREQ_DIV_1M, 1, SPI_BIG_ENDIAN, 1);
|
|
|
|
|
|
|
|
vTaskDelete(nullptr);
|
|
|
|
}
|