Yuliya Smirnova / ADE7912

Dependents:   h7adc

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers communication.h Source File

communication.h

00001 #ifndef COMMUNICATION
00002 #define COMMUNICATION
00003 
00004 #include "stm32h7xx_hal.h"
00005 
00006 #define COMMUNICATION_DELAY 1
00007 #define COMMUNICATION_WAITTING COMMUNICATION_DELAY * 5
00008 
00009 #define ALIGN32_SIZE(SIZE_ALIGN) (((SIZE_ALIGN + 31)/32)*32)
00010 
00011 enum _BOOL_
00012 {
00013     _TRUE_ = 1,
00014     _FALSE_ = 0 
00015 };
00016 
00017 enum OP_TYPE
00018 {
00019     READ,
00020     WRITE,
00021     CPLT,
00022     NONE
00023 };
00024 
00025 //void ReceiveUARTPackage(UART_HandleTypeDef *huart, uint8_t *buf, uint8_t len);
00026 //void TransmitUARTPackage(UART_HandleTypeDef *huart, uint8_t *buf, uint8_t len);
00027 
00028 void WriteToRegisterBySPI(SPI_HandleTypeDef *hspi, uint8_t addr, uint8_t *buf, uint8_t len);
00029 void ReadFromRegisterBySPI(SPI_HandleTypeDef *hspi, uint8_t addr, uint8_t *buf, uint8_t len);
00030 
00031 #endif