Bar Logo 3.8/7.6 kw Totem pole Demonstration Application (Part-No. (not specified))
 
Content
     
Loading...
Searching...
No Matches
drv_spi.h
Go to the documentation of this file.
1
11/*
12 (c) 2022 Microchip Technology Inc. and its subsidiaries. You may use this
13 software and any derivatives exclusively with Microchip products.
14
15 THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
16 EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
17 WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
18 PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
19 WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
20
21 IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
22 INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
23 WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
24 BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
25 FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
26 ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
27 THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
28
29 MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
30 TERMS.
31*/
32
33
34#ifndef _DRV_SPI_H
35#define _DRV_SPI_H
36
37#include <xc.h>
38#include <stdbool.h>
39
40// SPI timeout in seconds. If SPI message not received within this time, trigger timeout
41#define SPI_TIMEOUT (1.0e-3)
42
43// convert timeout to 100us ticks as the timeout is measured in the 100us scheduler
44#define SPI_TIMEOUT_IN_100us_TICKS ((uint16_t)(SPI_TIMEOUT/100.0e-6))
45
46//======================================================================================================================
47// @brief function prototypes
48//======================================================================================================================
49void Drv_SPI_Reset_Timeout_Counter(uint16_t count);
50void Drv_SPI_Timeout(void);
53
54bool Drv_SPI_Checksum(void);
55uint16_t* Drv_SPI_get_Adr_Data_Obj(void); //TODO: remove
56
57//======================================================================================================================
58// @brief static declarations
59//======================================================================================================================
60
61#endif /* XC_HEADER_TEMPLATE_H */
62
bool Drv_SPI_get_Connected_Flag(void)
Definition drv_spi.c:102
void Drv_SPI_Reset_Timeout_Counter(uint16_t count)
Definition drv_spi.c:87
void Drv_SPI_Timeout(void)
Definition drv_spi.c:146
uint16_t * Drv_SPI_get_Adr_Data_Obj(void)
Definition drv_spi.c:131
bool Drv_SPI_Checksum(void)
Definition drv_spi.c:172
bool Drv_SPI_get_ChecksumOK_Flag(void)
Definition drv_spi.c:117