adc
Diff: communication.h
- Revision:
- 1:5796bdddf29c
- Child:
- 3:1d62b3be52e8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/communication.h Tue Oct 27 12:13:16 2020 +0000 @@ -0,0 +1,29 @@ +#ifndef COMMUNICATION +#define COMMUNICATION + +#include "stm32h7xx_hal.h" + +#define COMMUNICATION_DELAY 1 +#define COMMUNICATION_WAITTING COMMUNICATION_DELAY * 5 + +enum _BOOL_ +{ + _TRUE_ = 1, + _FALSE_ = 0 +}; + +enum OP_TYPE +{ + READ, + WRITE, + CPLT, + NONE +}; + +//void ReceiveUARTPackage(UART_HandleTypeDef *huart, uint8_t *buf, uint8_t len); +//void TransmitUARTPackage(UART_HandleTypeDef *huart, uint8_t *buf, uint8_t len); + +void WriteToRegisterBySPI(SPI_HandleTypeDef *hspi, uint8_t addr, uint8_t *buf, uint8_t len); +void ReadFromRegisterBySPI(SPI_HandleTypeDef *hspi, uint8_t addr, uint8_t *buf, uint8_t len); + +#endif