/*
 * crc16.c
 *
 *  Created on: Jul 12, 2019
 *      Author: akos
 */

#include <stdint.h>
#include <stdbool.h>

#include <inc/hw_memmap.h>
#include <driverlib/crc.h>

uint16_t crc16(const uint8_t* const pByte, const int len)
{
    CRCConfigSet(CCM0_BASE, CRC_CFG_INIT_0 | CRC_CFG_TYPE_P1021 | CRC_CFG_SIZE_8BIT);

    return CRCDataProcess(CCM0_BASE, (uint32_t*)pByte, len, false);
}
