adc
communication.h@3:1d62b3be52e8, 2020-10-28 (annotated)
- Committer:
- yuliyasm
- Date:
- Wed Oct 28 15:35:08 2020 +0000
- Revision:
- 3:1d62b3be52e8
- Parent:
- 1:5796bdddf29c
new
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yuliyasm | 1:5796bdddf29c | 1 | #ifndef COMMUNICATION |
yuliyasm | 1:5796bdddf29c | 2 | #define COMMUNICATION |
yuliyasm | 1:5796bdddf29c | 3 | |
yuliyasm | 1:5796bdddf29c | 4 | #include "stm32h7xx_hal.h" |
yuliyasm | 1:5796bdddf29c | 5 | |
yuliyasm | 1:5796bdddf29c | 6 | #define COMMUNICATION_DELAY 1 |
yuliyasm | 1:5796bdddf29c | 7 | #define COMMUNICATION_WAITTING COMMUNICATION_DELAY * 5 |
yuliyasm | 1:5796bdddf29c | 8 | |
yuliyasm | 3:1d62b3be52e8 | 9 | #define ALIGN32_SIZE(SIZE_ALIGN) (((SIZE_ALIGN + 31)/32)*32) |
yuliyasm | 3:1d62b3be52e8 | 10 | |
yuliyasm | 1:5796bdddf29c | 11 | enum _BOOL_ |
yuliyasm | 1:5796bdddf29c | 12 | { |
yuliyasm | 1:5796bdddf29c | 13 | _TRUE_ = 1, |
yuliyasm | 1:5796bdddf29c | 14 | _FALSE_ = 0 |
yuliyasm | 1:5796bdddf29c | 15 | }; |
yuliyasm | 1:5796bdddf29c | 16 | |
yuliyasm | 1:5796bdddf29c | 17 | enum OP_TYPE |
yuliyasm | 1:5796bdddf29c | 18 | { |
yuliyasm | 1:5796bdddf29c | 19 | READ, |
yuliyasm | 1:5796bdddf29c | 20 | WRITE, |
yuliyasm | 1:5796bdddf29c | 21 | CPLT, |
yuliyasm | 1:5796bdddf29c | 22 | NONE |
yuliyasm | 1:5796bdddf29c | 23 | }; |
yuliyasm | 1:5796bdddf29c | 24 | |
yuliyasm | 1:5796bdddf29c | 25 | //void ReceiveUARTPackage(UART_HandleTypeDef *huart, uint8_t *buf, uint8_t len); |
yuliyasm | 1:5796bdddf29c | 26 | //void TransmitUARTPackage(UART_HandleTypeDef *huart, uint8_t *buf, uint8_t len); |
yuliyasm | 1:5796bdddf29c | 27 | |
yuliyasm | 1:5796bdddf29c | 28 | void WriteToRegisterBySPI(SPI_HandleTypeDef *hspi, uint8_t addr, uint8_t *buf, uint8_t len); |
yuliyasm | 1:5796bdddf29c | 29 | void ReadFromRegisterBySPI(SPI_HandleTypeDef *hspi, uint8_t addr, uint8_t *buf, uint8_t len); |
yuliyasm | 1:5796bdddf29c | 30 | |
yuliyasm | 1:5796bdddf29c | 31 | #endif |