![]() |
foxBMS
1.6.0
The foxBMS Battery Management System API Documentation
|
CAN driver Rx callback implementation. More...
#include "can_cbs_rx.h"
#include "can_cfg_rx-message-definitions.h"
#include "can_helper.h"
#include "diag.h"
#include <stdint.h>
Go to the source code of this file.
Macros | |
#define | CANRX_PARTICULAR_MATTER_CONCENTRATION_START_BIT (7u) |
#define | CANRX_PARTICULAR_MATTER_CONCENTRATION_LENGTH (16u) |
#define | CANRX_AEROSOL_SENSOR_STATUS_START_BIT (34u) |
#define | CANRX_AEROSOL_SENSOR_STATUS_LENGTH (3u) |
#define | CANRX_AEROSOL_SENSOR_FAULTS_START_BIT (39u) |
#define | CANRX_AEROSOL_SENSOR_FAULTS_LENGTH (5u) |
#define | CANRX_AEROSOL_SENSOR_CRC_CHECK_CODE_START_BIT (63u) |
#define | CANRX_AEROSOL_SENSOR_CRC_CHECK_CODE_LENGTH (8u) |
#define | CANRX_AEROSOL_SENSOR_STATUS_NORMAL (0u) |
#define | CANRX_AEROSOL_SENSOR_STATUS_ALARM (1u) |
#define | CANRX_AEROSOL_SENSOR_NO_ERROR (0u) |
#define | CANRX_AEROSOL_SENSOR_PHOTOELECTRIC_ERROR (1u) |
#define | CANRX_AEROSOL_SENSOR_VOLTAGE_SUPPLY_OVER_VOLTAGE_ERROR (2u) |
#define | CANRX_AEROSOL_SENSOR_VOLTAGE_SUPPLY_UNDER_VOLTAGE_ERROR (3u) |
Functions | |
static void | CANRX_HandleAerosolSensorErrors (const CAN_SHIM_s *const kpkCanShim, uint16_t signalData) |
Sets error flags in database as received from can message. More... | |
static void | CANRX_HandleAerosolSensorStatus (const CAN_SHIM_s *const kpkCanShim, uint16_t signalData) |
Sets sensor status in database. More... | |
static void | CANRX_SetParticulateMatterConcentration (const CAN_SHIM_s *const kpkCanShim, uint16_t signalData) |
Sets current particulate matter measurement value in database. More... | |
static void | CANRX_SetAerosolSensorCrcCheckCode (const CAN_SHIM_s *const kpkCanShim, uint16_t signalData) |
Sets CRC check code from sensor in database. More... | |
uint32_t | CANRX_AerosolSensor (CAN_MESSAGE_PROPERTIES_s message, const uint8_t *const kpkCanData, const CAN_SHIM_s *const kpkCanShim) |
can rx callback function for aerosol sensor messages More... | |
CAN driver Rx callback implementation.
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:
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:
CAN Rx callback for aerosol sensor measurements
Definition in file can_cbs_rx_aerosol-sensor.c.
#define CANRX_AEROSOL_SENSOR_CRC_CHECK_CODE_LENGTH (8u) |
Definition at line 72 of file can_cbs_rx_aerosol-sensor.c.
#define CANRX_AEROSOL_SENSOR_CRC_CHECK_CODE_START_BIT (63u) |
Definition at line 71 of file can_cbs_rx_aerosol-sensor.c.
#define CANRX_AEROSOL_SENSOR_FAULTS_LENGTH (5u) |
Definition at line 70 of file can_cbs_rx_aerosol-sensor.c.
#define CANRX_AEROSOL_SENSOR_FAULTS_START_BIT (39u) |
Definition at line 69 of file can_cbs_rx_aerosol-sensor.c.
#define CANRX_AEROSOL_SENSOR_NO_ERROR (0u) |
Definition at line 79 of file can_cbs_rx_aerosol-sensor.c.
#define CANRX_AEROSOL_SENSOR_PHOTOELECTRIC_ERROR (1u) |
Definition at line 80 of file can_cbs_rx_aerosol-sensor.c.
#define CANRX_AEROSOL_SENSOR_STATUS_ALARM (1u) |
Definition at line 76 of file can_cbs_rx_aerosol-sensor.c.
#define CANRX_AEROSOL_SENSOR_STATUS_LENGTH (3u) |
Definition at line 68 of file can_cbs_rx_aerosol-sensor.c.
#define CANRX_AEROSOL_SENSOR_STATUS_NORMAL (0u) |
Definition at line 75 of file can_cbs_rx_aerosol-sensor.c.
#define CANRX_AEROSOL_SENSOR_STATUS_START_BIT (34u) |
Definition at line 67 of file can_cbs_rx_aerosol-sensor.c.
#define CANRX_AEROSOL_SENSOR_VOLTAGE_SUPPLY_OVER_VOLTAGE_ERROR (2u) |
Definition at line 81 of file can_cbs_rx_aerosol-sensor.c.
#define CANRX_AEROSOL_SENSOR_VOLTAGE_SUPPLY_UNDER_VOLTAGE_ERROR (3u) |
Definition at line 82 of file can_cbs_rx_aerosol-sensor.c.
#define CANRX_PARTICULAR_MATTER_CONCENTRATION_LENGTH (16u) |
Definition at line 66 of file can_cbs_rx_aerosol-sensor.c.
#define CANRX_PARTICULAR_MATTER_CONCENTRATION_START_BIT (7u) |
Definition at line 65 of file can_cbs_rx_aerosol-sensor.c.
uint32_t CANRX_AerosolSensor | ( | CAN_MESSAGE_PROPERTIES_s | message, |
const uint8_t *const | kpkCanData, | ||
const CAN_SHIM_s *const | kpkCanShim | ||
) |
can rx callback function for aerosol sensor messages
[in] | message | contains the message ID, DLC and endianness |
[in] | kpkCanData | payload of can frame |
[in] | kpkCanShim | shim to the database entries |
Definition at line 179 of file can_cbs_rx_aerosol-sensor.c.
|
static |
Sets error flags in database as received from can message.
kpkCanShim | const pointer to can shim |
signalData | data from can message that covers errors |
Definition at line 118 of file can_cbs_rx_aerosol-sensor.c.
|
static |
Sets sensor status in database.
kpkCanShim | const pointer to can shim |
signalData | data from can message that covers status |
Definition at line 145 of file can_cbs_rx_aerosol-sensor.c.
|
static |
Sets CRC check code from sensor in database.
kpkCanShim | const pointer to can shim |
signalData | data from can message that covers crc check code |
Definition at line 170 of file can_cbs_rx_aerosol-sensor.c.
|
static |
Sets current particulate matter measurement value in database.
kpkCanShim | const pointer to can shim |
signalData | data from can message that covers particulate matter measurement |
Definition at line 163 of file can_cbs_rx_aerosol-sensor.c.