/* param base DCIC peripheral base address. param regionIdx Region index, from 0 to (DCIC_REGION_COUNT - 1). param config Pointer to the configuration.  */
void DCIC_EnableRegion(DCIC_Type *base, uint8_t regionIdx, const dcic_region_config_t *config)
/* param base DCIC peripheral base address. param regionIdx Region index, from 0 to (DCIC_REGION_COUNT - 1). param config Pointer to the configuration.  */
void DCIC_EnableRegion(DCIC_Type *base, uint8_t regionIdx, const dcic_region_config_t *config)
{
    assert(regionIdx < DCIC_REGION_COUNT);
    assert(NULL != config);
    base->REGION[regionIdx].DCICRRS = config->refCrc;
    base->REGION[regionIdx].DCICRS = (((uint32_t)config->lowerRightX << DCIC_DCICRS_END_OFFSET_X_SHIFT) |
                                      ((uint32_t)config->lowerRightY << DCIC_DCICRS_END_OFFSET_Y_SHIFT));
    base->REGION[regionIdx].DCICRC = (((uint32_t)config->upperLeftX << DCIC_DCICRC_START_OFFSET_X_SHIFT) |
                                      ((uint32_t)config->upperLeftY << DCIC_DCICRC_START_OFFSET_Y_SHIFT) |
                                      (config->lock ? DCIC_DCICRC_ROI_FREEZE_MASK : 0UL) | DCIC_DCICRC_ROI_EN_MASK);
}