Moved pin config into seperate config file
This commit is contained in:
parent
3a3c4c68ff
commit
9cbeee2c4d
9
software/main/include/config.h
Normal file
9
software/main/include/config.h
Normal file
|
@ -0,0 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include "hal/gpio_types.h"
|
||||
|
||||
#define I2S_PIN_BCK GPIO_NUM_26
|
||||
#define I2S_PIN_WS GPIO_NUM_25
|
||||
#define I2S_PIN_DATA GPIO_NUM_33
|
||||
#define TWAI_PIN_CTX GPIO_NUM_5
|
||||
#define TWAI_PIN_CRX GPIO_NUM_19
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include <cstdint>
|
||||
|
||||
#define WAV_PLAY_HELPER(str) #str
|
||||
#define WAV_PLAY(NAME) {\
|
||||
extern const uint8_t _binary_ ## NAME ## _wav_start[]; \
|
||||
extern const uint8_t _binary_ ## NAME ## _wav_end[]; \
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "driver/i2s.h"
|
||||
|
||||
#include "i2s.h"
|
||||
#include "config.h"
|
||||
|
||||
#define I2S_TAG "APP_I2S"
|
||||
|
||||
|
@ -62,9 +63,9 @@ void i2s::init() {
|
|||
|
||||
i2s_pin_config_t pin_config = {
|
||||
.mck_io_num = 0,
|
||||
.bck_io_num = 26,
|
||||
.ws_io_num = 25,
|
||||
.data_out_num = 33,
|
||||
.bck_io_num = I2S_PIN_BCK,
|
||||
.ws_io_num = I2S_PIN_WS,
|
||||
.data_out_num = I2S_PIN_DATA,
|
||||
.data_in_num = I2S_PIN_NO_CHANGE,
|
||||
};
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "hal/twai_types.h"
|
||||
|
||||
#include "twai.h"
|
||||
#include "config.h"
|
||||
#include "avrcp.h"
|
||||
#include "can_data.h"
|
||||
#include "volume.h"
|
||||
|
@ -158,7 +159,7 @@ static void listen(void*) {
|
|||
}
|
||||
|
||||
void twai::init() {
|
||||
twai_general_config_t g_config = TWAI_GENERAL_CONFIG_DEFAULT(GPIO_NUM_5, GPIO_NUM_19, TWAI_MODE_NORMAL);
|
||||
twai_general_config_t g_config = TWAI_GENERAL_CONFIG_DEFAULT(TWAI_PIN_CTX, TWAI_PIN_CRX, TWAI_MODE_NORMAL);
|
||||
twai_timing_config_t t_config = TWAI_TIMING_CONFIG_125KBITS();
|
||||
twai_filter_config_t f_config = {
|
||||
.acceptance_code = (0b100100101 << 5) + (0b1000011111 << 21),
|
||||
|
|
Loading…
Reference in New Issue
Block a user