64 lines
2.2 KiB
C
64 lines
2.2 KiB
C
/****************************************************************************
|
|
|
|
Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
|
|
|
|
This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
|
|
be copied by any method or incorporated into another program without
|
|
the express written consent of Aerospace C.Power. This Information or any portion
|
|
thereof remains the property of Aerospace C.Power. The Information contained herein
|
|
is believed to be accurate and Aerospace C.Power assumes no responsibility or
|
|
liability for its use in any way and conveys no license or title under
|
|
any patent or copyright and makes no representation or warranty that this
|
|
Information is free from patent or copyright infringement.
|
|
|
|
****************************************************************************/
|
|
|
|
#ifndef __KL3_SPI_TEST_H__
|
|
#define __KL3_SPI_TEST_H__
|
|
|
|
#include "iot_spi_api.h"
|
|
|
|
#define PASS_COUNT 5
|
|
#define SPI_SCPOL_L 0
|
|
#define SPI_SCPOL_H 1
|
|
#define SPI_SCPH_1EDGE 0
|
|
#define SPI_SCPH_2EDGE 1
|
|
#define DEVICE_SPI_FRQ_100k (DEVICE_SPI_DEFAULT_FREQUENCY)
|
|
#define DEVICE_SPI_FRQ_400k (4 * DEVICE_SPI_DEFAULT_FREQUENCY)
|
|
#define DEVICE_SPI_FRQ_1M (10 * DEVICE_SPI_DEFAULT_FREQUENCY)
|
|
#define DEVICE_SPI_FRQ_5M (5 * DEVICE_SPI_FRQ_1M)
|
|
#define DEVICE_SPI_FRQ_10M (10 * DEVICE_SPI_FRQ_1M)
|
|
#define DEVICE_SPI_FRQ_20M (20 * DEVICE_SPI_FRQ_1M)
|
|
#define DEVICE_SPI_FRQ_30M (30 * DEVICE_SPI_FRQ_1M)
|
|
|
|
#define TEST_DESC_NUM 2
|
|
#define TEST_BUF_SIZE 64
|
|
#define SPI_READ_SIZE (TEST_DESC_NUM * TEST_BUF_SIZE)
|
|
|
|
/* The uart rx pin for communicating with other board. */
|
|
#define UART_CMCN_RX_PIN 41
|
|
|
|
/* The uart tx pin for communicating with other board. */
|
|
#define UART_CMCN_TX_PIN 43
|
|
|
|
#pragma pack(push) /* save the pack status */
|
|
#pragma pack(1) /* 1 byte align */
|
|
|
|
typedef struct _dtest_spi_config_t
|
|
{
|
|
int caseSelect;
|
|
spi_cfg basic_cfg;
|
|
tm_cfg time_cfg;
|
|
} dtest_spi_config_t;
|
|
|
|
typedef struct _dtest_spi_config_rsp_t
|
|
{
|
|
int resault;
|
|
} dtest_spi_config_rsp_t;
|
|
|
|
#pragma pack(pop) /* restore the pack status */
|
|
|
|
void clk_core_freq_75m_set();
|
|
|
|
#endif
|