ConOpSys V2970
P004.07
ANVILEX control operating system
|
Digital I/O P019.14 board class. More...
#include <P019_14_KG3_DIO2.h>
Classes | |
union | TControl_Register |
Structure for control register bit parsing. More... | |
union | TData_Register |
Structure for bit parsing. More... | |
struct | TP019_14_KG3_DIO2_Registers |
union | TStatus_Register |
Structure for status register bit parsing. More... | |
union | TVoltage_Set_Point_Register |
Structure for bit parsing. More... | |
Public Member Functions | |
TP019_14_KG3_DIO2_T1 () | |
Class constructor method. More... | |
~TP019_14_KG3_DIO2_T1 () | |
Class destructor method. More... | |
VOID | Map (TP019_14_KG3_DIO2_Registers *struct_Registers_Base_Address) |
Map method. More... | |
virtual VOID | Init () |
Block initialization method. More... | |
virtual VOID | Execute () |
Block execution method. More... | |
U32 | Get_Module_ID () |
Return module ID. More... | |
virtual VOID | Send_Information (TProtocol_Base *object_Protocol) |
Block execution method. More... | |
Private Member Functions | |
BOOL | Exchange_Bytes (U8 u8_Transmit_Byte_1, U8 u8_Transmit_Byte_2, U8 u8_Transmit_Byte_3, U8 u8_Transmit_Byte_4, U8 *u8_Receive_Byte_1, U8 *u8_Receive_Byte_2, U8 *u8_Receive_Byte_3, U8 *u8_Receive_Byte_4) |
Exchange data with ATiny13A chip. More... | |
BOOL | Transmit_Bytes (U8 u8_Transmit_Byte_1, U8 u8_Transmit_Byte_2, U8 u8_Transmit_Byte_3, U8 u8_Transmit_Byte_4) |
Transmit data to ATiny13A. More... | |
BOOL | Wait_Busy_Bit () |
Wait while busy bit is set low. More... | |
BOOL | Chip_Connect () |
Connect to the chip in programming mode. More... | |
BOOL | Chip_Disconnect () |
Connect to the chip in programming mode. More... | |
BOOL | Chip_Erase () |
Erase all blocks of the chip. More... | |
BOOL | Chip_Programming (const U8 *u8_Programm_Data, const U32 u32_Length) |
Write firmware in the chip. More... | |
BOOL | Read_Fuse_Bytes () |
Read fuse bytes from the chip. More... | |
BOOL | Write_Fuse_Bytes (U8 u8_Low_Bute, U8 u8_High_Bute) |
Write fuse bytes to the chip. More... | |
BOOL | Read_Signature_Byte () |
Read signature bytes from the chip. More... | |
BOOL | Read_Verify (const U8 *u8_Programing_Data, U16 u16_Length) |
Read data from the chip for validate. More... | |
BOOL | Verify_Erase () |
Read data from the chip for validate and check that memory is empty. More... | |
BOOL | Read_Lock_Byte () |
Read data from the lock byte. More... | |
BOOL | Write_Lock_Byte (U8 u8_Lock_Byte) |
Write data to lock byte. More... | |
BOOL | Collect_Measured_Data (U8 *u8_Value_High, U8 *u8_Value_Low) |
Receiving data from ADC. More... | |
BOOL | Processing_Measured_Data (U16 u16_Voltage_Setpoint, U8 u8_Cycles_Number, U16 *u16_Measured_Value) |
Processing data reciving from ADC. More... | |
VOID | Chip_Reset () |
Chip reset. More... | |
VOID | Init_P009_05_6V () |
Init parameters for 6 V version. More... | |
VOID | Init_P009_05_12V () |
Init parameters for 12 V version. More... | |
VOID | Init_P009_05_24V () |
Init parameters for 24 V version. More... | |
Private Attributes | |
volatile TP019_14_KG3_DIO2_Registers * | struct_Registers |
Pointer to the memory area in FPGA address space. More... | |
volatile TStatus_Register | Status_Register |
Status register. More... | |
U8 | u8_Data_Buffer [512] |
Firmware data. More... | |
U16 | u16_Measured_Value |
Voltage value. More... | |
U32 | u32_Manufacturer_Data_Device_ID |
Manufacturer data Device ID. More... | |
U32 | u32_Manufacturer_Data_Serial_Number |
Manufacturer serial number. More... | |
U32 | u32_Manufacturer_Data_Production_Factory_ID |
Manufacturer data factory ID. More... | |
U16 | u16_DAC_SV_Setpoint |
DAC Setpoints for startup calibration. More... | |
U16 | u16_DAC_UV_Setpoint |
DAC Setpoints for undervoltage calibration. More... | |
U16 | u16_DAC_OV_Setpoint |
DAC Setpoints for overvoltage calibration. More... | |
U16 | u16_ADC_SV_Min |
Min startup voltage value. More... | |
U16 | u16_ADC_SV_Max |
Max startup voltage value. More... | |
U16 | u16_ADC_UV_Min |
Min undervoltage voltage value. More... | |
U16 | u16_ADC_UV_Max |
Max undervoltage voltage value. More... | |
U16 | u16_ADC_OV_Min |
Min overvoltage voltage value. More... | |
U16 | u16_ADC_OV_Max |
Max overvoltage voltage value. More... | |
U16 | u16_ADC_SV_Hyst |
Hyst values for startup calibration. More... | |
U16 | u16_ADC_UV_Hyst |
Hyst values for undervoltage calibration. More... | |
U16 | u16_ADC_OV_Hyst |
Hyst values for overvoltage calibration. More... | |
U16 | u16_ADC_SV |
Startup measured values. More... | |
U16 | u16_ADC_UV |
Undervoltage measured values. More... | |
U16 | u16_ADC_OV |
Overvoltage measured values. More... | |
TGlobal_FSM_State | FSM_State |
Contain state for FSM. More... | |
Digital I/O P019.14 board class.
|
private |
< FSM state definition
TP019_14_KG3_DIO2_T1::TP019_14_KG3_DIO2_T1 | ( | ) |
Class constructor method.
References object_bool_Done, object_bool_Error, object_bool_Start, object_u32_Device_ID, object_u8_Command, TBlock_Connector::Set_Type(), and TBlock_Input_Connector::Set_Type().
TP019_14_KG3_DIO2_T1::~TP019_14_KG3_DIO2_T1 | ( | ) |
Class destructor method.
|
private |
Connect to the chip in programming mode.
false | - Connection not available |
true | - Successfully connected |
References TSystem_Timer_Base::Delay_ms(), Exchange_Bytes(), NULL, object_System_Timer, struct_Registers, TP019_14_KG3_DIO2_T1::TControl_Register::u16_Clock_Mode, TP019_14_KG3_DIO2_T1::TP019_14_KG3_DIO2_Registers::u16_Control_Register_Reset, TP019_14_KG3_DIO2_T1::TP019_14_KG3_DIO2_Registers::u16_Control_Register_Set, TP019_14_KG3_DIO2_T1::TControl_Register::u16_CPHA, TP019_14_KG3_DIO2_T1::TControl_Register::u16_CPOL, TP019_14_KG3_DIO2_T1::TControl_Register::u16_ISP_Enable, TP019_14_KG3_DIO2_T1::TControl_Register::u16_Raw_Data, and TP019_14_KG3_DIO2_T1::TControl_Register::u16_Reset.
Referenced by Execute().
|
private |
Connect to the chip in programming mode.
false | - Operation failed |
true | - Successfully disconnected |
References TConOpSys_Variant_Data::bool_Value, object_bool_Done, object_bool_Error, TBlock_Connector::object_Storage, TConOpSys_Variant::struct_Data, struct_Registers, TP019_14_KG3_DIO2_T1::TP019_14_KG3_DIO2_Registers::u16_Control_Register_Reset, TP019_14_KG3_DIO2_T1::TControl_Register::u16_Raw_Data, and TP019_14_KG3_DIO2_T1::TControl_Register::u16_Reset.
Referenced by Execute().
|
private |
Erase all blocks of the chip.
false | - Erase operation failed |
true | - Erase operation successed |
References Transmit_Bytes().
Referenced by Execute().
|
private |
Write firmware in the chip.
[in] | *u8_Programm_Data | - Pointer on firmware data |
[in] | u32_Length | - Length of the firmware |
false | - programming operation failed |
true | - programming operation successed |
References Exchange_Bytes(), TSystem_Timer_Base::Is_Timeout_ms(), NULL, object_System_Timer, Transmit_Bytes(), and true.
Referenced by Execute().
|
private |
Chip reset.
References THigh_Precision_Timer_Base::Delay(), object_Delay_Timer, struct_Registers, TP019_14_KG3_DIO2_T1::TP019_14_KG3_DIO2_Registers::u16_Control_Register_Reset, TP019_14_KG3_DIO2_T1::TP019_14_KG3_DIO2_Registers::u16_Control_Register_Set, TP019_14_KG3_DIO2_T1::TControl_Register::u16_Raw_Data, and TP019_14_KG3_DIO2_T1::TControl_Register::u16_Reset.
Referenced by Processing_Measured_Data().
Receiving data from ADC.
[out] | *u8_Value_High | - Pointer on data received from the primary sensor (8..15 bit) |
[out] | *u8_Value_Low | - Pointer on data received from the primary sensor (0..7 bit) |
false | - Operation falled |
true | - Operation is done |
References Exchange_Bytes(), and NULL.
Referenced by Processing_Measured_Data().
|
private |
Exchange data with ATiny13A chip.
[in] | u8_Transmit_Byte_1 | - Data byte 1 for transmitting |
[in] | u8_Transmit_Byte_2 | - Data byte 2 for transmitting |
[in] | u8_Transmit_Byte_3 | - Data byte 3 for transmitting |
[in] | u8_Transmit_Byte_4 | - Data byte 4 for transmitting |
[out] | *u8_Receive_Byte_1 | - Pointer to the variable for data byte 1 receiving |
[out] | *u8_Receive_Byte_2 | - Pointer to the variable for data byte 2 receiving |
[out] | *u8_Receive_Byte_3 | - Pointer to the variable for data byte 3 receiving |
[out] | *u8_Receive_Byte_4 | - Pointer to the variable for data byte 4 receiving |
false | - Exchange operation failed |
true | - Exchange operation successed |
References NULL, struct_Registers, TP019_14_KG3_DIO2_T1::TData_Register::u16_Data, TP019_14_KG3_DIO2_T1::TP019_14_KG3_DIO2_Registers::u16_Data_Register, TP019_14_KG3_DIO2_T1::TData_Register::u16_Raw_Data, and Wait_Busy_Bit().
Referenced by Chip_Connect(), Chip_Programming(), Collect_Measured_Data(), Read_Fuse_Bytes(), Read_Lock_Byte(), Read_Signature_Byte(), Read_Verify(), and Verify_Erase().
|
virtual |
Block execution method.
References TConOpSys_Variant_Data::bool_Value, Chip_Connect(), Chip_Disconnect(), Chip_Erase(), Chip_Programming(), enum_Check_Calibration_Data_Integrity, enum_Connect_For_Measurement_Programming, enum_Connect_For_Production_Programming, enum_Disconnect_After_Measurement_Programming, enum_Disconnect_After_Production_Programming, enum_End_Calibration, enum_Erase_For_Measurement_Programming, enum_Erase_For_Production_Programming, enum_Error, enum_Idle, enum_Overvoltage_Limit_Calibration, enum_Programm_Fuses, enum_Programm_Measurement_Firmware, enum_Programm_Production_Data, enum_Startup_Voltage_Calibration, enum_Test_Signature, enum_Undervoltage_Limit_Calibration, enum_Verify_Erase_For_Measurement_Programming, enum_Verify_Erase_For_Production_Programming, enum_Verify_Programm_Measurement_Firmware, enum_Verify_Programm_Production_Firmware, FSM_State, MEASURMENT_LOOP_COUNT, object_bool_Done, object_bool_Error, object_bool_Start, TBlock_Input_Connector::object_Pointer, TBlock_Connector::object_Storage, P009_05_Image_Length, P009_05_M_Image_Length, TConOpSys_Variant_Data::pbool_Value, Processing_Measured_Data(), Read_Signature_Byte(), Read_Verify(), TConOpSys_Variant::struct_Data, struct_Registers, u16_ADC_OV, u16_ADC_OV_Hyst, u16_ADC_SV, u16_ADC_SV_Hyst, u16_ADC_UV, u16_ADC_UV_Hyst, TP019_14_KG3_DIO2_T1::TP019_14_KG3_DIO2_Registers::u16_Control_Register_Reset, TP019_14_KG3_DIO2_T1::TP019_14_KG3_DIO2_Registers::u16_Control_Register_Set, u16_DAC_OV_Setpoint, u16_DAC_SV_Setpoint, u16_DAC_UV_Setpoint, TP019_14_KG3_DIO2_T1::TControl_Register::u16_Raw_Data, TP019_14_KG3_DIO2_T1::TControl_Register::u16_VDC_Test_Enable, TP019_14_KG3_DIO2_T1::TP019_14_KG3_DIO2_Registers::u16_Voltage_Set_Point, u32_Manufacturer_Data_Device_ID, u32_Manufacturer_Data_Production_Factory_ID, u32_Manufacturer_Data_Serial_Number, u8_Data_Buffer, u8_P009_05_Image, u8_P009_05_M_Image, and Verify_Erase().
U32 TP019_14_KG3_DIO2_T1::Get_Module_ID | ( | ) |
Return module ID.
|
virtual |
Block initialization method.
References DEFAULT_DEVICE_SERIAL_NUMBER, DEVICE_ID_P009_05_12V, DEVICE_ID_P009_05_24V, DEVICE_ID_P009_05_6V, Init_P009_05_12V(), Init_P009_05_24V(), Init_P009_05_6V(), TBlock_Connector::object_Storage, object_u32_Device_ID, PRODUCTION_FACTORY_ID, TConOpSys_Variant::struct_Data, struct_Registers, TP019_14_KG3_DIO2_T1::TP019_14_KG3_DIO2_Registers::u16_Clock_Divider, TP019_14_KG3_DIO2_T1::TP019_14_KG3_DIO2_Registers::u16_Control_Register, TP019_14_KG3_DIO2_T1::TP019_14_KG3_DIO2_Registers::u16_SPI_Clock_Divider, u32_Manufacturer_Data_Device_ID, u32_Manufacturer_Data_Production_Factory_ID, u32_Manufacturer_Data_Serial_Number, and TConOpSys_Variant_Data::u32_Value.
|
private |
Init parameters for 12 V version.
References u16_ADC_OV_Hyst, u16_ADC_OV_Max, u16_ADC_OV_Min, u16_ADC_SV_Hyst, u16_ADC_SV_Max, u16_ADC_SV_Min, u16_ADC_UV_Hyst, u16_ADC_UV_Max, u16_ADC_UV_Min, u16_DAC_OV_Setpoint, u16_DAC_SV_Setpoint, and u16_DAC_UV_Setpoint.
Referenced by Init().
|
private |
Init parameters for 24 V version.
References u16_ADC_OV_Hyst, u16_ADC_OV_Max, u16_ADC_OV_Min, u16_ADC_SV_Hyst, u16_ADC_SV_Max, u16_ADC_SV_Min, u16_ADC_UV_Hyst, u16_ADC_UV_Max, u16_ADC_UV_Min, u16_DAC_OV_Setpoint, u16_DAC_SV_Setpoint, and u16_DAC_UV_Setpoint.
Referenced by Init().
|
private |
Init parameters for 6 V version.
References u16_ADC_OV_Hyst, u16_ADC_OV_Max, u16_ADC_OV_Min, u16_ADC_SV_Hyst, u16_ADC_SV_Max, u16_ADC_SV_Min, u16_ADC_UV_Hyst, u16_ADC_UV_Max, u16_ADC_UV_Min, u16_DAC_OV_Setpoint, u16_DAC_SV_Setpoint, and u16_DAC_UV_Setpoint.
Referenced by Init().
VOID TP019_14_KG3_DIO2_T1::Map | ( | TP019_14_KG3_DIO2_Registers * | struct_Registers_Base_Address | ) |
Map method.
[in] | *struct_Registers_Base_Address | - Pointer on register base address |
References struct_Registers.
|
private |
Processing data reciving from ADC.
[in] | u16_Voltage_Setpoint | - Voltage setting value |
[in] | u8_Cycles_Number | - Number of of measurements |
[out] | *u16_Measured_Value | - Pointer on processed measured value |
false | - Data is not valide |
true | - Operation is done |
References Chip_Reset(), Collect_Measured_Data(), Compose_U16(), THigh_Precision_Timer_Base::Delay(), object_Delay_Timer, struct_Registers, u16_Measured_Value, and TP019_14_KG3_DIO2_T1::TP019_14_KG3_DIO2_Registers::u16_Voltage_Set_Point.
Referenced by Execute().
|
private |
Read fuse bytes from the chip.
false | - Read operation failed |
true | - Read operation successed |
References Exchange_Bytes(), false, and NULL.
|
private |
Read data from the lock byte.
false | - Operation falled |
true | - Operation is done |
References Exchange_Bytes(), false, and NULL.
|
private |
Read signature bytes from the chip.
false | - Read operation failed |
true | - Read operation successed |
References Exchange_Bytes(), false, and NULL.
Referenced by Execute().
Read data from the chip for validate.
[in] | *u8_Programing_Data | - Pointer on data for comparative |
[in] | u16_Length | - Length of the data |
false | - The data read does not correspond to the required |
true | - Data is valid |
References Exchange_Bytes(), false, and NULL.
Referenced by Execute().
|
virtual |
Block execution method.
[in] | *object_Protocol | - Pointer on protocol for displaying information |
References struct_Registers, TProtocol_Base::Transmit_String(), TProtocol_Base::Transmit_U32_Value_As_Hex(), TP019_14_KG3_DIO2_T1::TP019_14_KG3_DIO2_Registers::u16_Unit_ID_H, and TP019_14_KG3_DIO2_T1::TP019_14_KG3_DIO2_Registers::u16_Unit_ID_L.
|
private |
Transmit data to ATiny13A.
[in] | u8_Transmit_Byte_1 | - Data byte 1 for transmitting |
[in] | u8_Transmit_Byte_2 | - Data byte 2 for transmitting |
[in] | u8_Transmit_Byte_3 | - Data byte 3 for transmitting |
[in] | u8_Transmit_Byte_4 | - Data byte 4 for transmitting |
false | - Transmitting operation failed |
true | - Transmitting operation successed |
References struct_Registers, TP019_14_KG3_DIO2_T1::TData_Register::u16_Data, TP019_14_KG3_DIO2_T1::TP019_14_KG3_DIO2_Registers::u16_Data_Register, TP019_14_KG3_DIO2_T1::TData_Register::u16_Raw_Data, and Wait_Busy_Bit().
Referenced by Chip_Erase(), Chip_Programming(), Write_Fuse_Bytes(), and Write_Lock_Byte().
|
private |
Read data from the chip for validate and check that memory is empty.
false | - The data read does not correspond to the required |
true | - Data is valid |
References Exchange_Bytes(), false, and NULL.
Referenced by Execute().
|
private |
Wait while busy bit is set low.
false | - Time is out |
true | - Busy bit have low level |
References TSystem_Timer_Base::Is_Timeout_ms(), object_System_Timer, Status_Register, struct_Registers, true, TP019_14_KG3_DIO2_T1::TStatus_Register::u16_Busy, TP019_14_KG3_DIO2_T1::TStatus_Register::u16_Raw_Data, and TP019_14_KG3_DIO2_T1::TP019_14_KG3_DIO2_Registers::u16_Status_Register.
Referenced by Exchange_Bytes(), and Transmit_Bytes().
Write fuse bytes to the chip.
[in] | u8_Low_Bute | - Low fuse bite |
[in] | u8_High_Bute | - High fuse bite |
false | - Write operation failed |
true | - Write operation successed |
References Transmit_Bytes().
Write data to lock byte.
[in] | u8_Lock_Byte | - Data witch need to write in Lock byte |
false | - Operation falled |
true | - Operation is done |
References Transmit_Bytes().
|
private |
Contain state for FSM.
Referenced by Execute().
TBlock_Output_Connector TP019_14_KG3_DIO2_T1::object_bool_Done |
Referenced by Chip_Disconnect(), Execute(), and TP019_14_KG3_DIO2_T1().
TBlock_Output_Connector TP019_14_KG3_DIO2_T1::object_bool_Error |
Referenced by Chip_Disconnect(), Execute(), and TP019_14_KG3_DIO2_T1().
TBlock_Input_Connector TP019_14_KG3_DIO2_T1::object_bool_Start |
Referenced by Execute(), and TP019_14_KG3_DIO2_T1().
TBlock_Input_Connector TP019_14_KG3_DIO2_T1::object_u32_Device_ID |
Referenced by Init(), and TP019_14_KG3_DIO2_T1().
TBlock_Input_Connector TP019_14_KG3_DIO2_T1::object_u8_Command |
Referenced by TP019_14_KG3_DIO2_T1().
|
private |
Status register.
Referenced by Wait_Busy_Bit().
|
private |
Pointer to the memory area in FPGA address space.
Referenced by Chip_Connect(), Chip_Disconnect(), Chip_Reset(), Exchange_Bytes(), Execute(), Init(), Map(), Processing_Measured_Data(), Send_Information(), Transmit_Bytes(), and Wait_Busy_Bit().
|
private |
Hyst values for overvoltage calibration.
Referenced by Execute(), Init_P009_05_12V(), Init_P009_05_24V(), and Init_P009_05_6V().
|
private |
Max overvoltage voltage value.
Referenced by Init_P009_05_12V(), Init_P009_05_24V(), and Init_P009_05_6V().
|
private |
Min overvoltage voltage value.
Referenced by Init_P009_05_12V(), Init_P009_05_24V(), and Init_P009_05_6V().
|
private |
Hyst values for startup calibration.
Referenced by Execute(), Init_P009_05_12V(), Init_P009_05_24V(), and Init_P009_05_6V().
|
private |
Max startup voltage value.
Referenced by Init_P009_05_12V(), Init_P009_05_24V(), and Init_P009_05_6V().
|
private |
Min startup voltage value.
Referenced by Init_P009_05_12V(), Init_P009_05_24V(), and Init_P009_05_6V().
|
private |
Hyst values for undervoltage calibration.
Referenced by Execute(), Init_P009_05_12V(), Init_P009_05_24V(), and Init_P009_05_6V().
|
private |
Max undervoltage voltage value.
Referenced by Init_P009_05_12V(), Init_P009_05_24V(), and Init_P009_05_6V().
|
private |
Min undervoltage voltage value.
Referenced by Init_P009_05_12V(), Init_P009_05_24V(), and Init_P009_05_6V().
|
private |
DAC Setpoints for overvoltage calibration.
Referenced by Execute(), Init_P009_05_12V(), Init_P009_05_24V(), and Init_P009_05_6V().
|
private |
DAC Setpoints for startup calibration.
Referenced by Execute(), Init_P009_05_12V(), Init_P009_05_24V(), and Init_P009_05_6V().
|
private |
DAC Setpoints for undervoltage calibration.
Referenced by Execute(), Init_P009_05_12V(), Init_P009_05_24V(), and Init_P009_05_6V().
|
private |
Voltage value.
Referenced by Processing_Measured_Data().
|
private |
|
private |
|
private |