adc

Dependents:   h7adc

communication.h

Committer:
yuliyasm
Date:
2020-10-28
Revision:
3:1d62b3be52e8
Parent:
1:5796bdddf29c

File content as of revision 3:1d62b3be52e8:

#ifndef COMMUNICATION
#define COMMUNICATION

#include "stm32h7xx_hal.h"

#define COMMUNICATION_DELAY 1
#define COMMUNICATION_WAITTING COMMUNICATION_DELAY * 5

#define ALIGN32_SIZE(SIZE_ALIGN) (((SIZE_ALIGN + 31)/32)*32)

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