foxBMS - Unit Tests  1.2.1
The foxBMS Unit Tests API Documentation
nxp_afe.c
Go to the documentation of this file.
1 /**
2  *
3  * @copyright © 2010 - 2021, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V.
4  * All rights reserved.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice, this
12  * list of conditions and the following disclaimer.
13  *
14  * 2. Redistributions in binary form must reproduce the above copyright notice,
15  * this list of conditions and the following disclaimer in the documentation
16  * and/or other materials provided with the distribution.
17  *
18  * 3. Neither the name of the copyright holder nor the names of its
19  * contributors may be used to endorse or promote products derived from
20  * this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  *
33  * We kindly request you to use one or more of the following phrases to refer to
34  * foxBMS in your hardware, software, documentation or advertising materials:
35  *
36  * - ″This product uses parts of foxBMS®″
37  * - ″This product includes parts of foxBMS®″
38  * - ″This product is derived from foxBMS®″
39  *
40  */
41 
42 /**
43  * @file nxp_afe.c
44  * @author foxBMS Team
45  * @date 2020-05-25 (date of creation)
46  * @updated 2020-06-17 (date of last update)
47  * @ingroup DRIVER
48  * @prefix AFE
49  *
50  * @brief AFE driver implementation for NXP ICs
51  */
52 
53 /*========== Includes =======================================================*/
54 #include "general.h"
55 /* clang-format off */
56 #include "afe.h"
57 /* clang-format on */
58 #include "dma.h"
59 #include "afe_dma.h"
60 #include "n775.h"
61 
62 /*========== Macros and Definitions =========================================*/
63 
64 /*========== Static Constant and Variable Definitions =======================*/
65 
66 /*========== Extern Constant and Variable Definitions =======================*/
67 
68 /*========== Static Function Prototypes =====================================*/
69 
70 /*========== Static Function Implementations ================================*/
71 
72 /*========== Extern Function Implementations ================================*/
74  N775_Trigger();
75  return STD_OK;
76 }
77 
79  return STD_OK;
80 }
81 
84 
86  retval = STD_OK;
87  }
88 
89  return retval;
90 }
91 
94 }
95 
96 extern STD_RETURN_TYPE_e AFE_RequestIoWrite(uint8_t string) {
98 
99  return (retval);
100 }
101 
102 extern STD_RETURN_TYPE_e AFE_RequestIoRead(uint8_t string) {
103  STD_RETURN_TYPE_e retval = STD_NOT_OK;
104 
105  return (retval);
106 }
107 
109  STD_RETURN_TYPE_e retval = STD_NOT_OK;
110 
111  return (retval);
112 }
113 
115  STD_RETURN_TYPE_e retval = STD_NOT_OK;
116 
117  return (retval);
118 }
119 
120 extern STD_RETURN_TYPE_e AFE_RequestEepromRead(uint8_t string) {
121  STD_RETURN_TYPE_e retval = STD_NOT_OK;
122 
123  return (retval);
124 }
125 
127  STD_RETURN_TYPE_e retVal = STD_NOT_OK;
128 
129  return (retVal);
130 }
131 
133  STD_RETURN_TYPE_e retVal = STD_NOT_OK;
134 
135  return (retVal);
136 }
137 
138 /*========== Externalized Static Function Implementations (Unit Test) =======*/
AFE driver header.
Headers for the driver for the general DMA module of monitoring ICs.
Headers for the driver for the DMA module.
@ STD_NOT_OK
Definition: fstd_types.h:82
@ STD_OK
Definition: fstd_types.h:81
enum STD_RETURN_TYPE STD_RETURN_TYPE_e
General macros and definitions for the whole platform.
bool N775_IsFirstMeasurementCycleFinished(void)
gets the measurement initialization status.
Definition: n775.c:532
void N775_Trigger(void)
trigger function for the N775 driver state machine.
Definition: n775.c:353
N775_RETURN_TYPE_e N775_SetStateRequest(N775_STATE_REQUEST_e statereq)
sets the current state request of the state variable n775_state.
Definition: n775.c:339
Headers for the driver for the MC33775A monitoring chip.
@ N775_OK
Definition: n775_defs.h:129
@ N775_STATE_INIT_REQUEST
Definition: n775_defs.h:121
STD_RETURN_TYPE_e AFE_RequestEepromRead(uint8_t string)
Makes the request to the AFE state machine to read from the external EEPROM on slaves.
Definition: nxp_afe.c:120
STD_RETURN_TYPE_e AFE_RequestEepromWrite(uint8_t string)
Makes the request to the AFE state machine to write to the external EEPROM on slaves.
Definition: nxp_afe.c:126
STD_RETURN_TYPE_e AFE_RequestIoRead(uint8_t string)
Makes the request to the AFE state machine to read from the IO port-expander.
Definition: nxp_afe.c:102
STD_RETURN_TYPE_e AFE_TriggerIc(void)
Definition: nxp_afe.c:73
STD_RETURN_TYPE_e AFE_RequestOpenWireCheck(uint8_t string)
Makes the request to the AFE state machine to perform open-wire check.
Definition: nxp_afe.c:132
bool AFE_IsFirstMeasurementCycleFinished(void)
Checks if the first AFE measurement cycle was made.
Definition: nxp_afe.c:92
STD_RETURN_TYPE_e AFE_RequestBalancingFeedbackRead(uint8_t string)
Makes the request to the AFE state machine to read balancing feedback from the slaves.
Definition: nxp_afe.c:114
STD_RETURN_TYPE_e AFE_RequestTemperatureRead(uint8_t string)
Makes the request to the AFE state machine to read from the external temperature sensor on slaves.
Definition: nxp_afe.c:108
STD_RETURN_TYPE_e AFE_RequestIoWrite(uint8_t string)
Makes the request to the AFE state machine to write to the IO port-expander.
Definition: nxp_afe.c:96
STD_RETURN_TYPE_e AFE_Initialize(void)
Definition: nxp_afe.c:78
STD_RETURN_TYPE_e AFE_StartMeasurement(void)
Makes the initialization request to the AFE state machine.
Definition: nxp_afe.c:82