-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding new gpio expander driver changes and pdu interface
- Loading branch information
Showing
4 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#ifndef PDU_H | ||
#define PDU_H | ||
|
||
#include <stdint.h> | ||
#include <stdbool.h> | ||
#include "pi4ioe.h" | ||
#include "cmsis_os.h" | ||
|
||
typedef struct { | ||
pi4ioe_t *gpio_exp; | ||
osMutexId_t *mutex; | ||
} pdu_t; | ||
|
||
/* Creates a new PDU interface */ | ||
pdu_t *init_pdu(I2C_HandleTypeDef *hi2c); | ||
|
||
/* Functions to Control PDU */ | ||
int8_t write_pump(pdu_t *pdu, bool status); | ||
int8_t write_fan_radiator(pdu_t *pdu, bool status); | ||
int8_t write_brakelight(pdu_t *pdu, bool status); | ||
int8_t write_fan_battbox(pdu_t *pdu, bool status); | ||
|
||
/* Functions to Read the Status of Fuses from PDU */ | ||
int8_t read_fuse_pump(pdu_t *pdu); | ||
int8_t read_fuse_fan_radiator(pdu_t *pdu); | ||
int8_t read_fuse_fan_battbox(pdu_t *pdu); | ||
int8_t read_fuse_mc(pdu_t *pdu); | ||
int8_t read_fuse_lvbox(pdu_t *pdu); | ||
int8_t read_fuse_dashboard(pdu_t *pdu); | ||
int8_t read_fuse_brakelight(pdu_t *pdu); | ||
int8_t read_fuse_brb(pdu_t *pdu); | ||
|
||
/* Function to read the status of Tractive System Main Switch */ | ||
int8_t read_tsms_sense(pdu_t *pdu); | ||
|
||
#endif /* PDU_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "pdu.h" | ||
|
||
#define PUMP_CTRL 0x00 | ||
#define RADFAN_CTRL 0x01 | ||
#define BRKLIGHT_CTRL 0x02 | ||
#define BATBOXFAN_CTRL 0x03 | ||
#define TSMS_CTRL 0x04 | ||
#define SMBALERT 0x05 | ||
|
||
pdu_t *init_pdu(I2C_HandleTypeDef *hi2c); | ||
|
||
int8_t write_pump(pdu_t *pdu, bool status); | ||
int8_t write_fan_radiator(pdu_t *pdu_t, bool status); | ||
int8_t write_brakelight(pdu_t *pdu, bool status); | ||
int8_t write_fan_battbox(pdu_t *pdu, bool status); | ||
int8_t read_fuse_pump(pdu_t *pdu); | ||
int8_t read_fuse_fan_radiator(pdu_t *pdu); | ||
int8_t read_fuse_fan_battbox(pdu_t *pdu); | ||
int8_t read_fuse_mc(pdu_t *pdu); | ||
int8_t read_fuse_lvbox(pdu_t *pdu); | ||
int8_t read_fuse_dashboard(pdu_t *pdu); | ||
int8_t read_fuse_brakelight(pdu_t *pdu); | ||
int8_t read_fuse_brb(pdu_t *pdu); | ||
int8_t read_tsms_sense(pdu_t *pdu); |
Submodule Embedded-Base
updated
19 files
+25 −0 | .github/workflows/build_cerberus.yml | |
+12 −0 | clang-format | |
+105 −0 | general/include/LTC4015.h | |
+2 −2 | general/include/lsm6dso.h | |
+54 −72 | general/include/ltc68041.h | |
+5 −7 | general/include/m24c32.h | |
+0 −20 | general/include/pi4ioe.h | |
+65 −0 | general/src/LTC4015.c | |
+2 −2 | general/src/lsm6dso.c | |
+822 −678 | general/src/ltc68041.c | |
+24 −63 | general/src/m24c32.c | |
+34 −3 | general/src/pi4ioe.c | |
+60 −0 | middleware/include/eepromdirectory.h | |
+45 −0 | middleware/include/timer.h | |
+90 −0 | middleware/src/eepromdirectory.c | |
+34 −0 | middleware/src/timer.c | |
+23 −74 | platforms/stm32f405/include/can.h | |
+0 −47 | platforms/stm32f405/include/can_config.h | |
+81 −342 | platforms/stm32f405/src/can.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters