Update repo

This commit is contained in:
hangpersonal committed 2026-08-30 23:04:35 -07:00
1 parent 749dab5721
commit ce65a0f59a
14950 files changed
+4408250 -1

No files matched your search

@@ -0,0 +1,91 @@
#ifndef _CRCTABLE0X04C11DB7_H_
#define _CRCTABLE0X04C11DB7_H_
//#############################################################################
//! \file include/common/CrcTable0x04C11DB7.h
//!
//! \brief CRC Lookup Table for polynomial 0x04C11DB7
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
#define POLYNOMIAL32P1 0x04C11DB7
const unsigned long crc32P1Table[] = {
0x00000000, 0x04C11DB7, 0x09823B6E, 0x0D4326D9, 0x130476DC, 0x17C56B6B, 0x1A864DB2, 0x1E475005,
0x2608EDB8, 0x22C9F00F, 0x2F8AD6D6, 0x2B4BCB61, 0x350C9B64, 0x31CD86D3, 0x3C8EA00A, 0x384FBDBD,
0x4C11DB70, 0x48D0C6C7, 0x4593E01E, 0x4152FDA9, 0x5F15ADAC, 0x5BD4B01B, 0x569796C2, 0x52568B75,
0x6A1936C8, 0x6ED82B7F, 0x639B0DA6, 0x675A1011, 0x791D4014, 0x7DDC5DA3, 0x709F7B7A, 0x745E66CD,
0x9823B6E0, 0x9CE2AB57, 0x91A18D8E, 0x95609039, 0x8B27C03C, 0x8FE6DD8B, 0x82A5FB52, 0x8664E6E5,
0xBE2B5B58, 0xBAEA46EF, 0xB7A96036, 0xB3687D81, 0xAD2F2D84, 0xA9EE3033, 0xA4AD16EA, 0xA06C0B5D,
0xD4326D90, 0xD0F37027, 0xDDB056FE, 0xD9714B49, 0xC7361B4C, 0xC3F706FB, 0xCEB42022, 0xCA753D95,
0xF23A8028, 0xF6FB9D9F, 0xFBB8BB46, 0xFF79A6F1, 0xE13EF6F4, 0xE5FFEB43, 0xE8BCCD9A, 0xEC7DD02D,
0x34867077, 0x30476DC0, 0x3D044B19, 0x39C556AE, 0x278206AB, 0x23431B1C, 0x2E003DC5, 0x2AC12072,
0x128E9DCF, 0x164F8078, 0x1B0CA6A1, 0x1FCDBB16, 0x018AEB13, 0x054BF6A4, 0x0808D07D, 0x0CC9CDCA,
0x7897AB07, 0x7C56B6B0, 0x71159069, 0x75D48DDE, 0x6B93DDDB, 0x6F52C06C, 0x6211E6B5, 0x66D0FB02,
0x5E9F46BF, 0x5A5E5B08, 0x571D7DD1, 0x53DC6066, 0x4D9B3063, 0x495A2DD4, 0x44190B0D, 0x40D816BA,
0xACA5C697, 0xA864DB20, 0xA527FDF9, 0xA1E6E04E, 0xBFA1B04B, 0xBB60ADFC, 0xB6238B25, 0xB2E29692,
0x8AAD2B2F, 0x8E6C3698, 0x832F1041, 0x87EE0DF6, 0x99A95DF3, 0x9D684044, 0x902B669D, 0x94EA7B2A,
0xE0B41DE7, 0xE4750050, 0xE9362689, 0xEDF73B3E, 0xF3B06B3B, 0xF771768C, 0xFA325055, 0xFEF34DE2,
0xC6BCF05F, 0xC27DEDE8, 0xCF3ECB31, 0xCBFFD686, 0xD5B88683, 0xD1799B34, 0xDC3ABDED, 0xD8FBA05A,
0x690CE0EE, 0x6DCDFD59, 0x608EDB80, 0x644FC637, 0x7A089632, 0x7EC98B85, 0x738AAD5C, 0x774BB0EB,
0x4F040D56, 0x4BC510E1, 0x46863638, 0x42472B8F, 0x5C007B8A, 0x58C1663D, 0x558240E4, 0x51435D53,
0x251D3B9E, 0x21DC2629, 0x2C9F00F0, 0x285E1D47, 0x36194D42, 0x32D850F5, 0x3F9B762C, 0x3B5A6B9B,
0x0315D626, 0x07D4CB91, 0x0A97ED48, 0x0E56F0FF, 0x1011A0FA, 0x14D0BD4D, 0x19939B94, 0x1D528623,
0xF12F560E, 0xF5EE4BB9, 0xF8AD6D60, 0xFC6C70D7, 0xE22B20D2, 0xE6EA3D65, 0xEBA91BBC, 0xEF68060B,
0xD727BBB6, 0xD3E6A601, 0xDEA580D8, 0xDA649D6F, 0xC423CD6A, 0xC0E2D0DD, 0xCDA1F604, 0xC960EBB3,
0xBD3E8D7E, 0xB9FF90C9, 0xB4BCB610, 0xB07DABA7, 0xAE3AFBA2, 0xAAFBE615, 0xA7B8C0CC, 0xA379DD7B,
0x9B3660C6, 0x9FF77D71, 0x92B45BA8, 0x9675461F, 0x8832161A, 0x8CF30BAD, 0x81B02D74, 0x857130C3,
0x5D8A9099, 0x594B8D2E, 0x5408ABF7, 0x50C9B640, 0x4E8EE645, 0x4A4FFBF2, 0x470CDD2B, 0x43CDC09C,
0x7B827D21, 0x7F436096, 0x7200464F, 0x76C15BF8, 0x68860BFD, 0x6C47164A, 0x61043093, 0x65C52D24,
0x119B4BE9, 0x155A565E, 0x18197087, 0x1CD86D30, 0x029F3D35, 0x065E2082, 0x0B1D065B, 0x0FDC1BEC,
0x3793A651, 0x3352BBE6, 0x3E119D3F, 0x3AD08088, 0x2497D08D, 0x2056CD3A, 0x2D15EBE3, 0x29D4F654,
0xC5A92679, 0xC1683BCE, 0xCC2B1D17, 0xC8EA00A0, 0xD6AD50A5, 0xD26C4D12, 0xDF2F6BCB, 0xDBEE767C,
0xE3A1CBC1, 0xE760D676, 0xEA23F0AF, 0xEEE2ED18, 0xF0A5BD1D, 0xF464A0AA, 0xF9278673, 0xFDE69BC4,
0x89B8FD09, 0x8D79E0BE, 0x803AC667, 0x84FBDBD0, 0x9ABC8BD5, 0x9E7D9662, 0x933EB0BB, 0x97FFAD0C,
0xAFB010B1, 0xAB710D06, 0xA6322BDF, 0xA2F33668, 0xBCB4666D, 0xB8757BDA, 0xB5365D03, 0xB1F740B4,
};
#endif // _CRCTABLE0X04C11DB7_H_
// End of File
@@ -0,0 +1,94 @@
#ifndef _CRCTABLE0X04C11DB7REFLECTED_H_
#define _CRCTABLE0X04C11DB7REFLECTED_H_
//#############################################################################
//! \file include/common/CrcTable0x04C11DB7Reflected.h
//!
//! \brief CRC Lookup Table for the polynomial 0x04C11DB7 for a reflected algorithm
//! i.e. the bits shifted out of the accumulator from the right instead of the
//! left
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
#define POLYNOMIAL32P1 0x04C11DB7
const unsigned long crc32P1TableReflected[] = {
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D,
};
#endif // _CRCTABLE0X04C11DB7REFLECTED_H_
// End of File
@@ -0,0 +1,92 @@
#ifndef _CRCTABLE0X1021_H_
#define _CRCTABLE0X1021_H_
//#############################################################################
//! \file include/common/CrcTable0x1021.h
//!
//! \brief CRC Lookup Table for polynomial 0x1021
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
#define POLYNOMIAL16P2 0x1021
const unsigned short crc16P2Table[] = {
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,
0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE,
0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485,
0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D,
0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4,
0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC,
0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823,
0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B,
0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12,
0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A,
0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41,
0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49,
0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70,
0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78,
0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F,
0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067,
0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E,
0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256,
0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D,
0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C,
0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634,
0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB,
0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3,
0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A,
0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92,
0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9,
0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1,
0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8,
0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0,
};
#endif // _CRCTABLE0X1021_H_
// End of File
@@ -0,0 +1,93 @@
#ifndef _CRCTABLE0X1021REFLECTED_H_
#define _CRCTABLE0X1021REFLECTED_H_
//#############################################################################
//! \file include/common/CrcTable0x1021Reflected.h
//!
//! \brief CRC Lookup Table for the polynomial 0x1021 for a reflected algorithm
//! i.e. the bits shifted out of the accumulator from the right instead of the
//! left
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
#define POLYNOMIAL16P2 0x1021
const unsigned short crc16P2TableReflected[] = {
0x0000, 0x1189, 0x2312, 0x329B, 0x4624, 0x57AD, 0x6536, 0x74BF,
0x8C48, 0x9DC1, 0xAF5A, 0xBED3, 0xCA6C, 0xDBE5, 0xE97E, 0xF8F7,
0x1081, 0x0108, 0x3393, 0x221A, 0x56A5, 0x472C, 0x75B7, 0x643E,
0x9CC9, 0x8D40, 0xBFDB, 0xAE52, 0xDAED, 0xCB64, 0xF9FF, 0xE876,
0x2102, 0x308B, 0x0210, 0x1399, 0x6726, 0x76AF, 0x4434, 0x55BD,
0xAD4A, 0xBCC3, 0x8E58, 0x9FD1, 0xEB6E, 0xFAE7, 0xC87C, 0xD9F5,
0x3183, 0x200A, 0x1291, 0x0318, 0x77A7, 0x662E, 0x54B5, 0x453C,
0xBDCB, 0xAC42, 0x9ED9, 0x8F50, 0xFBEF, 0xEA66, 0xD8FD, 0xC974,
0x4204, 0x538D, 0x6116, 0x709F, 0x0420, 0x15A9, 0x2732, 0x36BB,
0xCE4C, 0xDFC5, 0xED5E, 0xFCD7, 0x8868, 0x99E1, 0xAB7A, 0xBAF3,
0x5285, 0x430C, 0x7197, 0x601E, 0x14A1, 0x0528, 0x37B3, 0x263A,
0xDECD, 0xCF44, 0xFDDF, 0xEC56, 0x98E9, 0x8960, 0xBBFB, 0xAA72,
0x6306, 0x728F, 0x4014, 0x519D, 0x2522, 0x34AB, 0x0630, 0x17B9,
0xEF4E, 0xFEC7, 0xCC5C, 0xDDD5, 0xA96A, 0xB8E3, 0x8A78, 0x9BF1,
0x7387, 0x620E, 0x5095, 0x411C, 0x35A3, 0x242A, 0x16B1, 0x0738,
0xFFCF, 0xEE46, 0xDCDD, 0xCD54, 0xB9EB, 0xA862, 0x9AF9, 0x8B70,
0x8408, 0x9581, 0xA71A, 0xB693, 0xC22C, 0xD3A5, 0xE13E, 0xF0B7,
0x0840, 0x19C9, 0x2B52, 0x3ADB, 0x4E64, 0x5FED, 0x6D76, 0x7CFF,
0x9489, 0x8500, 0xB79B, 0xA612, 0xD2AD, 0xC324, 0xF1BF, 0xE036,
0x18C1, 0x0948, 0x3BD3, 0x2A5A, 0x5EE5, 0x4F6C, 0x7DF7, 0x6C7E,
0xA50A, 0xB483, 0x8618, 0x9791, 0xE32E, 0xF2A7, 0xC03C, 0xD1B5,
0x2942, 0x38CB, 0x0A50, 0x1BD9, 0x6F66, 0x7EEF, 0x4C74, 0x5DFD,
0xB58B, 0xA402, 0x9699, 0x8710, 0xF3AF, 0xE226, 0xD0BD, 0xC134,
0x39C3, 0x284A, 0x1AD1, 0x0B58, 0x7FE7, 0x6E6E, 0x5CF5, 0x4D7C,
0xC60C, 0xD785, 0xE51E, 0xF497, 0x8028, 0x91A1, 0xA33A, 0xB2B3,
0x4A44, 0x5BCD, 0x6956, 0x78DF, 0x0C60, 0x1DE9, 0x2F72, 0x3EFB,
0xD68D, 0xC704, 0xF59F, 0xE416, 0x90A9, 0x8120, 0xB3BB, 0xA232,
0x5AC5, 0x4B4C, 0x79D7, 0x685E, 0x1CE1, 0x0D68, 0x3FF3, 0x2E7A,
0xE70E, 0xF687, 0xC41C, 0xD595, 0xA12A, 0xB0A3, 0x8238, 0x93B1,
0x6B46, 0x7ACF, 0x4854, 0x59DD, 0x2D62, 0x3CEB, 0x0E70, 0x1FF9,
0xF78F, 0xE606, 0xD49D, 0xC514, 0xB1AB, 0xA022, 0x92B9, 0x8330,
0x7BC7, 0x6A4E, 0x58D5, 0x495C, 0x3DE3, 0x2C6A, 0x1EF1, 0x0F78,
};
#endif // _CRCTABLE0X1021REFLECTED_H_
// End of File
@@ -0,0 +1,93 @@
#ifndef _CRCTABLE0X1EDC6F41_H_
#define _CRCTABLE0X1EDC6F41_H_
//#############################################################################
//! \file include/common/CrcTable0x1EDC6F41.h
//!
//! \brief CRC Lookup Table for polynomial 0x1EDC6F41
//!
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
#define POLYNOMIAL32P2 0x1EDC6F41
const unsigned long crc32P2Table[] = {
0x00000000, 0x1EDC6F41, 0x3DB8DE82, 0x2364B1C3, 0x7B71BD04, 0x65ADD245, 0x46C96386, 0x58150CC7,
0xF6E37A08, 0xE83F1549, 0xCB5BA48A, 0xD587CBCB, 0x8D92C70C, 0x934EA84D, 0xB02A198E, 0xAEF676CF,
0xF31A9B51, 0xEDC6F410, 0xCEA245D3, 0xD07E2A92, 0x886B2655, 0x96B74914, 0xB5D3F8D7, 0xAB0F9796,
0x05F9E159, 0x1B258E18, 0x38413FDB, 0x269D509A, 0x7E885C5D, 0x6054331C, 0x433082DF, 0x5DECED9E,
0xF8E959E3, 0xE63536A2, 0xC5518761, 0xDB8DE820, 0x8398E4E7, 0x9D448BA6, 0xBE203A65, 0xA0FC5524,
0x0E0A23EB, 0x10D64CAA, 0x33B2FD69, 0x2D6E9228, 0x757B9EEF, 0x6BA7F1AE, 0x48C3406D, 0x561F2F2C,
0x0BF3C2B2, 0x152FADF3, 0x364B1C30, 0x28977371, 0x70827FB6, 0x6E5E10F7, 0x4D3AA134, 0x53E6CE75,
0xFD10B8BA, 0xE3CCD7FB, 0xC0A86638, 0xDE740979, 0x866105BE, 0x98BD6AFF, 0xBBD9DB3C, 0xA505B47D,
0xEF0EDC87, 0xF1D2B3C6, 0xD2B60205, 0xCC6A6D44, 0x947F6183, 0x8AA30EC2, 0xA9C7BF01, 0xB71BD040,
0x19EDA68F, 0x0731C9CE, 0x2455780D, 0x3A89174C, 0x629C1B8B, 0x7C4074CA, 0x5F24C509, 0x41F8AA48,
0x1C1447D6, 0x02C82897, 0x21AC9954, 0x3F70F615, 0x6765FAD2, 0x79B99593, 0x5ADD2450, 0x44014B11,
0xEAF73DDE, 0xF42B529F, 0xD74FE35C, 0xC9938C1D, 0x918680DA, 0x8F5AEF9B, 0xAC3E5E58, 0xB2E23119,
0x17E78564, 0x093BEA25, 0x2A5F5BE6, 0x348334A7, 0x6C963860, 0x724A5721, 0x512EE6E2, 0x4FF289A3,
0xE104FF6C, 0xFFD8902D, 0xDCBC21EE, 0xC2604EAF, 0x9A754268, 0x84A92D29, 0xA7CD9CEA, 0xB911F3AB,
0xE4FD1E35, 0xFA217174, 0xD945C0B7, 0xC799AFF6, 0x9F8CA331, 0x8150CC70, 0xA2347DB3, 0xBCE812F2,
0x121E643D, 0x0CC20B7C, 0x2FA6BABF, 0x317AD5FE, 0x696FD939, 0x77B3B678, 0x54D707BB, 0x4A0B68FA,
0xC0C1D64F, 0xDE1DB90E, 0xFD7908CD, 0xE3A5678C, 0xBBB06B4B, 0xA56C040A, 0x8608B5C9, 0x98D4DA88,
0x3622AC47, 0x28FEC306, 0x0B9A72C5, 0x15461D84, 0x4D531143, 0x538F7E02, 0x70EBCFC1, 0x6E37A080,
0x33DB4D1E, 0x2D07225F, 0x0E63939C, 0x10BFFCDD, 0x48AAF01A, 0x56769F5B, 0x75122E98, 0x6BCE41D9,
0xC5383716, 0xDBE45857, 0xF880E994, 0xE65C86D5, 0xBE498A12, 0xA095E553, 0x83F15490, 0x9D2D3BD1,
0x38288FAC, 0x26F4E0ED, 0x0590512E, 0x1B4C3E6F, 0x435932A8, 0x5D855DE9, 0x7EE1EC2A, 0x603D836B,
0xCECBF5A4, 0xD0179AE5, 0xF3732B26, 0xEDAF4467, 0xB5BA48A0, 0xAB6627E1, 0x88029622, 0x96DEF963,
0xCB3214FD, 0xD5EE7BBC, 0xF68ACA7F, 0xE856A53E, 0xB043A9F9, 0xAE9FC6B8, 0x8DFB777B, 0x9327183A,
0x3DD16EF5, 0x230D01B4, 0x0069B077, 0x1EB5DF36, 0x46A0D3F1, 0x587CBCB0, 0x7B180D73, 0x65C46232,
0x2FCF0AC8, 0x31136589, 0x1277D44A, 0x0CABBB0B, 0x54BEB7CC, 0x4A62D88D, 0x6906694E, 0x77DA060F,
0xD92C70C0, 0xC7F01F81, 0xE494AE42, 0xFA48C103, 0xA25DCDC4, 0xBC81A285, 0x9FE51346, 0x81397C07,
0xDCD59199, 0xC209FED8, 0xE16D4F1B, 0xFFB1205A, 0xA7A42C9D, 0xB97843DC, 0x9A1CF21F, 0x84C09D5E,
0x2A36EB91, 0x34EA84D0, 0x178E3513, 0x09525A52, 0x51475695, 0x4F9B39D4, 0x6CFF8817, 0x7223E756,
0xD726532B, 0xC9FA3C6A, 0xEA9E8DA9, 0xF442E2E8, 0xAC57EE2F, 0xB28B816E, 0x91EF30AD, 0x8F335FEC,
0x21C52923, 0x3F194662, 0x1C7DF7A1, 0x02A198E0, 0x5AB49427, 0x4468FB66, 0x670C4AA5, 0x79D025E4,
0x243CC87A, 0x3AE0A73B, 0x198416F8, 0x075879B9, 0x5F4D757E, 0x41911A3F, 0x62F5ABFC, 0x7C29C4BD,
0xD2DFB272, 0xCC03DD33, 0xEF676CF0, 0xF1BB03B1, 0xA9AE0F76, 0xB7726037, 0x9416D1F4, 0x8ACABEB5,
};
#endif // _CRCTABLE0X1EDC6F41_H_
// End of File
@@ -0,0 +1,93 @@
#ifndef _CRCTABLE0X1EDC6F41REFLECTED_H_
#define _CRCTABLE0X1EDC6F41REFLECTED_H_
//#############################################################################
//! \file include/common/CrcTable0x1EDC6F41Reflected.h
//!
//! \brief CRC Lookup Table for the polynomial 0x1EDC6F41 for a reflected algorithm
//! i.e. the bits shifted out of the accumulator from the right instead of the
//! left
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
#define POLYNOMIAL32P2 0x1EDC6F41
const unsigned long crc32P2TableReflected[] = {
0x00000000, 0xF26B8303, 0xE13B70F7, 0x1350F3F4, 0xC79A971F, 0x35F1141C, 0x26A1E7E8, 0xD4CA64EB,
0x8AD958CF, 0x78B2DBCC, 0x6BE22838, 0x9989AB3B, 0x4D43CFD0, 0xBF284CD3, 0xAC78BF27, 0x5E133C24,
0x105EC76F, 0xE235446C, 0xF165B798, 0x030E349B, 0xD7C45070, 0x25AFD373, 0x36FF2087, 0xC494A384,
0x9A879FA0, 0x68EC1CA3, 0x7BBCEF57, 0x89D76C54, 0x5D1D08BF, 0xAF768BBC, 0xBC267848, 0x4E4DFB4B,
0x20BD8EDE, 0xD2D60DDD, 0xC186FE29, 0x33ED7D2A, 0xE72719C1, 0x154C9AC2, 0x061C6936, 0xF477EA35,
0xAA64D611, 0x580F5512, 0x4B5FA6E6, 0xB93425E5, 0x6DFE410E, 0x9F95C20D, 0x8CC531F9, 0x7EAEB2FA,
0x30E349B1, 0xC288CAB2, 0xD1D83946, 0x23B3BA45, 0xF779DEAE, 0x05125DAD, 0x1642AE59, 0xE4292D5A,
0xBA3A117E, 0x4851927D, 0x5B016189, 0xA96AE28A, 0x7DA08661, 0x8FCB0562, 0x9C9BF696, 0x6EF07595,
0x417B1DBC, 0xB3109EBF, 0xA0406D4B, 0x522BEE48, 0x86E18AA3, 0x748A09A0, 0x67DAFA54, 0x95B17957,
0xCBA24573, 0x39C9C670, 0x2A993584, 0xD8F2B687, 0x0C38D26C, 0xFE53516F, 0xED03A29B, 0x1F682198,
0x5125DAD3, 0xA34E59D0, 0xB01EAA24, 0x42752927, 0x96BF4DCC, 0x64D4CECF, 0x77843D3B, 0x85EFBE38,
0xDBFC821C, 0x2997011F, 0x3AC7F2EB, 0xC8AC71E8, 0x1C661503, 0xEE0D9600, 0xFD5D65F4, 0x0F36E6F7,
0x61C69362, 0x93AD1061, 0x80FDE395, 0x72966096, 0xA65C047D, 0x5437877E, 0x4767748A, 0xB50CF789,
0xEB1FCBAD, 0x197448AE, 0x0A24BB5A, 0xF84F3859, 0x2C855CB2, 0xDEEEDFB1, 0xCDBE2C45, 0x3FD5AF46,
0x7198540D, 0x83F3D70E, 0x90A324FA, 0x62C8A7F9, 0xB602C312, 0x44694011, 0x5739B3E5, 0xA55230E6,
0xFB410CC2, 0x092A8FC1, 0x1A7A7C35, 0xE811FF36, 0x3CDB9BDD, 0xCEB018DE, 0xDDE0EB2A, 0x2F8B6829,
0x82F63B78, 0x709DB87B, 0x63CD4B8F, 0x91A6C88C, 0x456CAC67, 0xB7072F64, 0xA457DC90, 0x563C5F93,
0x082F63B7, 0xFA44E0B4, 0xE9141340, 0x1B7F9043, 0xCFB5F4A8, 0x3DDE77AB, 0x2E8E845F, 0xDCE5075C,
0x92A8FC17, 0x60C37F14, 0x73938CE0, 0x81F80FE3, 0x55326B08, 0xA759E80B, 0xB4091BFF, 0x466298FC,
0x1871A4D8, 0xEA1A27DB, 0xF94AD42F, 0x0B21572C, 0xDFEB33C7, 0x2D80B0C4, 0x3ED04330, 0xCCBBC033,
0xA24BB5A6, 0x502036A5, 0x4370C551, 0xB11B4652, 0x65D122B9, 0x97BAA1BA, 0x84EA524E, 0x7681D14D,
0x2892ED69, 0xDAF96E6A, 0xC9A99D9E, 0x3BC21E9D, 0xEF087A76, 0x1D63F975, 0x0E330A81, 0xFC588982,
0xB21572C9, 0x407EF1CA, 0x532E023E, 0xA145813D, 0x758FE5D6, 0x87E466D5, 0x94B49521, 0x66DF1622,
0x38CC2A06, 0xCAA7A905, 0xD9F75AF1, 0x2B9CD9F2, 0xFF56BD19, 0x0D3D3E1A, 0x1E6DCDEE, 0xEC064EED,
0xC38D26C4, 0x31E6A5C7, 0x22B65633, 0xD0DDD530, 0x0417B1DB, 0xF67C32D8, 0xE52CC12C, 0x1747422F,
0x49547E0B, 0xBB3FFD08, 0xA86F0EFC, 0x5A048DFF, 0x8ECEE914, 0x7CA56A17, 0x6FF599E3, 0x9D9E1AE0,
0xD3D3E1AB, 0x21B862A8, 0x32E8915C, 0xC083125F, 0x144976B4, 0xE622F5B7, 0xF5720643, 0x07198540,
0x590AB964, 0xAB613A67, 0xB831C993, 0x4A5A4A90, 0x9E902E7B, 0x6CFBAD78, 0x7FAB5E8C, 0x8DC0DD8F,
0xE330A81A, 0x115B2B19, 0x020BD8ED, 0xF0605BEE, 0x24AA3F05, 0xD6C1BC06, 0xC5914FF2, 0x37FACCF1,
0x69E9F0D5, 0x9B8273D6, 0x88D28022, 0x7AB90321, 0xAE7367CA, 0x5C18E4C9, 0x4F48173D, 0xBD23943E,
0xF36E6F75, 0x0105EC76, 0x12551F82, 0xE03E9C81, 0x34F4F86A, 0xC69F7B69, 0xD5CF889D, 0x27A40B9E,
0x79B737BA, 0x8BDCB4B9, 0x988C474D, 0x6AE7C44E, 0xBE2DA0A5, 0x4C4623A6, 0x5F16D052, 0xAD7D5351,
};
#endif // _CRCTABLE0X1EDC6F41REFLECTED_H_
// End of File
@@ -0,0 +1,91 @@
#ifndef _CRCTABLE0X5D6DCB_H_
#define _CRCTABLE0X5D6DCB_H_
//#############################################################################
//! \file include/common/CrcTable0x5D6DCB.h
//!
//! \brief CRC Lookup Table for polynomial 0x5D6DCB
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
#define POLYNOMIAL24 0x5D6DCB
const unsigned long crc24Table[] = {
0x000000, 0x5D6DCB, 0xBADB96, 0xE7B65D, 0x28DAE7, 0x75B72C, 0x920171, 0xCF6CBA,
0x51B5CE, 0x0CD805, 0xEB6E58, 0xB60393, 0x796F29, 0x2402E2, 0xC3B4BF, 0x9ED974,
0xA36B9C, 0xFE0657, 0x19B00A, 0x44DDC1, 0x8BB17B, 0xD6DCB0, 0x316AED, 0x6C0726,
0xF2DE52, 0xAFB399, 0x4805C4, 0x15680F, 0xDA04B5, 0x87697E, 0x60DF23, 0x3DB2E8,
0x1BBAF3, 0x46D738, 0xA16165, 0xFC0CAE, 0x336014, 0x6E0DDF, 0x89BB82, 0xD4D649,
0x4A0F3D, 0x1762F6, 0xF0D4AB, 0xADB960, 0x62D5DA, 0x3FB811, 0xD80E4C, 0x856387,
0xB8D16F, 0xE5BCA4, 0x020AF9, 0x5F6732, 0x900B88, 0xCD6643, 0x2AD01E, 0x77BDD5,
0xE964A1, 0xB4096A, 0x53BF37, 0x0ED2FC, 0xC1BE46, 0x9CD38D, 0x7B65D0, 0x26081B,
0x3775E6, 0x6A182D, 0x8DAE70, 0xD0C3BB, 0x1FAF01, 0x42C2CA, 0xA57497, 0xF8195C,
0x66C028, 0x3BADE3, 0xDC1BBE, 0x817675, 0x4E1ACF, 0x137704, 0xF4C159, 0xA9AC92,
0x941E7A, 0xC973B1, 0x2EC5EC, 0x73A827, 0xBCC49D, 0xE1A956, 0x061F0B, 0x5B72C0,
0xC5ABB4, 0x98C67F, 0x7F7022, 0x221DE9, 0xED7153, 0xB01C98, 0x57AAC5, 0x0AC70E,
0x2CCF15, 0x71A2DE, 0x961483, 0xCB7948, 0x0415F2, 0x597839, 0xBECE64, 0xE3A3AF,
0x7D7ADB, 0x201710, 0xC7A14D, 0x9ACC86, 0x55A03C, 0x08CDF7, 0xEF7BAA, 0xB21661,
0x8FA489, 0xD2C942, 0x357F1F, 0x6812D4, 0xA77E6E, 0xFA13A5, 0x1DA5F8, 0x40C833,
0xDE1147, 0x837C8C, 0x64CAD1, 0x39A71A, 0xF6CBA0, 0xABA66B, 0x4C1036, 0x117DFD,
0x6EEBCC, 0x338607, 0xD4305A, 0x895D91, 0x46312B, 0x1B5CE0, 0xFCEABD, 0xA18776,
0x3F5E02, 0x6233C9, 0x858594, 0xD8E85F, 0x1784E5, 0x4AE92E, 0xAD5F73, 0xF032B8,
0xCD8050, 0x90ED9B, 0x775BC6, 0x2A360D, 0xE55AB7, 0xB8377C, 0x5F8121, 0x02ECEA,
0x9C359E, 0xC15855, 0x26EE08, 0x7B83C3, 0xB4EF79, 0xE982B2, 0x0E34EF, 0x535924,
0x75513F, 0x283CF4, 0xCF8AA9, 0x92E762, 0x5D8BD8, 0x00E613, 0xE7504E, 0xBA3D85,
0x24E4F1, 0x79893A, 0x9E3F67, 0xC352AC, 0x0C3E16, 0x5153DD, 0xB6E580, 0xEB884B,
0xD63AA3, 0x8B5768, 0x6CE135, 0x318CFE, 0xFEE044, 0xA38D8F, 0x443BD2, 0x195619,
0x878F6D, 0xDAE2A6, 0x3D54FB, 0x603930, 0xAF558A, 0xF23841, 0x158E1C, 0x48E3D7,
0x599E2A, 0x04F3E1, 0xE345BC, 0xBE2877, 0x7144CD, 0x2C2906, 0xCB9F5B, 0x96F290,
0x082BE4, 0x55462F, 0xB2F072, 0xEF9DB9, 0x20F103, 0x7D9CC8, 0x9A2A95, 0xC7475E,
0xFAF5B6, 0xA7987D, 0x402E20, 0x1D43EB, 0xD22F51, 0x8F429A, 0x68F4C7, 0x35990C,
0xAB4078, 0xF62DB3, 0x119BEE, 0x4CF625, 0x839A9F, 0xDEF754, 0x394109, 0x642CC2,
0x4224D9, 0x1F4912, 0xF8FF4F, 0xA59284, 0x6AFE3E, 0x3793F5, 0xD025A8, 0x8D4863,
0x139117, 0x4EFCDC, 0xA94A81, 0xF4274A, 0x3B4BF0, 0x66263B, 0x819066, 0xDCFDAD,
0xE14F45, 0xBC228E, 0x5B94D3, 0x06F918, 0xC995A2, 0x94F869, 0x734E34, 0x2E23FF,
0xB0FA8B, 0xED9740, 0x0A211D, 0x574CD6, 0x98206C, 0xC54DA7, 0x22FBFA, 0x7F9631,
};
#endif // _CRCTABLE0X5D6DCB_H_
// End of File
@@ -0,0 +1,93 @@
#ifndef _CRCTABLE0X5D6DCBREFLECTED_H_
#define _CRCTABLE0X5D6DCBREFLECTED_H_
//#############################################################################
//! \file include/common/CrcTable0x5D6DCBReflected.h
//!
//! \brief CRC Lookup Table for the polynomial 0x5D6DCB for a reflected algorithm
//! i.e. the bits shifted out of the accumulator from the right instead of the
//! left
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
#define POLYNOMIAL24 0x5D6DCB
const unsigned long crc24TableReflected[] = {
0x000000, 0x33D776, 0x67AEEC, 0x54799A, 0xCF5DD8, 0xFC8AAE, 0xA8F334, 0x9B2442,
0x39D6C5, 0x0A01B3, 0x5E7829, 0x6DAF5F, 0xF68B1D, 0xC55C6B, 0x9125F1, 0xA2F287,
0x73AD8A, 0x407AFC, 0x140366, 0x27D410, 0xBCF052, 0x8F2724, 0xDB5EBE, 0xE889C8,
0x4A7B4F, 0x79AC39, 0x2DD5A3, 0x1E02D5, 0x852697, 0xB6F1E1, 0xE2887B, 0xD15F0D,
0xE75B14, 0xD48C62, 0x80F5F8, 0xB3228E, 0x2806CC, 0x1BD1BA, 0x4FA820, 0x7C7F56,
0xDE8DD1, 0xED5AA7, 0xB9233D, 0x8AF44B, 0x11D009, 0x22077F, 0x767EE5, 0x45A993,
0x94F69E, 0xA721E8, 0xF35872, 0xC08F04, 0x5BAB46, 0x687C30, 0x3C05AA, 0x0FD2DC,
0xAD205B, 0x9EF72D, 0xCA8EB7, 0xF959C1, 0x627D83, 0x51AAF5, 0x05D36F, 0x360419,
0x69DB5D, 0x5A0C2B, 0x0E75B1, 0x3DA2C7, 0xA68685, 0x9551F3, 0xC12869, 0xF2FF1F,
0x500D98, 0x63DAEE, 0x37A374, 0x047402, 0x9F5040, 0xAC8736, 0xF8FEAC, 0xCB29DA,
0x1A76D7, 0x29A1A1, 0x7DD83B, 0x4E0F4D, 0xD52B0F, 0xE6FC79, 0xB285E3, 0x815295,
0x23A012, 0x107764, 0x440EFE, 0x77D988, 0xECFDCA, 0xDF2ABC, 0x8B5326, 0xB88450,
0x8E8049, 0xBD573F, 0xE92EA5, 0xDAF9D3, 0x41DD91, 0x720AE7, 0x26737D, 0x15A40B,
0xB7568C, 0x8481FA, 0xD0F860, 0xE32F16, 0x780B54, 0x4BDC22, 0x1FA5B8, 0x2C72CE,
0xFD2DC3, 0xCEFAB5, 0x9A832F, 0xA95459, 0x32701B, 0x01A76D, 0x55DEF7, 0x660981,
0xC4FB06, 0xF72C70, 0xA355EA, 0x90829C, 0x0BA6DE, 0x3871A8, 0x6C0832, 0x5FDF44,
0xD3B6BA, 0xE061CC, 0xB41856, 0x87CF20, 0x1CEB62, 0x2F3C14, 0x7B458E, 0x4892F8,
0xEA607F, 0xD9B709, 0x8DCE93, 0xBE19E5, 0x253DA7, 0x16EAD1, 0x42934B, 0x71443D,
0xA01B30, 0x93CC46, 0xC7B5DC, 0xF462AA, 0x6F46E8, 0x5C919E, 0x08E804, 0x3B3F72,
0x99CDF5, 0xAA1A83, 0xFE6319, 0xCDB46F, 0x56902D, 0x65475B, 0x313EC1, 0x02E9B7,
0x34EDAE, 0x073AD8, 0x534342, 0x609434, 0xFBB076, 0xC86700, 0x9C1E9A, 0xAFC9EC,
0x0D3B6B, 0x3EEC1D, 0x6A9587, 0x5942F1, 0xC266B3, 0xF1B1C5, 0xA5C85F, 0x961F29,
0x474024, 0x749752, 0x20EEC8, 0x1339BE, 0x881DFC, 0xBBCA8A, 0xEFB310, 0xDC6466,
0x7E96E1, 0x4D4197, 0x19380D, 0x2AEF7B, 0xB1CB39, 0x821C4F, 0xD665D5, 0xE5B2A3,
0xBA6DE7, 0x89BA91, 0xDDC30B, 0xEE147D, 0x75303F, 0x46E749, 0x129ED3, 0x2149A5,
0x83BB22, 0xB06C54, 0xE415CE, 0xD7C2B8, 0x4CE6FA, 0x7F318C, 0x2B4816, 0x189F60,
0xC9C06D, 0xFA171B, 0xAE6E81, 0x9DB9F7, 0x069DB5, 0x354AC3, 0x613359, 0x52E42F,
0xF016A8, 0xC3C1DE, 0x97B844, 0xA46F32, 0x3F4B70, 0x0C9C06, 0x58E59C, 0x6B32EA,
0x5D36F3, 0x6EE185, 0x3A981F, 0x094F69, 0x926B2B, 0xA1BC5D, 0xF5C5C7, 0xC612B1,
0x64E036, 0x573740, 0x034EDA, 0x3099AC, 0xABBDEE, 0x986A98, 0xCC1302, 0xFFC474,
0x2E9B79, 0x1D4C0F, 0x493595, 0x7AE2E3, 0xE1C6A1, 0xD211D7, 0x86684D, 0xB5BF3B,
0x174DBC, 0x249ACA, 0x70E350, 0x433426, 0xD81064, 0xEBC712, 0xBFBE88, 0x8C69FE,
};
#endif // _CRCTABLE0X5D6DCBREFLECTED_H_
// End of File
@@ -0,0 +1,93 @@
#ifndef _CRCTABLE0X7_H_
#define _CRCTABLE0X7_H_
//#############################################################################
//! \file include/common/CrcTable0x7.h
//!
//! \brief CRC Lookup Table for polynomial 0x07
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
//#define POLYNOMIAL8 0x07
const unsigned short crc8Table[] = {
0x00, 0x07, 0x0E, 0x09, 0x1C, 0x1B, 0x12, 0x15,
0x38, 0x3F, 0x36, 0x31, 0x24, 0x23, 0x2A, 0x2D,
0x70, 0x77, 0x7E, 0x79, 0x6C, 0x6B, 0x62, 0x65,
0x48, 0x4F, 0x46, 0x41, 0x54, 0x53, 0x5A, 0x5D,
0xE0, 0xE7, 0xEE, 0xE9, 0xFC, 0xFB, 0xF2, 0xF5,
0xD8, 0xDF, 0xD6, 0xD1, 0xC4, 0xC3, 0xCA, 0xCD,
0x90, 0x97, 0x9E, 0x99, 0x8C, 0x8B, 0x82, 0x85,
0xA8, 0xAF, 0xA6, 0xA1, 0xB4, 0xB3, 0xBA, 0xBD,
0xC7, 0xC0, 0xC9, 0xCE, 0xDB, 0xDC, 0xD5, 0xD2,
0xFF, 0xF8, 0xF1, 0xF6, 0xE3, 0xE4, 0xED, 0xEA,
0xB7, 0xB0, 0xB9, 0xBE, 0xAB, 0xAC, 0xA5, 0xA2,
0x8F, 0x88, 0x81, 0x86, 0x93, 0x94, 0x9D, 0x9A,
0x27, 0x20, 0x29, 0x2E, 0x3B, 0x3C, 0x35, 0x32,
0x1F, 0x18, 0x11, 0x16, 0x03, 0x04, 0x0D, 0x0A,
0x57, 0x50, 0x59, 0x5E, 0x4B, 0x4C, 0x45, 0x42,
0x6F, 0x68, 0x61, 0x66, 0x73, 0x74, 0x7D, 0x7A,
0x89, 0x8E, 0x87, 0x80, 0x95, 0x92, 0x9B, 0x9C,
0xB1, 0xB6, 0xBF, 0xB8, 0xAD, 0xAA, 0xA3, 0xA4,
0xF9, 0xFE, 0xF7, 0xF0, 0xE5, 0xE2, 0xEB, 0xEC,
0xC1, 0xC6, 0xCF, 0xC8, 0xDD, 0xDA, 0xD3, 0xD4,
0x69, 0x6E, 0x67, 0x60, 0x75, 0x72, 0x7B, 0x7C,
0x51, 0x56, 0x5F, 0x58, 0x4D, 0x4A, 0x43, 0x44,
0x19, 0x1E, 0x17, 0x10, 0x05, 0x02, 0x0B, 0x0C,
0x21, 0x26, 0x2F, 0x28, 0x3D, 0x3A, 0x33, 0x34,
0x4E, 0x49, 0x40, 0x47, 0x52, 0x55, 0x5C, 0x5B,
0x76, 0x71, 0x78, 0x7F, 0x6A, 0x6D, 0x64, 0x63,
0x3E, 0x39, 0x30, 0x37, 0x22, 0x25, 0x2C, 0x2B,
0x06, 0x01, 0x08, 0x0F, 0x1A, 0x1D, 0x14, 0x13,
0xAE, 0xA9, 0xA0, 0xA7, 0xB2, 0xB5, 0xBC, 0xBB,
0x96, 0x91, 0x98, 0x9F, 0x8A, 0x8D, 0x84, 0x83,
0xDE, 0xD9, 0xD0, 0xD7, 0xC2, 0xC5, 0xCC, 0xCB,
0xE6, 0xE1, 0xE8, 0xEF, 0xFA, 0xFD, 0xF4, 0xF3,
};
#endif //end of _CRCTABLE0X7_H_ definition
// End of File
@@ -0,0 +1,95 @@
#ifndef _CRCTABLE0X7REFLECTED_H_
#define _CRCTABLE0X7REFLECTED_H_
//#############################################################################
//! \file include/common/CrcTable0x7Reflected.h
//!
//! \brief CRC Lookup Table for the polynomial 0x07 for a reflected algorithm
//! i.e. the bits shifted out of the accumulator from the right instead of the
//! left
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
//#define POLYNOMIAL8 0x07
const unsigned short crc8TableReflected[] = {
0x00, 0x91, 0xE3, 0x72, 0x07, 0x96, 0xE4, 0x75,
0x0E, 0x9F, 0xED, 0x7C, 0x09, 0x98, 0xEA, 0x7B,
0x1C, 0x8D, 0xFF, 0x6E, 0x1B, 0x8A, 0xF8, 0x69,
0x12, 0x83, 0xF1, 0x60, 0x15, 0x84, 0xF6, 0x67,
0x38, 0xA9, 0xDB, 0x4A, 0x3F, 0xAE, 0xDC, 0x4D,
0x36, 0xA7, 0xD5, 0x44, 0x31, 0xA0, 0xD2, 0x43,
0x24, 0xB5, 0xC7, 0x56, 0x23, 0xB2, 0xC0, 0x51,
0x2A, 0xBB, 0xC9, 0x58, 0x2D, 0xBC, 0xCE, 0x5F,
0x70, 0xE1, 0x93, 0x02, 0x77, 0xE6, 0x94, 0x05,
0x7E, 0xEF, 0x9D, 0x0C, 0x79, 0xE8, 0x9A, 0x0B,
0x6C, 0xFD, 0x8F, 0x1E, 0x6B, 0xFA, 0x88, 0x19,
0x62, 0xF3, 0x81, 0x10, 0x65, 0xF4, 0x86, 0x17,
0x48, 0xD9, 0xAB, 0x3A, 0x4F, 0xDE, 0xAC, 0x3D,
0x46, 0xD7, 0xA5, 0x34, 0x41, 0xD0, 0xA2, 0x33,
0x54, 0xC5, 0xB7, 0x26, 0x53, 0xC2, 0xB0, 0x21,
0x5A, 0xCB, 0xB9, 0x28, 0x5D, 0xCC, 0xBE, 0x2F,
0xE0, 0x71, 0x03, 0x92, 0xE7, 0x76, 0x04, 0x95,
0xEE, 0x7F, 0x0D, 0x9C, 0xE9, 0x78, 0x0A, 0x9B,
0xFC, 0x6D, 0x1F, 0x8E, 0xFB, 0x6A, 0x18, 0x89,
0xF2, 0x63, 0x11, 0x80, 0xF5, 0x64, 0x16, 0x87,
0xD8, 0x49, 0x3B, 0xAA, 0xDF, 0x4E, 0x3C, 0xAD,
0xD6, 0x47, 0x35, 0xA4, 0xD1, 0x40, 0x32, 0xA3,
0xC4, 0x55, 0x27, 0xB6, 0xC3, 0x52, 0x20, 0xB1,
0xCA, 0x5B, 0x29, 0xB8, 0xCD, 0x5C, 0x2E, 0xBF,
0x90, 0x01, 0x73, 0xE2, 0x97, 0x06, 0x74, 0xE5,
0x9E, 0x0F, 0x7D, 0xEC, 0x99, 0x08, 0x7A, 0xEB,
0x8C, 0x1D, 0x6F, 0xFE, 0x8B, 0x1A, 0x68, 0xF9,
0x82, 0x13, 0x61, 0xF0, 0x85, 0x14, 0x66, 0xF7,
0xA8, 0x39, 0x4B, 0xDA, 0xAF, 0x3E, 0x4C, 0xDD,
0xA6, 0x37, 0x45, 0xD4, 0xA1, 0x30, 0x42, 0xD3,
0xB4, 0x25, 0x57, 0xC6, 0xB3, 0x22, 0x50, 0xC1,
0xBA, 0x2B, 0x59, 0xC8, 0xBD, 0x2C, 0x5E, 0xCF,
};
#endif //end of _CRCTABLE0X7REFLECTED_H_ definition
// End of File
@@ -0,0 +1,91 @@
#ifndef _CRCTABLE0X8005_H_
#define _CRCTABLE0X8005_H_
//#############################################################################
//! \file include/common/CrcTable0x8005.h
//!
//! \brief CRC Lookup Table for polynomial 0x8005
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
#define POLYNOMIAL16P1 0x8005
const unsigned short crc16P1Table[] = {
0x0000, 0x8005, 0x800F, 0x000A, 0x801B, 0x001E, 0x0014, 0x8011,
0x8033, 0x0036, 0x003C, 0x8039, 0x0028, 0x802D, 0x8027, 0x0022,
0x8063, 0x0066, 0x006C, 0x8069, 0x0078, 0x807D, 0x8077, 0x0072,
0x0050, 0x8055, 0x805F, 0x005A, 0x804B, 0x004E, 0x0044, 0x8041,
0x80C3, 0x00C6, 0x00CC, 0x80C9, 0x00D8, 0x80DD, 0x80D7, 0x00D2,
0x00F0, 0x80F5, 0x80FF, 0x00FA, 0x80EB, 0x00EE, 0x00E4, 0x80E1,
0x00A0, 0x80A5, 0x80AF, 0x00AA, 0x80BB, 0x00BE, 0x00B4, 0x80B1,
0x8093, 0x0096, 0x009C, 0x8099, 0x0088, 0x808D, 0x8087, 0x0082,
0x8183, 0x0186, 0x018C, 0x8189, 0x0198, 0x819D, 0x8197, 0x0192,
0x01B0, 0x81B5, 0x81BF, 0x01BA, 0x81AB, 0x01AE, 0x01A4, 0x81A1,
0x01E0, 0x81E5, 0x81EF, 0x01EA, 0x81FB, 0x01FE, 0x01F4, 0x81F1,
0x81D3, 0x01D6, 0x01DC, 0x81D9, 0x01C8, 0x81CD, 0x81C7, 0x01C2,
0x0140, 0x8145, 0x814F, 0x014A, 0x815B, 0x015E, 0x0154, 0x8151,
0x8173, 0x0176, 0x017C, 0x8179, 0x0168, 0x816D, 0x8167, 0x0162,
0x8123, 0x0126, 0x012C, 0x8129, 0x0138, 0x813D, 0x8137, 0x0132,
0x0110, 0x8115, 0x811F, 0x011A, 0x810B, 0x010E, 0x0104, 0x8101,
0x8303, 0x0306, 0x030C, 0x8309, 0x0318, 0x831D, 0x8317, 0x0312,
0x0330, 0x8335, 0x833F, 0x033A, 0x832B, 0x032E, 0x0324, 0x8321,
0x0360, 0x8365, 0x836F, 0x036A, 0x837B, 0x037E, 0x0374, 0x8371,
0x8353, 0x0356, 0x035C, 0x8359, 0x0348, 0x834D, 0x8347, 0x0342,
0x03C0, 0x83C5, 0x83CF, 0x03CA, 0x83DB, 0x03DE, 0x03D4, 0x83D1,
0x83F3, 0x03F6, 0x03FC, 0x83F9, 0x03E8, 0x83ED, 0x83E7, 0x03E2,
0x83A3, 0x03A6, 0x03AC, 0x83A9, 0x03B8, 0x83BD, 0x83B7, 0x03B2,
0x0390, 0x8395, 0x839F, 0x039A, 0x838B, 0x038E, 0x0384, 0x8381,
0x0280, 0x8285, 0x828F, 0x028A, 0x829B, 0x029E, 0x0294, 0x8291,
0x82B3, 0x02B6, 0x02BC, 0x82B9, 0x02A8, 0x82AD, 0x82A7, 0x02A2,
0x82E3, 0x02E6, 0x02EC, 0x82E9, 0x02F8, 0x82FD, 0x82F7, 0x02F2,
0x02D0, 0x82D5, 0x82DF, 0x02DA, 0x82CB, 0x02CE, 0x02C4, 0x82C1,
0x8243, 0x0246, 0x024C, 0x8249, 0x0258, 0x825D, 0x8257, 0x0252,
0x0270, 0x8275, 0x827F, 0x027A, 0x826B, 0x026E, 0x0264, 0x8261,
0x0220, 0x8225, 0x822F, 0x022A, 0x823B, 0x023E, 0x0234, 0x8231,
0x8213, 0x0216, 0x021C, 0x8219, 0x0208, 0x820D, 0x8207, 0x0202,
};
#endif // _CRCTABLE0X8005_H_
// End of File
@@ -0,0 +1,93 @@
#ifndef _CRCTABLE0X8005REFLECTED_H_
#define _CRCTABLE0X8005REFLECTED_H_
//#############################################################################
//! \file include/common/CrcTable0x8005Reflected.h
//!
//! \brief CRC Lookup Table for the polynomial 0x8005 for a reflected algorithm
//! i.e. the bits shifted out of the accumulator from the right instead of the
//! left
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
#define POLYNOMIAL16P1 0x8005
const unsigned short crc16P1TableReflected[] = {
0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241,
0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440,
0xCC01, 0x0CC0, 0x0D80, 0xCD41, 0x0F00, 0xCFC1, 0xCE81, 0x0E40,
0x0A00, 0xCAC1, 0xCB81, 0x0B40, 0xC901, 0x09C0, 0x0880, 0xC841,
0xD801, 0x18C0, 0x1980, 0xD941, 0x1B00, 0xDBC1, 0xDA81, 0x1A40,
0x1E00, 0xDEC1, 0xDF81, 0x1F40, 0xDD01, 0x1DC0, 0x1C80, 0xDC41,
0x1400, 0xD4C1, 0xD581, 0x1540, 0xD701, 0x17C0, 0x1680, 0xD641,
0xD201, 0x12C0, 0x1380, 0xD341, 0x1100, 0xD1C1, 0xD081, 0x1040,
0xF001, 0x30C0, 0x3180, 0xF141, 0x3300, 0xF3C1, 0xF281, 0x3240,
0x3600, 0xF6C1, 0xF781, 0x3740, 0xF501, 0x35C0, 0x3480, 0xF441,
0x3C00, 0xFCC1, 0xFD81, 0x3D40, 0xFF01, 0x3FC0, 0x3E80, 0xFE41,
0xFA01, 0x3AC0, 0x3B80, 0xFB41, 0x3900, 0xF9C1, 0xF881, 0x3840,
0x2800, 0xE8C1, 0xE981, 0x2940, 0xEB01, 0x2BC0, 0x2A80, 0xEA41,
0xEE01, 0x2EC0, 0x2F80, 0xEF41, 0x2D00, 0xEDC1, 0xEC81, 0x2C40,
0xE401, 0x24C0, 0x2580, 0xE541, 0x2700, 0xE7C1, 0xE681, 0x2640,
0x2200, 0xE2C1, 0xE381, 0x2340, 0xE101, 0x21C0, 0x2080, 0xE041,
0xA001, 0x60C0, 0x6180, 0xA141, 0x6300, 0xA3C1, 0xA281, 0x6240,
0x6600, 0xA6C1, 0xA781, 0x6740, 0xA501, 0x65C0, 0x6480, 0xA441,
0x6C00, 0xACC1, 0xAD81, 0x6D40, 0xAF01, 0x6FC0, 0x6E80, 0xAE41,
0xAA01, 0x6AC0, 0x6B80, 0xAB41, 0x6900, 0xA9C1, 0xA881, 0x6840,
0x7800, 0xB8C1, 0xB981, 0x7940, 0xBB01, 0x7BC0, 0x7A80, 0xBA41,
0xBE01, 0x7EC0, 0x7F80, 0xBF41, 0x7D00, 0xBDC1, 0xBC81, 0x7C40,
0xB401, 0x74C0, 0x7580, 0xB541, 0x7700, 0xB7C1, 0xB681, 0x7640,
0x7200, 0xB2C1, 0xB381, 0x7340, 0xB101, 0x71C0, 0x7080, 0xB041,
0x5000, 0x90C1, 0x9181, 0x5140, 0x9301, 0x53C0, 0x5280, 0x9241,
0x9601, 0x56C0, 0x5780, 0x9741, 0x5500, 0x95C1, 0x9481, 0x5440,
0x9C01, 0x5CC0, 0x5D80, 0x9D41, 0x5F00, 0x9FC1, 0x9E81, 0x5E40,
0x5A00, 0x9AC1, 0x9B81, 0x5B40, 0x9901, 0x59C0, 0x5880, 0x9841,
0x8801, 0x48C0, 0x4980, 0x8941, 0x4B00, 0x8BC1, 0x8A81, 0x4A40,
0x4E00, 0x8EC1, 0x8F81, 0x4F40, 0x8D01, 0x4DC0, 0x4C80, 0x8C41,
0x4400, 0x84C1, 0x8581, 0x4540, 0x8701, 0x47C0, 0x4680, 0x8641,
0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040,
};
#endif // _CRCTABLE0X8005REFLECTED_H_
// End of File
@@ -0,0 +1,169 @@
#ifndef _INTERLEAVER_H_
#define _INTERLEAVER_H_
//#############################################################################
//! \file include/common/interleaver.h
//!
//! \brief Interleaver header file
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
//*****************************************************************************
// includes
//*****************************************************************************
#include <stdint.h>
//!
//! \defgroup _INTERLEAVER_H_ Interleaver
//!
//! \ingroup _INTERLEAVER_H_
// @{
#ifdef __cplusplus
extern "C" {
#endif
//*****************************************************************************
// defines
//*****************************************************************************
#define _DOXYGEN_ 1 // Temporary Definition for documentation purposes
//*****************************************************************************
// typedefs
//*****************************************************************************
//! \brief Interleaver structure
//! The de-interleaver will reshuffle the rows and
//! columns according to the following two equations
//! J = (j * n_j + i * n_i) % n
//! I = (i * m_i + J * m_j) % m
//! where m (# columns) is the number of subcarriers perror
//! OFDM symbol and n (# rows) is the number of OFDM symbols
//! Each OFDM symbol may have mod_size number of bits (bits
//! per constellation e.g. 1, 2, 3, 4) and so the entire matrix
//! is m x (n x mod_size)
//! m_i, m_j are relatively prime to m i.e.
//! GCD(m_i,m) = 1, m_i > 2
//! GCD(m_j,m) = 1, m_j > 2
//! m_i < m_j < m
//! Similarly, n_i, n_j are relatively prime to n i.e.
//! GCD(n_i,n) = 1, n_i > 2
//! GCD(n_j,n) = 1, n_j > 2
//! n_i < n_j < n
//! Solving these equations give us i, j which are the
//! interleaver operations
//! i*m_i = (I - J*m_j) mod m
//! We find a_i s.t. m_i * a_i = 1 mod m i.e. m_i is the
//! multiplicative inverse (mod m) of a_i
//! i*a_i*m_i = a_i*(I - J*m_j) mod m
//! i = a_i*I - a_i*m_j*J mod m
//! i = a_i*I - u_ij*J mod m, where u_ij = a_i*m_j
//! i = a*I - u*J mod m (dropping subscripts)
//! In a similar fashion we find j to begin
//! j = b_j*J - b_j*n_i*i mod n
//! j = b_j*J - v_ji*i mod n, where v_ji = b_j*n_i
//! j = b*J - v*i mod n (dropping subscripts)
//! The interleaver equations are:
//! i = a*I - u*J mod m
//! j = b*J - v*i mod n
//
typedef struct _INTERLEAVER_Obj_{
uint16_t n;
uint16_t m;
uint16_t b;
uint16_t v;
uint16_t a;
uint16_t u;
uint16_t n_i;
uint16_t n_j;
uint16_t m_i;
uint16_t m_j;
uint16_t offset; //!< offset index into the sub carrier parameters table
uint16_t *tbl_p; //!< Pointer to the sub-carrier parameters table
}INTERLEAVER_Obj;
//! \brief Handle to the Interleaver structure
//!
typedef INTERLEAVER_Obj *INTERLEAVER_Handle;
//*****************************************************************************
// globals
//*****************************************************************************
//*****************************************************************************
// function prototypes
//*****************************************************************************
//! \brief Finds the interleaver parameters
//!
//! \param hndInterleaver pointer to the interleaver object
//! \param[in] n number of symbols
//! \param[in] m number of sub-carriers
//!
void INTERLEAVER_findParams(INTERLEAVER_Handle hndInterleaver,
uint16_t n,
uint16_t m);
//! \brief Runs the Interleaver
//!
//! Generates interleaved bits for data
//!
//! \param hndInterleaver pointer to the interleaver object
//! \param[in] in_p pointer to the input buffer
//! \param[in] out_p pointer to the output buffer
//! \param[in] symb number of sub-carriers
//!
void INTERLEAVER_run(INTERLEAVER_Handle hndInterleaver,
uint16_t *in_p, uint16_t *out_p,
uint16_t symb);
#ifdef __cplusplus
}
#endif // extern "C"
// @} //ingroup
#endif //end of _INTERLEAVER_H_ definition
// End of File
@@ -0,0 +1,141 @@
#ifndef _REEDSOLOMON_ENCODER_H_
#define _REEDSOLOMON_ENCODER_H_
//#############################################################################
//! \file include/common/reedsolomon_encoder.h
//!
//! \brief Reed Solomon Encoder header file
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
//*****************************************************************************
// includes
//*****************************************************************************
#include <stdint.h>
//!
//! \defgroup REEDSOLOMON_ENCODER Reed Solomon Encoder
//!
//! \ingroup REEDSOLOMON_ENCODER
// @{
#ifdef __cplusplus
extern "C" {
#endif
//*****************************************************************************
// defines
//*****************************************************************************
#define RS_BLOCK_N 255 //!< Encoded block size
#define RS_BLOCK_K 239 //!< Message size
#define RS_BLOCK_T ((RS_BLOCK_N - RS_BLOCK_K)/2) //!< number of correctable errors
#define WORD_2BYTES 1 //!< Encoder can either operate on 2 bytes/word or 1 byte/word
//*****************************************************************************
// typedefs
//*****************************************************************************
//! \brief Reed-Solomon Encoder structure
//!
typedef struct _REEDSOLOMON_ENCODER_Obj_{
uint16_t n; //!< number of codeword symbols (bytes) in a block
uint16_t k; //!< number of message symbols (bytes) in a block
uint16_t t; //!< number of correctable errors in the block
int16_t *pGenPolyIdx; //!< Pointer to the Code Generator Polynomial with coefficients in index form
int16_t *pRS_expTable; //!< Pointer to the lookup table (roots of the extension Galois Field)
//! that converts index to decimal form
int16_t *pRS_logTable; //!< Pointer to the lookup table (roots of the extension Galois Field)
//! that converts decimal to index form
void (*init)(void *,
int16_t *,
int16_t *,
int16_t *); //!< Function pointer to Reed Solomon Encoder initialization routine
void (*run)(void *,
int16_t *,
int16_t ); //!< Function pointer to Reed Solomon Encoder computation routine
}REEDSOLOMON_ENCODER_Obj;
//! \brief Handle to the Reed-Solomon Encoder structure
//!
typedef REEDSOLOMON_ENCODER_Obj *REEDSOLOMON_ENCODER_Handle;
//*****************************************************************************
// globals
//*****************************************************************************
//*****************************************************************************
// function prototypes
//*****************************************************************************
//! \brief Initializes the Reed Solomon Encoder object
//!
//! \param[in] hndRSEncoder handle to the Reed Solomon Encoder object
//! \param[in] pGenPolyIdx pointer to the code generator polynomial (Index Form)
//! \param[in] pRS_expTable pointer to the lookup table that converts index to decimal form
//! \param[in] pRS_logTable pointer to the lookup table that converts decimal to index form
//
void REEDSOLOMON_ENCODER_init(REEDSOLOMON_ENCODER_Handle hndRSEncoder,
int16_t *pGenPolyIdx,
int16_t *pRS_expTable,
int16_t *pRS_logTable);
//! \brief Runs the Reed Solomon Encoder
//!
//! \param[in] hndRSEncoder handle to the Reed Solomon Encoder object
//! \param pData pointer to the original message or data
//! \param[in] nBytes number of bytes in the input message
//
void REEDSOLOMON_ENCODER_run(REEDSOLOMON_ENCODER_Handle hndRSEncoder,
int16_t *pData, int16_t nBytes);
#ifdef __cplusplus
}
#endif // extern "C"
// @} //ingroup
#endif //end of _REEDSOLOMON_ENCODER_H_ definition
// End of File
@@ -0,0 +1,71 @@
#ifndef _RS_TABLESN255K239_H_
#define _RS_TABLESN255K239_H_
//#############################################################################
//! \file include/common/RS_TablesN255K239.h
//!
//! \brief Galois Field Lookup Table for polynomial 0x0000011D
//! Field Generator Polynomial: x^{8}+x^{4}+x^{3}+x^{2}+1
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
#include <stdint.h>
#define FIELDGENPOLY 0x0000011D
#define TABLE_SIZE 256
#define NUM_ROOTS 16
#define CODEGENPOLY_SIZE 17
extern const int16_t RS_expTable[TABLE_SIZE];
extern const int16_t RS_logTable[TABLE_SIZE];
extern const int16_t RS_expInvTable[TABLE_SIZE];
extern const int16_t RS_logInvTable[TABLE_SIZE];
extern const int16_t RS_codeGenPoly[CODEGENPOLY_SIZE];
extern const int16_t RS_packedAlpha[NUM_ROOTS];
extern const int16_t RS_packedBeta[NUM_ROOTS>>1];
#endif // _RS_TABLESN255K239_H_
// End of File
@@ -0,0 +1,172 @@
#ifndef _VITERBI_ENCODER_H_
#define _VITERBI_ENCODER_H_
//#############################################################################
//! \file include/common/viterbi_encoder.h
//!
//! \brief Viterbi Encoder header file
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
//*****************************************************************************
// includes
//*****************************************************************************
#include <stdint.h>
//!
//! \defgroup VITERBI_ENCODER Viterbi Encoder
//!
//! \ingroup VITERBI_ENCODER
// @{
#ifdef __cplusplus
extern "C" {
#endif
//*****************************************************************************
// defines
//*****************************************************************************
#define MIN_K 4
#define MAX_K 7
#define MAX_CNV_ENC_DELAY_LEN (MAX_K - 1)
#define K4_CNV_ENC_DELAY_LEN 4
#define K7_CNV_ENC_DELAY_LEN 7
//*****************************************************************************
// typedefs
//*****************************************************************************
//! \brief VITERBI Encoder Structure
//! The encoder is implemented in C. It is used to generate the input
//! sequence for the example
//!
typedef struct _VITERBI_ENCODER_Obj_{
uint16_t delay[MAX_CNV_ENC_DELAY_LEN]; //!< delay line
uint16_t *u_p; //!< pointer to uncoded bits buffer
uint16_t *c_p; //!< pointer to coded bits buffer
uint16_t cr; //! code rate
uint16_t nBits; //!< Number of uncoded bits
void (*init)(void *); //!< Function pointer to Encoder initialization routine
void (*run)(void *); //!< Function pointer to Encoder computation routine
void (*quantize)(void *, int16_t ); //!< Function pointer to Encoder quantization routine
}VITERBI_ENCODER_Obj;
//! \brief Handle to the VITERBI Encoder structure
//!
typedef VITERBI_ENCODER_Obj *VITERBI_ENCODER_Handle;
//*****************************************************************************
// globals
//*****************************************************************************
//*****************************************************************************
// function prototypes
//*****************************************************************************
//! \brief Initialize the encoder structure by zeroing out the delay line
//! \param hndVITEncoder Handle to the Viterbi Encoder Structure
void VITERBI_ENCODER_init(VITERBI_ENCODER_Handle hndVITEncoder);
//!
//! \brief This function performs convolution encoding in prime. It uses
//! constraint length of K=7, and code rate 1/2.
//!
//! The polynomials are:
//! G0 = 1 + D2 + D3
//! G1 = 1 + D + D2 + D3
//!
//! It calculates:
//! c(2k )=u(k)+u(k-2)+u(k-3)
//! c(2k+1)=u(k)+u(k-1)+u(k-2)+u(k-3)
//!
//! \param hndVITEncoder handle to the Viterbi encoder object whose elements are
//! nBits - number of input bits for decode
//! u_p - pointer to input uncoded bits
//! c_p - pointer to output coded bits
//! (It produces 2xnBit bits)
//!
void VITERBI_ENCODER_runK4CR12(VITERBI_ENCODER_Handle hndVITEncoder);
//!
//! \brief This function performs convolution encoding in prime. It uses
//! constraint length of K=7, and code rate 1/2.
//!
//! The polynomials are:
//! G0 = 1 + D + D2 +D3 + D6
//! G1 = 1 + D2 + D3 + D5 + D6
//!
//! It calculates:
//! c(2k )=u(k)+u(k-1)+u(k-2)+u(k-3)+u(k-6)
//! c(2k+1)=u(k)+u(k-2)+u(k-3)+u(k-5)+u(k-6)
//!
//! \param hndVITEncoder handle to the Viterbi encoder object whose elements are
//! nBits - number of input bits for decode
//! u_p - pointer to input uncoded bits
//! c_p - pointer to output coded bits
//! (It produces 2xnBit bits)
//!
void VITERBI_ENCODER_runK7CR12(VITERBI_ENCODER_Handle hndVITEncoder);
//! \brief Quantization of Encoder Bits
//! \param hndVITEncoder handle to the Viterbi encoder object whose elements are
//! nBits - number of input bits to be quantized
//! c_p - pointer to output coded bits
//! \param format power of 2, the bits will be quantized to +-(2^format)
void VITERBI_ENCODER_quantizeBits(VITERBI_ENCODER_Handle hndVITEncoder, int16_t format);
//! \brief Word Unpacking to Bits
//! \param[in] nSize number of 16-bits words
//! \param[in] in_p pointer to input data in 16-bit words
//! \param[out] out_p pointer to output data in bits
void VITERBI_ENCODER_blockUnpack2Bits(uint16_t nSize, uint16_t *in_p, uint16_t *out_p);
#ifdef __cplusplus
}
#endif // extern "C"
// @} //ingroup
#endif //end of _VITERBI_ENCODER_H_ definition
// End of File
@@ -0,0 +1,137 @@
//###############################################################################
//! \file /2838x_vcrc_config_poly/vcrc_configpoly.h
//!
//! \brief Header file for the configurable polynomial and data sizes (VCRC and C)
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
//!
//! \defgroup VCRC_APIS VCRC Configurable Polynomial APIs
//!
//! \ingroup VCRC_APIS
// @{
//*****************************************************************************
// function prototypes
//*****************************************************************************
//! \brief Runs the CRC routine using provided polynomial
//! with the input bits reversed, message size in bytes.
//!
//! The polynomial to be used is set by the element \b polynomial in the \b CRC_Obj.
//! The size of the polynomial is set by the element \b polySize in the \b CRC_Obj.
//! For example - to use a 1 bit polynomial \b polySize must be set to 0x0 and
//! to use a 32 bit polynomial \b polySize must be set to 0x1F. The size of the data is set
//! by the element \b dataSize in \b the CRC_Obj. \b Datasize refers to the integral unit
//! on which the CRC is computed. For example - to use data size of 1 bit \b dataSize must be set
//! to 0x0 and data size of 8 bit is set by setting \b dataSize to a value of 0x7. These values
//! finally translate to elements in the \b VCRCSIZE register - \b PSIZE and \b DSIZE fields and they are
//! set in the functions \b _CRC_runConfigPolyBytes implemented in the asm file \b vcrc_configpoly_asm.asm.
//! Total size of the message on which the CRC to be computed is specified by the element \b MsgBytes
//! in the \b CRC_Obj.
//!
//! \param[in] hndCRC handle to the CRC object
//
void CRC_runConfigPolyBytesReflected(CRC_Handle hndCRC);
//! \brief Runs the CRC routine using provided polynomial
//! with the input bits reversed, message size in bits.
//!
//! The polynomial to be used is set by the element \b polynomial in the \b CRC_Obj.
//! The size of the polynomial is set by the element \b polySize in the \b CRC_Obj.
//! For example - to use a 1 bit polynomial \b polySize must be set to 0x0 and
//! to use a 32 bit polynomial \b polySize must be set to 0x1F. The size of the data is set
//! by the element \b dataSize in \b the CRC_Obj. \b Datasize refers to the integral unit
//! on which the CRC is computed. For example - to use data size of 1 bit \b dataSize must be set
//! to 0x0 and data size of 8 bit is set by setting \b dataSize to a value of 0x7. These values
//! finally translate to elements in the \b VCRCSIZE register - \b PSIZE and \b DSIZE fields and they are
//! set in the functions \b _CRC_runConfigPolyBytes implemented in the asm file \b vcrc_configpoly_asm.asm.
//! Total size of the message on which the CRC to be computed is specified by the element \b MsgBytes
//! in the \b CRC_Obj.
//!
//! \param[in] hndCRC handle to the CRC object
//
void CRC_runConfigPolyBitsReflected(CRC_Handle hndCRC);
//! \brief Runs the CRC routine using provided polynomial with message size in bytes.
//!
//! The polynomial to be used is set by the element \b polynomial in the \b CRC_Obj.
//! The size of the polynomial is set by the element \b polySize in the \b CRC_Obj.
//! For example - to use a 1 bit polynomial \b polySize must be set to 0x0 and
//! to use a 32 bit polynomial \b polySize must be set to 0x1F. The size of the data is set
//! by the element \b dataSize in \b the CRC_Obj. \b Datasize refers to the integral unit
//! on which the CRC is computed. For example - to use data size of 1 bit \b dataSize must be set
//! to 0x0 and data size of 8 bit is set by setting \b dataSize to a value of 0x7. These values
//! finally translate to elements in the \b VCRCSIZE register - \b PSIZE and \b DSIZE fields and they are
//! set in the functions \b _CRC_runConfigPolyBytes implemented in the asm file \b vcrc_configpoly_asm.asm.
//! Total size of the message on which the CRC to be computed is specified by the element \b MsgBytes
//! in the \b CRC_Obj.
//!
//! \param[in] hndCRC handle to the CRC object
//
void CRC_runConfigPolyBytes(CRC_Handle hndCRC);
//! \brief Runs the CRC routine using provided polynomial with message size in bits.
//!
//! The polynomial to be used is set by the element \b polynomial in the \b CRC_Obj.
//! The size of the polynomial is set by the element \b polySize in the \b CRC_Obj.
//! For example - to use a 1 bit polynomial \b polySize must be set to 0x0 and
//! to use a 32 bit polynomial \b polySize must be set to 0x1F. The size of the data is set
//! by the element \b dataSize in \b the CRC_Obj. \b Datasize refers to the integral unit
//! on which the CRC is computed. For example - to use data size of 1 bit \b dataSize must be set
//! to 0x0 and data size of 8 bit is set by setting \b dataSize to a value of 0x7. These values
//! finally translate to elements in the \b VCRCSIZE register - \b PSIZE and \b DSIZE fields and they are
//! set in the functions \b _CRC_runConfigPolyBytes implemented in the asm file \b vcrc_configpoly_asm.asm.
//! Total size of the message on which the CRC to be computed is specified by the element \b MsgBytes
//! in the \b CRC_Obj.
//!
//! \param[in] hndCRC handle to the CRC object
//
void CRC_runConfigPolyBits(CRC_Handle hndCRC);
// @} //ingroup
@@ -0,0 +1,346 @@
#ifndef _VCU0_CRC_H_
#define _VCU0_CRC_H_
//#############################################################################
//! \file include/vcu0/vcu0_crc.h
//!
//! \brief Cyclic Redundancy Check Header File
//!
//! \note CRC implementations are based on tables. If the tables
//! are calculated on the fly, the macro GEN_CRC_TABLES shall be defined
//! and genCRC8Tables() shall be called during
//! initialization. If the macro is not defined, pre-calculated tables will
//! will be used. Using the latter option can put the tables to flash.
//
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
//*****************************************************************************
// includes
//*****************************************************************************
#include "vcu0_types.h"
//!
//! \defgroup VCU0_CRC Cyclic Redundancy Check (VCU0)
//!
//! \ingroup VCU0_CRC
// @{
#ifdef __cplusplus
extern "C" {
#endif
//*****************************************************************************
// defines
//*****************************************************************************
#define INIT_CRC8 0x0 //!< Initial CRC Register Value
#define INIT_CRC16 0x0 //!< Initial CRC Register Value
#define INIT_CRC32 0x0 //!< Initial CRC Register Value
#define POLYNOMIAL16_1 0x8005 //!< CRC16 802.15.4 Polynomial
#define POLYNOMIAL16_2 0x1021 //!< CRC16 Alternate Polynomial
#define POLYNOMIAL32 0x04c11db7 //!< CRC32 PRIME Polynomial
#define POLYNOMIAL8 0x07 //!< CRC8 PRIME Polynomial
//*****************************************************************************
// globals
//*****************************************************************************
extern uint16 crc8_table[];
extern uint16 crc16p1_table[];
extern uint16 crc16p2_table[];
extern uint32 crc32_table[];
//*****************************************************************************
// function prototypes
//*****************************************************************************
//! \brief VCU(ASM)- function to get the 8-bit CRC
//!
//! Calculate the 8-bit CRC of a message buffer by using the VCU instructions,
//! VCRC8L_1 and VCRC8H_1
//!
//! \param input_crc8_accum The seed value for the CRC, in the event of a
//! multi-part message, the result of the previous crc8 can be used as
//! the initial value for the current segment crc8 calculation
//! until the final crc is derived.
//! \param msg Address of the message buffer
//! \param parity Parity of the first message word. The parity determines whether
//! the CRC begins at the low byte (CRC_parity_even) or at the high
//! byte (CRC_parity_odd) of the first word
//! determines whether the CRC begins at the low byte (EVEN) or at the high byte (ODD).
//! \param rxLen Length of the message in bytes
//! \return CRC result
//
extern uint16 getCRC8_vcu(uint32 input_crc8_accum, uint16 *msg, CRC_parity_e parity,
uint16 rxLen);
//! \brief VCU(ASM)- function to get the 16-bit CRC
//!
//! Calculate the 16-bit CRC of a message buffer by using the VCU instructions
//! VCRC16P1H_1 and VCRC16P1L_1
//!
//! \param input_crc16_accum The seed value for the CRC, in the event of a
//! multi-part message, the result of the previous crc16 can be used as the initial
//! value for the current segment crc16 calculation
//! until the final crc is derived.
//! \param msg Address of the message buffer
//! \param parity Parity of the first message word. The parity determines whether
//! the CRC begins at the low byte (CRC_parity_even) or at the high
//! byte (CRC_parity_odd) of the first word
//! \param rxLen Length of the message in bytes
//! \return CRC result
//
extern uint16 getCRC16P1_vcu(uint32 input_crc16_accum, uint16 * msg, CRC_parity_e parity,
uint16 rxLen);
//! \brief VCU(ASM)- function to get the 16-bit CRC
//!
//! Calculate the 16-bit CRC of a message buffer by using the VCU instructions
//! VCRC16P2H_1 and VCRC16P2L_1
//!
//! \param input_crc16_accum The seed value for the CRC, in the event of a
//! multi-part message, the result of the previous crc16 can be used as the
//! initial value for the current segment crc16 calculation
//! until the final crc is derived.
//! \param msg Address of the message buffer
//! \param parity Parity of the first message word. The parity determines whether
//! the CRC begins at the low byte (CRC_parity_even) or at the high
//! byte (CRC_parity_odd) of the first word
//! \param rxLen Length of the message in bytes
//! \return CRC result
//
extern uint16 getCRC16P2_vcu(uint32 input_crc16_accum, uint16 * msg, CRC_parity_e parity,
uint16 rxLen);
//! \brief VCU(ASM)- function to get the 32-bit CRC
//!
//! Calculate the 32-bit CRC of a message buffer by using the VCU instructions
//! VCRC32H_1 and VCRC32L_1
//! For a given 16b memory word, CRC is computed first on the low byte in memory
//! followed by the high byte in memory
//!
//! \param input_crc32_accum The seed value for the CRC, in the event of a
//! multi-part message, the result of the previous crc32 can be used as the
//! initial value for the current segment crc32 calculation
//! until the final crc is derived.
//! \param msg Address of the message buffer
//! \param parity Parity of the first message word. The parity determines whether
//! the CRC begins at the low byte (CRC_parity_even) or at the high
//! byte (CRC_parity_odd) of the first word
//! \param rxLen Length of the message in bytes
//! \return CRC result
//
extern uint32 getCRC32_vcu (uint32 input_crc32_accum, uint16 *msg, CRC_parity_e parity,
uint16 rxLen);
//! \brief VCU(ASM)- function to get the 32-bit CRC
//!
//! Calculate the 32-bit CRC of a message buffer by using the VCU instructions
//! VCRC32L_1 and VCRC32H_1
//! For a given 16b memory word, CRC is computed first on the high byte in memory
//! followed by the low byte in memory
//!
//! \param input_crc32_accum The seed value for the CRC, in the event of a
//! multi-part message, the result of the previous crc32 can be used as the
//! initial value for the current segment crc32 calculation
//! until the final crc is derived.
//! \param msg Address of the message buffer
//! \param parity Parity of the first message word. The parity determines whether
//! the CRC begins at the low byte (CRC_parity_even) or at the high
//! byte (CRC_parity_odd) of the first word
//! \param rxLen Length of the message in bytes
//! \return CRC result
//
extern uint32 getCRC32_vcu_hilo_order_swap (uint32 input_crc32_accum, uint16 *msg, CRC_parity_e parity,
uint16 rxLen);
//! \brief VCU(ASM)- function to flip a 16b input buffer
//!
//! Flip/Bit-reverse an input buffer
//! This function is added on VCU0 where the VCU hardware does not contain support (unlike in VCU2) to
//! input bytes in bit reversed order for CRC computation
//! hence this "Reflection" needs to be done in software
//!
//! \param dst Pointer to the 16b output buffer
//! \param src Pointer to the 16b input buffer
//! \param rxLen Number of 16b words to be flipped
//
extern void flipInputBuf_cpu (uint16 *dst, uint16 *src, uint16 rxLen);
//! \brief Generate the CRC lookup table using the polynomial 0x7
//!
//! This function generates the CRC8 table for every possible byte,
//! i.e. 2^8 = 256 table values, using the CRC8_PRIME polynomial 0x07. It
//! expects a global array, crc8_table, to be defined in the application
//! code
//
extern void genCRC8Table();
//! \brief Generate the CRC lookup table using the polynomial 0x8005
//!
//! This function generates the CRC16 table for every possible byte,
//! i.e. 2^8 = 256 table values, using the CRC16_802_15_4 polynomial 0x8005. It
//! expects a global array, crc16p1_table, to be defined in the application
//! code
//
extern void genCRC16P1Table();
//! \brief Generate the CRC lookup table using the polynomial 0x1021
//!
//! This function generates the CRC16 table for every possible byte,
//! i.e. 2^8 = 256 table values, using the CRC16_ALT polynomial 0x1021. It
//! expects a global array, crc16p2_table, to be defined in the application
//! code
//
extern void genCRC16P2Table();
//! \brief Generate the CRC lookup table using the polynomial 0x04c11db7
//!
//! This function generates the CRC32 table for every possible byte,
//! i.e. 2^8 = 256 table values, using the CRC32_PRIME polynomial 0x04c11db7.
//! It expects a global array, crc32_table, to be defined in the application
//! code
//
extern void genCRC32Table();
//! \brief C- function to get the 8-bit CRC
//!
//! Calculate the 8-bit CRC of a message buffer by using the lookup table,
//! crc8_table, based on the polynomial 0x7.
//!
//! \param input_crc8_accum The seed value for the CRC, in the event of a
//! multi-part message, the result of the previous crc8 can be used as the
//! initial value for the current segment crc8 calculation
//! until the final crc is derived.
//! \param msg Address of the message buffer
//! \param parity Parity of the first message word. The parity determines whether
//! the CRC begins at the low byte (CRC_parity_even) or at the high
//! byte (CRC_parity_odd) of the first word
//! \param rxLen Length of the message in bytes
//! \return CRC result
//
uint16 getCRC8_cpu(uint16 input_crc8_accum, uint16 *msg, CRC_parity_e parity, uint16 rxLen);
//! \brief C- function to get the 16-bit CRC
//!
//! Calculate the 16-bit CRC of a message buffer by using the lookup table,
//! crc16p1_table, based on the polynomial 0x8005.
//!
//! \param input_crc16_accum The seed value for the CRC, in the event of a
//! multi-part message, the result of the previous crc16 can be used as the
//! initial value for the current segment crc16 calculation
//! until the final crc is derived.
//! \param msg Address of the message buffer
//! \param parity Parity of the first message word. The parity determines whether
//! the CRC begins at the low byte (CRC_parity_even) or at the high
//! byte (CRC_parity_odd) of the first word
//! \param rxLen Length of the message in bytes
//! \return CRC result
//
uint16 getCRC16P1_cpu (uint16 input_crc16_accum, uint16 *msg, CRC_parity_e parity, uint16 rxLen);
//! \brief C- function to get the 16-bit CRC
//!
//! Calculate the 16-bit CRC of a message buffer by using the lookup table,
//! crc16p2_table, based on the polynomial 0x1021.
//!
//! \param input_crc16_accum The seed value for the CRC, in the event of a
//! multi-part message, the result of the previous crc16 can be used as the
//! initial value for the current segment crc16 calculation
//! until the final crc is derived.
//! \param msg Address of the message buffer
//! \param parity Parity of the first message word. The parity determines whether
//! the CRC begins at the low byte (CRC_parity_even) or at the high
//! byte (CRC_parity_odd) of the first word
//! \param rxLen Length of the message in bytes
//! \return CRC result
//
uint16 getCRC16P2_cpu (uint16 input_crc16_accum, uint16 *msg, CRC_parity_e parity, uint16 rxLen);
//! \brief C- function to get the 32-bit CRC
//!
//! Calculate the 32-bit CRC of a message buffer by using the lookup table,
//! crc32_table, based on the polynomial 0x04c11db7.
//!
//! \param input_crc32_accum The seed value for the CRC, in the event of a
//! multi-part message, the result of the previous crc32 can be used as the
//! initial value for the current segment crc32 calculation
//! until the final crc is derived.
//! \param msg Address of the message buffer
//! \param parity Parity of the first message word. The parity determines whether
//! the CRC begins at the low byte (CRC_parity_even) or at the high
//! byte (CRC_parity_odd) of the first word
//! \param rxLen Length of the message in bytes
//! \return CRC result
//
uint32 getCRC32_cpu (uint32 input_crc32_accum, uint16 *msg, CRC_parity_e parity, uint16 rxLen);
//! \brief Workaround to the silicon issue of first VCU calculation on power up being
//! erroneous
//!
//! Due to the internal power-up state of the VCU module, it is possible
//! that the first CRC result will be incorrect. This condition applies to the
//! first result from each of the eight CRC instructions.
//! This rare condition can only occur after a power-on reset, but will not
//! necessarily occur on every power on. A warm reset will not cause this condition
//! to reappear.
//! The application can reset the internal VCU CRC logic by
//! performing a CRC calculation of a single byte in the initialization routine.
//! This routine only needs to perform one CRC calculation and can use any of the
//! CRC instructions
//
void CRC_reset(void);
#ifdef __cplusplus
}
#endif // extern "C"
// @} //ingroup
#endif //end of _VCU0_CRC_H_ definition
// End of File
@@ -0,0 +1,338 @@
#ifndef _VCU0_FFT_H_
#define _VCU0_FFT_H_
//#############################################################################
//! \file include/vcu0/vcu0_fft.h
//!
//! \brief Fast-Fourier Transform header file
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
//*****************************************************************************
// includes
//*****************************************************************************
#include "vcu0_types.h"
//!
//! \defgroup VCU0_FFT Fast Fourier Transform (VCU0)
//!
//! \ingroup VCU0_FFT
// @{
//
#ifdef __cplusplus
extern "C" {
#endif
//*****************************************************************************
// defines
//*****************************************************************************
#define NULL 0
#define rfft16_unpack (fft_hnd) rfft16_unpack_asm (fft_hnd)
//! Default values for the complex FFT structure for 64 sample points
#define cfft16_64P_DEFAULTS { (int *)NULL,\
(int *)NULL,\
(int *)NULL,\
64,\
6,\
8,\
(int *)NULL,\
(void (*)(void *))cfft16_init,\
(void (*)(void *))cfft16_64p_calc}
//! Default values for the complex FFT structure for 64 sample points
//! if using bit reversal lookup table (Deprecated)
#define cfft16_64P_BREV_DEFAULTS { (int *)NULL,\
(int *)NULL,\
(int *)NULL,\
64,\
6,\
8,\
BIT_REV_64_TBL,\
(void (*)(void *))cfft16_init,\
(void (*)(void *))cfft16_64p_calc}
//! Default values for the complex FFT structure for 128 sample points
#define cfft16_128P_DEFAULTS { (int *)NULL,\
(int *)NULL,\
(int *)NULL,\
128,\
7,\
4,\
(int *)NULL,\
(void (*)(void *))cfft16_init,\
(void (*)(void *))cfft16_128p_calc}
//! Default values for the complex FFT structure for 256 sample points
#define cfft16_256P_DEFAULTS { (int *)NULL,\
(int *)NULL,\
(int *)NULL,\
256,\
8,\
2,\
(int *)NULL,\
(void (*)(void *))cfft16_init,\
(void (*)(void *))cfft16_256p_calc}
//! Default values for the complex FFT structure for 128 real sample points
#define rfft16_128P_DEFAULTS { (int *)NULL,\
(int *)NULL,\
(int *)NULL,\
64,\
6,\
4,\
(int *)NULL,\
(void (*)(void *))cfft16_init,\
(void (*)(void *))cfft16_64p_calc}
//! Default values for the complex FFT structure for 256 real sample points
#define rfft16_256P_DEFAULTS { (int *)NULL,\
(int *)NULL,\
(int *)NULL,\
128,\
7,\
4,\
(int *)NULL,\
(void (*)(void *))cfft16_init,\
(void (*)(void *))cfft16_128p_calc}
//! Default values for the complex FFT structure for 512 real sample points
#define rfft16_512P_DEFAULTS { (int *)NULL,\
(int *)NULL,\
(int *)NULL,\
256,\
8,\
1,\
(int *)NULL,\
(void (*)(void *))cfft16_init,\
(void (*)(void *))cfft16_256p_calc}
//! Default values for the Real Inverse FFT structure for 64 points
#define rifft16_64P_DEFAULTS \
cfft16_64P_DEFAULTS
//! Default values for the Real Inverse FFT structure for 128 points
#define rifft16_128P_DEFAULTS \
cfft16_128P_DEFAULTS
//! Default values for the Real Inverse FFT structure for 256 points
#define rifft16_256P_DEFAULTS \
cfft16_256P_DEFAULTS
#define cfft16_pack(fft_hnd) \
cfft16_pack_asm(fft_hnd)
#define cfft16_unpack(fft_hnd) \
cfft16_unpack_asm(fft_hnd)
//*****************************************************************************
// typedefs
//*****************************************************************************
//! Complex FFT data structure
typedef struct {
int *ipcbptr; //!< input buffer pointer
int *workptr; //!< work buffer pointer
int *tfptr; //!< twiddle factor table pointer
int size; //!< Number of data points
int nrstage; //!< Number of FFT stages
int step; //!< Twiddle factor table search step
int *brevptr; //!< Bit reversal table pointer
void (*init)(void *); //!< Function pointer to initialization routine
void (*calc)(void *); //!< Function pointer to calculation routine
}cfft16_t;
typedef cfft16_t *cfft16_handle_s; //!< Handle to structure
//*****************************************************************************
// globals
//*****************************************************************************
extern SINT16 CFFT16_64p_in_data[]; // Input fed into the simulator
extern SINT16 CFFT16_64p_out_data[]; // Output from the simulator
extern SINT16 CFFT16_64p_brev_in_data[]; // Input fed into the simulator
extern SINT16 CFFT16_64p_brev_out_data[]; // Output from the simulator
extern SINT16 CFFT16_128p_in_data[]; // Input fed into the simulator
extern SINT16 CFFT16_128p_out_data[]; // Output from the simulator
extern SINT16 CFFT16_256p_in_data[]; // Input fed into the simulator
extern SINT16 CFFT16_256p_out_data[]; // Output from the simulator
extern SINT16 RFFT16_128p_in_data[]; // Input fed into the simulator
extern SINT16 RFFT16_128p_out_data[]; // Output from the simulator
extern SINT16 RFFT16_256p_in_data[]; // Input fed into the simulator
extern SINT16 RFFT16_256p_out_data[]; // Output from the simulator
extern SINT16 RFFT16_512p_in_data[]; // Input fed into the simulator
extern SINT16 RFFT16_512p_out_data[]; // Output from the simulator
extern SINT16 RIFFT16_64p_in_data[]; // Input fed into the simulator
extern SINT16 RIFFT16_64p_out_data[]; // Output from the simulator
extern SINT16 RIFFT16_128p_in_data[]; // Input fed into the simulator
extern SINT16 RIFFT16_128p_out_data[]; // Output from the simulator
extern SINT16 RIFFT16_256p_in_data[]; // Input fed into the simulator
extern SINT16 RIFFT16_256p_out_data[]; // Output from the simulator
extern SINT16 BIT_REV_64_TBL[64];
extern SINT16 CFFT16_TF[];
//*****************************************************************************
// function prototypes
//*****************************************************************************
//! \brief Twiddle Factor Table Initialization
//!
//! Initializes the tfptr (twiddle factor pointer)to the start of the twiddle factor
//! table in memory
//!
//! \param cfft16_handle_s Handle to the FFT structure
//
extern void cfft16_init(cfft16_t *cfft16_handle_s);
//! \brief Bit-Reversed Indexing
//!
//! Rearranges the input data in bit-reveresed index format. If the number
//! of FFT stages is even, the data is bit-reversed into the work buffer and then copied
//! back to the input buffer. In this respect the bit reversal is considered to be
//! in-place. For an odd number of stages the bit-reversed output is placed
//! in the work buffer (off-place). The FFT (not the bit reversal function)
//! will then transfer the data back to the input buffer pointed to by ipcbptr
//!
//! \param cfft16_handle_s Handle to the FFT structure
//!
//! \attention For bit reverse addressing to work, the input buffer must be aligned
//! to size of the buffer in words (16-bit). For example, the 128 point complex FFT requires
//! an input buffer of size 256 words (16-bit), therefore it must be aligned to a boundary
//! of 256. This can be done by assigning the array to a named section
//! (fftInput) using compiler pragmas (in the example, the input is assigned to
//! .econst and aligned to a boundary of 256 using the .align assembler directive)
//! \code #pragma DATA_SECTION (CFFT16_128p_in_data, "fftInput") \endcode
//! and then either assigning this memory to the start of a RAM block in the
//! linker command file, as is done in the examples, or aligning it to a boundary
//! using the align directive
//! \code fftInput : > RAMLS4, ALIGN = 256, PAGE = 1 \endcode
//
extern void cfft16_brev(cfft16_t *cfft16_handle_s);
//! \brief Flip real and imaginary parts of complex number
//!
//! This functions is needed in the computation of real FFTs to ensure that
//! the real part of the complex number always ends up at the high word (16-bit) of
//! a 32 bit address
//!
//! \param cfft16_handle_s Handle to the FFT structure
//
extern void cfft16_flip_re_img(cfft16_t *cfft16_handle_s);
//! \brief Flip real and imaginary parts of complex number and conjugate
//!
//! This functions is needed in the computation of real IFFTs to ensure that
//! the real part of the complex number always ends up at the high word (16-bit) of
//! a 32 bit address
//!
//! \param cfft16_handle_s Handle to the FFT structure
//
extern void cfft16_flip_re_img_conj(cfft16_t *cfft16_handle_s);
//! \brief Real FFT Unpack
//!
//! When using an N/2 pt complex FFT to compute the N-pt real FFT, the
//! result of the complex FFT must be unpacked to get the real value. Refer
//! to http://www.engineeringproductivitytools.com/stuff/T0001/PT10.HTM
//! for the complete derivation and explanation of the algorithm
//!
//! \param cfft16_handle_s Handle to the FFT structure
//
extern void cfft16_unpack_asm(cfft16_t *cfft16_handle_s);
//! \brief complex IFFT pack
//!
//! When calculating the IFFT of a Real FFT, the data must be packed before
//! using the complex IFFT to get the result. Refer to
//! http://www.engineeringproductivitytools.com/stuff/T0001/PT10.HTM
//! for the complete derivation and explanation of the algorithm
//!
//! \param cfft16_handle_s Handle to the FFT structure
//
extern void cifft16_pack_asm(cfft16_t *cfft16_handle_s);
//! \brief Calculate the 64 pt Complex FFT
//!
//! \param cfft16_handle_s Handle to the FFT structure
//!
//
extern void cfft16_64p_calc(cfft16_t *cfft16_handle_s);
//! \brief Calculate the 128 pt Complex FFT
//!
//! \param cfft16_handle_s Handle to the FFT structure
//!
//! \sa cfft16_brev for memory alignment requirements
//
extern void cfft16_128p_calc(cfft16_t *cfft16_handle_s);
//! \brief Calculate the 256 pt Complex FFT
//!
//! \param cfft16_handle_s Handle to the FFT structure
//!
//! \sa cfft16_brev for memory alignment requirements
//
extern void cfft16_256p_calc(cfft16_t *cfft16_handle_s);
// \brief Table based Bit Reversal
//
// \param cfft16_handle_s Handle to the FFT structure
//
// Uses the table, pointed to by brevptr, to rearrange the input data
// in bit reversed index format
//
//
extern void cfft16_tbl_brev(cfft16_t *cfft16_handle_s) __attribute__ ((__deprecated__));
#ifdef __cplusplus
}
#endif // extern "C"
// @} //ingroup
#endif //end of _VCU0_FFT_H_ definition
// End of File
@@ -0,0 +1,202 @@
#ifndef _VCU0_TYPES_H_
#define _VCU0_TYPES_H_
//#############################################################################
//! \file include/vcu0/vcu0_types.h
//!
//! \brief Type definitions for the VCU0 algorithms
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
//*****************************************************************************
// includes
//*****************************************************************************
//#include <string.h>
#include <limits.h>
#include <stdint.h>
#include <stdbool.h>
//!
//! \defgroup VCU0_DEFINITIONS VCU0 Type Defintions
//!
//! \ingroup VCU0_DEFINITIONS
// @{
#ifdef __cplusplus
extern "C" {
#endif
//*****************************************************************************
// defines
//*****************************************************************************
#ifndef TRUE
#define TRUE (1)
#define FALSE (0)
#endif //TRUE
#define PARITY(a) ((a) % 2)
#define ALIGN16(len) (((len) + 1) & ~1)
/* size of, in octets */
#define OCTETS(x) ((sizeof(x)) * (CHAR_BIT >> 3))
#define SIZEOF_SINT16 2
#define SIZEOF_UINT16 2
#define SIZEOF_SINT32 4
#define SIZEOF_UINT32 4
//*****************************************************************************
// typedefs
//*****************************************************************************
//! \brief Parity enumeration
//!
//! The parity is used by the CRC algorithm to determine whether to begin
//! calculations from the low byte (EVEN) or from the high byte (ODD) of the
//! first word (16-bit) in the message. \n
//! For example, if your message had 10 bytes and started at the address 0x8000
//! but the first byte was at the high byte position of the first 16-bit word,
//! the user would call the CRC function with odd parity i.e. CRC_parity_odd \n
//! Address: HI LO \n
//! 0x8000 : B0 XX \n
//! 0x8001 : B2 B1 \n
//! 0x8002 : B4 B3 \n
//! 0x8003 : B6 B5 \n
//! 0x8004 : B8 B7 \n
//! 0x8005 : XX B9 \n
//! However, if the first byte was at the low byte position of the first 16-bit word,
//! the user would call the CRC function with even parity i.e. CRC_parity_even \n
//! Address: HI LO \n
//! 0x8000 : B1 B0 \n
//! 0x8001 : B3 B2 \n
//! 0x8002 : B5 B4 \n
//! 0x8003 : B7 B6 \n
//! 0x8004 : B9 B8 \n
//
typedef enum {
CRC_parity_even = 0, //!< Even parity, CRC starts at the low byte of the first word
CRC_parity_odd = 1 //!< Odd parity, CRC starts at the high byte of the first word
} CRC_parity_e;
//typedef unsigned char uint8;
typedef unsigned int uint16;
typedef unsigned long uint32;
typedef unsigned long long uint64;
#ifndef F28_DATA_TYPES
#define F28_DATA_TYPES
typedef int int16;
typedef long int32;
typedef long long int64;
typedef unsigned int Uint16;
typedef unsigned long Uint32;
typedef unsigned long long Uint64;
typedef float float32;
typedef long double float64;
#endif //F28_DATA_TYPES
#ifndef VCU0_TYPES
#define VCU0_TYPES
typedef long RCODE;
#ifndef _STDBOOL
#define _STDBOOL
//typedef unsigned long bool;
#endif /* _STDBOOL */
// Read-Write Data Types
typedef signed int SINT16; // Signed 16-bit integer (15-bit magnitude)
typedef unsigned int UINT16; // Unsigned 16-bit integer
typedef signed long SINT32; // Signed 32-bit integer (31-bit magnitude)
typedef unsigned long UINT32; // Unsigned 32-bit integer
typedef signed long long SINT64; // Signed 64-bit integer
typedef unsigned long long UINT64; // Unsigned 64-bit integer
typedef int BOOL; // Only TRUE/FALSE applied
// All pointers are 32 bits long
typedef SINT16 *PSINT16; // Pointer to SINT16
typedef UINT16 *PUINT16; // Pointer to UINT16
typedef SINT32 *PSINT32; // Pointer to SINT32
typedef UINT32 *PUINT32; // Pointer to UINT32
//----------------------------------------------------------------------------
// Complex data Typedef Declarations
//----------------------------------------------------------------------------
//! \brief Complex data
//!
typedef struct
{
SINT16 real; //!< Real Part
SINT16 imag; //!< Imaginary Part
}cplx16, ComplexShort;
//----------------------------------------------------------------------------
// Circular buffer Typedef Declarations
//----------------------------------------------------------------------------
typedef struct
{
SINT16 *buf_p; // buffer base addr
UINT16 rdIdx; // read index
UINT16 wtIdx; // write index
UINT16 bufSize; // buf size in 16-bits words
}Buffer_t;
#endif //VCU0_TYPES
#ifdef __cplusplus
}
#endif // extern "C"
// @} //ingroup
#endif //end of _VCU0_TYPES_H_ definition
// End of File
@@ -0,0 +1,178 @@
#ifndef _VCU0_VITERBI_DECODER_H_
#define _VCU0_VITERBI_DECODER_H_
//#############################################################################
//! \file include/vcu0/vcu0_viterbi_decoder.h
//!
//! \brief Viterbi Decoder header file
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
//*****************************************************************************
// includes
//*****************************************************************************
#include "vcu0_types.h"
//!
//! \defgroup VCU0_VITERBI_DECODER Viterbi Decoding (VCU0)
//!
//! \ingroup VCU0_VITERBI_DECODER
// @{
#ifdef __cplusplus
extern "C" {
#endif
//*****************************************************************************
// defines
//*****************************************************************************
#define FRAME_LEN 128
#define CODED_LEN (FRAME_LEN << 1)
#define ENCODER_LEN 7
#define STATES 64
#define LARGE_NEG_NUMBER -8192
#define CNV_DEC_NUM_STATES (1<<(G3_PHY_CNV_K -1))
/* When no overlap method is used */
/* Viterbi decodes maximum of 256 coded bits in 1 shot */
#define CNV_DEC_MAX_UBITS 128
#define CNV_DEC_MAX_CBITS (CNV_DEC_MAX_UBITS << 1) // CR=1/2
/* When overlap method is used */
/* Viterbi decodes in blocks of 128 coded bits */
#define CNV_DEC_BLK_UBITS 64
#define CNV_DEC_BLK_CBITS (CNV_DEC_BLK_UBITS << 1) // CR=1/2
#define CNV_DEC_BLK_CBITS_LOG2 7
#define CNV_DEC_BLK_UWORDS 4 // 16-bits words
#define CNV_DEC_METRIC_INIT -16384
#define G3_PHY_CNV_K 7
#define cnvDec(nBits, in_p, out_p, flag) \
cnvDec_asm(nBits, in_p, out_p, flag)
#define cnvDecInit(nBits) \
cnvDecInit_asm(nBits)
#define cnvDecMetricRescale() \
cnvDecMetricRescale_asm()
//*****************************************************************************
// typedefs
//*****************************************************************************
//! Viterbi decode mode enumeration
typedef enum
{
CNV_DEC_MODE_DEC_ALL = 0, //!< Decodes all output bits
CNV_DEC_MODE_OVLP_INIT = 1, //!< Use window overlap method,
//!< only metrics and transitions update
CNV_DEC_MODE_OVLP_DEC = 2, //!< Use window overlap method,
//!< update transitions/metrics/trace through current &
//!< previous blocks, decode previous block only
CNV_DEC_MODE_OVLP_LAST = 3 //!< last block in overlap
}vitMode_t;
//*****************************************************************************
// globals
//*****************************************************************************
extern int16 VIT_in_data[]; //!< Input fed into the C-model encoder
extern int16 VIT_quant_data[]; //!< Output from the C-model encoder
extern int32 VIT_gold_vt_data[]; //!< Golden trace history (VT0/VT1); can be used to verify functionality
extern Uint16 VIT_frame_len;
extern UINT16 trn_tmp[CNV_DEC_MAX_UBITS];
//*****************************************************************************
// function prototypes
//*****************************************************************************
//! \brief Initialize Viterbi Decoder
//!
//! Initialize state metric table to a large negative value given by
//! CNV_DEC_METRIC_INIT and initialize the transition and wrap pointers
//!
//! \param nTranBits Number of Coded bits
//
extern void cnvDecInit_asm(int nTranBits);
//! Viterbi Decoder
//!
//! This routine performs the trellis decoding. It has four modes of
//! operation
//! - 0: Update metrics and transition history, trace and decodes all (for header packets)
//! - 1: Update metrics and transition history for only 1st block in payload
//! - 2: Update metrics and transition history, trace back through the current
//! and previous blocks, decodes previos block giving nBits/2 bits
//! - 3: Update metrics and transition history, trace back through the current
//! and previous blocks, decodes current and previos block giving nBits/2 bits
//!
//! \param nBits Number of Coded bits for this block
//! \param in_p Address of input buffer
//! \param out_p Address of output buffer
//! \param flag Mode of operation
//
extern void cnvDec_asm(int nBits, int *in_p, int *out_p, int flag);
//! \brief State Metrics Rescale
//!
//! Rescale the state metrics by finding the lowest metric and dividing the
//! rest by it. This prevents overflow between successive decoder stages
//!
//
extern void cnvDecMetricRescale_asm();
#ifdef __cplusplus
}
#endif // extern "C"
// @} //ingroup
#endif //end of _VCU0_VITERBI_DECODER_H_ definition
// End of File
@@ -0,0 +1,520 @@
#ifndef _VCU2_CRC_H_
#define _VCU2_CRC_H_
//#############################################################################
//! \file include/vcu2/vcu2_crc.h
//!
//! \brief Cyclic Redundancy Check Header File
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
//*****************************************************************************
// includes
//*****************************************************************************
#include "vcu2_types.h"
//!
//! \defgroup VCU2_CRC Cyclic Redundancy Check (VCU2)
//!
//! \ingroup VCU2_CRC
// @{
#ifdef __cplusplus
extern "C" {
#endif
//*****************************************************************************
// defines
//*****************************************************************************
#define INIT_CRC8 0x0 //!< Initial CRC Register Value
#define INIT_CRC16 0x0 //!< Initial CRC Register Value
#define INIT_CRC24 0x0 //!< Initial CRC Register Value
#define INIT_CRC32 0x0 //!< Initial CRC Register Value
//*****************************************************************************
// typedefs
//*****************************************************************************
//! \brief Parity enumeration
//!
//! The parity is used by the CRC algorithm to determine whether to begin
//! calculations from the low byte (EVEN) or from the high byte (ODD) of the
//! first word (16-bit) in the message. \n
//! For example, if your message had 10 bytes and started at the address 0x8000
//! but the first byte was at the high byte position of the first 16-bit word,
//! the user would call the CRC function with odd parity i.e. CRC_parity_odd \n
//! Address: HI LO \n
//! 0x8000 : B0 XX \n
//! 0x8001 : B2 B1 \n
//! 0x8002 : B4 B3 \n
//! 0x8003 : B6 B5 \n
//! 0x8004 : B8 B7 \n
//! 0x8005 : XX B9 \n
//! However, if the first byte was at the low byte position of the first 16-bit word,
//! the user would call the CRC function with even parity i.e. CRC_parity_even \n
//! Address: HI LO \n
//! 0x8000 : B1 B0 \n
//! 0x8001 : B3 B2 \n
//! 0x8002 : B5 B4 \n
//! 0x8003 : B7 B6 \n
//! 0x8004 : B9 B8 \n
//
typedef enum {
CRC_parity_even = 0, //!< Even parity, CRC starts at the low byte of the first word (16-bit)
CRC_parity_odd = 1 //!< Odd parity, CRC starts at the high byte of the first word (16-bit)
} CRC_parity_e;
//! \brief CRC structure
//!
typedef struct _CRC_Obj_{
uint32_t seedValue; //!< Initial value of the CRC calculation
uint16_t nMsgBytes; //!< the number of bytes in the message buffer
CRC_parity_e parity; //!< the location, in a word, of the first byte of the CRC calculation
uint32_t crcResult; //!< the calculated CRC
void *pMsgBuffer; //!< Pointer to the message buffer
void *pCrcTable; //!< Pointer to the CRC lookup table
uint32_t nMsgBits; // provde the data size in bits if the CRC is to be computed bitwise
uint32_t polynomial; // added to ensure customized polynomial can be added by the user
uint16_t polySize; // provide the polynomial size for the customized polynomial
uint16_t dataSize;
uint16_t reflected;
void (*init)(void *); //!< Function pointer to CRC initialization routine
void (*run)(void *); //!< Function pointer to CRC computation routine
}CRC_Obj;
//! \brief Handle to the CRC structure
//!
typedef CRC_Obj *CRC_Handle;
//*****************************************************************************
// globals
//*****************************************************************************
//*****************************************************************************
// function prototypes
//*****************************************************************************
//----------------------
// CRC Helper functions
//----------------------
//! \brief Bit-reverse a value
//!
//! Bit reverse a given hex value, The number of bits must be a power of 2
//!
//! \param valToReverse Value to reverse
//! \param bitWidth Bit-width of the input, must be a power of 2
//!
//! \return bit-reversed value
//
uint32_t CRC_bitReflect(uint32_t valToReverse,int16_t bitWidth);
//
//! \brief power of 2
//!
//! recursive function to calculate a positive integer that is a power of two
//!
//! \param power The exponent of two
//!
//! \returns an integer that is a power of two
//!
//
uint16_t CRC_pow2(uint16_t power);
//! \brief Workaround to the silicon issue of first VCU calculation on power up being
//! erroneous
//!
//! Details Due to the internal power-up state of the VCU module, it is possible
//! that the first CRC result will be incorrect. This condition applies to the
//! first result from each of the eight CRC instructions.
//! This rare condition can only occur after a power-on reset, but will not
//! necessarily occur on every power on. A warm reset will not cause this condition
//! to reappear.
//! Workaround(s): The application can reset the internal VCU CRC logic by
//! performing a CRC calculation of a single byte in the initialization routine.
//! This routine only needs to perform one CRC calculation and can use any of the
//! CRC instructions
//
void CRC_reset(void);
//----------------------
//8-bit CRC functions
//----------------------
//! \brief Initializes the CRC object
//!
//! Clears the CRCMSGFLIP bit is cleared ensuring the input
//! is interpreted in normal bit-order
//!
//! \param[in] hndCRC handle to the CRC object
//
void CRC_init8Bit(CRC_Handle hndCRC );
//! \brief Calculate the 8-bit CRC using polynomial 0x7
//!
//! Calculates the 8-bit CRC using polynomial 0x7 on the VCU.
//! Depending on the parity chosen the CRC begins at either
//! the low byte (PARITY_LOWBYTE) or the high byte (PARITY_HIGHBYTE)
//! of the first word (16-bit).
//! \note the size of the message (bytes) is limited to 65535 bytes.
//! If attempting to process a larger message, the user must break
//! it into pieces of size 65535 or smaller, and successively run
//! the CRC on each block, with the CRC result of one block becoming the
//! seed value for the next block. An example of this is shown in the
//! FLASH build configuration of the example \b 2837x_vcu2_crc_8.
//!
//! \param[in] hndCRC handle to the CRC object
//
void CRC_run8Bit(CRC_Handle hndCRC);
//! \brief Runs the 8-bit CRC routine using polynomial 0x7
//! with the input bits reversed
//!
//! By setting the CRCMSGFLIP bit, the input is fed through the
//! VCU 8-bit CRC calculator (polynomial 0x7) in reverse bit order
//!
//! \note the size of the message (bytes) is limited to 65535 bytes
//! Please see the notes for the function \b CRC_run8Bit for details
//!
//! \param[in] hndCRC handle to the CRC object
//
void CRC_run8BitReflected(CRC_Handle hndCRC);
//! \brief C table-lookup 8-bit CRC calculation
//!
//! The CRC is calculated using a table lookup method, where
//! each byte of the input is an index into the table. The value
//! at that index is XOR'd into a variable called the accumulator.
//! Once the final byte's CRC is looked up and accumulated we get
//! the CRC for the entire message block
//!
//! \note the size of the message (bytes) is limited to 65535 bytes
//! Please see the notes for the function \b CRC_run8Bit for details
//!
//! \param[in] hndCRC handle to the CRC object
//! \sa http://www.ross.net/crc/download/crc_v3.txt
//
void CRC_run8BitTableLookupC(CRC_Handle hndCRC);
//----------------------
//16-bit CRC functions
//----------------------
//! \brief Initializes the CRC object
//!
//! Clears the CRCMSGFLIP bit is cleared ensuring the input
//! is interpreted in normal bit-order
//!
//! \param[in] hndCRC handle to the CRC object
//
void CRC_init16Bit(CRC_Handle hndCRC);
//! \brief Runs the CRC routine using polynomial 0x8005
//!
//! Calculates the 16-bit CRC using polynomial 0x8005 on the VCU.
//! Depending on the parity chosen the CRC begins at either
//! the low byte (PARITY_LOWBYTE) or the high byte (PARITY_HIGHBYTE)
//! of the first word (16-bit).
//!
//! \note the size of the message (bytes) is limited to 65535 bytes
//! Please see the notes for the function \b CRC_run8Bit for details
//!
//! \param[in] hndCRC handle to the CRC object
//
void CRC_run16BitPoly1(CRC_Handle hndCRC);
//! \brief Runs the CRC routine using polynomial 0x1021
//!
//! Calculates the 16-bit CRC using polynomial 0x1021 on the VCU.
//! Depending on the parity chosen the CRC begins at either
//! the low byte (PARITY_LOWBYTE) or the high byte (PARITY_HIGHBYTE)
//! of the first word (16-bit).
//!
//! \note the size of the message (bytes) is limited to 65535 bytes
//! Please see the notes for the function \b CRC_run8Bit for details
//!
//! \param[in] hndCRC handle to the CRC object
//
void CRC_run16BitPoly2(CRC_Handle hndCRC);
//! \brief Runs the 16-bit CRC routine using polynomial 0x8005
//! with the input bits reversed
//!
//! By setting the CRCMSGFLIP bit, the input is fed through the
//! VCU 16-bit CRC calculator (polynomial 0x8005) in reverse bit order
//!
//! \note the size of the message (bytes) is limited to 65535 bytes
//! Please see the notes for the function \b CRC_run8Bit for details
//!
//! \param[in] hndCRC handle to the CRC object
//
void CRC_run16BitPoly1Reflected(CRC_Handle hndCRC);
//! \brief Runs the 16-bit CRC routine using polynomial 0x1021
//! with the input bits reversed
//!
//! By setting the CRCMSGFLIP bit, the input is fed through the
//! VCU 16-bit CRC calculator (polynomial 0x1021) in reverse bit order
//!
//! \note the size of the message (bytes) is limited to 65535 bytes
//! Please see the notes for the function \b CRC_run8Bit for details
//!
//! \param[in] hndCRC handle to the CRC object
//
void CRC_run16BitPoly2Reflected(CRC_Handle hndCRC);
//! \brief C table-lookup 16-bit CRC calculation
//!
//! The CRC is calculated using a table lookup method, where
//! each byte of the input is an index into the table. The value
//! at that index is XOR'd into a variable called the accumulator.
//! Once the final byte's CRC is looked up and accumulated we get
//! the CRC for the entire message block
//!
//! \note the size of the message (bytes) is limited to 65535 bytes
//! Please see the notes for the function \b CRC_run8Bit for details
//!
//! \param[in] hndCRC handle to the CRC object
//! \sa http://www.ross.net/crc/download/crc_v3.txt
//
void CRC_run16BitTableLookupC(CRC_Handle hndCRC);
//! \brief C table-lookup 16-bit CRC calculation(reflected algorithm)
//!
//! The CRC is calculated using a table lookup method, where
//! each byte of the input is an index into the table. The value
//! at that index is XOR'd into a variable called the accumulator.
//! Once the final byte's CRC is looked up and accumulated we get
//! the CRC for the entire message block
//!
//! \note the size of the message (bytes) is limited to 65535 bytes
//! Please see the notes for the function \b CRC_run8Bit for details
//!
//! \param[in] hndCRC handle to the CRC object
//! \sa http://www.ross.net/crc/download/crc_v3.txt
//
void CRC_run16BitReflectedTableLookupC(CRC_Handle hndCRC);
//----------------------
//24-bit CRC functions
//----------------------
//! \brief Initializes the CRC object
//!
//! Clears the CRCMSGFLIP bit is cleared ensuring the input
//! is interpreted in normal bit-order
//!
//! \param[in] hndCRC handle to the CRC object
//
void CRC_init24Bit(CRC_Handle hndCRC);
//! \brief Runs the CRC routine
//!
//! Calculates the 24-bit CRC using polynomial 0x5d6dcb on the VCU.
//! Depending on the parity chosen the CRC begins at either
//! the low byte (PARITY_LOWBYTE) or the high byte (PARITY_HIGHBYTE)
//! of the first word (16-bit).
//!
//! \note the size of the message (bytes) is limited to 65535 bytes
//! Please see the notes for the function \b CRC_run8Bit for details
//!
//! \param[in] hndCRC handle to the CRC object
//
void CRC_run24Bit(CRC_Handle hndCRC);
//! \brief Runs the 24-bit CRC routine using polynomial 0x5d6dcb
//! with the input bits reversed
//!
//! By setting the CRCMSGFLIP bit, the input is fed through the
//! VCU 24-bit CRC calculator (polynomial 0x5d6dcb) in reverse bit order
//!
//! \note the size of the message (bytes) is limited to 65535 bytes
//! Please see the notes for the function \b CRC_run8Bit for details
//!
//! \param[in] hndCRC handle to the CRC object
//
void CRC_run24BitReflected(CRC_Handle hndCRC);
//! \brief C table-lookup 24-bit CRC calculation
//!
//! The CRC is calculated using a table lookup method, where
//! each byte of the input is an index into the table. The value
//! at that index is XOR'd into a variable called the accumulator.
//! Once the final byte's CRC is looked up and accumulated we get
//! the CRC for the entire message block
//!
//! \note the size of the message (bytes) is limited to 65535 bytes
//! Please see the notes for the function \b CRC_run8Bit for details
//!
//! \param[in] hndCRC handle to the CRC object
//! \sa http://www.ross.net/crc/download/crc_v3.txt
//
void CRC_run24BitTableLookupC(CRC_Handle hndCRC);
//! \brief C table-lookup 24-bit CRC calculation(reflected algorithm)
//!
//! The CRC is calculated using a table lookup method, where
//! each byte of the input is an index into the table. The value
//! at that index is XOR'd into a variable called the accumulator.
//! Once the final byte's CRC is looked up and accumulated we get
//! the CRC for the entire message block
//!
//! \note the size of the message (bytes) is limited to 65535 bytes
//! Please see the notes for the function \b CRC_run8Bit for details
//!
//! \param[in] hndCRC handle to the CRC object
//! \sa http://www.ross.net/crc/download/crc_v3.txt
//
void CRC_run24BitReflectedTableLookupC(CRC_Handle hndCRC);
//----------------------
//32-bit CRC functions
//----------------------
//! \brief Initializes the CRC object
//!
//! Clears the CRCMSGFLIP bit is cleared ensuring the input
//! is interpreted in normal bit-order
//!
//! \param[in] hndCRC handle to the CRC object
//
void CRC_init32Bit(CRC_Handle hndCRC);
//! \brief Runs the 32-bit CRC routine using polynomial 0x04c11db7
//!
//! Calculates the 32-bit CRC using polynomial 0x04c11db7 on the VCU.
//! Depending on the parity chosen the CRC begins at either
//! the low byte (PARITY_LOWBYTE) or the high byte (PARITY_HIGHBYTE)
//! of the first word (16-bit).
//!
//! \note the size of the message (bytes) is limited to 65535 bytes
//! Please see the notes for the function \b CRC_run8Bit for details
//!
//! \param[in] hndCRC handle to the CRC object
//
void CRC_run32BitPoly1(CRC_Handle hndCRC);
//! \brief Runs the 32-bit CRC routine using polynomial 0x1edc6f41
//!
//! Calculates the 32-bit CRC using polynomial 0x1edc6f41 on the VCU.
//! Depending on the parity chosen the CRC begins at either
//! the low byte (PARITY_LOWBYTE) or the high byte (PARITY_HIGHBYTE)
//! of the first word (16-bit).
//!
//! \note the size of the message (bytes) is limited to 65535 bytes
//! Please see the notes for the function \b CRC_run8Bit for details
//!
//! \param[in] hndCRC handle to the CRC object
//
void CRC_run32BitPoly2(CRC_Handle hndCRC);
//! \brief Runs the 32-bit CRC routine using polynomial 0x04c11db7
//! with the input bits reversed
//!
//! By setting the CRCMSGFLIP bit, the input is fed through the
//! VCU 32-bit CRC calculator (polynomial 0x04c11db7) in reverse bit order
//!
//! \note the size of the message (bytes) is limited to 65535 bytes
//! Please see the notes for the function \b CRC_run8Bit for details
//!
//! \param[in] hndCRC handle to the CRC object
//
void CRC_run32BitPoly1Reflected(CRC_Handle hndCRC);
//! \brief Runs the 32-bit CRC routine using polynomial 0x1edc6f41
//! with the input bits reversed
//!
//! By setting the CRCMSGFLIP bit, the input is fed through the
//! VCU 32-bit CRC calculator (polynomial 0x1edc6f41) in reverse bit order
//!
//! \note the size of the message (bytes) is limited to 65535 bytes
//! Please see the notes for the function \b CRC_run8Bit for details
//!
//! \param[in] hndCRC handle to the CRC object
//
void CRC_run32BitPoly2Reflected(CRC_Handle hndCRC);
//! \brief C table-lookup 32-bit CRC calculation
//!
//! The CRC is calculated using a table lookup method, where
//! each byte of the input is an index into the table. The value
//! at that index is XOR'd into a variable called the accumulator.
//! Once the final byte's CRC is looked up and accumulated we get
//! the CRC for the entire message block
//!
//! \note the size of the message (bytes) is limited to 65535 bytes
//! Please see the notes for the function \b CRC_run8Bit for details
//!
//! \param[in] hndCRC handle to the CRC object
//! \sa http://www.ross.net/crc/download/crc_v3.txt
//
void CRC_run32BitTableLookupC(CRC_Handle hndCRC);
//! \brief C table-lookup 32-bit CRC calculation(reflected algorithm)
//!
//! The CRC is calculated using a table lookup method, where
//! each byte of the input is an index into the table. The value
//! at that index is XOR'd into a variable called the accumulator.
//! Once the final byte's CRC is looked up and accumulated we get
//! the CRC for the entire message block
//!
//! \note the size of the message (bytes) is limited to 65535 bytes
//! Please see the notes for the function \b CRC_run8Bit for details
//!
//! \param[in] hndCRC handle to the CRC object
//! \sa http://www.ross.net/crc/download/crc_v3.txt
//
void CRC_run32BitReflectedTableLookupC(CRC_Handle hndCRC);
#ifdef __cplusplus
}
#endif // extern "C"
// @} //ingroup
#endif //end of _VCU2_CRC_H_ definition
// End of File
@@ -0,0 +1,171 @@
#ifndef _VCU2_DEINTERLEAVER_H_
#define _VCU2_DEINTERLEAVER_H_
//#############################################################################
//! \file include/vcu2/vcu2_deinterleaver.h
//!
//! \brief De-interleaver header file
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
//*****************************************************************************
// includes
//*****************************************************************************
#include "vcu2_types.h"
//!
//! \defgroup VCU2_DEINTERLEAVER De-Interleaver (VCU2)
//!
//! \ingroup VCU2_DEINTERLEAVER
// @{
#ifdef __cplusplus
extern "C" {
#endif
//*****************************************************************************
// defines
//*****************************************************************************
#define _DOXYGEN_ 1 // Temporary Definition for documentation purposes
//*****************************************************************************
// typedefs
//*****************************************************************************
//
// | Sub-carrier number i = 0..m -1
// --|------------------------------------------------------>
// O | +----------------------------------------------------+
// F | | 0 | 1 | | m-1 |
// D | +-------+------+------------------------------+------+
// M | | m | m+1 | |2m-1 |
// | +-------+------+------------------------------+------+
// s | | | | | |
// y | | | | | |
// m | | | | | |
// b | | | | | |
// o | | | | | |
// l | | | | | |
// | | | | | |
// n | | | | | |
// u | | | | | |
// m | | | | | |
// b | | | | | |
// e | | | | | |
// r | | | | | |
// | | | | | |
// j | | | | | |
// = | | | | | |
// 0 | | | | | |
// . | +-------+------+------------------------------+------+
// . | |(n-1)*m| | | n*m-1|
// n-1| +----------------------------------------------------+
// v
//
// J = (j*n_j + i*n_i)%n
// I = (i*m_i + J*M_j)%m
// (i,j) - original bit position (I,J) - interleaved position
//! \brief De-interleaver structure
//!
typedef struct _DEINTERLEAVER_Obj_{
uint16_t *pInBuffer; //!< Pointer to the input buffer
uint16_t *pOutBuffer; //!< Pointer to the input buffer
uint16_t *pSymbol; //!< Pointer to symbol storage
uint16_t n; //!< number of OFDM symbols in each interleaving block
uint16_t m; //!< number of sub-carriers in each OFDM symbol
uint16_t b; //!< beta
uint16_t v; //!< mu
uint16_t a; //!< alpha
uint16_t u; //!< upsilon
uint16_t n_i; //!< Circular shift of the rows
uint16_t n_j; //!< Circular shift of the rows
uint16_t m_i; //!< Circular shift of the columns
uint16_t m_j; //!< Circular shift of the columns
void (*init)(void *); //!< Function pointer to DEINTERLEAVER initialization routine (NULL as of current release)
void (*run)(void *); //!< Function pointer to DEINTERLEAVER computation routine
}DEINTERLEAVER_Obj;
//! \brief Handle to the DEINTERLEAVER structure
//!
typedef DEINTERLEAVER_Obj *DEINTERLEAVER_Handle;
//*****************************************************************************
// globals
//*****************************************************************************
//*****************************************************************************
// function prototypes
//*****************************************************************************
//! \brief Runs the DEINTERLEAVER routine
//!
//! The de-interleaver equations are:
//! \f[J &=& (j{\times}n_{j} + i{\times}n_{i}) \% n \\ \f]
//! \f[I &=& (i{\times}m_{i} + J{\times}m_{j}) \% m \\ \f]
//!
//! The interleaver equations are:
//! \f[ i &=& (a \times I - u \times J) \% m \\ \f]
//! \f[ j &=& (b \times J - v \times i) \% n \\ \f]
//! \f[ b &=& \beta_{j} \\ \f]
//! \f[ v &=& \mu_{ij} = \beta_{j} \times n_{i} \\ \f]
//! \f[ a &=& \alpha_{i} \\ \f]
//! \f[ u &=& \upsilon_{ij} = alpha_{i} \times m_{j} \\ \f]
//! (i,j) - original bit position (I,J) - interleaved position
//!
//! \param[in] hndDEINTERLEAVER handle to the DEINTERLEAVER object
//
void DEINTERLEAVER_run(DEINTERLEAVER_Handle hndDEINTERLEAVER);
#ifdef __cplusplus
}
#endif // extern "C"
// @} //ingroup
#endif //end of _VCU2_DEINTERLEAVER_H_ definition
// End of File
@@ -0,0 +1,486 @@
#ifndef _VCU2_FFT_H_
#define _VCU2_FFT_H_
//#############################################################################
//! \file include/vcu2/vcu2_fft.h
//!
//! \brief Fast-Fourier Transform header file
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
//*****************************************************************************
// includes
//*****************************************************************************
#include "vcu2_types.h"
//!
//! \defgroup VCU2_FFT Fast Fourier Transform (VCU2)
//!
//! \ingroup VCU2_FFT
// @{
#ifdef __cplusplus
extern "C" {
#endif
//*****************************************************************************
// defines
//*****************************************************************************
#define _DOXYGEN_ 1 // Temporary Definition for documentation purposes
//*****************************************************************************
// typedefs
//*****************************************************************************
//! \brief CFFT structure
//!
typedef struct _CFFT_Obj_{
int16_t *pInBuffer; //!< Input buffer pointer
int16_t *pOutBuffer; //!< Output buffer pointer
const int16_t *pTwiddleFactors; //!< Twiddle Factor pointer
int16_t nSamples; //!< Number of samples
int16_t nStages; //!< Number of stages in the FFT, \f$n\ =\ log_{2}(N)\f$
int16_t twiddleSkipStep; //!< Twiddle factor table search(skip) step
void (*init)(void *); //!< Function pointer to CFFT initialization routine
void (*run)(void *); //!< Function pointer to CFFT computation routine
}CFFT_Obj;
//! \brief Handle to the CFFT structure
//!
typedef CFFT_Obj *CFFT_Handle;
//*****************************************************************************
// globals
//*****************************************************************************
//! \brief VCU2 twiddle factors
//!
extern const int16_t *vcu2_twiddleFactors;
//! \brief VCU0 twiddle factors
//!
extern const int16_t *vcu0_twiddleFactors;
//*****************************************************************************
// function prototypes
//*****************************************************************************
//! \brief Initializes the CFFT object
//!
//! This routine is used to initialize the CFFT object and must be called atleast
//! once before using either the CFFT or ICFFT routines
//!
//! \param[in] hndCFFT handle to the CFFT object
//
void CFFT_init32Pt(CFFT_Handle hndCFFT);
//! \brief Runs the Complex FFT routine
//!
//! \param[in] hndCFFT handle to the CFFT object
//! \attention For bit reverse addressing to work, the input buffer must be aligned
//! to size of the buffer in words (16-bit). For example, the 32 point complex FFT requires
//! an input buffer of size 64 words (16-bit), therefore it must be aligned to a boundary
//! of 64. This can be done by assigning the array to a named section
//! (buffer1) using compiler pragmas
//! \code #pragma DATA_SECTION(buffer1Q15,"buffer1") \endcode
//! and then either assigning this memory to the start of a RAM block in the
//! linker command file or aligning it to a boundary using the align directive
//! \code buffer1 : > RAMLS3, ALIGN = 64, PAGE = 1 \endcode
//! \note The algorithm ping-pongs between the two buffers, i.e. the buffers
//! pointed to by \b pInBuffer and \b pOutBuffer, at every stage. Depending
//! on the number of stages the output may be in either of the two buffers; the
//! algorithm will switch the pointers \b pOutBuffer and \b pInBuffer in the
//! event that the output ends up in the original input buffer, with the end result
//! that \b pOutBuffer always points to the output.
//
void CFFT_run32Pt(CFFT_Handle hndCFFT);
//! \brief Runs the Complex Inverse FFT routine
//!
//! Run the forward FFT on the input and rearrange the output as follows:
//! \f[x(0) = x'(0)\f]
//! \f[x(n) = x'(N-n), n \in \{1,N-1\} \f], where N is the sample size
//!
//! \param[in] hndCFFT handle to the CFFT object
//! \attention For bit reverse addressing to work, the input buffer must be aligned
//! to size of the buffer in words (16-bit). For example, the 32 point complex FFT requires
//! an input buffer of size 64 words (16-bit), therefore it must be aligned to a boundary
//! of 64. This can be done by assigning the array to a named section
//! (buffer1) using compiler pragmas
//! \code #pragma DATA_SECTION(buffer1Q15,"buffer1") \endcode
//! and then either assigning this memory to the start of a RAM block in the
//! linker command file or aligning it to a boundary using the align directive
//! \code buffer1 : > RAMLS3, ALIGN = 64, PAGE = 1 \endcode
//! If the output buffer of the forward FFT becomes the input to the IFFT, then it
//! must be aligned to the same word (16-bit) boundary as well.
//! \note The algorithm ping-pongs between the two buffers, i.e. the buffers
//! pointed to by \b pInBuffer and \b pOutBuffer, at every stage. Depending
//! on the number of stages the output may be in either of the two buffers; the
//! algorithm will switch the pointers \b pOutBuffer and \b pInBuffer in the
//! event that the output ends up in the original input buffer, with the end result
//! that \b pOutBuffer always points to the output.
//
void ICFFT_run32Pt(CFFT_Handle hndCFFT);
//! \brief Initializes the CFFT object
//! \param[in] hndCFFT handle to the CFFT object
//
void CFFT_init64Pt(CFFT_Handle hndCFFT);
//! \brief Runs the Complex FFT routine
//!
//! \param[in] hndCFFT handle to the CFFT object
//! \attention For bit reverse addressing to work, the input buffer must be aligned
//! to size of the buffer in words (16-bit). For example, the 64 point complex FFT requires
//! an input buffer of size 128 words (16-bit), therefore it must be aligned to a boundary
//! of 128. This can be done by assigning the array to a named section
//! (buffer1) using compiler pragmas
//! \code #pragma DATA_SECTION(buffer1Q15,"buffer1") \endcode
//! and then either assigning this memory to the start of a RAM block in the
//! linker command file or aligning it to a boundary using the align directive
//! \code buffer1 : > RAMLS3, ALIGN = 128, PAGE = 1 \endcode
//! \note The algorithm ping-pongs between the two buffers, i.e. the buffers
//! pointed to by \b pInBuffer and \b pOutBuffer, at every stage. Depending
//! on the number of stages the output may be in either of the two buffers; the
//! algorithm will switch the pointers \b pOutBuffer and \b pInBuffer in the
//! event that the output ends up in the original input buffer, with the end result
//! that \b pOutBuffer always points to the output.
//
void CFFT_run64Pt(CFFT_Handle hndCFFT);
//! \brief Runs the Complex Inverse FFT routine
//!
//! Run the forward FFT on the input and rearrange the output as follows:
//! \f[x(0) = x'(0)\f]
//! \f[x(n) = x'(N-n), n \in \{1,N-1\} \f], where N is the sample size
//!
//! \param[in] hndCFFT handle to the CFFT object
//! \attention For bit reverse addressing to work, the input buffer must be aligned
//! to size of the buffer in words (16-bit). For example, the 64 point complex FFT requires
//! an input buffer of size 128 words (16-bit), therefore it must be aligned to a boundary
//! of 128. This can be done by assigning the array to a named section
//! (buffer1) using compiler pragmas
//! \code #pragma DATA_SECTION(buffer1Q15,"buffer1") \endcode
//! and then either assigning this memory to the start of a RAM block in the
//! linker command file or aligning it to a boundary using the align directive
//! \code buffer1 : > RAMLS3, ALIGN = 128, PAGE = 1 \endcode
//! If the output buffer of the forward FFT becomes the input to the IFFT, then it
//! must be aligned to the same word (16-bit) boundary as well.
//! \note The algorithm ping-pongs between the two buffers, i.e. the buffers
//! pointed to by \b pInBuffer and \b pOutBuffer, at every stage. Depending
//! on the number of stages the output may be in either of the two buffers; the
//! algorithm will switch the pointers \b pOutBuffer and \b pInBuffer in the
//! event that the output ends up in the original input buffer, with the end result
//! that \b pOutBuffer always points to the output.
//
void ICFFT_run64Pt(CFFT_Handle hndCFFT);
//! \brief Initializes the CFFT object
//! \param[in] hndCFFT handle to the CFFT object
//
void CFFT_init128Pt(CFFT_Handle hndCFFT);
//! \brief Runs the Complex FFT routine
//!
//! \param[in] hndCFFT handle to the CFFT object
//! \attention For bit reverse addressing to work, the input buffer must be aligned
//! to size of the buffer in words (16-bit). For example, the 128 point complex FFT requires
//! an input buffer of size 256 words (16-bit), therefore it must be aligned to a boundary
//! of 256. This can be done by assigning the array to a named section
//! (buffer1) using compiler pragmas
//! \code #pragma DATA_SECTION(buffer1Q15,"buffer1") \endcode
//! and then either assigning this memory to the start of a RAM block in the
//! linker command file or aligning it to a boundary using the align directive
//! \code buffer1 : > RAMLS3, ALIGN = 256, PAGE = 1 \endcode
//
void CFFT_run128Pt(CFFT_Handle hndCFFT);
//! \brief Runs the Complex Inverse FFT routine
//!
//! Run the forward FFT on the input and rearrange the output as follows:
//! \f[x(0) = x'(0)\f]
//! \f[x(n) = x'(N-n), n \in \{1,N-1\} \f], where N is the sample size
//!
//! \param[in] hndCFFT handle to the CFFT object
//! \attention For bit reverse addressing to work, the input buffer must be aligned
//! to size of the buffer in words (16-bit). For example, the 128 point complex FFT requires
//! an input buffer of size 256 words (16-bit), therefore it must be aligned to a boundary
//! of 256. This can be done by assigning the array to a named section
//! (buffer1) using compiler pragmas
//! \code #pragma DATA_SECTION(buffer1Q15,"buffer1") \endcode
//! and then either assigning this memory to the start of a RAM block in the
//! linker command file or aligning it to a boundary using the align directive
//! \code buffer1 : > RAMLS3, ALIGN = 256, PAGE = 1 \endcode
//! If the output buffer of the forward FFT becomes the input to the IFFT, then it
//! must be aligned to the same word (16-bit) boundary as well.
//! \note The algorithm ping-pongs between the two buffers, i.e. the buffers
//! pointed to by \b pInBuffer and \b pOutBuffer, at every stage. Depending
//! on the number of stages the output may be in either of the two buffers; the
//! algorithm will switch the pointers \b pOutBuffer and \b pInBuffer in the
//! event that the output ends up in the original input buffer, with the end result
//! that \b pOutBuffer always points to the output.
//
void ICFFT_run128Pt(CFFT_Handle hndCFFT);
//! \brief Initializes the CFFT object
//! \param[in] hndCFFT handle to the CFFT object
//
void CFFT_init256Pt(CFFT_Handle hndCFFT);
//! \brief Runs the Complex FFT routine
//!
//! \param[in] hndCFFT handle to the CFFT object
//! \attention For bit reverse addressing to work, the input buffer must be aligned
//! to size of the buffer in words (16-bit). For example, the 256 point complex FFT requires
//! an input buffer of size 512 words (16-bit), therefore it must be aligned to a boundary
//! of 512. This can be done by assigning the array to a named section
//! (buffer1) using compiler pragmas
//! \code #pragma DATA_SECTION(buffer1Q15,"buffer1") \endcode
//! and then either assigning this memory to the start of a RAM block in the
//! linker command file or aligning it to a boundary using the align directive
//! \code buffer1 : > RAMLS3, ALIGN = 512, PAGE = 1 \endcode
//! \note The algorithm ping-pongs between the two buffers, i.e. the buffers
//! pointed to by \b pInBuffer and \b pOutBuffer, at every stage. Depending
//! on the number of stages the output may be in either of the two buffers; the
//! algorithm will switch the pointers \b pOutBuffer and \b pInBuffer in the
//! event that the output ends up in the original input buffer, with the end result
//! that \b pOutBuffer always points to the output.
//
void CFFT_run256Pt(CFFT_Handle hndCFFT);
//! \brief Runs the Complex Inverse FFT routine
//!
//! Run the forward FFT on the input and rearrange the output as follows:
//! \f[x(0) = x'(0)\f]
//! \f[x(n) = x'(N-n), n \in \{1,N-1\} \f], where N is the sample size
//!
//! \param[in] hndCFFT handle to the CFFT object
//! \attention For bit reverse addressing to work, the input buffer must be aligned
//! to size of the buffer in words (16-bit). For example, the 256 point complex FFT requires
//! an input buffer of size 512 words (16-bit), therefore it must be aligned to a boundary
//! of 512. This can be done by assigning the array to a named section
//! (buffer1) using compiler pragmas
//! \code #pragma DATA_SECTION(buffer1Q15,"buffer1") \endcode
//! and then either assigning this memory to the start of a RAM block in the
//! linker command file or aligning it to a boundary using the align directive
//! \code buffer1 : > RAMLS3, ALIGN = 512, PAGE = 1 \endcode
//! If the output buffer of the forward FFT becomes the input to the IFFT, then it
//! must be aligned to the same word (16-bit) boundary as well.
//
void ICFFT_run256Pt(CFFT_Handle hndCFFT);
//! \brief Initializes the CFFT object
//! \param[in] hndCFFT handle to the CFFT object
//
void CFFT_init512Pt(CFFT_Handle hndCFFT);
//! \brief Runs the Complex FFT routine
//!
//! \param[in] hndCFFT handle to the CFFT object
//! \attention For bit reverse addressing to work, the input buffer must be aligned
//! to size of the buffer in words (16-bit). For example, the 512 point complex FFT requires
//! an input buffer of size 1024 words (16-bit), therefore it must be aligned to a boundary
//! of 1024. This can be done by assigning the array to a named section
//! (buffer1) using compiler pragmas
//! \code #pragma DATA_SECTION(buffer1Q15,"buffer1") \endcode
//! and then either assigning this memory to the start of a RAM block in the
//! linker command file or aligning it to a boundary using the align directive
//! \code buffer1 : > RAMGS4, ALIGN = 1024, PAGE = 1 \endcode
//! \note The algorithm ping-pongs between the two buffers, i.e. the buffers
//! pointed to by \b pInBuffer and \b pOutBuffer, at every stage. Depending
//! on the number of stages the output may be in either of the two buffers; the
//! algorithm will switch the pointers \b pOutBuffer and \b pInBuffer in the
//! event that the output ends up in the original input buffer, with the end result
//! that \b pOutBuffer always points to the output.
//
void CFFT_run512Pt(CFFT_Handle hndCFFT);
//! \brief Runs the Complex Inverse FFT routine
//!
//! Run the forward FFT on the input and rearrange the output as follows:
//! \f[x(0) = x'(0)\f]
//! \f[x(n) = x'(N-n), n \in \{1,N-1\} \f], where N is the sample size
//!
//! \param[in] hndCFFT handle to the CFFT object
//! \attention For bit reverse addressing to work, the input buffer must be aligned
//! to size of the buffer in words (16-bit). For example, the 512 point complex FFT requires
//! an input buffer of size 1024 words (16-bit), therefore it must be aligned to a boundary
//! of 1024. This can be done by assigning the array to a named section
//! (buffer1) using compiler pragmas
//! \code #pragma DATA_SECTION(buffer1Q15,"buffer1") \endcode
//! and then either assigning this memory to the start of a RAM block in the
//! linker command file or aligning it to a boundary using the align directive
//! \code buffer1 : > RAMGS4, ALIGN = 1024, PAGE = 1 \endcode
//! If the output buffer of the forward FFT becomes the input to the IFFT, then it
//! must be aligned to the same word (16-bit) boundary as well.
//! \note The algorithm ping-pongs between the two buffers, i.e. the buffers
//! pointed to by \b pInBuffer and \b pOutBuffer, at every stage. Depending
//! on the number of stages the output may be in either of the two buffers; the
//! algorithm will switch the pointers \b pOutBuffer and \b pInBuffer in the
//! event that the output ends up in the original input buffer, with the end result
//! that \b pOutBuffer always points to the output.
//
void ICFFT_run512Pt(CFFT_Handle hndCFFT);
//! \brief Initializes the CFFT object
//! \param[in] hndCFFT handle to the CFFT object
//
void CFFT_init1024Pt(CFFT_Handle hndCFFT);
//! \brief Runs the Complex FFT routine
//!
//! \param[in] hndCFFT handle to the CFFT object
//! \attention For bit reverse addressing to work, the input buffer must be aligned
//! to size of the buffer in words (16-bit). For example, the 1024 point complex FFT requires
//! an input buffer of size 2048 words (16-bit), therefore it must be aligned to a boundary
//! of 2048. This can be done by assigning the array to a named section
//! (buffer1) using compiler pragmas
//! \code #pragma DATA_SECTION(buffer1Q15,"buffer1") \endcode
//! and then either assigning this memory to the start of a RAM block in the
//! linker command file or aligning it to a boundary using the align directive
//! \code buffer1 : > RAMGS4, ALIGN = 2048, PAGE = 1 \endcode
//! \note The algorithm ping-pongs between the two buffers, i.e. the buffers
//! pointed to by \b pInBuffer and \b pOutBuffer, at every stage. Depending
//! on the number of stages the output may be in either of the two buffers; the
//! algorithm will switch the pointers \b pOutBuffer and \b pInBuffer in the
//! event that the output ends up in the original input buffer, with the end result
//! that \b pOutBuffer always points to the output.
//
void CFFT_run1024Pt(CFFT_Handle hndCFFT);
//! \brief Runs the Complex Inverse FFT routine
//!
//! Run the forward FFT on the input and rearrange the output as follows:
//! \f[x(0) = x'(0)\f]
//! \f[x(n) = x'(N-n), n \in \{1,N-1\} \f], where N is the sample size
//!
//! \param[in] hndCFFT handle to the CFFT object
//! \attention For bit reverse addressing to work, the input buffer must be aligned
//! to size of the buffer in words (16-bit). For example, the 1024 point complex FFT requires
//! an input buffer of size 2048 words (16-bit), therefore it must be aligned to a boundary
//! of 2048. This can be done by assigning the array to a named section
//! (buffer1) using compiler pragmas
//! \code #pragma DATA_SECTION(buffer1Q15,"buffer1") \endcode
//! and then either assigning this memory to the start of a RAM block in the
//! linker command file or aligning it to a boundary using the align directive
//! \code buffer1 : > RAMGS4, ALIGN = 2048, PAGE = 1 \endcode
//! If the output buffer of the forward FFT becomes the input to the IFFT, then it
//! must be aligned to the same word (16-bit) boundary as well.
//! \note The algorithm ping-pongs between the two buffers, i.e. the buffers
//! pointed to by \b pInBuffer and \b pOutBuffer, at every stage. Depending
//! on the number of stages the output may be in either of the two buffers; the
//! algorithm will switch the pointers \b pOutBuffer and \b pInBuffer in the
//! event that the output ends up in the original input buffer, with the end result
//! that \b pOutBuffer always points to the output.
//
void ICFFT_run1024Pt(CFFT_Handle hndCFFT);
//!
//! \brief Unpack the complex FFT output to get the FFT of two interleaved
//! real sequences
//!
//! In order to get the FFT of a real N-pt sequences, we treat the input as
//! an N/2 pt complex sequence, take its complex FFT, use the following properties
//! to get the N-pt Fourier transform of the real sequence
//!
//! \f[ FFT_{n}(k,f) = FFT_{N/2}(k,f_{e}) + e^{\frac{-j2{\pi}k}{N}}FFT_{N/2}(k,f_{o}) \f]
//!
//! where \f$f_{e}\f$ is the even elements, \f$f_{o}\f$ the odd elements and
//!
//! \f[ F_{e}(k) = \frac{Z(k) + Z(\frac{N}{2}-k)^{\ast}}{2} \f]
//! \f[ F_{o}(k) = -j\frac{Z(k) - Z(\frac{N}{2}-k)^{\ast}}{2} \f]
//!
//! We get the first N/2 points of the FFT by combining the above two equations
//! \f[ F(k) = F_{e}(k) + e^{\frac{-j2{\pi}k}{N}}F_{o}(k) \f]
//!
//! \param[in] hndCFFT handle to the CFFT object
//! \note This is an in-place algorithm; the routine writes the output to the input buffer itself
//! \sa http://www.engineeringproductivitytools.com/stuff/T0001/PT10.HTM for the entire
//! derivation
//
void CFFT_unpack(CFFT_Handle hndCFFT);
//! \brief Pack the input prior to running the inverse complex FFT to get
//! the real inverse FFT
//!
//! In order to reverse the process of the forward real FFT,
//!
//! \f[ F_{e}(k) = \frac{F(k) + F(\frac{N}{2}-k)^{\ast}}{2} \f]
//! \f[ F_{o}(k) = \frac{F(k) - F(\frac{N}{2}-k)^{\ast}}{2} e^{\frac{j2{\pi}k}{N}} \f]
//!
//! where \f$f_{e}\f$ is the even elements, \f$f_{o}\f$ the odd elements.
//! The array for the IFFT then becomes:
//! \f[ Z(k) = F_{e}(k) + jF_{o}(k), \ k = 0...\frac{N}{2}-1 \f]
//!
//! \param[in] hndCFFT handle to the CFFT object
//! \note
//! - This is an in-place algorithm; the routine writes the output to the input buffer itself
//! - The assumption is that the user will run the packed sequence through
//! an IFFT sequence i.e. conjugate -> Forward FFT -> conjugate. The packed output
//! is conjugated in this routine obviating the need for the first conjugate in the
//! IFFT sequence
//! \sa http://www.engineeringproductivitytools.com/stuff/T0001/PT10.HTM for the entire
//! derivation
//
void CFFT_pack(CFFT_Handle hndCFFT);
//!
//! \brief Take the complex conjugate of the entries in an array of complex
//! numbers
//!
//! \param pBuffer Pointer to the buffer of complex data to be conjugated
//! \param[in] size Size of the buffer (multiple of 2 32-bits locations)
//
void CFFT_conjugate(void *pBuffer, uint16_t size);
#ifdef __cplusplus
}
#endif // extern "C"
// @} //ingroup
#endif //end of _VCU2_FFT_H_ definition
// End of File
@@ -0,0 +1,187 @@
#ifndef _VCU2_REEDSOLOMON_DECODER_H_
#define _VCU2_REEDSOLOMON_DECODER_H_
//#############################################################################
//! \file include/vcu2/vcu2_reedsolomon_decoder.h
//!
//! \brief Reed Solomon Decoder header file
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
//*****************************************************************************
// includes
//*****************************************************************************
#include "vcu2_types.h"
//!
//! \defgroup VCU2_REEDSOLOMON_DECODER Reed Solomon Decoder (VCU2)
//!
//! \ingroup VCU2_REEDSOLOMON_DECODER
// @{
#ifdef __cplusplus
extern "C" {
#endif
//*****************************************************************************
// defines
//*****************************************************************************
#define RS_BLOCK_N 255 //!< Encoded block size
#define RS_BLOCK_K 239 //!< Message size
#define RS_BLOCK_T ((RS_BLOCK_N - RS_BLOCK_K)/2) //!< number of correctable errors
#define RS_NROOTS (RS_BLOCK_N - RS_BLOCK_K) //!< Number of code generator polynomial roots
//*****************************************************************************
// typedefs
//*****************************************************************************
typedef struct _ERROR_LOCVAL_Obj_{
uint16_t pos; //!< Error position
int16_t val; //!< Error value
}ERROR_LOCVAL_Obj;
//! \brief Reed-Solomon Decoder structure
//!
typedef struct _REEDSOLOMON_DECODER_Obj_{
uint16_t _n; //!< number of codeword symbols (bytes) in a block
uint16_t _k; //!< number of message symbols (bytes) in a block
uint16_t _t; //!< number of correctable errors in the block
uint16_t nRoots; //!< number of roots for the code generator polynomial
int16_t *pSyndrome; //!< pointer to the syndromes
int16_t *pLambda; //!< pointer to the Lambdas
int16_t *pOmega; //!< pointer to the Omega
int16_t *pPackedAlpha; //!< Pointer to the roots of the code generator polynomial
int16_t *pPackedBeta; //!< Pointer to the first 2t elements of the Galois Field
int16_t *pRS_expTable; //!< Pointer to the lookup table (roots of the extension Galois Field) that converts index to decimal form
int16_t *pRS_logTable; //!< Pointer to the lookup table (roots of the extension Galois Field) that converts decimal to index form
ERROR_LOCVAL_Obj *pErrorLoc; //!< Pointer to the error (location, value) pairs
void (*init)(void *,
int16_t *,
int16_t *,
int16_t *,
int16_t *,
int16_t *,
int16_t *,
int16_t *,
ERROR_LOCVAL_Obj *); //!< Function pointer to Reed Solomon Decoder initialization routine
void (*run)(void *,
int16_t*,
int16_t ); //!< Function pointer to Reed Solomon Decoder computation routine
}REEDSOLOMON_DECODER_Obj;
//! \brief Handle to the Reed-Solomon Decoder structure
//!
typedef REEDSOLOMON_DECODER_Obj *REEDSOLOMON_DECODER_Handle;
//*****************************************************************************
// globals
//*****************************************************************************
//*****************************************************************************
// function prototypes
//*****************************************************************************
//! \brief Initializes the Reed Solomon Decoder object (n,k = 255, 239)
//!
//! \param[in] hndRSDecoder handle to the Reed Solomon Decoder object
//! \param[in] pSyndrome Pointer to the syndromes
//! \param[in] pLambda Pointer to the error locator polynomial coefficients
//! \param[in] pOmega Pointer to the error magnitude polynomial coefficients
//! \param[in] pPackedAlpha Pointer to the roots of the generator polynomial \f$ x + \alpha^{i}\f$
//! \param[in] pPackedBeta Pointer to the roots of the generator polynomial \f$ x + \beta^{i}\f$
//! \param[in] pRS_expTable Pointer to the lookup table that converts index to decimal form
//! \param[in] pRS_logTable Pointer to the lookup table that converts decimal to index form
//! \param[in] pErrorLoc Pointer to the error (location, value) pairs
//! \note Requires the data array to be even aligned
//
void REEDSOLOMON_DECODER_initN255K239(REEDSOLOMON_DECODER_Handle hndRSDecoder,
int16_t *pSyndrome, int16_t *pLambda, int16_t *pOmega,
int16_t *pPackedAlpha, int16_t *pPackedBeta, int16_t *pRS_expTable,
int16_t *pRS_logTable, ERROR_LOCVAL_Obj *pErrorLoc);
//! \brief Runs the Reed Solomon Decoder (n,k = 255, 239)
//!
//! \param[in] hndRSDecoder handle to the Reed Solomon Decoder object
//! \param[in] pData pointer to the received message block
//! \param[in] nBytes number of bytes in the message block
void REEDSOLOMON_DECODER_runN255K239(REEDSOLOMON_DECODER_Handle hndRSDecoder,
int16_t *pData, int16_t nBytes);
//! \brief Syndrome calculation function (Horner's Method)
//!
//! \param[in] hndRSDecoder handle to the Reed Solomon Decoder object
//! \param[in] pData pointer to the data
//! \param[in] nBytes number of bytes in the message block
//! \note Requires the syndrome array to be even aligned
//
void REEDSOLOMON_DECODER_calcSyndrome(REEDSOLOMON_DECODER_Handle hndRSDecoder,
int16_t *pData, int16_t nBytes);
//! \brief Error locator polynomial calculation (inversionless Berlekamp Massey Method)
//!
//! \param[in] hndRSDecoder handle to the Reed Solomon Decoder object
//! \note Requires the lambda array to be even aligned
//
void REEDSOLOMON_DECODER_berlekampMassey(REEDSOLOMON_DECODER_Handle hndRSDecoder);
//! \brief caculate error locations using Chien search and magnitude
//! using Forney's algorithm
//!
//! \param[in] hndRSDecoder handle to the Reed Solomon Decoder object
//! \param[in] nBytes number of bytes in the message block
//! \note Requires the omega and error location arrays to be even aligned
//
void REEDSOLOMON_DECODER_chienForney(REEDSOLOMON_DECODER_Handle hndRSDecoder,
int16_t nBytes);
#ifdef __cplusplus
}
#endif // extern "C"
// @} //ingroup
#endif //end of _VCU2_REEDSOLOMON_DECODER_H_ definition
// End of File
@@ -0,0 +1,137 @@
#ifndef _VCU2_TYPES_H_
#define _VCU2_TYPES_H_
//#############################################################################
//! \file include/vcu2/vcu2_types.h
//!
//! \brief Type definitions for the VCU2 algorithms
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
//*****************************************************************************
// includes
//*****************************************************************************
//#include <string.h>
#include <stdint.h>
//!
//! \defgroup VCU2_DEFINITIONS VCU2 Type Defintions
//!
//! \ingroup VCU2_DEFINITIONS
// @{
#ifdef __cplusplus
extern "C" {
#endif
//*****************************************************************************
// defines
//*****************************************************************************
#ifndef NULL
#define NULL 0
#endif
#define TRUE 1
#define FALSE 0
//*****************************************************************************
// typedefs
//*****************************************************************************
#ifndef VCU2_TYPES
#define VCU2_TYPES
//! \brief Boolean enumeration
//!
typedef enum{
BOOL_FALSE=0,
BOOL_TRUE
}Bool_e;
//! \brief Complex data (CPACK = 0)
//!
//! On reset the CPACK bit is 0, therefore, this is the
//! default complex structure
//
typedef struct{
int16_t real; //!< Real Part
int16_t imag; //!< Imaginary Part
}complexShort_t;
typedef union{
//! \brief Complex data (CPACK = 1)
//!
struct{
int16_t imag; //!< Real Part
int16_t real; //!< Imaginary Part
}cplx;
uint32_t ui32;
}complexCPACKON_t;
typedef union{
//! \brief Complex data (CPACK = 0)
//!
struct{
int16_t real; //!< Real Part
int16_t imag; //!< Imaginary Part
}cplx;
uint32_t ui32;
}complexCPACKOFF_t;
#endif //VCU2_TYPES
#ifdef __cplusplus
}
#endif // extern "C"
// @} //ingroup
#endif //end of _VCU2_TYPES_H_ definition
// End of File
@@ -0,0 +1,238 @@
#ifndef _VCU2_VITERBI_DECODER_H_
#define _VCU2_VITERBI_DECODER_H_
//#############################################################################
//! \file include/vcu2/VCU2_VITERBI.h
//!
//! \brief Viterbi Decoder header file
//#############################################################################
//!
//! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
//! All rights reserved not granted herein.
//! Limited License.
//!
//! Texas Instruments Incorporated grants a world-wide, royalty-free,
//! non-exclusive license under copyrights and patents it now or hereafter
//! owns or controls to make, have made, use, import, offer to sell and sell
//! ("Utilize") this software subject to the terms herein. With respect to the
//! foregoing patent license, such license is granted solely to the extent that
//! any such patent is necessary to Utilize the software alone. The patent
//! license shall not apply to any combinations which include this software,
//! other than combinations with devices manufactured by or for TI
//! ("TI Devices").
//! No hardware patent is licensed hereunder.
//!
//! Redistributions must preserve existing copyright notices and reproduce this
//! license (including the above copyright notice and the disclaimer and
//! (if applicable) source code license limitations below) in the documentation
//! and/or other materials provided with the distribution.
//!
//! Redistribution and use in binary form, without modification, are permitted
//! provided that the following conditions are met:
//!
//! * No reverse engineering, decompilation, or disassembly of this software is
//! permitted with respect to any software provided in binary form.
//! * Any redistribution and use are licensed by TI for use only
//! with TI Devices.
//! * Nothing shall obligate TI to provide you with source code for the
//! software licensed and provided to you in object code.
//!
//! If software source code is provided to you, modification and redistribution
//! of the source code are permitted provided that the following conditions
//! are met:
//!
//! * any redistribution and use of the source code, including any resulting
//! derivative works, are licensed by TI for use only with TI Devices.
//! * any redistribution and use of any object code compiled from the source
//! code and any resulting derivative works, are licensed by TI for use
//! only with TI Devices.
//!
//! Neither the name of Texas Instruments Incorporated nor the names of its
//! suppliers may be used to endorse or promote products derived from this
//! software without specific prior written permission.
//#############################################################################
//*****************************************************************************
// includes
//*****************************************************************************
#include "vcu2_types.h"
//!
//! \defgroup VCU2_VITERBI_DECODER Viterbi Decoding (VCU2)
//!
//! \ingroup VCU2_VITERBI_DECODER
// @{
#ifdef __cplusplus
extern "C" {
#endif
//*****************************************************************************
// defines
//*****************************************************************************
#define MIN_K 4
#define MAX_K 7
#define MAX_CNV_ENC_DELAY_LEN (MAX_K - 1)
#define K4_CNV_ENC_DELAY_LEN 4
#define K7_CNV_ENC_DELAY_LEN 7
//*****************************************************************************
// typedefs
//*****************************************************************************
//! \brief The Viterbi mode enumerator
//!
typedef enum{
VITERBIMODE_DECODEALL = 0, //!< Decodes all output bits, upto a max of 256, at once
VITERBIMODE_OVERLAPINIT, //!< Use window overlap method, This is used for the first block
//!< where state metrics and transition history is updated but
//!< no traceback is performed
VITERBIMODE_OVERLAPDECODE, //!< Use window overlap method, update transitions/metrics for the current
//!< block (ith block), run a traceback using the ith and (i-1)st block's
//!< transition history but only decode the (i-1)st block
VITERBIMODE_OVERLAPLAST //!< Trace back and decode the last block in overlap window method
}VITERBIMODE_e;
//! \brief VITERBI Decoder Structure
//!
typedef struct _VITERBI_DECODER_Obj_{
int16_t *pInBuffer; //!< Input buffer pointer
uint16_t *pOutBuffer; //!< Output buffer pointer
uint16_t *pTransitionHistory;//!< Transition History pointer
const int32_t *pBMSELInit; //!< Initialization value for the BMSEL register
int16_t stateMetricInit; //!< Initialization value for the state metrics
int16_t nBits; //!< Total number of bits to be decoded
int16_t constraintLength; //!< Constraint Length, i.e. K
int16_t nStates; //!< number of states = \f$ 2^{K - 1} \f$
int16_t codeRate; //!< The symbol code rate
VITERBIMODE_e mode; //!< Viterbi mode enumerator
uint16_t *pTransitionStart1; //!< Points to the start of the tranistion history buffer
uint16_t *pTransitionStart2; //!< Points to the mid of the tranistion history buffer
uint16_t *pTransitionWrap1; //!< Points to the mid of the tranistion history buffer
uint16_t *pTransitionWrap2; //!< Points to the end of the tranistion history buffer
uint16_t *pTransitionTemp; //!< Points to a temporary(scratch) tranistion history buffer
void (*init)(void *); //!< Function pointer to VITERBI initialization routine
void (*run)(void *); //!< Function pointer to VITERBI computation routine
void (*rescale)(void *); //!< Function pointer to VITERBI rescale routine
}VITERBI_DECODER_Obj;
//! \brief Handle to the VITERBI Decoder structure
//!
typedef VITERBI_DECODER_Obj *VITERBI_DECODER_Handle;
//*****************************************************************************
// globals
//*****************************************************************************
//*****************************************************************************
// function prototypes
//*****************************************************************************
//! \brief Initializes the VITERBI object (constraint length 4, code rate 1/2)
//!
//! Sets the constraint length of the viterbi object and initialized
//! the state metrcs to the object element, stateMetricInit
//!
//! \param[in] hndVITDecoder handle to the VITERBI object
//
void VITERBI_DECODER_initK4CR12(VITERBI_DECODER_Handle hndVITDecoder);
//! \brief Runs the VITERBI decoder for constraint length 4, code rate 1/2
//!
//! The viterbi decode is done using a window overlap method with 4 modes
//! of operation :
//! -# VITERBIMODE_DECODEALL, a one-shot decode mode typically used for header
//! information where the entire block of data is processed
//! through the trellis and decoded
//! -# VITERBIMODE_OVERLAPINIT, window overlap method -- this is used for the first block
//! where state metrics and transition history is updated but
//! no traceback is performed
//! -# VITERBIMODE_OVERLAPDECODE, window overlap method -- update transitions/metrics for the current
//! block (ith block), run a traceback using the ith and (i-1)st block's
//! transition history but only decode the (i-1)st block
//! -# VITERBIMODE_OVERLAPLAST, window overlap method-- trace back and decode the last block
//!
//! The window overlap method requires the transition history of two successive blocks to
//! be recorded. The transition history buffer is used in a circular fashion and requires
//! 5 pointers:
//! - pTransitionHistory(hist_p): start of the transition history buffer
//! - pTransitionStart1(S1_p): points to where the transition update should start
//! - pTransitionStart2(S2_p: points to the mid point of the overlap(S1_p + 4*nUnencodedBits)
//! - pTransitionWrap1(W1_p): points to where trace overlap 2 should go (wrap, S1_p + 4*nUnencodedBits)
//! - pTransitionWrap2(W2_p): points to the end of the overlap(S1_p + 2*4*nUnencodedBits)
//! \verbatim
//! CBITS = 128(coded bits per block)
//! UBITS = CBITS/2 = 64(uncoded bits per block)
//! UWORDS = 4 (4 words (16-bits) required to store UBITS)
//!
//! Transition history(bits per stage)--->
//! <-------64 bits----->
//! +----+----+----+----+ ^
//! S1_p->hist_p->| | | | | |
//! ^ | | | | | |
//! | | | | | | |
//! | | | | | | |
//! 4*UBITS | | | | | |
//! | | | | | | |
//! | | | | | | |
//! | | | | | | |
//! v | | | | | |
//! S2_p->W1_p->| | | | | 128 stages
//! ^ | | | | | |
//! | | | | | | |
//! | | | | | | |
//! 4*UBITS | | | | | |
//! | | | | | | |
//! | | | | | | |
//! | | | | | | |
//! v | | | | | |
//! W2_p->| | | | | |
//! +----+----+----+----+ v
//! \endverbatim
//! \param[in] hndVITDecoder handle to the VITERBI object
//
void VITERBI_DECODER_runK4CR12(VITERBI_DECODER_Handle hndVITDecoder);
//! \brief Rescales the viterbi state metrics (constraint length 4, code rate 1/2)
//!
//! Rescale the state metrics by finding the lowest metric and dividing the
//! rest by it. This prevents overflow between successive decoder stages.
//!
//! \param[in] hndVITDecoder handle to the VITERBI object
//
void VITERBI_DECODER_rescaleK4CR12(VITERBI_DECODER_Handle hndVITDecoder);
//! \brief Initializes the VITERBI object (constraint length 7, code rate 1/2)
//!
//! Sets the constraint length of the viterbi object and initialized
//! the state metrcs to the object element, stateMetricInit
//!
//! \note This function uses a global variable to save off the metric registers
//! and is, therefore, non re-entrant
//!
//! \param[in] hndVITDecoder handle to the VITERBI object
//
void VITERBI_DECODER_initK7CR12(VITERBI_DECODER_Handle hndVITDecoder);
//! \brief Runs the VITERBI decoder for constraint length 7, code rate 1/2
//! \param[in] hndVITDecoder handle to the VITERBI object
//! \sa VITERBI_DECODER_runK4CR12 for a description of the window overlap method
void VITERBI_DECODER_runK7CR12(VITERBI_DECODER_Handle hndVITDecoder);
//! \brief Rescales the viterbi state metrics (constraint length 7, code rate 1/2)
//!
//! Rescale the state metrics by finding the lowest metric and dividing the
//! rest by it. This prevents overflow between successive decoder stages.
//!
//! \param[in] hndVITDecoder handle to the VITERBI object
//
void VITERBI_DECODER_rescaleK7CR12(VITERBI_DECODER_Handle hndVITDecoder);
#ifdef __cplusplus
}
#endif // extern "C"
// @} //ingroup
#endif //end of _VCU2_VITERBI_DECODER_H_ definition
// End of File