30 lines
738 B
C
30 lines
738 B
C
#ifndef __USER_SPI_H__
|
|
#define __USER_SPI_H__
|
|
|
|
/* Includes ------------------------------------------------------------------*/
|
|
#include "main.h"
|
|
#include "spi.h"
|
|
|
|
typedef enum
|
|
{
|
|
AD7124 = 0,
|
|
DAC161S997_1 = 1,
|
|
DAC161S997_2 = 2,
|
|
} chip_type_e; // 芯片类型
|
|
|
|
extern int32_t spi_transmit_receive(SPI_HandleTypeDef *hspi, uint8_t *data_write, uint8_t bytes_number);
|
|
|
|
// extern void board_spi_init(chip_type_e chip_type);
|
|
extern void board_spi_cs_on(chip_type_e chip_type);
|
|
extern void board_spi_cs_off(chip_type_e chip_type);
|
|
|
|
void dac161s997_cs_on(uint8_t dac_num);
|
|
void dac161s997_cs_off(uint8_t dac_num);
|
|
void dac161s997_spi_init(void);
|
|
|
|
void ad7124_cs_off(void);
|
|
void ad7124_cs_on(void);
|
|
void ad7124_spi_init(void);
|
|
|
|
#endif
|