Skip to content

Commit

Permalink
Alert code for FW
Browse files Browse the repository at this point in the history
  • Loading branch information
swateeshrivastava committed Mar 13, 2019
1 parent 34ff2e9 commit 46c0324
Show file tree
Hide file tree
Showing 45 changed files with 1,663 additions and 1,192 deletions.
3 changes: 2 additions & 1 deletion firmware/ec/common/inc/global/Framework.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ typedef struct AlertData {
} AlertData;

void OCMP_GenerateAlert(const AlertData *alert_data, unsigned int alert_id,
const void *data);
const void *data, const void *lValue,
OCMPActionType actionType);

#endif /* _SYS_CFG_FRAMEWORK_H */
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ SCHEMA_IMPORT const Driver_fxnTable CAT24C04_gbc_sid_fxnTable;
SCHEMA_IMPORT const Driver_fxnTable CAT24C04_gbc_inv_fxnTable;
SCHEMA_IMPORT const Driver_fxnTable CAT24C04_sdr_inv_fxnTable;
SCHEMA_IMPORT const Driver_fxnTable CAT24C04_fe_inv_fxnTable;
SCHEMA_IMPORT const Driver_fxnTable AT45DB641E_fxnTable;

static const Driver CAT24C04_gbc_sid = {
.name = "EEPROM",
Expand Down
5 changes: 2 additions & 3 deletions firmware/ec/inc/common/spibus.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ ReturnStatus spi_reg_read(SPI_Handle spiHandle, OcGpio_Pin *chip_select,
uint32_t byte, uint8_t numofBytes);

ReturnStatus spi_reg_write(SPI_Handle spiHandle, OcGpio_Pin *chip_select,
void *regAddress, const uint8_t *data,
uint32_t data_size, uint32_t byte,
uint8_t numofBytes);
void *regAddress, uint8_t *data, uint32_t data_size,
uint32_t byte, uint8_t numofBytes);

#endif /* INC_COMMON_SPIBUS_H_ */
2 changes: 2 additions & 0 deletions firmware/ec/inc/devices/at45db.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ typedef void (*AT45DB_CallbackFn)(AT45DB_Event evt, uint16_t value,
typedef struct AT45DB_Cfg {
SPI_Dev dev;
OcGpio_Pin *pin_alert;
const char *fileName[5];
uint8_t noOfFiles;
} AT45DB_Cfg;

typedef struct AT45DB_Obj {
Expand Down
4 changes: 3 additions & 1 deletion firmware/ec/inc/devices/ina226.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* HEADER FILES
*****************************************************************************/
#include "common/inc/global/post_frame.h"
#include "common/inc/global/ocmp_frame.h"
#include "drivers/OcGpio.h"
#include "inc/common/i2cbus.h"

Expand Down Expand Up @@ -76,7 +77,8 @@ typedef enum INA226_Event {
INA226_EVT_CUL, /* Current under limit - based on SUL */
} INA226_Event;

typedef void (*INA226_CallbackFn)(INA226_Event evt, uint16_t value,
typedef void (*INA226_CallbackFn)(INA226_Event evt, OCMPActionType alertAction,
uint16_t value, uint16_t lValue,
void *context);

typedef struct INA226_Cfg {
Expand Down
4 changes: 3 additions & 1 deletion firmware/ec/inc/devices/se98a.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* HEADER FILES
*****************************************************************************/
#include "common/inc/global/post_frame.h"
#include "common/inc/global/ocmp_frame.h"
#include "common/inc/global/Framework.h"
#include "drivers/OcGpio.h"
#include "inc/common/i2cbus.h"
Expand Down Expand Up @@ -50,7 +51,8 @@ typedef enum Se98aAlert {
SE98A_ALERT_CRITICAL
} Se98aAlert;

typedef void (*SE98A_CallbackFn)(SE98A_Event evt, int8_t temperature,
typedef void (*SE98A_CallbackFn)(SE98A_Event evt, OCMPActionType alertAction,
int8_t temperature, int8_t lValue,
void *context);

typedef struct SE98A_Cfg {
Expand Down
2 changes: 2 additions & 0 deletions firmware/ec/platform/oc-sdr/cfg/OC_CONNECT_GBC.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ AT45DB_Dev gbc_spi_flash_memory = {
.chip_select = &(OcGpio_Pin){ &ec_io, OC_EC_FLASH_nCS },
},
.pin_alert = NULL,
.fileName = { "alertLog", "configLog", "bootLog" },
.noOfFiles = 3,
},
.obj = {},
};
Expand Down
Loading

0 comments on commit 46c0324

Please sign in to comment.