30 lines
603 B
C
30 lines
603 B
C
#ifndef __HDL_SPI4_H_
|
|
#define __HDL_SPI4_H_
|
|
|
|
#include "hc32_ll.h"
|
|
#include "hdl_clk.h"
|
|
|
|
//logic spi4
|
|
#define SPI4_CLOCK FCG1_PERIPH_SPI1
|
|
#define SPI4_INSTANCE CM_SPI1
|
|
|
|
#define SPI4_SCLK_PORT GPIO_PORT_A
|
|
#define SPI4_SCLK_PIN GPIO_PIN_03
|
|
#define SPI4_SCLK_FUNC GPIO_FUNC_43
|
|
|
|
#define SPI4_MISO_PORT GPIO_PORT_A
|
|
#define SPI4_MISO_PIN GPIO_PIN_01
|
|
#define SPI4_MISO_FUNC GPIO_FUNC_41
|
|
|
|
#define SPI4_MOSI_PORT GPIO_PORT_A
|
|
#define SPI4_MOSI_PIN GPIO_PIN_04
|
|
#define SPI4_MOSI_FUNC GPIO_FUNC_40
|
|
|
|
void hdl_spi4_init(void);
|
|
|
|
uint8_t hdl_spi4_txrx(uint8_t w_data);
|
|
|
|
#endif
|
|
|
|
|