1 /*
2  * ==========================================================
3  *
4  *    Copyright (C) 2020 QuickLogic Corporation
5  *    Licensed under the Apache License, Version 2.0 (the "License");
6  *    you may not use this file except in compliance with the License.
7  *    You may obtain a copy of the License at
8  * 		http://www.apache.org/licenses/LICENSE-2.0
9  *    Unless required by applicable law or agreed to in writing, software
10  *    distributed under the License is distributed on an "AS IS" BASIS,
11  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  *    See the License for the specific language governing permissions and
13  *    limitations under the License.
14  *
15  *    File      : eoss3_hal_def.h
16  *    Purpose   : This file contains macros for HAL API status
17  *
18  *
19  * ===========================================================
20  *
21  */
22 
23 /*!	\file eoss3_hal_def.h
24  *
25  *  Created on: Feb 15, 2016
26  *      Author: Rajkumar Thiagarajan
27  *
28  *  \brief .
29  */
30 
31 #ifndef HAL_INC_EOSS3_HAL_DEF_H_
32 #define HAL_INC_EOSS3_HAL_DEF_H_
33 
34 #include <stdint.h>
35 #include <stddef.h>
36 #include "test_types.h"
37 /*! \enum HAL_StatusTypeDef
38  * \brief HAL Status values
39  */
40 typedef enum
41 {
42   HAL_OK       = 0x00,
43   HAL_ERROR    = 0x01,
44   HAL_BUSY     = 0x02,
45   HAL_TIMEOUT  = 0x03
46 } HAL_StatusTypeDef;
47 
48 ///@cond HAL_DEF_MACROS
49 #define BYTE_IDX_0			(0x0)
50 #define BYTE_IDX_1			(0x1)
51 #define BYTE_IDX_2			(0x2)
52 #define BYTE_IDX_3			(0x3)
53 #define BYTE_IDX_4			(0x4)
54 #define BYTE_IDX_5			(0x5)
55 #define BYTE_IDX_6			(0x6)
56 #define BYTE_IDX_7			(0x7)
57 ///@endcond
58 
59 typedef void (*HAL_FBISRfunction) (void);
60 #define FB_INTERRUPT_0                  0
61 #define FB_INTERRUPT_1                  1
62 #define FB_INTERRUPT_2                  2
63 #define FB_INTERRUPT_3                  3
64 #define MAX_FB_INTERRUPTS               4
65 
66 #define FB_INTERRUPT_TYPE_LEVEL         0
67 #define FB_INTERRUPT_TYPE_EDGE          1
68 
69 #define FB_INTERRUPT_POL_EDGE_FALL      0
70 #define FB_INTERRUPT_POL_EDGE_RISE      1
71 
72 #define FB_INTERRUPT_POL_LEVEL_LOW      0
73 #define FB_INTERRUPT_POL_LEVEL_HIGH     1
74 
75 #define FB_INTERRUPT_DEST_AP_ENABLE     1
76 #define FB_INTERRUPT_DEST_AP_DISBLE     0
77 
78 #define FB_INTERRUPT_DEST_M4_ENABLE     1
79 #define FB_INTERRUPT_DEST_M4_DISBLE     0
80 
81 void FB_RegisterISR(UINT32_t fbIrq, HAL_FBISRfunction ISRfn);
82 void FB_ConfigureInterrupt(UINT32_t fbIrq, UINT8_t type, UINT8_t polarity, UINT8_t destAP,UINT8_t destM4 );
83 
84 
85 #endif /* HAL_INC_EOSS3_HAL_DEF_H_ */
86