/*
 * Copyright 2020-2026 Yuntu Microelectronics Co., Ltd.
 * All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 * 
 * @file spi_config.c
 * @brief 
 * 
 */


#include <stddef.h>
#include "spi_config.h"

/* SPI master */
/*lpspi_MasterConfig0*/
extern void SPI4_EndNotification(void *driverState, spi_event_t event, void *userData);


spi_state_t lpspi_MasterConfig0_State;
const spi_master_config_t lpspi_MasterConfig0 = {
    .bitsPerSec=10000000U,
    .whichPcs=SPI_PCS0,
    .pcsPolarity=SPI_ACTIVE_LOW,
    .isPcsContinuous=true,
    .bitcount=8,
    .clkPhase=SPI_CLOCK_PHASE_1ST_EDGE,
    .clkPolarity=SPI_SCK_ACTIVE_HIGH,
    .lsbFirst=false,
    .transferType=SPI_USING_DMA,
    .rxDMAChannel=1,
    .txDMAChannel=0,
    .callback=SPI4_EndNotification,
    .callbackParam=NULL,
    .width=SPI_SINGLE_BIT_XFER,
};
/* SPI slave */
/*spi_SlaveConfig0*/



spi_state_t spi_SlaveConfig0_State;
spi_slave_config_t spi_SlaveConfig0 = {
    .whichPcs=SPI_PCS0,
    .pcsPolarity=SPI_ACTIVE_LOW,
    .bitcount=8,
    .clkPhase=SPI_CLOCK_PHASE_1ST_EDGE,
    .clkPolarity=SPI_SCK_ACTIVE_HIGH,
    .lsbFirst=false,
    .transferType=SPI_USING_DMA,
    .rxDMAChannel=3,
    .txDMAChannel=2,
    .callback=NULL,
    .callbackParam=NULL,
    .width=SPI_SINGLE_BIT_XFER,
};

