lark1fq/test/src/ltc1867.h

36 lines
910 B
C
Raw Normal View History

2024-05-01 21:43:05 +08:00
#ifndef __LTC1867_H__
#define __LTC1867_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "stm32f4xx.h"
#define LEDIR_FREQ (8)
#define TIMER_SRC_FREQ (84 * 1000 * 1000)
#define TIMER_PERIOD_DELAY (TIMER_SRC_FREQ / 1000 / 1000 * 35 / 10 - 1) /* 3.5us */
#define TIMER_INTERVAL (32)
#define PORT_LEDIR (GPIOB)
#define PIN_LEDIR (GPIO_Pin_0)
#define PORT_LTC1867 (GPIOA)
#define PIN_CONV (GPIO_Pin_4)
#define PORT_SPI (GPIOA)
#define PIN_SPI_CS (GPIO_Pin_4)
#define PIN_SPI_SCK (GPIO_Pin_5)
#define PIN_SPI_SDO (GPIO_Pin_6)
#define PIN_SPI_SDI (GPIO_Pin_7)
void ltc1867_init(void);
void ltc1867_delay(void);
void ltc1867_conv(void);
void ltc1867_spi_select(void);
uint16_t ltc1867_transfer(uint16_t data_send);
#ifdef __cplusplus
}
#endif
#endif /* __LTC1867_H__ */