/*!
    \file  readme.txt
    \brief description of the SPI transmit and receive data fullduplex polling on two boards example
    
    \version 2023-07-08, V1.0.0, firmware for GD32F3X0
*/

/*
    Copyright (c) 2023, GigaDevice Semiconductor Inc.

    Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    1. Redistributions of source code must retain the above copyright notice, this 
       list of conditions and the following disclaimer.
    2. Redistributions in binary form must reproduce the above copyright notice, 
       this list of conditions and the following disclaimer in the documentation 
       and/or other materials provided with the distribution.
    3. Neither the name of the copyright holder nor the names of its contributors 
       may be used to endorse or promote products derived from this software without 
       specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
OF SUCH DAMAGE.
*/

  This demo is based on the GD32350R-EVAL-V1.0 board, it provides a basic communication using
polling mode between SPI0 and SPI1 on two boards. After system start-up, the transmitter board 
will send an array of 256 bytes data to the receiver board if the Wakeup KEY(PA0) is pressed. Then
compare the transmit data and receive data, the result will be displayed on the HyperTerminal
  
Hardware:

  Connect SPI0_NSS(PA4) pin(master)   to SPI1_NSS(PB12) pin(slave)
  Connect SPI0_SCK(PA5) pin(master)  to SPI1_SCK(PB13) pin(slave)
  Connect SPI0_MISO(PA6) pin(master)  to SPI1_MISO(PB14) pin(slave)
  Connect SPI0_MOSI(PA7)pin(master) to SPI1_MOSI(PB15) pin(slave)
  Connect GND (master)               to GND (slave)
  
Software:
  modify file: examlple/SPI/gd32f3x0_hal_init.h
  first, choose master or slave mode.
    #define SPI_MASTER_USED
  //#define SPI_SLAVE_USED

  test step:
  1. press master board reset key
  2. press slave board reset key
  3. press master wakeup key