foxBMS - Unit Tests  1.2.1
The foxBMS Unit Tests API Documentation
n775.h File Reference

Headers for the driver for the MC33775A monitoring chip. More...

#include "n775_cfg.h"
Include dependency graph for n775.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void N775_Trigger (void)
 trigger function for the N775 driver state machine. More...
 
N775_RETURN_TYPE_e N775_SetStateRequest (N775_STATE_REQUEST_e statereq)
 sets the current state request of the state variable n775_state. More...
 
bool N775_IsFirstMeasurementCycleFinished (void)
 gets the measurement initialization status. More...
 
void N775_SaveVoltages (void)
 
void N775_SaveTemperatures (void)
 
N775_STATE_REQUEST_e N775_GetStateRequest (void)
 gets the current state request. More...
 
N775_STATEMACH_e N775_GetState (void)
 gets the current state. More...
 
uint8_t TEST_N775_CheckReEntrance ()
 
void TEST_N775_SetFirstMeasurementCycleFinished (N775_STATE_s *n775_state)
 

Variables

uint16_t n775_RXbuffer [N775_MAX_N_BYTES_FOR_DATA_RECEPTION]
 
uint16_t n775_TXbuffer [N775_TX_MESSAGE_LENGTH]
 
N775_MESSAGE_s n775_sentData
 
N775_MESSAGE_s n775_receivedData
 
N775_STATE_s n775_state
 

Detailed Description

Headers for the driver for the MC33775A monitoring chip.

SPDX-License-Identifier: BSD-3-Clause

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

We kindly request you to use one or more of the following phrases to refer to foxBMS in your hardware, software, documentation or advertising materials:

  • ″This product uses parts of foxBMS®″
  • ″This product includes parts of foxBMS®″
  • ″This product is derived from foxBMS®″
Author
foxBMS Team
Date
2020-05-08 (date of creation)
Updated
2020-05-08 (date of last update)
Prefix
N775

Definition in file n775.h.

Function Documentation

◆ N775_GetState()

N775_STATEMACH_e N775_GetState ( void  )

gets the current state.

This function is used in the functioning of the N775 state machine.

Returns
current state, taken from N775_STATEMACH_e

Definition at line 315 of file n775.c.

◆ N775_GetStateRequest()

N775_STATE_REQUEST_e N775_GetStateRequest ( void  )

gets the current state request.

This function is used in the functioning of the N775 state machine.

Returns
retval current state request, taken from N775_STATE_REQUEST_e

Definition at line 298 of file n775.c.

Here is the call graph for this function:

◆ N775_IsFirstMeasurementCycleFinished()

bool N775_IsFirstMeasurementCycleFinished ( void  )

gets the measurement initialization status.

Returns
retval true if a first measurement cycle was made, false otherwise

Definition at line 532 of file n775.c.

Here is the call graph for this function:

◆ N775_SaveTemperatures()

void N775_SaveTemperatures ( void  )

◆ N775_SaveVoltages()

void N775_SaveVoltages ( void  )

◆ N775_SetStateRequest()

N775_RETURN_TYPE_e N775_SetStateRequest ( N775_STATE_REQUEST_e  statereq)

sets the current state request of the state variable n775_state.

This function is used to make a state request to the state machine,e.g, start voltage measurement, read result of voltage measurement, re-initialization It calls N775_CheckStateRequest() to check if the request is valid. The state request is rejected if is not valid. The result of the check is returned immediately, so that the requester can act in case it made a non-valid state request.

Parameters
statereqstate request to set
Returns
retVal current state request, taken from N775_STATE_REQUEST_e

Definition at line 339 of file n775.c.

Here is the call graph for this function:

◆ N775_Trigger()

void N775_Trigger ( void  )

trigger function for the N775 driver state machine.

This function contains the sequence of events in the N775 state machine. It must be called time-triggered, every 1ms.

Definition at line 353 of file n775.c.

Here is the call graph for this function:

◆ TEST_N775_CheckReEntrance()

uint8_t TEST_N775_CheckReEntrance ( )

Definition at line 287 of file n775.c.

Here is the call graph for this function:

◆ TEST_N775_SetFirstMeasurementCycleFinished()

void TEST_N775_SetFirstMeasurementCycleFinished ( N775_STATE_s n775_state)

Definition at line 551 of file n775.c.

Here is the call graph for this function:

Variable Documentation

◆ n775_receivedData

N775_MESSAGE_s n775_receivedData
extern

Struct used for SPI Rx transmissions for the communicaiton with MC33775A.

Definition at line 86 of file n775.c.

◆ n775_RXbuffer

uint16_t n775_RXbuffer[N775_MAX_N_BYTES_FOR_DATA_RECEPTION]
extern

Buffer used for SPI Rx transmissions for the communication with MC33775A.

Definition at line 81 of file n775.c.

◆ n775_sentData

N775_MESSAGE_s n775_sentData
extern

Struct used for SPI Tx transmissions for the communicaiton with MC33775A.

Definition at line 85 of file n775.c.

◆ n775_state

N775_STATE_s n775_state
extern

Variable containing the state machine state for the MC33775A driver.

Definition at line 108 of file n775.c.

◆ n775_TXbuffer

uint16_t n775_TXbuffer[N775_TX_MESSAGE_LENGTH]
extern

Buffer used for SPI Tx transmissions for the communication with MC33775A.

Definition at line 82 of file n775.c.