ConOpSys V2970  P004.07
ANVILEX control operating system
P019_14_KG3_DIO2.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file P019_14_KG3_DIO2.h
3 //! @brief KG3 digital I/O board P019.14 DIO2 V1 T1 hardware driver header file.
4 //! @attention No special attention requered.
5 //! @copyright (C) 2015-2020 ANVILEX LLC
6 //! $HeadURL: https://192.168.3.4:8443/svn/P004_07/ConOpSys/Hardware/P019_14_KG3_DIO2/P019_14_KG3_DIO2.h $
7 //! $Revision: 2305 $
8 //! $Date: 2020-12-25 03:00:01 +0500 (Fr, 25 Dez 2020) $
9 //! $Author: minch $
10 //------------------------------------------------------------------------------
11 //
12 // Redistribution and use in source and binary forms, with or without
13 // modification, are permitted provided that the following conditions are met:
14 //
15 // 1. Redistributions of source code must retain the above copyright notice,
16 // this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright notice,
19 // this list of conditions and the following disclaimer in the documentation
20 // and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of ANVILEX nor the names of its contributors may be
23 // used to endorse or promote products derived from this software without
24 // specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
30 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 // POSSIBILITY OF SUCH DAMAGE.
37 //
38 //------------------------------------------------------------------------------
39 //
40 // TP019_14_KG3_DIO2_T1
41 //
42 //------------------------------------------------------------------------------
43 
44 //------------------------------------------------------------------------------
45 // Protecting header files from mutual, recursive inclusion.
46 //------------------------------------------------------------------------------
47 
48 #pragma once
49 
50 //------------------------------------------------------------------------------
51 // Include standard libraries header files
52 //------------------------------------------------------------------------------
53 
54 //------------------------------------------------------------------------------
55 // Include thrid party header files
56 //------------------------------------------------------------------------------
57 
58 //------------------------------------------------------------------------------
59 // Include ConOpSys header files
60 //------------------------------------------------------------------------------
61 
62 #include "Functional_Block_Base.h"
63 
64 //------------------------------------------------------------------------------
65 // Include ConOpSys application header files
66 //------------------------------------------------------------------------------
67 
68 //! @brief Digital I/O P019.14 board class
69 class TP019_14_KG3_DIO2_T1 : public TFunctional_Block_Base
70 {
71 
72  //----------------------------------------------------------------------------
73  // Public defines, methods and variables
74  //----------------------------------------------------------------------------
75 
76  public:
77 
78  //--------------------------------------------------------------------------
79  // Public defines
80  //--------------------------------------------------------------------------
81 
82  // Register structure for digital I/O access
83  typedef struct
84  {
85 
86  // Unit identification registers
87  U16 u16_Unit_ID_L; //!< 0x00 : Module identification register
88  U16 u16_Unit_ID_H; //!< 0x01 : Module identification register
89 
90  union
91  {
92  U16 u16_Control_Register; //!< 0x02 : Control register
93  U16 u16_Status_Register; //!< 0x02 : Status register
94  };
95  U16 u16_Control_Register_Set; //!< 0x03 : Control register bit set register
96  U16 u16_Control_Register_Reset; //!< 0x04 : Control register bit reset register
97  U16 u16_Control_Register_Toogle; //!< 0x05 : Control register bit toggle register
98 
99  U16 u16_Data_Register; //!< 0x06 : SPI data read and write register
100 
101  U16 u16_Voltage_Set_Point; //!< 0x07 : Voltage control register
102  U16 u16_SPI_Clock_Divider; //!< 0x08 : SPI clock divider register
103  U16 u16_Clock_Divider; //!< 0x09 : CPU clock divider register
104  U16 u16_Reserve_10; //!< 0x0A : Reserved
105  U16 u16_Reserve_11; //!< 0x0B : Reserved
106  U16 u16_Reserve_12; //!< 0x0C : Reserved
107  U16 u16_Reserve_13; //!< 0x0D : Reserved
108  U16 u16_Reserve_14; //!< 0x0E : Reserved
109  U16 u16_Reserve_15; //!< 0x0F : Reserved
110 
112 
113  //--------------------------------------------------------------------------
114  // Public methods
115  //--------------------------------------------------------------------------
116 
117  //!-------------------------------------------------------------------------
118  //! @brief Class constructor method
119  //! @note None
120  //! \par Override
121  //! Not allowed
122  //! @attention Don't call this method directly.
123  //--------------------------------------------------------------------------
124 
126 
127  //!-------------------------------------------------------------------------
128  //! @brief Class destructor method
129  //! @note None
130  //! \par Override
131  //! Not allowed
132  //! @attention Don't call this method directly.
133  //--------------------------------------------------------------------------
134 
136 
137  //!-------------------------------------------------------------------------
138  //! @brief Map method
139  //! @note None
140  //! @param [in] *struct_Registers_Base_Address - Pointer on register base address
141  //! @return None
142  //! \par Override
143  //! Not requered
144  //! @attention None
145  //--------------------------------------------------------------------------
146 
147  VOID Map( TP019_14_KG3_DIO2_Registers *struct_Registers_Base_Address );
148 
149  //!-------------------------------------------------------------------------
150  //! @brief Block initialization method
151  //! @note None
152  //! @return None
153  //! \par Override
154  //! Not requered
155  //! @attention None
156  //--------------------------------------------------------------------------
157 
158  virtual VOID Init();
159 
160  //!-------------------------------------------------------------------------
161  //! @brief Block execution method
162  //! @note None
163  //! @return None
164  //! \par Override
165  //! Not requered
166  //! @attention None
167  //--------------------------------------------------------------------------
168 
169  virtual VOID Execute();
170 
171  //!-------------------------------------------------------------------------
172  //! @brief Return module ID
173  //! @note None
174  //! @return U32 - Module ID
175  //! \par Override
176  //! Not requered
177  //! @attention None
178  //--------------------------------------------------------------------------
179 
181 
182  //!-------------------------------------------------------------------------
183  //! @brief Block execution method
184  //! @note None
185  //! @param [in] *object_Protocol - Pointer on protocol for displaying information
186  //! @return None
187  //! \par Override
188  //! Not requered
189  //! @attention None
190  //--------------------------------------------------------------------------
191 
192  virtual VOID Send_Information( TProtocol_Base *object_Protocol );
193 
194  //--------------------------------------------------------------------------
195  // Public variables
196  //--------------------------------------------------------------------------
197 
198  //--------------------------------------------------------------------------
199  // Function block parameters
200  //--------------------------------------------------------------------------
201 
202  //--------------------------------------------------------------------------
203  // Function block input signals
204  //--------------------------------------------------------------------------
205 
209 
210  //--------------------------------------------------------------------------
211  // Function block output signals
212  //--------------------------------------------------------------------------
213 
216 
217  //--------------------------------------------------------------------------
218  // Protected defines, methods and variables
219  //--------------------------------------------------------------------------
220 
221  protected:
222 
223  //--------------------------------------------------------------------------
224  // Private defines, methods and variables
225  //--------------------------------------------------------------------------
226 
227  private:
228 
229  //--------------------------------------------------------------------------
230  // Private defines
231  //--------------------------------------------------------------------------
232 
233  //!< FSM state definition
234  typedef enum
235  {
236  // Download test firmware
245 
246  // Calibration and data processing
252 
253  // Downloading product firmware
261 
263  enum_Error
264 
266 
267  //! @brief Structure for control register bit parsing
268  typedef union
269  {
270 
271  //! @brief Control register raw data
273 
274  //! @brief Control register bit parsing structure
275  struct
276  {
277 
278  //! @brief Bit 0 - Multibyte flag, controls chip select for multibyte transfer
280 
281  //! @brief Bit 1 - Clock polarity bit
283 
284  //! @brief Bit 2 - Clock phase bit
286 
287  //! @brief Bit 3 - DUT reset bit: 0 - Normal operation, 1 - Reset condition
289 
290  //! @brief Bit 4..5 - DUT clock enable bit: 0 - Clock generation disabled, 1 - Clock generation enabled, 2 - Clock tied low, 3 - Clock tied high
292 
293  //! @brief Bit 6 - ISP protocol enable for FPGA: 0 - Disable, 1 - Enable
295 
296  //! @brief Bit 7 - Reserved
297  U16 :1;
298 
299  //! @brief Bit 8 - Test mode enable: 0 - Disable, 1 - Enable
301 
302  //! @brief Bit 9 - Reserved
303  U16 :1;
304 
305  //! @brief Bit 10 - Reserved
306  U16 :1;
307 
308  //! @brief Bit 11 - Reserved
309  U16 :1;
310 
311  //! @brief Bit 12 - Reserved
312  U16 :1;
313 
314  //! @brief Bit 13 - Mode for red led: 0 - Disable, 1 - Enable
316 
317  //! @brief Bit 14 - Mode for green led: 0 - Disable, 1 - Enable
319 
320  //! @brief Bit 15 - Mode for yellow led: 0 - Disable, 1 - Enable
322 
323  };
324 
325  } TControl_Register;
326 
327  //! @brief Structure for status register bit parsing
328  typedef union
329  {
330 
331  //! @brief Status register raw data
333 
334  //! @brief Status register bit parsing structure
335  struct
336  {
337 
338  //! @brief Bit 0 - SPI transaction in progress flag
340 
341  //! @brief Bit 1 - Reserved
342  U16 :1;
343 
344  //! @brief Bit 2 - Reserved
345  U16 :1;
346 
347  //! @brief Bit 3 - Red sensor status: 0 - Bad status, 1 - Good status
349 
350  //! @brief Bit 4 - Green sensor status: 0 - Bad status, 1 - Good status
352 
353  //! @brief Bit 5 - Reserved
354  U16 :1;
355 
356  //! @brief Bit 6 - Reserved
357  U16 :1;
358 
359  //! @brief Bit 7 - Reserved
360  U16 :1;
361 
362  //! @brief Bit 8 - Reserved
363  U16 :1;
364 
365  //! @brief Bit 9 - Reserved
366  U16 :1;
367 
368  //! @brief Bit 10 - Reserved
369  U16 :1;
370 
371  //! @brief Bit 11 - Reserved
372  U16 :1;
373 
374  //! @brief Bit 12 - Reserved
375  U16 :1;
376 
377  //! @brief Bit 13 - Reserved
378  U16 :1;
379 
380  //! @brief Bit 14 - Reserved
381  U16 :1;
382 
383  //! @brief Bit 15 - Reserved
384  U16 :1;
385 
386  };
387 
388  } TStatus_Register;
389 
390  //! @brief Structure for bit parsing
391  typedef union
392  {
393 
394  //! @brief Raw data
396 
397  //! @brief Data register bit parsing structure
398  struct
399  {
400 
401  //! @brief Bits 0..7 - SPI data
403 
404  //! @brief Bits 8..15 - Not used
405  U16 :8;
406 
407  };
408 
409  } TData_Register;
410 
411 
412  //! @brief Structure for bit parsing
413  typedef union
414  {
415 
416  //! @brief Bits 0..16 - Voltage value
418 
420 
421  //--------------------------------------------------------------------------
422  // Private methods
423  //--------------------------------------------------------------------------
424 
425  //!-------------------------------------------------------------------------
426  //! @brief Exchange data with ATiny13A chip.
427  //! @note None
428  //! @param [in] u8_Transmit_Byte_1 - Data byte 1 for transmitting
429  //! @param [in] u8_Transmit_Byte_2 - Data byte 2 for transmitting
430  //! @param [in] u8_Transmit_Byte_3 - Data byte 3 for transmitting
431  //! @param [in] u8_Transmit_Byte_4 - Data byte 4 for transmitting
432  //! @param [out] *u8_Receive_Byte_1 - Pointer to the variable for data byte 1 receiving
433  //! @param [out] *u8_Receive_Byte_2 - Pointer to the variable for data byte 2 receiving
434  //! @param [out] *u8_Receive_Byte_3 - Pointer to the variable for data byte 3 receiving
435  //! @param [out] *u8_Receive_Byte_4 - Pointer to the variable for data byte 4 receiving
436  //! @return BOOL - Data exchange operation status
437  //! @retval false - Exchange operation failed
438  //! @retval true - Exchange operation successed
439  //! \par Override
440  //! Not requered
441  //! @attention None
442  //--------------------------------------------------------------------------
443 
444  BOOL Exchange_Bytes( U8 u8_Transmit_Byte_1, U8 u8_Transmit_Byte_2, U8 u8_Transmit_Byte_3, U8 u8_Transmit_Byte_4,
445  U8 *u8_Receive_Byte_1, U8 *u8_Receive_Byte_2, U8 *u8_Receive_Byte_3, U8 *u8_Receive_Byte_4 );
446 
447  //!-------------------------------------------------------------------------
448  //! @brief Transmit data to ATiny13A.
449  //! @note None
450  //! @param [in] u8_Transmit_Byte_1 - Data byte 1 for transmitting
451  //! @param [in] u8_Transmit_Byte_2 - Data byte 2 for transmitting
452  //! @param [in] u8_Transmit_Byte_3 - Data byte 3 for transmitting
453  //! @param [in] u8_Transmit_Byte_4 - Data byte 4 for transmitting
454  //! @return BOOL - Data exchange operation status
455  //! @retval false - Transmitting operation failed
456  //! @retval true - Transmitting operation successed
457  //! \par Override
458  //! Not requered
459  //! @attention None
460  //--------------------------------------------------------------------------
461 
462  BOOL Transmit_Bytes( U8 u8_Transmit_Byte_1, U8 u8_Transmit_Byte_2, U8 u8_Transmit_Byte_3, U8 u8_Transmit_Byte_4 );
463 
464  //!-------------------------------------------------------------------------
465  //! @brief Wait while busy bit is set low.
466  //! @note None
467  //! @return BOOL - Operation status
468  //! @retval false - Time is out
469  //! @retval true - Busy bit have low level
470  //! \par Override
471  //! Not requered
472  //! @attention None
473  //--------------------------------------------------------------------------
474 
476 
477  //!-------------------------------------------------------------------------
478  //! @brief Connect to the chip in programming mode.
479  //! @note None
480  //! @return BOOL - Operation status
481  //! @retval false - Connection not available
482  //! @retval true - Successfully connected
483  //! \par Override
484  //! Not requered
485  //! @attention None
486  //--------------------------------------------------------------------------
487 
488  BOOL Chip_Connect();
489 
490  //!-------------------------------------------------------------------------
491  //! @brief Connect to the chip in programming mode.
492  //! @note None
493  //! @return BOOL - Operation status
494  //! @retval false - Operation failed
495  //! @retval true - Successfully disconnected
496  //! \par Override
497  //! Not requered
498  //! @attention None
499  //--------------------------------------------------------------------------
500 
502 
503  //!-------------------------------------------------------------------------
504  //! @brief Erase all blocks of the chip.
505  //! @note None
506  //! @return BOOL - Erase operation status
507  //! @retval false - Erase operation failed
508  //! @retval true - Erase operation successed
509  //! \par Override
510  //! Not requered
511  //! @attention None
512  //--------------------------------------------------------------------------
513 
514  BOOL Chip_Erase();
515 
516  //!-------------------------------------------------------------------------
517  //! @brief Write firmware in the chip.
518  //! @note None
519  //! @param [in] *u8_Programm_Data - Pointer on firmware data
520  //! @param [in] u32_Length - Length of the firmware
521  //! @return BOOL - programming operation status
522  //! @retval false - programming operation failed
523  //! @retval true - programming operation successed
524  //! \par Override
525  //! Not requered
526  //! @attention None
527  //--------------------------------------------------------------------------
528 
529  BOOL Chip_Programming( const U8 *u8_Programm_Data, const U32 u32_Length);
530 
531  //!-------------------------------------------------------------------------
532  //! @brief Read fuse bytes from the chip.
533  //! @note None
534  //! @return BOOL - Read operation status
535  //! @retval false - Read operation failed
536  //! @retval true - Read operation successed
537  //! \par Override
538  //! Not requered
539  //! @attention None
540  //--------------------------------------------------------------------------
541 
543 
544  //!-------------------------------------------------------------------------
545  //! @brief Write fuse bytes to the chip.
546  //! @note None
547  //! @param [in] u8_Low_Bute - Low fuse bite
548  //! @param [in] u8_High_Bute - High fuse bite
549  //! @return BOOL - Write operation status
550  //! @retval false - Write operation failed
551  //! @retval true - Write operation successed
552  //! \par Override
553  //! Not requered
554  //! @attention None
555  //--------------------------------------------------------------------------
556 
557  BOOL Write_Fuse_Bytes( U8 u8_Low_Bute, U8 u8_High_Bute);
558 
559  //!-------------------------------------------------------------------------
560  //! @brief Read signature bytes from the chip.
561  //! @note None
562  //! @return BOOL - Read operation status
563  //! @retval false - Read operation failed
564  //! @retval true - Read operation successed
565  //! \par Override
566  //! Not requered
567  //! @attention None
568  //--------------------------------------------------------------------------
569 
571 
572  //!-------------------------------------------------------------------------
573  //! @brief Read data from the chip for validate.
574  //! @note None
575  //! @param [in] *u8_Programing_Data - Pointer on data for comparative
576  //! @param [in] u16_Length - Length of the data
577  //! @return BOOL - Validate operation status
578  //! @retval false - The data read does not correspond to the required
579  //! @retval true - Data is valid
580  //! \par Override
581  //! Not requered
582  //! @attention None
583  //--------------------------------------------------------------------------
584 
585  BOOL Read_Verify( const U8 *u8_Programing_Data, U16 u16_Length );
586 
587  //!-------------------------------------------------------------------------
588  //! @brief Read data from the chip for validate and check that memory is empty.
589  //! @note None
590  //! @return BOOL - Validate operation status
591  //! @retval false - The data read does not correspond to the required
592  //! @retval true - Data is valid
593  //! \par Override
594  //! Not requered
595  //! @attention None
596  //--------------------------------------------------------------------------
597 
598  BOOL Verify_Erase();
599 
600  //!-------------------------------------------------------------------------
601  //! @brief Read data from the lock byte.
602  //! @note None
603  //! @return BOOL - Read operation status
604  //! @retval false - Operation falled
605  //! @retval true - Operation is done
606  //! \par Override
607  //! Not requered
608  //! @attention None
609  //--------------------------------------------------------------------------
610 
612 
613  //!-------------------------------------------------------------------------
614  //! @brief Write data to lock byte.
615  //! @note None
616  //! @param [in] u8_Lock_Byte - Data witch need to write in Lock byte
617  //! @return BOOL - Write operation status
618  //! @retval false - Operation falled
619  //! @retval true - Operation is done
620  //! \par Override
621  //! Not requered
622  //! @attention None
623  //--------------------------------------------------------------------------
624 
625  BOOL Write_Lock_Byte( U8 u8_Lock_Byte );
626 
627  //!-------------------------------------------------------------------------
628  //! @brief Receiving data from ADC.
629  //! @note None
630  //! @param [out] *u8_Value_High - Pointer on data received from the primary sensor (8..15 bit)
631  //! @param [out] *u8_Value_Low - Pointer on data received from the primary sensor (0..7 bit)
632  //! @return BOOL - Receive operation status
633  //! @retval false - Operation falled
634  //! @retval true - Operation is done
635  //! \par Override
636  //! Not requered
637  //! @attention None
638  //--------------------------------------------------------------------------
639 
640  BOOL Collect_Measured_Data( U8 *u8_Value_High, U8 *u8_Value_Low );
641 
642  //!-------------------------------------------------------------------------
643  //! @brief Processing data reciving from ADC.
644  //! @note None
645  //! @param [in] u16_Voltage_Setpoint - Voltage setting value
646  //! @param [in] u8_Cycles_Number - Number of of measurements
647  //! @param [out] *u16_Measured_Value - Pointer on processed measured value
648  //! @return BOOL - Processing operation status
649  //! @retval false - Data is not valide
650  //! @retval true - Operation is done
651  //! \par Override
652  //! Not requered
653  //! @attention None
654  //--------------------------------------------------------------------------
655 
656  BOOL Processing_Measured_Data( U16 u16_Voltage_Setpoint, U8 u8_Cycles_Number, U16 *u16_Measured_Value );
657 
658  //!-------------------------------------------------------------------------
659  //! @brief Chip reset.
660  //! @note None
661  //! @return None
662  //! \par Override
663  //! Not requered
664  //! @attention None
665  //--------------------------------------------------------------------------
666 
667  VOID Chip_Reset();
668 
669  //!-------------------------------------------------------------------------
670  //! @brief Init parameters for 6 V version.
671  //! @note None
672  //! @return None
673  //! \par Override
674  //! Not requered
675  //! @attention None
676  //--------------------------------------------------------------------------
677 
679 
680  //!-------------------------------------------------------------------------
681  //! @brief Init parameters for 12 V version.
682  //! @note None
683  //! @return None
684  //! \par Override
685  //! Not requered
686  //! @attention None
687  //--------------------------------------------------------------------------
688 
690 
691  //!-------------------------------------------------------------------------
692  //! @brief Init parameters for 24 V version.
693  //! @note None
694  //! @return None
695  //! \par Override
696  //! Not requered
697  //! @attention None
698  //--------------------------------------------------------------------------
699 
701 
702  //--------------------------------------------------------------------------
703  // Private variables
704  //--------------------------------------------------------------------------
705 
706  //! @brief Pointer to the memory area in FPGA address space
708 
709  //! @brief Status register
711 
712  //! @brief Firmware data
714 
715  //! @brief Voltage value
717 
718  //! @brief Manufacturer data Device ID
720 
721  //! @brief Manufacturer serial number
723 
724  //! @brief Manufacturer data factory ID
726 
727  //! @brief DAC Setpoints for startup calibration
729 
730  //! @brief DAC Setpoints for undervoltage calibration
732 
733  //! @brief DAC Setpoints for overvoltage calibration
735 
736  //! @brief Min startup voltage value
738 
739  //! @brief Max startup voltage value
741 
742  //! @brief Min undervoltage voltage value
744 
745  //! @brief Max undervoltage voltage value
747 
748  //! @brief Min overvoltage voltage value
750 
751  //! @brief Max overvoltage voltage value
753 
754  //! @brief Hyst values for startup calibration
756 
757  //! @brief Hyst values for undervoltage calibration
759 
760  //! @brief Hyst values for overvoltage calibration
762 
763  //! @brief Startup measured values
765 
766  //! @brief Undervoltage measured values
768 
769  //! @brief Overvoltage measured values
771 
772  //! @brief Contain state for FSM
774 
775 };
776 
777 //------------------------------------------------------------------------------
778 // End of file
779 //------------------------------------------------------------------------------
int BOOL
Boolean datatype definition.
Definition: Defines.h:124
unsigned char U8
Binary 8-Bit unsigned integer datatype defenition.
Definition: Defines.h:183
void VOID
Datatypesess datatype definition.
Definition: Defines.h:105
unsigned long U32
Binary 32-Bit unsigned integer datatype defenition.
Definition: Defines.h:203
unsigned short U16
Binary 16-Bit unsigned integer datatype defenition.
Definition: Defines.h:193
Function block input connector class.
Definition: Block_Input_Connector.h:83
Function block output connector class.
Definition: Block_Output_Connector.h:59
Digital I/O P019.14 board class.
Definition: P019_14_KG3_DIO2.h:70
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.
Definition: P019_14_KG3_DIO2.cpp:1265
U16 u16_ADC_OV
Overvoltage measured values.
Definition: P019_14_KG3_DIO2.h:770
U32 Get_Module_ID()
Return module ID.
BOOL Chip_Disconnect()
Connect to the chip in programming mode.
Definition: P019_14_KG3_DIO2.cpp:1547
U16 u16_ADC_OV_Hyst
Hyst values for overvoltage calibration.
Definition: P019_14_KG3_DIO2.h:761
volatile TStatus_Register Status_Register
Status register.
Definition: P019_14_KG3_DIO2.h:710
TGlobal_FSM_State
< FSM state definition
Definition: P019_14_KG3_DIO2.h:235
@ enum_Programm_Production_Data
Definition: P019_14_KG3_DIO2.h:257
@ enum_Test_Signature
Definition: P019_14_KG3_DIO2.h:239
@ enum_Startup_Voltage_Calibration
Definition: P019_14_KG3_DIO2.h:247
@ enum_Verify_Programm_Production_Firmware
Definition: P019_14_KG3_DIO2.h:258
@ enum_Verify_Erase_For_Production_Programming
Definition: P019_14_KG3_DIO2.h:256
@ enum_Connect_For_Measurement_Programming
Definition: P019_14_KG3_DIO2.h:238
@ enum_Idle
Definition: P019_14_KG3_DIO2.h:237
@ enum_Done
Definition: P019_14_KG3_DIO2.h:262
@ enum_End_Calibration
Definition: P019_14_KG3_DIO2.h:250
@ enum_Disconnect_After_Production_Programming
Definition: P019_14_KG3_DIO2.h:260
@ enum_Erase_For_Measurement_Programming
Definition: P019_14_KG3_DIO2.h:240
@ enum_Connect_For_Production_Programming
Definition: P019_14_KG3_DIO2.h:254
@ enum_Programm_Measurement_Firmware
Definition: P019_14_KG3_DIO2.h:242
@ enum_Overvoltage_Limit_Calibration
Definition: P019_14_KG3_DIO2.h:249
@ enum_Disconnect_After_Measurement_Programming
Definition: P019_14_KG3_DIO2.h:244
@ enum_Undervoltage_Limit_Calibration
Definition: P019_14_KG3_DIO2.h:248
@ enum_Check_Calibration_Data_Integrity
Definition: P019_14_KG3_DIO2.h:251
@ enum_Verify_Erase_For_Measurement_Programming
Definition: P019_14_KG3_DIO2.h:241
@ enum_Error
Definition: P019_14_KG3_DIO2.h:263
@ enum_Programm_Fuses
Definition: P019_14_KG3_DIO2.h:259
@ enum_Verify_Programm_Measurement_Firmware
Definition: P019_14_KG3_DIO2.h:243
@ enum_Erase_For_Production_Programming
Definition: P019_14_KG3_DIO2.h:255
VOID Init_P009_05_6V()
Init parameters for 6 V version.
Definition: P019_14_KG3_DIO2.cpp:2508
BOOL Read_Fuse_Bytes()
Read fuse bytes from the chip.
Definition: P019_14_KG3_DIO2.cpp:1784
U8 u8_Data_Buffer[512]
Firmware data.
Definition: P019_14_KG3_DIO2.h:713
virtual VOID Execute()
Block execution method.
Definition: P019_14_KG3_DIO2.cpp:303
BOOL Wait_Busy_Bit()
Wait while busy bit is set low.
Definition: P019_14_KG3_DIO2.cpp:1389
TGlobal_FSM_State FSM_State
Contain state for FSM.
Definition: P019_14_KG3_DIO2.h:773
U32 u32_Manufacturer_Data_Production_Factory_ID
Manufacturer data factory ID.
Definition: P019_14_KG3_DIO2.h:725
TBlock_Input_Connector object_u32_Device_ID
Definition: P019_14_KG3_DIO2.h:208
U16 u16_ADC_UV_Hyst
Hyst values for undervoltage calibration.
Definition: P019_14_KG3_DIO2.h:758
BOOL Write_Fuse_Bytes(U8 u8_Low_Bute, U8 u8_High_Bute)
Write fuse bytes to the chip.
Definition: P019_14_KG3_DIO2.cpp:1895
virtual VOID Send_Information(TProtocol_Base *object_Protocol)
Block execution method.
Definition: P019_14_KG3_DIO2.cpp:1046
BOOL Chip_Programming(const U8 *u8_Programm_Data, const U32 u32_Length)
Write firmware in the chip.
Definition: P019_14_KG3_DIO2.cpp:1618
BOOL Write_Lock_Byte(U8 u8_Lock_Byte)
Write data to lock byte.
Definition: P019_14_KG3_DIO2.cpp:2297
U16 u16_ADC_UV_Min
Min undervoltage voltage value.
Definition: P019_14_KG3_DIO2.h:743
U16 u16_DAC_OV_Setpoint
DAC Setpoints for overvoltage calibration.
Definition: P019_14_KG3_DIO2.h:734
U16 u16_ADC_OV_Min
Min overvoltage voltage value.
Definition: P019_14_KG3_DIO2.h:749
TBlock_Input_Connector object_u8_Command
Definition: P019_14_KG3_DIO2.h:207
VOID Map(TP019_14_KG3_DIO2_Registers *struct_Registers_Base_Address)
Map method.
Definition: P019_14_KG3_DIO2.cpp:202
~TP019_14_KG3_DIO2_T1()
Class destructor method.
Definition: P019_14_KG3_DIO2.cpp:194
virtual VOID Init()
Block initialization method.
Definition: P019_14_KG3_DIO2.cpp:217
U16 u16_ADC_UV_Max
Max undervoltage voltage value.
Definition: P019_14_KG3_DIO2.h:746
BOOL Read_Signature_Byte()
Read signature bytes from the chip.
Definition: P019_14_KG3_DIO2.cpp:1928
U16 u16_ADC_SV_Max
Max startup voltage value.
Definition: P019_14_KG3_DIO2.h:740
volatile TP019_14_KG3_DIO2_Registers * struct_Registers
Pointer to the memory area in FPGA address space.
Definition: P019_14_KG3_DIO2.h:707
BOOL Read_Lock_Byte()
Read data from the lock byte.
Definition: P019_14_KG3_DIO2.cpp:2253
U16 u16_ADC_UV
Undervoltage measured values.
Definition: P019_14_KG3_DIO2.h:767
VOID Chip_Reset()
Chip reset.
Definition: P019_14_KG3_DIO2.cpp:2481
U16 u16_DAC_UV_Setpoint
DAC Setpoints for undervoltage calibration.
Definition: P019_14_KG3_DIO2.h:731
BOOL Collect_Measured_Data(U8 *u8_Value_High, U8 *u8_Value_Low)
Receiving data from ADC.
Definition: P019_14_KG3_DIO2.cpp:2340
BOOL Processing_Measured_Data(U16 u16_Voltage_Setpoint, U8 u8_Cycles_Number, U16 *u16_Measured_Value)
Processing data reciving from ADC.
Definition: P019_14_KG3_DIO2.cpp:2383
U32 u32_Manufacturer_Data_Device_ID
Manufacturer data Device ID.
Definition: P019_14_KG3_DIO2.h:719
U16 u16_ADC_OV_Max
Max overvoltage voltage value.
Definition: P019_14_KG3_DIO2.h:752
VOID Init_P009_05_24V()
Init parameters for 24 V version.
Definition: P019_14_KG3_DIO2.cpp:2556
U16 u16_Measured_Value
Voltage value.
Definition: P019_14_KG3_DIO2.h:716
U16 u16_ADC_SV
Startup measured values.
Definition: P019_14_KG3_DIO2.h:764
TBlock_Input_Connector object_bool_Start
Definition: P019_14_KG3_DIO2.h:206
VOID Init_P009_05_12V()
Init parameters for 12 V version.
Definition: P019_14_KG3_DIO2.cpp:2532
BOOL Chip_Connect()
Connect to the chip in programming mode.
Definition: P019_14_KG3_DIO2.cpp:1442
U16 u16_ADC_SV_Hyst
Hyst values for startup calibration.
Definition: P019_14_KG3_DIO2.h:755
BOOL Read_Verify(const U8 *u8_Programing_Data, U16 u16_Length)
Read data from the chip for validate.
Definition: P019_14_KG3_DIO2.cpp:2040
U16 u16_ADC_SV_Min
Min startup voltage value.
Definition: P019_14_KG3_DIO2.h:737
TP019_14_KG3_DIO2_T1()
Class constructor method.
Definition: P019_14_KG3_DIO2.cpp:162
U16 u16_DAC_SV_Setpoint
DAC Setpoints for startup calibration.
Definition: P019_14_KG3_DIO2.h:728
U32 u32_Manufacturer_Data_Serial_Number
Manufacturer serial number.
Definition: P019_14_KG3_DIO2.h:722
BOOL Verify_Erase()
Read data from the chip for validate and check that memory is empty.
Definition: P019_14_KG3_DIO2.cpp:2145
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.
Definition: P019_14_KG3_DIO2.cpp:1071
TBlock_Output_Connector object_bool_Done
Definition: P019_14_KG3_DIO2.h:214
BOOL Chip_Erase()
Erase all blocks of the chip.
Definition: P019_14_KG3_DIO2.cpp:1575
TBlock_Output_Connector object_bool_Error
Definition: P019_14_KG3_DIO2.h:215
Definition: Protocol_Base.h:57
Definition: P019_14_KG3_DIO2.h:84
U16 u16_Control_Register_Reset
0x04 : Control register bit reset register
Definition: P019_14_KG3_DIO2.h:96
U16 u16_Control_Register_Set
0x03 : Control register bit set register
Definition: P019_14_KG3_DIO2.h:95
U16 u16_Reserve_10
0x0A : Reserved
Definition: P019_14_KG3_DIO2.h:104
U16 u16_Reserve_12
0x0C : Reserved
Definition: P019_14_KG3_DIO2.h:106
U16 u16_Reserve_11
0x0B : Reserved
Definition: P019_14_KG3_DIO2.h:105
U16 u16_Voltage_Set_Point
0x07 : Voltage control register
Definition: P019_14_KG3_DIO2.h:101
U16 u16_SPI_Clock_Divider
0x08 : SPI clock divider register
Definition: P019_14_KG3_DIO2.h:102
U16 u16_Data_Register
0x06 : SPI data read and write register
Definition: P019_14_KG3_DIO2.h:99
U16 u16_Unit_ID_L
0x00 : Module identification register
Definition: P019_14_KG3_DIO2.h:87
U16 u16_Control_Register
0x02 : Control register
Definition: P019_14_KG3_DIO2.h:92
U16 u16_Reserve_13
0x0D : Reserved
Definition: P019_14_KG3_DIO2.h:107
U16 u16_Status_Register
0x02 : Status register
Definition: P019_14_KG3_DIO2.h:93
U16 u16_Unit_ID_H
0x01 : Module identification register
Definition: P019_14_KG3_DIO2.h:88
U16 u16_Clock_Divider
0x09 : CPU clock divider register
Definition: P019_14_KG3_DIO2.h:103
U16 u16_Reserve_14
0x0E : Reserved
Definition: P019_14_KG3_DIO2.h:108
U16 u16_Control_Register_Toogle
0x05 : Control register bit toggle register
Definition: P019_14_KG3_DIO2.h:97
U16 u16_Reserve_15
0x0F : Reserved
Definition: P019_14_KG3_DIO2.h:109
U16 u16_ISP_Enable
Bit 6 - ISP protocol enable for FPGA: 0 - Disable, 1 - Enable.
Definition: P019_14_KG3_DIO2.h:294
U16 u16_Green_Led_Enable
Bit 14 - Mode for green led: 0 - Disable, 1 - Enable.
Definition: P019_14_KG3_DIO2.h:318
U16 u16_Multibyte
Bit 0 - Multibyte flag, controls chip select for multibyte transfer.
Definition: P019_14_KG3_DIO2.h:279
U16 u16_Red_Led_Enable
Bit 13 - Mode for red led: 0 - Disable, 1 - Enable.
Definition: P019_14_KG3_DIO2.h:315
U16 u16_VDC_Test_Enable
Bit 8 - Test mode enable: 0 - Disable, 1 - Enable.
Definition: P019_14_KG3_DIO2.h:300
U16 u16_Reset
Bit 3 - DUT reset bit: 0 - Normal operation, 1 - Reset condition.
Definition: P019_14_KG3_DIO2.h:288
U16 u16_Raw_Data
Control register raw data.
Definition: P019_14_KG3_DIO2.h:272
U16 u16_Yellow_Led_Enable
Bit 15 - Mode for yellow led: 0 - Disable, 1 - Enable.
Definition: P019_14_KG3_DIO2.h:321
U16 u16_Clock_Mode
Bit 4..5 - DUT clock enable bit: 0 - Clock generation disabled, 1 - Clock generation enabled,...
Definition: P019_14_KG3_DIO2.h:291
U16 u16_CPHA
Bit 2 - Clock phase bit.
Definition: P019_14_KG3_DIO2.h:285
U16 u16_CPOL
Bit 1 - Clock polarity bit.
Definition: P019_14_KG3_DIO2.h:282
U16 u16_Raw_Data
Raw data.
Definition: P019_14_KG3_DIO2.h:395
U16 u16_Data
Bits 0..7 - SPI data.
Definition: P019_14_KG3_DIO2.h:402
Structure for status register bit parsing.
Definition: P019_14_KG3_DIO2.h:329
U16 u16_Raw_Data
Status register raw data.
Definition: P019_14_KG3_DIO2.h:332
U16 u16_Sensor_Green
Bit 4 - Green sensor status: 0 - Bad status, 1 - Good status.
Definition: P019_14_KG3_DIO2.h:351
U16 u16_Sensor_Red
Bit 3 - Red sensor status: 0 - Bad status, 1 - Good status.
Definition: P019_14_KG3_DIO2.h:348
U16 u16_Busy
Bit 0 - SPI transaction in progress flag.
Definition: P019_14_KG3_DIO2.h:339
Structure for bit parsing.
Definition: P019_14_KG3_DIO2.h:414
U16 u16_Raw_Data
Bits 0..16 - Voltage value.
Definition: P019_14_KG3_DIO2.h:417