#pragma once
/*----------------------------------------------------------------------------*/
/* Includes */
/*----------------------------------------------------------------------------*/
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
/*----------------------------------------------------------------------------*/
/* Definitions */
/*----------------------------------------------------------------------------*/
typedef enum {
ILaS_ERROR,
ILaS_OK,
Ilas_BUSY,
} ILaS_ReturnType;
typedef struct {
uint16_t NetworkNodes;
uint32_t *retData;
} ILaS_ReadDataResultType;
typedef const struct {
uint16_t firstBDCDAdr : 12;
bool Switch_CSP : 1;
uint8_t Event_address_allocation : 4;
bool MemoryAdr : 1;
bool Phaseshift : 1;
bool CRCenable : 1;
bool TempCmpEnable : 1;
bool VoltSwing : 1;
} ILaS_InitType;
/*----------------------------------------------------------------------------*/
/* Signatures */
/*----------------------------------------------------------------------------*/
#ifdef __cplusplus
extern "C" {
#endif
// ILAS API Initialization Functions
ILaS_ReturnType ILaS_Network_Init_Interface(uint8_t nrOfILaSNetworks, bool pSPIMasterSlave);
ILaS_ReturnType ILaS_Network_Init(const ILaS_InitType* NetworkInitPtr, ILaS_ReadDataResultType* NetworkInitResultPtr, uint8_t NetworkNr);
ILaS_ReturnType ILaS_Branch_Init(const ILaS_InitType* NetworkInitPtr, ILaS_ReadDataResultType* NetworkInitResultPtr, uint8_t NetworkNr);
// ILAS API Write Commands
ILaS_ReturnType ILaS_NOP(uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Reset(uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Define_Mcast(uint16_t Param, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_Config(uint16_t Param, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_Bias(uint16_t Param, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Trig_ADC_Cal(uint16_t Param, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_ADC_DAC(uint16_t Param, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Trig_ADC_Meas(uint16_t Param, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_Temp_Offset(uint16_t Param, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_Cur_Ch2(uint16_t Param, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_Cur_Ch1(uint16_t Param, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_Cur_Ch0(uint16_t Param, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_PWM_Max_Hi_Ch2(uint16_t Param, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_PWM_Max_Hi_Ch1(uint16_t Param, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_PWM_Max_Hi_Ch0(uint16_t Param, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_PWM_Max_Low_Ch2(uint16_t Param, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_PWM_Max_Low_Ch1(uint16_t Param, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_PWM_Max_Low_Ch0(uint16_t Param, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_PWM_Max_Ch3(uint16_t Param, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_TC_Base(uint16_t Param, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_TC_Offset(uint16_t Param, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_TC_LUT(uint8_t LUT_Adr, uint16_t LUT_Value, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Burn_Item(uint8_t BurnItem, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_3PWM_Hi(uint8_t CTRL_Hi_Ch2, uint8_t CTRL_Hi_Ch1, uint8_t CTRL_Hi_Ch0, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_3PWM_Low(uint8_t CTRL_Low_Ch2, uint8_t CTRL_Low_Ch1, uint8_t CTRL_Low_Ch0, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_DIM(uint8_t DIM_Ch2, uint8_t DIM_Ch1, uint8_t DIM_Ch0, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_PWM_Ch3(uint32_t CTRL_Ch3, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Write_Register(uint16_t RegVal, uint16_t RegAdd, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Burn_Register(uint16_t Param, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_Fw_Mode(uint8_t FwMode, uint8_t NrOfLA, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_Ps_Mode(uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_Sig_High(uint8_t Param, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Burn_Sig(uint16_t Param, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Burn_Sniff_Mode(uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Set_Port(bool CP_CSP, bool CP_ESP, uint16_t Address, uint16_t NetworkNr);
// ILAS Read Commands
ILaS_ReturnType ILaS_Branch_Read_Temp(ILaS_ReadDataResultType* BranchTempPtr, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Branch_Read_Status(ILaS_ReadDataResultType* BranchStatusPtr, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Branch_Read_ADC(ILaS_ReadDataResultType* BranchADCPtr, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Branch_Read_Item(uint8_t Param, ILaS_ReadDataResultType* BranchItemPtr, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Branch_Read_PWM(ILaS_ReadDataResultType* BranchPWMPtr, uint8_t Param, bool Byte, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Network_Ping(ILaS_ReadDataResultType* NetworkPingPtr, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Branch_Ping(ILaS_ReadDataResultType* BranchPingPtr, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Read_Register(ILaS_ReadDataResultType* ReadRegisterPtr, uint16_t RegAdd, uint16_t Address, uint16_t NetworkNr);
ILaS_ReturnType ILaS_Read_Event(ILaS_ReadDataResultType* ReadEventPtr, uint16_t NetworkNr);
ILaS_ReturnType ILaS_BranchDevices_Read(ILaS_ReadDataResultType* BranchDevicesReadPtr, uint16_t RegAdd, uint16_t NetworkNr);
#ifdef __cplusplus
}
#endif
/*----------------------------------------------------------------------------*/
/* EOF */
/*----------------------------------------------------------------------------*/