MCUXpresso SDK API Reference Manual  Rev 2.16.000
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
SINC: SINC Filter

Overview

The MCUXpresso SDK provides a peripheral driver for the SINC Filter module of MCUXpresso SDK devices. The SINC module is a digital filter that converts an external ADC sigma-delta modulator bitstream to a data stream. One SINC module contains 4 channel4 with dedicated modulator clocks, bitstreams, and triggers. Based on features of SINC module, this driver are divided into following function groups:

SINC Generic Functional Control APIs

Functions in this group are used to initialize or de-initialize SINC module, users can use SINC module by only invoking SINC_Init() with correct configuration.

SINC Generic Low Level Control APIs

Functions in this group are used to enable/disable SINC master or reset SINC module.

Clock Control APIs

Functions in this group are used to control SINC internal clocks.

Channel Functional Control APIs

Functions in this group can be used to set specific channel in the high level method. For example, if only want to set all options(input, protection, FIFO and so on) of channel0, invoking SINC_SetChannelConfig() with the second parameter as kSINC_Channel0.

Channel Result/FIFO Low Level Control APIs

Functions in this group can be used to set specific channel's result related options.

Channel Conversion Low Level Control APIs

Functions in this group can be used to set specific channel's conversion related options.

Channel Protection Low Level Control APIs

Functions in this group can be used to set specific channel's protection related options.

Channel Debug Low Level Control APIs

Functions in this group can be used to set specific channel's debug options.

Interrupt Control APIs

Functions in this group are used to enable/disable SINC module interrupts.

Data Structures

struct  sinc_channel_input_option_t
 The structure of channel input options, including input bit settings and input clock settings. More...
 
struct  sinc_channel_conv_option_t
 The structure of channel conversion options, including CIC filter settings, HPF settings, shift settings, bias settings and so on. More...
 
struct  sinc_channel_protection_option_t
 The structure of channel protection options, including limit check settings, short-circuit settings, clock-absence settings, and zero-crossing settings. More...
 
struct  sinc_channel_config_t
 The structure of channel configurations, including channel input option, channel conversion options, channel protection options, and so on. More...
 
struct  sinc_config_t
 The structure of sinc configurations, including clock settings anc channels' settings. More...
 

Enumerations

enum  _sinc_interrupt_enable
 The enumeration of SINC module's interrupts. More...
 
enum  _sinc_interrupt_status
 The enumeration of SINC interrupt status flags. More...
 
enum  sinc_channel_id_t {
  kSINC_Channel0 = 0U,
  kSINC_Channel1,
  kSINC_Channel2,
  kSINC_Channel3
}
 The enumeration of channel id, the sinc module contains 4 channels. More...
 
enum  _sinc_modulator_clock {
  kSINC_ModClk0 = 1UL,
  kSINC_ModClk1 = 2UL,
  kSINC_ModClk2 = 4UL
}
 The enumeration of modulator clock name. More...
 
enum  sinc_inputClk_source_t {
  kSINC_InputClk_SourceMclkOut0 = 0U,
  kSINC_InputClk_SourceMclkOut1 = 1U,
  kSINC_InputClk_SourceMclkOut2 = 2U,
  kSINC_InputClk_SourceExternalModulatorClk = 3U,
  kSINC_InputClk_SourceAdjacentChannelClk = 7U
}
 The enumeration of input clock. More...
 
enum  sinc_inputClk_edge_t {
  kSINC_InputClk_EdgePositive = 1U,
  kSINC_InputClk_EdgeNegative,
  kSINC_InputClk_EdgeBoth,
  kSINC_InputClk_EdgeOddPositive,
  kSINC_InputClk_EdgeEvenPositive,
  kSINC_InputClk_EdgeOddNegative,
  kSINC_InputClk_EdgeEvenNegative
}
 The enumeration of clock edge. More...
 
enum  sinc_inputBit_format_t {
  kSINC_InputBit_FormatExternalBitstream = 0U,
  kSINC_InputBit_FormatExternalManchesterCode,
  kSINC_InputBit_FormatInternal16bitParallelData,
  kSINC_InputBit_FormatInternal32bitSerialData
}
 The enumeration of input bit format. More...
 
enum  sinc_inputBit_source_t {
  kSINC_InputBit_SourceExternalBitstream = 0U,
  kSINC_InputBit_SourceInternalBitstream = 1U,
  kSINC_InputBit_SourceAdjacentChannel = 3U
}
 The enumeration of input bit source. More...
 
enum  sinc_conv_trigger_source_t {
  kSINC_ConvTrig_SoftPosEdge = 0x0U,
  kSINC_ConvTrig_SoftHighLevel = 0x4U,
  kSINC_ConvTrig_HardPosEdge = 0x1U,
  kSINC_ConvTrig_HardHighLevel = 0x5U,
  kSINC_ConvTrig_AdjacentChannel = 0x3U
}
 The enumeration of trigger source. More...
 
enum  sinc_conv_mode_t {
  kSINC_ConvMode_Single = 0U,
  kSINC_ConvMode_Continuous,
  kSINC_ConvMode_Always,
  kSINC_ConvMode_FixedNumber
}
 The enumeration of conversion mode. More...
 
enum  sinc_pulse_trigger_mux_t {
  kSINC_PulseTrigger_Disabled = 0U,
  kSINC_PulseTrigger_MuxHighLimitLevelSignal,
  kSINC_PulseTrigger_MuxLowLimitLevelSignal,
  kSINC_PulseTrigger_MuxHighLowLimitLevelSignal,
  kSINC_PulseTrigger_MuxWindowLimitLevelSignal,
  kSINC_PulseTrigger_MuxZeroCrossRisingLevelSignal,
  kSINC_PulseTrigger_MuxZeroCrossFallingLevelSignal,
  kSINC_PulseTrigger_MuxRsLimHighLevelSignal,
  kSINC_PulseTrigger_MuxRsLimLowLevelSignal,
  kSINC_PulseTrigger_MuxChannelRawInputModBitStream,
  kSINC_PulseTrigger_MuxChannelRawInputModClock,
  kSINC_PulseTrigger_MuxChannelRecoveredModBitStream,
  kSINC_PulseTrigger_MuxChannelRecoveredModClock,
  kSINC_PulseTrigger_MuxHighLimitPulseSignal,
  kSINC_PulseTrigger_MuxLowLimitPulseSignal,
  kSINC_PulseTrigger_MuxLimitPulseSignal,
  kSINC_PulseTrigger_MuxWindowLimitPulseSignal,
  kSINC_PulseTrigger_MuxHighLowLimitPulseSignal,
  kSINC_PulseTrigger_MuxZeroCrossRisePulseSignal,
  kSINC_PulseTrigger_MuxZeroCrossFallPulseSignal,
  kSINC_PulseTrigger_MuxZeroCrossRiseFallPulseSignal,
  kSINC_PulseTrigger_MuxFifoWatermarkOkPulseSignal,
  kSINC_PulseTrigger_MuxFifoOverflowPulseSignal,
  kSINC_PulseTrigger_MuxFifoUnderflowPulseSignal,
  kSINC_PulseTrigger_MuxFifoEmptyPulseSignal,
  kSINC_PulseTrigger_MuxClockMonitorAssertPulseSignal,
  kSINC_PulseTrigger_MuxShortCircuitAssertPulseSignal,
  kSINC_PulseTrigger_MuxSaturationPulseSignal,
  kSINC_PulseTrigger_MuxConversionCompletePulseSignal
}
 The enumeration of pulse trigger mux. More...
 
enum  sinc_zero_cross_operate_mode_t {
  kSINC_ZCD_BothRiseAndFall = 0U,
  kSINC_ZCD_OnlyFall,
  kSINC_ZCD_OnlyRise,
  kSINC_ZCD_Disabled = 0xFU
}
 The enumeration of zero cross detector operate mode. More...
 
enum  sinc_primary_filter_order_t {
  kSINC_PF_FastSinc = 0U,
  kSINC_PF_FirstOrder,
  kSINC_PF_SecondOrder,
  kSINC_PF_ThirdOrder
}
 The enumeration of primary filter order. More...
 
enum  sinc_clock_prescale_t {
  kSINC_ClkPrescale1 = 0UL,
  kSINC_ClkPrescale2,
  kSINC_ClkPrescale4,
  kSINC_ClkPrescale8
}
 The enumeration of clock prescale that specify the clock divider ratio for the modulator clock. More...
 
enum  sinc_primary_filter_shift_direction_t {
  kSINC_PF_ShiftRight = 0U,
  kSINC_PF_ShiftLeft = 1U << 4U
}
 The enumeration of primary filter shift direction. More...
 
enum  sinc_primary_filter_bias_sign_t {
  kSINC_PF_BiasPositive = 0UL,
  kSINC_PF_BiasNegative
}
 The enumeration of primary filer bias sign. More...
 
enum  sin_primary_filter_hpf_alpha_coeff_t {
  kSINC_PF_HPFAlphaCoeff0 = 0UL,
  kSINC_PF_HPFAlphaCoeff1,
  kSINC_PF_HPFAlphaCoeff2,
  kSINC_PF_HPFAlphaCoeff3,
  kSINC_PF_HPFAlphaCoeff4,
  kSINC_PF_HPFAlphaCoeff5,
  kSINC_PF_HPFAlphaCoeff6,
  kSINC_PF_HPFAlphaCoeff7,
  kSINC_PF_HPFAlphaCoeff8,
  kSINC_PF_HPFAlphaCoeff9,
  kSINC_PF_HPFAlphaCoeff10,
  kSINC_PF_HPFAlphaCoeff11,
  kSINC_PF_HPFAlphaCoeff12,
  kSINC_PF_HPFAlphaCoeff13,
  kSINC_PF_HPFAlphaCoeff14,
  kSINC_PF_HPFAlphaCoeff15
}
 The enumeration of HPF DC remover Alpha coefficient. More...
 
enum  sinc_inputBit_delay_t {
  kSINC_InputBit_DelayDisabled = 0U,
  kSINC_InputBit_Delay1ClkCycle,
  kSINC_InputBit_Delay2ClkCycle,
  kSINC_InputBit_Delay3ClkCycle,
  kSINC_InputBit_Delay4ClkCycle,
  kSINC_InputBit_Delay5ClkCycle,
  kSINC_InputBit_Delay6ClkCycle,
  kSINC_InputBit_Delay7ClkCycle,
  kSINC_InputBit_Delay8ClkCycle,
  kSINC_InputBit_Delay9ClkCycle,
  kSINC_InputBit_Delay10ClkCycle,
  kSINC_InputBit_Delay11ClkCycle,
  kSINC_InputBit_Delay12ClkCycle,
  kSINC_InputBit_Delay13ClkCycle,
  kSINC_InputBit_Delay14ClkCycle,
  kSINC_InputBit_Delay15ClkCycle
}
 The enumeration of input bit delay. More...
 
enum  sinc_scd_operate_mode_t {
  kSINC_Scd_OperateAtChannelEnabled = 0U,
  kSINC_Scd_OperateAtConversion,
  kSINC_Scd_OperateDisabled = 0xFU
}
 The enumeration of short-circuit detector operate mode. More...
 
enum  sinc_scd_option_t {
  kSINC_Scd_DetectRepeating0And1 = 0U,
  kSINC_Scd_DetectRepeatingOnly1,
  kSINC_Scd_DetectRepeatingOnly0
}
 The enumeration of short-circuit detector option. More...
 
enum  sinc_limit_detector_mode_t {
  kSINC_Lmt_BothHighAndLowLimit = 0x94U,
  kSINC_Lmt_OnlyHighLimit = 0x91U,
  kSINC_Lmt_OnlyLowLimit = 0x86U,
  kSINC_Lmt_WindowedValue = 0x8BU,
  kSINC_Lmt_Disabled = 0x0U
}
 The mode of limit detector. More...
 
enum  sinc_cad_threshold_t {
  kSINC_Cad_Disabled = 0U,
  kSINC_Cad_Count1ClkCycle,
  kSINC_Cad_Count2ClkCycle,
  kSINC_Cad_Count3ClkCycle,
  kSINC_Cad_Count4ClkCycle,
  kSINC_Cad_Count5ClkCycle,
  kSINC_Cad_Count6ClkCycle,
  kSINC_Cad_Count7ClkCycle,
  kSINC_Cad_Count8ClkCycle,
  kSINC_Cad_Count9ClkCycle,
  kSINC_Cad_Count10ClkCycle,
  kSINC_Cad_Count11ClkCycle,
  kSINC_Cad_Count12ClkCycle,
  kSINC_Cad_Count13ClkCycle,
  kSINC_Cad_Count14ClkCycle,
  kSINC_Cad_Count15ClkCycle
}
 The enumeration of clock-absence threshold. More...
 
enum  sinc_result_data_format_t {
  kSINC_LeftJustifiedSigned = 0U,
  kSINC_LeftJustifiedUnsigned
}
 The enumeration of result data format. More...
 
enum  sinc_debug_output_t {
  kSINC_Debug_PfFinalData = 0U,
  kSINC_Debug_OffsetData,
  kSINC_Debug_PfShiftedData,
  kSINC_Debug_HpfData,
  kSINC_Debug_CicRawData,
  kSINC_Debug_ScdHistoricalData,
  kSINC_Debug_ManchesterDecoderData,
  kSINC_Debug_CadData,
  kSINC_Debug_FifoEntriesNum,
  kSINC_Debug_ParallelSerialConverterStatus
}
 The enumeration of debug output. More...
 

Driver version

#define FSL_SINC_DRIVER_VERSION   (MAKE_VERSION(2, 1, 4))
 lower_component_name driver version 2.1.4. More...
 

SINC Generic Functional Control APIs

void SINC_Init (SINC_Type *base, const sinc_config_t *config)
 Initialize selected SINC instance, including clock options and channel options. More...
 
void SINC_Deinit (SINC_Type *base)
 De-initialize selected SINC instance. More...
 
void SINC_GetDefaultConfig (sinc_config_t *config)
 Get default configuration. More...
 

SINC Generic Low Level Control APIs

static void SINC_EnableMaster (SINC_Type *base, bool enable)
 Enable/disable all function blocks enabled in their respective registers. More...
 
static void SINC_DoSoftwareReset (SINC_Type *base)
 Reset all function blocks(except for the clock blocks), interrupt statuses. More...
 
static void SINC_DisableDozeMode (SINC_Type *base, bool disable)
 Disable/enable SINC module when the chip enters Doze or Stop mode. More...
 

Clock Control APIs

static bool SINC_CheckModulatorClockReady (SINC_Type *base, uint32_t modClkMasks)
 Check whether selected modulator clocks are ready. More...
 
static void SINC_DisableModulatorClockOutput (SINC_Type *base, uint32_t modClkMasks, bool disable)
 Disable/enable modulator clocks' output. More...
 
static void SINC_SetClkPrescale (SINC_Type *base, sinc_clock_prescale_t clkPrescale)
 Set the clock divider ratio for the modulator clock. More...
 
static void SINC_SetModulatorClockDivider (SINC_Type *base, uint32_t modClkDivider)
 Set modulator clock divider value. More...
 

Channel Functional Control APIs

void SINC_SetChannelConfig (SINC_Type *base, sinc_channel_id_t chId, sinc_channel_config_t *chConfig)
 Set channel configurations, including input options, conversion options and protection options. More...
 
void SINC_SetChannelInputOption (SINC_Type *base, sinc_channel_id_t chId, sinc_channel_input_option_t *chInputOption)
 Set channel input options, including input bit format, input bit source, input bit delay, input clock source, input clock edge. More...
 
void SINC_SetChannelConversionOption (SINC_Type *base, sinc_channel_id_t chId, sinc_channel_conv_option_t *chConvOption)
 Set channel conversion options, including conversion mode, trigger source, and primary filter settings. More...
 
void SINC_SetChannelProtectionOption (SINC_Type *base, sinc_channel_id_t chId, sinc_channel_protection_option_t *chProtection)
 Set channel protection options, including limit check, short-circuit detector, clock-absence detector, and zero-crossing detector. More...
 

Channel Result/FIFO Low Level Control APIs

static uint32_t SINC_ReadChannelResultData (SINC_Type *base, sinc_channel_id_t chId)
 Read selected channel's result data. More...
 
static void SINC_EnableChannelFIFO (SINC_Type *base, sinc_channel_id_t chId, bool enable)
 Enable/disable FIFO transfers for the primary filter. More...
 
static void SINC_SetChannelFifoWatermark (SINC_Type *base, sinc_channel_id_t chId, uint8_t fifoWaterMark)
 Set the FIFO watermark. More...
 
static void SINC_EnableChannel (SINC_Type *base, sinc_channel_id_t chId, bool enable)
 Enable/disable selected channel. More...
 
static void SINC_EnableChannelPrimaryDma (SINC_Type *base, sinc_channel_id_t chId, bool enable)
 Enable/disable selected channel's primary DMA transfers when the channel's FIFO exceeds its watermark. More...
 
static void SINC_SetChannelResultDataFormat (SINC_Type *base, sinc_channel_id_t chId, sinc_result_data_format_t dataFormat)
 Set selected channel's result data format. More...
 
static uint8_t SINC_GetChannelFifoCount (SINC_Type *base, sinc_channel_id_t chId)
 Get the number of remaining data entries in the FIFO. More...
 
static bool SINC_CheckChannelResultDataReady (SINC_Type *base, sinc_channel_id_t chId)
 Check whether the data in selected channel's result data register is stable when FIFO is disabled. More...
 
static bool SINC_CheckChannelFifoEmpty (SINC_Type *base, sinc_channel_id_t chId)
 Check whether selected channel's FIFO is empty. More...
 

Channel Conversion Low Level Control APIs

static void SINC_AffirmChannelSoftwareTrigger (SINC_Type *base, uint32_t chMask)
 Trigger selected channel's conversion. More...
 
static void SINC_NegateChannelSoftwareTrigger (SINC_Type *base, uint32_t chMask)
 Negate the trigger of selected channel. More...
 
static void SINC_SetChannelConversionMode (SINC_Type *base, sinc_channel_id_t chId, sinc_conv_mode_t mode)
 Set selected channel's conversion mode. More...
 
static void SINC_SetChannelTriggerSource (SINC_Type *base, sinc_channel_id_t chId, sinc_conv_trigger_source_t triggerSource)
 Set selected channel's trigger source. More...
 
static void SINC_SetChannelMultipurposeData (SINC_Type *base, sinc_channel_id_t chId, uint32_t data)
 Set multipurpose data to selected channel. More...
 
static void SINC_SetChannelPfOrder (SINC_Type *base, sinc_channel_id_t chId, sinc_primary_filter_order_t pfOrder)
 Set selected channel's PF order. More...
 
static void SINC_SetChannelPfOsr (SINC_Type *base, sinc_channel_id_t chId, uint16_t pfOsr)
 Set selected channel's PF over sample rate. More...
 
static void SINC_SetChannelPfHpfAlphaCoeff (SINC_Type *base, sinc_channel_id_t chId, sin_primary_filter_hpf_alpha_coeff_t pfHpfAlphaCoeff)
 set selected channel's HPF DC remover Alpha coefficient. More...
 
static void SINC_SetChannelPfShiftConfig (SINC_Type *base, sinc_channel_id_t chId, sinc_primary_filter_shift_direction_t pfShiftDirection, uint8_t pfShiftBitsNum)
 Set the value that shifts the PF data for the correct 24-bit precision. More...
 
static void SINC_SetChannelPfBiasConfig (SINC_Type *base, sinc_channel_id_t chId, sinc_primary_filter_bias_sign_t pfBiasSign, uint32_t pfBiasValue)
 Set the bias offset for the selected channel's PF. More...
 
static void SINC_EnableChannelPrimaryFilter (SINC_Type *base, sinc_channel_id_t chId, bool enable)
 Enable/disable selected channel's primary filter. More...
 
static bool SINC_CheckChannelParallelSerialDataReady (SINC_Type *base, sinc_channel_id_t chId)
 Check whether selected channel's multipurpose data is ready to write parallel or serial data. More...
 
static bool SINC_CheckChannelPrimaryCICSaturation (SINC_Type *base, sinc_channel_id_t chId)
 Check whether primary CIC filter saturation occurred. More...
 
static bool SINC_CheckChannelHPFSaturation (SINC_Type *base, sinc_channel_id_t chId)
 Check whether HPF saturation occurred. More...
 
static bool SINC_CheckChannelShiftSaturation (SINC_Type *base, sinc_channel_id_t chId)
 Check whether Shift saturation occurred. More...
 
static bool SINC_CheckChannelBiasSaturation (SINC_Type *base, sinc_channel_id_t chId)
 Check whether bias saturation occurred. More...
 
uint8_t SINC_GetChannelConversionCount (SINC_Type *base, sinc_channel_id_t chId)
 Get selected channel's number of conversions. More...
 
static bool SINC_CheckChannelConvProgress (SINC_Type *base, sinc_channel_id_t chId)
 Check whether the selected channel is in conversion. More...
 
static bool SINC_CheckChannelReadyForConv (SINC_Type *base, sinc_channel_id_t chId)
 Check whether the selected channel is ready for conversion. More...
 

Channel Protection Low Level Control APIs

static void SINC_SetChannelLowLimitThreshold (SINC_Type *base, sinc_channel_id_t chId, uint32_t lowLimitThreshold)
 Set selected channel's low-limit threshold value. More...
 
static void SINC_SetChannelHighLimitThreshold (SINC_Type *base, sinc_channel_id_t chId, uint32_t highLimitThreshold)
 Set selected channel's high-limit threshold value. More...
 
static void SINC_SetChannelLimitDetectorMode (SINC_Type *base, sinc_channel_id_t chId, sinc_limit_detector_mode_t mode)
 Set selected channel's limit detector mode. More...
 
static void SINC_EnableChannelHighLimitBreakSignal (SINC_Type *base, sinc_channel_id_t chId, bool enable)
 Enable/disable selected channel's high limit break signal. More...
 
static void SINC_EnableChannelWindowLimitBreakSignal (SINC_Type *base, sinc_channel_id_t chId, bool enable)
 Enable/disable selected channel's window limit break signal. More...
 
static void SINC_EnableChannelLowLimitBreakSignal (SINC_Type *base, sinc_channel_id_t chId, bool enable)
 Enable/disable selected channel's low limit break signal. More...
 
static void SINC_SetChannelScdOperateMode (SINC_Type *base, sinc_channel_id_t chId, sinc_scd_operate_mode_t opMode)
 Set selected channel's short-circuit detector operate mode. More...
 
static void SINC_SetChannelScdLimitThreshold (SINC_Type *base, sinc_channel_id_t chId, uint8_t u8ScdLimitThreshold)
 Set selected channel's Scd limit threshold. More...
 
static void SINC_SetChannelScdOption (SINC_Type *base, sinc_channel_id_t chId, sinc_scd_option_t option)
 Set selected channel's SDC option. More...
 
static void SINC_EnableChannelScdBreakSignal (SINC_Type *base, sinc_channel_id_t chId, bool enable)
 Enable/disable the automatic assertion of the BREAK_SCD signal when SINC detects an SCD event on the selected channel. More...
 
static void SINC_SetChannelCadLimitThreshold (SINC_Type *base, sinc_channel_id_t chId, sinc_cad_threshold_t cadLimitThreshold)
 Set the threshold value for the CAD counter. More...
 
static void SINC_EnableChannelCadBreakSignal (SINC_Type *base, sinc_channel_id_t chId, bool enable)
 Enable/disable the automatic assertion of the BREAK_CAD signal when SINC detects a CAD event on the assoicated channel. More...
 
static void SINC_SetChannelZcdOperateMode (SINC_Type *base, sinc_channel_id_t chId, sinc_zero_cross_operate_mode_t opMode)
 Set selected channel's zero-crossing detector operate mode. More...
 

Channel Debug Low Level Control APIs

static void SINC_SetChannelPulseTriggerMux (SINC_Type *base, sinc_channel_id_t chId, sinc_pulse_trigger_mux_t pulseTrigMux)
 Set selected channel's pulse trigger mux. More...
 
static void SINC_SetChannelDebugOutput (SINC_Type *base, sinc_channel_id_t chId, sinc_debug_output_t debugOutput)
 Set selected channel's debug output. More...
 
static void SINC_LatchChannelDebugProceduce (SINC_Type *base, sinc_channel_id_t chId)
 Start selected channel's debug data latch proceduce. More...
 
static bool SINC_CheckChannelDebugDataValid (SINC_Type *base, sinc_channel_id_t chId)
 Check if the selected channel's debug data is valid. More...
 
static uint32_t SINC_GetChannelDebugData (SINC_Type *base, sinc_channel_id_t chId)
 Return selected channel's the debug data that requested by SINC_SetChannelDebugOutput(). More...
 

Interrupt Control APIs

static void SINC_EnableInterrupts (SINC_Type *base, uint64_t interruptMasks)
 Enable the mask of interrupts, such as channel data ready interrupt, channel limit detect interrupt and so on. More...
 
static void SINC_DisableInterrupts (SINC_Type *base, uint64_t interruptMasks)
 Enable the mask of interrupts, such as channel data ready interrupt, channel limit detect interrupt and so on. More...
 
static uint64_t SINC_GetInterruptStatus (SINC_Type *base)
 Get interrupt status flags. More...
 
static void SINC_ClearInterruptStatus (SINC_Type *base, uint64_t statusMasks)
 Clear selected mask of interrupt status flags. More...
 

Data Structure Documentation

struct sinc_channel_input_option_t

Data Fields

sinc_inputBit_format_t inputBitFormat
 Specify input bit format, please refer to sinc_inputBit_format_t. More...
 
sinc_inputBit_source_t inputBitSource
 Specify input bit source, please refer to sinc_inputBit_source_t. More...
 
sinc_inputBit_delay_t inputBitDelay
 Specify input bit delay, please refer to sinc_inputBit_delay_t. More...
 
sinc_inputClk_source_t inputClkSource
 Specify input clock source, please refer to sinc_inputClk_source_t. More...
 
sinc_inputClk_edge_t inputClkEdge
 Specify input clock edge, please refer to sinc_inputClk_edge_t. More...
 

Field Documentation

sinc_inputBit_format_t sinc_channel_input_option_t::inputBitFormat
sinc_inputBit_source_t sinc_channel_input_option_t::inputBitSource
sinc_inputBit_delay_t sinc_channel_input_option_t::inputBitDelay
sinc_inputClk_source_t sinc_channel_input_option_t::inputClkSource
sinc_inputClk_edge_t sinc_channel_input_option_t::inputClkEdge
struct sinc_channel_conv_option_t

Data Fields

sinc_conv_mode_t convMode
 Specify conversion mode, please refer to sinc_conv_mode_t. More...
 
sinc_conv_trigger_source_t convTriggerSource
 Specify conversion trigger source, please refer to sinc_conv_trigger_source_t. More...
 
bool enableChPrimaryFilter
 Enable/disable channel's primary filter. More...
 
sinc_primary_filter_order_t pfOrder
 Specify the order of primary filter, please refer to sinc_primary_filter_order_t. More...
 
uint16_t u16pfOverSampleRatio
 Control primary filter's OSR, the minimum permissible value is 3, low value produce unpredictable result, the maximum permissible value depend on PF order and the desired data format, if PF order is third order and data format is signed, the maximum OSR value is 1289, if PF order is third order and data format is unsigned, the maximum OSR value is 1624, otherwise the maximum OSR value is 2047. More...
 
sin_primary_filter_hpf_alpha_coeff_t pfHpfAlphaCoeff
 Specify HPF's alpha coeff, please refer to sin_primary_filter_hpf_alpha_coeff_t. More...
 
sinc_primary_filter_shift_direction_t pfShiftDirection
 Select shift direction, right or left. More...
 
uint8_t u8pfShiftBitsNum
 Specify the number of bits to shift the data, ranges from 0 to 15. More...
 
sinc_primary_filter_bias_sign_t pfBiasSign
 Select bias sign, please refer to sinc_primary_filter_bias_sign_t. More...
 
uint32_t u32pfBiasValue
 Range from 0 to 0x7FFFFFUL. More...
 

Field Documentation

sinc_conv_mode_t sinc_channel_conv_option_t::convMode
sinc_conv_trigger_source_t sinc_channel_conv_option_t::convTriggerSource
bool sinc_channel_conv_option_t::enableChPrimaryFilter
sinc_primary_filter_order_t sinc_channel_conv_option_t::pfOrder
uint16_t sinc_channel_conv_option_t::u16pfOverSampleRatio

Please note that the OSR for equation is u16pfOverSampleRatio + 1

sin_primary_filter_hpf_alpha_coeff_t sinc_channel_conv_option_t::pfHpfAlphaCoeff
sinc_primary_filter_shift_direction_t sinc_channel_conv_option_t::pfShiftDirection
uint8_t sinc_channel_conv_option_t::u8pfShiftBitsNum
sinc_primary_filter_bias_sign_t sinc_channel_conv_option_t::pfBiasSign
uint32_t sinc_channel_conv_option_t::u32pfBiasValue
struct sinc_channel_protection_option_t

Data Fields

sinc_limit_detector_mode_t limitDetectorMode
 Specify limit detector mode, please refer to sinc_limit_detector_mode_t. More...
 
bool bEnableLmtBreakSignal
 Enable/disable limit break signal, the details of break signal is depended on detector mode. More...
 
uint32_t u32LowLimitThreshold
 Specify the low-limit threshold value, range from 0 to 0xFFFFFFUL. More...
 
uint32_t u32HighLimitThreshold
 Specify the high-limit threshold value, range from 0 to 0xFFFFFFUL. More...
 
sinc_scd_operate_mode_t scdOperateMode
 Enable/disable scd, and set SCD operate timming. More...
 
uint8_t u8ScdLimitThreshold
 Range from 2 to 255, 0 and 1 are prohibited. More...
 
sinc_scd_option_t scdOption
 Specify SCD options, please refer to sinc_scd_option_t. More...
 
bool bEnableScdBreakSignal
 Enable/disable SCD break signal. More...
 
sinc_cad_threshold_t cadLimitThreshold
 Specify the threshold value for the CAD counter. More...
 
bool bEnableCadBreakSignal
 Enable/disable CAD break signal. More...
 
sinc_zero_cross_operate_mode_t zcdOperateMode
 Specify zero cross detector operate mode. More...
 

Field Documentation

sinc_limit_detector_mode_t sinc_channel_protection_option_t::limitDetectorMode
bool sinc_channel_protection_option_t::bEnableLmtBreakSignal
uint32_t sinc_channel_protection_option_t::u32LowLimitThreshold
uint32_t sinc_channel_protection_option_t::u32HighLimitThreshold
sinc_scd_operate_mode_t sinc_channel_protection_option_t::scdOperateMode
uint8_t sinc_channel_protection_option_t::u8ScdLimitThreshold
sinc_scd_option_t sinc_channel_protection_option_t::scdOption
bool sinc_channel_protection_option_t::bEnableScdBreakSignal
sinc_cad_threshold_t sinc_channel_protection_option_t::cadLimitThreshold
bool sinc_channel_protection_option_t::bEnableCadBreakSignal
sinc_zero_cross_operate_mode_t sinc_channel_protection_option_t::zcdOperateMode
struct sinc_channel_config_t

Data Fields

bool bEnableChannel
 Enable/disable channel. More...
 
bool bEnableFifo
 Enable/disable channel's FIFO. More...
 
uint8_t u8FifoWaterMark
 Specify the fifo watermark, range from 0 to 15. More...
 
bool bEnablePrimaryDma
 Used to enable/disable primary DMA. More...
 
sinc_result_data_format_t dataFormat
 Set channel's result data format, please refer to sinc_result_data_format_t. More...
 
sinc_channel_input_option_tchInputOption
 The pointer to sinc_channel_input_option_t that contains channel input options. More...
 
sinc_channel_conv_option_tchConvOption
 The pointer to sinc_channel_conv_option_t that contains channel conversion options. More...
 
sinc_channel_protection_option_tchProtectionOption
 
        The pointer to @ref sinc_channel_protection_option_t

that contains channel protection options. More...

 

Field Documentation

bool sinc_channel_config_t::bEnableChannel
bool sinc_channel_config_t::bEnableFifo
uint8_t sinc_channel_config_t::u8FifoWaterMark
bool sinc_channel_config_t::bEnablePrimaryDma
sinc_result_data_format_t sinc_channel_config_t::dataFormat
sinc_channel_input_option_t* sinc_channel_config_t::chInputOption
sinc_channel_conv_option_t* sinc_channel_config_t::chConvOption
sinc_channel_protection_option_t* sinc_channel_config_t::chProtectionOption
struct sinc_config_t

Data Fields

sinc_clock_prescale_t clockPreDivider
 Specify modulator clock pre divider, please refer to sinc_clock_prescale_t. More...
 
uint32_t modClkDivider
 Range from 2 to 256, 0 and 1 are prohibited, to obtain a 50% duty cycle in the MCLK output, write an even value to.
 
bool disableModClk0Output
 Disable/enable modulator clock0 output. More...
 
bool disableModClk1Output
 Disable/enable modulator clock1 output. More...
 
bool disableModClk2Output
 Disable/enable modulator clock2 output. More...
 
sinc_channel_config_tchannelsConfigArray [SINC_CHANNEL_COUNT]
 The array that contains 4 elements, and the type of each element is sinc_channel_config_t *, channelsConfigArray[0] corresponding to channel0, channelsConfigArray[1] corresponding to channel1, channelsConfigArray[2] corresponding to channel2, channelsConfigArray[3] corresponding to channel3, if some channels are not used, the corresponding elements should be set as NULL. More...
 
bool disableDozeMode
 Disable/enable SINC module when the chip enters Doze or stop mode. More...
 
bool enableMaster
 Enable/disable all function blocks of SINC module. More...
 

Field Documentation

sinc_clock_prescale_t sinc_config_t::clockPreDivider
bool sinc_config_t::disableModClk0Output
bool sinc_config_t::disableModClk1Output
bool sinc_config_t::disableModClk2Output
sinc_channel_config_t* sinc_config_t::channelsConfigArray[SINC_CHANNEL_COUNT]
bool sinc_config_t::disableDozeMode
bool sinc_config_t::enableMaster

Macro Definition Documentation

#define FSL_SINC_DRIVER_VERSION   (MAKE_VERSION(2, 1, 4))

Enumeration Type Documentation

Enumerator
kSINC_Channel0 

Channel 0.

kSINC_Channel1 

Channel 1.

kSINC_Channel2 

Channel 2.

kSINC_Channel3 

Channel 3.

Enumerator
kSINC_ModClk0 

Modulator Clock 0 output.

kSINC_ModClk1 

Modulator Clock 1 output.

kSINC_ModClk2 

Modulator Clock 2 output.

Enumerator
kSINC_InputClk_SourceMclkOut0 

MCLK_OUT0 with internal routeback.

kSINC_InputClk_SourceMclkOut1 

MCLK_OUT1 with internal routeback.

kSINC_InputClk_SourceMclkOut2 

MCLK_OUT2 with internal routeback.

kSINC_InputClk_SourceExternalModulatorClk 

External modulator clock dedicated to the selected channel.

kSINC_InputClk_SourceAdjacentChannelClk 

Grouped clock shared with an adjacent channel.

Enumerator
kSINC_InputClk_EdgePositive 

Positive edge.

kSINC_InputClk_EdgeNegative 

Negative edge.

kSINC_InputClk_EdgeBoth 

Both edges.

kSINC_InputClk_EdgeOddPositive 

Every other odd positive edge.

kSINC_InputClk_EdgeEvenPositive 

Every other even positive edge.

kSINC_InputClk_EdgeOddNegative 

Every other odd negative edge.

kSINC_InputClk_EdgeEvenNegative 

Every other even negative edge.

Enumerator
kSINC_InputBit_FormatExternalBitstream 

External bitstream from the MBIT[n] signal.

kSINC_InputBit_FormatExternalManchesterCode 

External Manchester code.

kSINC_InputBit_FormatInternal16bitParallelData 

Internal 16-bit parallel data from MPDATA register.

kSINC_InputBit_FormatInternal32bitSerialData 

Internal 32-bit serial data from MPDATA.

Enumerator
kSINC_InputBit_SourceExternalBitstream 

External bitstream from the MBIT[n] signal.

kSINC_InputBit_SourceInternalBitstream 

Alternate internal bitstream from the INP[n] signal.

kSINC_InputBit_SourceAdjacentChannel 

Grouped bitstream shared with an adjacent chanel.

Enumerator
kSINC_ConvTrig_SoftPosEdge 

Positive edge software trigger.

kSINC_ConvTrig_SoftHighLevel 

High level software trigger.

kSINC_ConvTrig_HardPosEdge 

Positive edge hardware trigger.

kSINC_ConvTrig_HardHighLevel 

High level hardware trigger.

kSINC_ConvTrig_AdjacentChannel 

Grouped hardware trigger shared with an adjacent channel.

Enumerator
kSINC_ConvMode_Single 

One conversion that follows an edge or level trigger event.

kSINC_ConvMode_Continuous 

Multiple conversions that follow a triggering event, a new triggering event cancels and restarts conversion.

kSINC_ConvMode_Always 

Multiple conversions that follow the first triggering event, SINC ignores the next triggering event.

kSINC_ConvMode_FixedNumber 

Fixed number conversions that follow the first triggering event, a new triggering event cancels and restarts conversion.

Enumerator
kSINC_PulseTrigger_Disabled 

Disable pulse trigger output.

kSINC_PulseTrigger_MuxHighLimitLevelSignal 

Select high limit level signal for pulse trigger output.

kSINC_PulseTrigger_MuxLowLimitLevelSignal 

Select low limit level signal for pulse trigger output.

kSINC_PulseTrigger_MuxHighLowLimitLevelSignal 

Select low or high limit level signal for pulse trigger output.

kSINC_PulseTrigger_MuxWindowLimitLevelSignal 

Select window limit level signal for pulse trigger output.

kSINC_PulseTrigger_MuxZeroCrossRisingLevelSignal 

Select zero cross rising level signal for pulse trigger output.

kSINC_PulseTrigger_MuxZeroCrossFallingLevelSignal 

Select zero cross falling level signal for pulse trigger output.

kSINC_PulseTrigger_MuxRsLimHighLevelSignal 

Select level signal that indicates a high level from an RS flip-flop or a schmitt trigger for pulse trigger output.

kSINC_PulseTrigger_MuxRsLimLowLevelSignal 

Select level signal that indicates a low level from an RS flip-flop or a schmitt trigger for pulse trigger output.

kSINC_PulseTrigger_MuxChannelRawInputModBitStream 

Select channel raw input modulator bitstream for pulse trigger output.

kSINC_PulseTrigger_MuxChannelRawInputModClock 

Select channel raw input modulator clock for pulse trigger output.

kSINC_PulseTrigger_MuxChannelRecoveredModBitStream 

Select channel output recovered modulator bitstream for pulse trigger output.

kSINC_PulseTrigger_MuxChannelRecoveredModClock 

Select channel output recovered modulator clock for pulse trigger output.

kSINC_PulseTrigger_MuxHighLimitPulseSignal 

Select high limit pulse signal for pulse trigger output.

kSINC_PulseTrigger_MuxLowLimitPulseSignal 

Select low limit pulse signal for pulse trigger output.

kSINC_PulseTrigger_MuxLimitPulseSignal 

Select the pulse signal that indicates a high/low/window limit for pulse trigger output.

kSINC_PulseTrigger_MuxWindowLimitPulseSignal 

Select window limit pulse signal for pulse trigger output.

kSINC_PulseTrigger_MuxHighLowLimitPulseSignal 

Select the pulse signal that indicates a high or low limit for pulse trigger output.

kSINC_PulseTrigger_MuxZeroCrossRisePulseSignal 

Select zero cross rise pulse signal for trigger output.

kSINC_PulseTrigger_MuxZeroCrossFallPulseSignal 

Select zero cross fall pulse signal for trigger output.

kSINC_PulseTrigger_MuxZeroCrossRiseFallPulseSignal 

Select zero cross rise/fall pulse signal for trigger output.

kSINC_PulseTrigger_MuxFifoWatermarkOkPulseSignal 

Select FIFO watermark OK pulse signal for trigger output.

kSINC_PulseTrigger_MuxFifoOverflowPulseSignal 

Select FIFO overflow pulse signal.

kSINC_PulseTrigger_MuxFifoUnderflowPulseSignal 

Select FIFO underflow pulse signal.

kSINC_PulseTrigger_MuxFifoEmptyPulseSignal 

Select FIFO empty pulse signal.

kSINC_PulseTrigger_MuxClockMonitorAssertPulseSignal 

Select clock monitor assert pulse signal.

kSINC_PulseTrigger_MuxShortCircuitAssertPulseSignal 

Select short circuit assert pulse signal.

kSINC_PulseTrigger_MuxSaturationPulseSignal 

Select saturation pulse signal.

kSINC_PulseTrigger_MuxConversionCompletePulseSignal 

Select conversion complete pulse signal.

Enumerator
kSINC_ZCD_BothRiseAndFall 

Zero cross detector operate on both rise and fall.

kSINC_ZCD_OnlyFall 

Zero cross detector operate on fall edge.

kSINC_ZCD_OnlyRise 

Zero cross detector operate on rise edge.

kSINC_ZCD_Disabled 

Zero cross detector disabled.

Enumerator
kSINC_PF_FastSinc 

Fast sinc filter, ORD is 4.

kSINC_PF_FirstOrder 

First order filter, ORD is 1.

kSINC_PF_SecondOrder 

Second order filter, ORD is 2.

kSINC_PF_ThirdOrder 

Third order filter, ORD is 3.

Enumerator
kSINC_ClkPrescale1 

No prescale.

kSINC_ClkPrescale2 

Modulator clock divider ratio is 2.

kSINC_ClkPrescale4 

Modulator clock divider ratio is 4.

kSINC_ClkPrescale8 

Modulator clock divider ratio is 8.

Enumerator
kSINC_PF_ShiftRight 

Right shift the raw data.

kSINC_PF_ShiftLeft 

Left shift the raw data.

Enumerator
kSINC_PF_BiasPositive 

The bias sign is positive.

kSINC_PF_BiasNegative 

The bias sign is negative.

Enumerator
kSINC_PF_HPFAlphaCoeff0 

Disabled HPF.

kSINC_PF_HPFAlphaCoeff1 

Alpha coefficient = 1 - (2^-5)

kSINC_PF_HPFAlphaCoeff2 

Alpha coefficient = 1 - (2^-6)

kSINC_PF_HPFAlphaCoeff3 

Alpha coefficient = 1 - (2^-7)

kSINC_PF_HPFAlphaCoeff4 

Alpha coefficient = 1 - (2^-8)

kSINC_PF_HPFAlphaCoeff5 

Alpha coefficient = 1 - (2^-9)

kSINC_PF_HPFAlphaCoeff6 

Alpha coefficient = 1 - (2^-10)

kSINC_PF_HPFAlphaCoeff7 

Alpha coefficient = 1 - (2^-11)

kSINC_PF_HPFAlphaCoeff8 

Alpha coefficient = 1 - (2^-12)

kSINC_PF_HPFAlphaCoeff9 

Alpha coefficient = 1 - (2^-13)

kSINC_PF_HPFAlphaCoeff10 

Alpha coefficient = 1 - (2^-14)

kSINC_PF_HPFAlphaCoeff11 

Alpha coefficient = 1 - (2^-15)

kSINC_PF_HPFAlphaCoeff12 

Alpha coefficient = 1 - (2^-16)

kSINC_PF_HPFAlphaCoeff13 

Alpha coefficient = 1 - (2^-17)

kSINC_PF_HPFAlphaCoeff14 

Alpha coefficient = 1 - (2^-18)

kSINC_PF_HPFAlphaCoeff15 

Alpha coefficient = 1 - (2^-19)

Enumerator
kSINC_InputBit_DelayDisabled 

Input modulator bitstream delay disabled.

kSINC_InputBit_Delay1ClkCycle 

Input modulator bitstream delay 1 PRE_CLK cycle.

kSINC_InputBit_Delay2ClkCycle 

Input modulator bitstream delay 2 PRE_CLK cycle.

kSINC_InputBit_Delay3ClkCycle 

Input modulator bitstream delay 3 PRE_CLK cycle.

kSINC_InputBit_Delay4ClkCycle 

Input modulator bitstream delay 4 PRE_CLK cycle.

kSINC_InputBit_Delay5ClkCycle 

Input modulator bitstream delay 5 PRE_CLK cycle.

kSINC_InputBit_Delay6ClkCycle 

Input modulator bitstream delay 6 PRE_CLK cycle.

kSINC_InputBit_Delay7ClkCycle 

Input modulator bitstream delay 7 PRE_CLK cycle.

kSINC_InputBit_Delay8ClkCycle 

Input modulator bitstream delay 8 PRE_CLK cycle.

kSINC_InputBit_Delay9ClkCycle 

Input modulator bitstream delay 9 PRE_CLK cycle.

kSINC_InputBit_Delay10ClkCycle 

Input modulator bitstream delay 10 PRE_CLK cycle.

kSINC_InputBit_Delay11ClkCycle 

Input modulator bitstream delay 11 PRE_CLK cycle.

kSINC_InputBit_Delay12ClkCycle 

Input modulator bitstream delay 12 PRE_CLK cycle.

kSINC_InputBit_Delay13ClkCycle 

Input modulator bitstream delay 13 PRE_CLK cycle.

kSINC_InputBit_Delay14ClkCycle 

Input modulator bitstream delay 14 PRE_CLK cycle.

kSINC_InputBit_Delay15ClkCycle 

Input modulator bitstream delay 15 PRE_CLK cycle.

Enumerator
kSINC_Scd_OperateAtChannelEnabled 

SCD operates when the channel is enabled.

kSINC_Scd_OperateAtConversion 

SCD operates when the PF is performing a conversion.

kSINC_Scd_OperateDisabled 

Short circuit detect is disabled.

Enumerator
kSINC_Scd_DetectRepeating0And1 

Both repeating 0 and 1 increment the SCD counter.

kSINC_Scd_DetectRepeatingOnly1 

Only repeating 1 increment the SCD counter.

kSINC_Scd_DetectRepeatingOnly0 

Only repeating 1 increment the SCD counter.

Note
The value of each limit detector contains lot of information: bit[1:0]: limit detection options, bit[2]: low limit break signal. bit[3]: window limit break signal. bit[4]: High limit break signal. bit[7]: Enable/disable limit detector.
Enumerator
kSINC_Lmt_BothHighAndLowLimit 

Limit detector is enabled, and compare the filter sample value to high and low limit, if the value larger than high limit will trigger interrupt or break, and if the value lower than low limit will trigger interrupt or break.

kSINC_Lmt_OnlyHighLimit 

Limit detector is enabled, and compare the filter sample value to high limit, if the value larger than high limit will trigger interrupt or break.

kSINC_Lmt_OnlyLowLimit 

Limit detector is enabled, and compare the filter sample value to low limit, if the value lower than low limit will trigger interrupt or break.

kSINC_Lmt_WindowedValue 

Limit detector is enabled, and compare the filter sample value to high and low limit, if the value higher than low limit and lower than high limit will trigger interrupt or break.

kSINC_Lmt_Disabled 

Limit detector is disabled.

Enumerator
kSINC_Cad_Disabled 

Clock absence detector is disabled.

kSINC_Cad_Count1ClkCycle 

Clock absence detector threshold is 1 clock cycle.

kSINC_Cad_Count2ClkCycle 

Clock absence detector threshold is 2 clock cycle.

kSINC_Cad_Count3ClkCycle 

Clock absence detector threshold is 3 clock cycle.

kSINC_Cad_Count4ClkCycle 

Clock absence detector threshold is 4 clock cycle.

kSINC_Cad_Count5ClkCycle 

Clock absence detector threshold is 5 clock cycle.

kSINC_Cad_Count6ClkCycle 

Clock absence detector threshold is 6 clock cycle.

kSINC_Cad_Count7ClkCycle 

Clock absence detector threshold is 7 clock cycle.

kSINC_Cad_Count8ClkCycle 

Clock absence detector threshold is 8 clock cycle.

kSINC_Cad_Count9ClkCycle 

Clock absence detector threshold is 9 clock cycle.

kSINC_Cad_Count10ClkCycle 

Clock absence detector threshold is 10 clock cycle.

kSINC_Cad_Count11ClkCycle 

Clock absence detector threshold is 11 clock cycle.

kSINC_Cad_Count12ClkCycle 

Clock absence detector threshold is 12 clock cycle.

kSINC_Cad_Count13ClkCycle 

Clock absence detector threshold is 13 clock cycle.

kSINC_Cad_Count14ClkCycle 

Clock absence detector threshold is 14 clock cycle.

kSINC_Cad_Count15ClkCycle 

Clock absence detector threshold is 15 clock cycle.

Enumerator
kSINC_LeftJustifiedSigned 

Left justified, signed.

kSINC_LeftJustifiedUnsigned 

Left justified, unsigned.

Enumerator
kSINC_Debug_PfFinalData 

Final data from PF(24 bits).

kSINC_Debug_OffsetData 

Offset data(24 bits).

kSINC_Debug_PfShiftedData 

Shifted data from the PF(24 bits).

kSINC_Debug_HpfData 

DC remover(HPF) data(32 bits).

kSINC_Debug_CicRawData 

Raw data from the PF's CIC filter.

kSINC_Debug_ScdHistoricalData 

Historical data from SCD.

kSINC_Debug_ManchesterDecoderData 

Data from the Manchester decoder.

kSINC_Debug_CadData 

Data from CAD.

kSINC_Debug_FifoEntriesNum 

Number of available entries in the FIFO.

kSINC_Debug_ParallelSerialConverterStatus 

Status of the parallel or serial data converter.

Function Documentation

void SINC_Init ( SINC_Type *  base,
const sinc_config_t config 
)
Parameters
baseSINC peripheral base address.
configThe pointer to sinc_config_t structure.
void SINC_Deinit ( SINC_Type *  base)
Parameters
baseSINC peripheral base address.
void SINC_GetDefaultConfig ( sinc_config_t config)
* config->clockPreDivider = kSINC_ClkPrescale1;
* config->modClkDivider = 2UL;
* config->disableModClk0Output = false;
* config->disableModClk1Output = false;
* config->disableModClk2Output = false;
*
* config->channelsConfigArray[4] = {NULL, NULL, NULL, NULL};
*
* config->disableDozeMode = false;
* config->enableMaster = false;
*
Parameters
configThe pointer to sinc_config_t structure, must not be NULL.
static void SINC_EnableMaster ( SINC_Type *  base,
bool  enable 
)
inlinestatic
Parameters
baseSINC peripheral base address.
enableUsed to enable/disable all function blocks:
  • true Enable all function blocks, please note that clock must be configured previously;
  • false Disable all function blocks.
static void SINC_DoSoftwareReset ( SINC_Type *  base)
inlinestatic
Parameters
baseSINC peripheral base address.
static void SINC_DisableDozeMode ( SINC_Type *  base,
bool  disable 
)
inlinestatic
Parameters
baseSINC peripheral base address.
disableUsed to control if module functional when the chip enters Doze and Stop mode:
  • true Disable SINC when the chip enters Doze or Stop mode;
  • false Enable SINC when the chip enters Doze or stop mode.
static bool SINC_CheckModulatorClockReady ( SINC_Type *  base,
uint32_t  modClkMasks 
)
inlinestatic
Note
The result of this APIs means all selected modulator clocks are (not) ready.
Parameters
baseSINC peripheral base address.
modClkMasksThe mask of modulator clocks, please refer to _sinc_modulator_clock.
Return values
trueThe input mask of modulator clocks are ready.
falseThe input mask of modulator clocks are not ready.
static void SINC_DisableModulatorClockOutput ( SINC_Type *  base,
uint32_t  modClkMasks,
bool  disable 
)
inlinestatic
Note
By default, modulator clock's output is enabled.
Parameters
baseSINC peripheral base address.
modClkMasksThe mask of modulator clocks, please refer to _sinc_modulator_clock.
disableUsed to enable/disable clock output:
  • true Disable modulator clocks' output;
  • false Enable modulator clocks' output.
static void SINC_SetClkPrescale ( SINC_Type *  base,
sinc_clock_prescale_t  clkPrescale 
)
inlinestatic
Parameters
baseSINC peripheral base address.
clkPrescaleClock prescale value, please refer to sinc_clock_prescale_t.
static void SINC_SetModulatorClockDivider ( SINC_Type *  base,
uint32_t  modClkDivider 
)
inlinestatic
Note
IMCLK0 = PRE_CLK / modClkDivider, the minimum clock divider ration is 2.
Parameters
baseSINC peripheral base address.
modClkDividerRange from 2 to 256, 0 and 1 are prohibited, to obtain a 50% duty cycle in the MCLK output, write an even value to modClkDivider .
void SINC_SetChannelConfig ( SINC_Type *  base,
sinc_channel_id_t  chId,
sinc_channel_config_t chConfig 
)
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
chConfigPointer to sinc_channel_config_t structure, must not be NULL.
void SINC_SetChannelInputOption ( SINC_Type *  base,
sinc_channel_id_t  chId,
sinc_channel_input_option_t chInputOption 
)
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
chInputOptionPointer to sinc_channel_input_option_t structure, must not be NULL.
void SINC_SetChannelConversionOption ( SINC_Type *  base,
sinc_channel_id_t  chId,
sinc_channel_conv_option_t chConvOption 
)
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
chConvOptionPointer to sinc_channel_conv_option_t structure, must not be NULL.
void SINC_SetChannelProtectionOption ( SINC_Type *  base,
sinc_channel_id_t  chId,
sinc_channel_protection_option_t chProtection 
)
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
chProtectionPointer to sinc_channel_protection_option_t, must not be NULL.
static uint32_t SINC_ReadChannelResultData ( SINC_Type *  base,
sinc_channel_id_t  chId 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
Returns
Result data of the selected channel, 24 bits width.
static void SINC_EnableChannelFIFO ( SINC_Type *  base,
sinc_channel_id_t  chId,
bool  enable 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
enableUsed to enable/disable channl FIFO:
  • true Enable channel FIFO.
  • false Disable channle FIFO.
static void SINC_SetChannelFifoWatermark ( SINC_Type *  base,
sinc_channel_id_t  chId,
uint8_t  fifoWaterMark 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
fifoWaterMarkSpecify the fifo watermark, range from 0 to 15.
static void SINC_EnableChannel ( SINC_Type *  base,
sinc_channel_id_t  chId,
bool  enable 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
enableUsed to enable/disable selected channel:
  • true Enable selected channel;
  • false Disable selected channel.
static void SINC_EnableChannelPrimaryDma ( SINC_Type *  base,
sinc_channel_id_t  chId,
bool  enable 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
enableUsed to enable/disable primary DMA :
  • true Enable primary DMA;
  • false Disable primary DMA.
static void SINC_SetChannelResultDataFormat ( SINC_Type *  base,
sinc_channel_id_t  chId,
sinc_result_data_format_t  dataFormat 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
dataFormatSpecify the result data format, please refer to sinc_result_data_format_t.
static uint8_t SINC_GetChannelFifoCount ( SINC_Type *  base,
sinc_channel_id_t  chId 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
Returns
The number of remaining data entries in the FIFO.
static bool SINC_CheckChannelResultDataReady ( SINC_Type *  base,
sinc_channel_id_t  chId 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, refer to sinc_channel_id_t for details.
Return values
trueData in selected channel's result data regiter is stable.
falseData in selected channel's result data register is not stable.
static bool SINC_CheckChannelFifoEmpty ( SINC_Type *  base,
sinc_channel_id_t  chId 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdThe id of sinc channel to check.
Return values
trueSelected channel's FIFO is empty.
falseSelected channel's FIFO is not empty.
static void SINC_AffirmChannelSoftwareTrigger ( SINC_Type *  base,
uint32_t  chMask 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chMaskThe mask of channels to trigger.
static void SINC_NegateChannelSoftwareTrigger ( SINC_Type *  base,
uint32_t  chMask 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chMaskThe mask of channels.
static void SINC_SetChannelConversionMode ( SINC_Type *  base,
sinc_channel_id_t  chId,
sinc_conv_mode_t  mode 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
modeThe conversion mode to set, please refer to sinc_conv_mode_t.
static void SINC_SetChannelTriggerSource ( SINC_Type *  base,
sinc_channel_id_t  chId,
sinc_conv_trigger_source_t  triggerSource 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
triggerSourceTrigger source to set, please refer to sinc_conv_trigger_source_t.
static void SINC_SetChannelMultipurposeData ( SINC_Type *  base,
sinc_channel_id_t  chId,
uint32_t  data 
)
inlinestatic
Note
If input bit format is set as ManchesterCode, multipurpose data indicates the Manchester decoder threshold value and is 11 bits width; if input bit format is set as parallel, multipurpose data indicates the parallel 16-bit data and is 16 bits width; if input bit format is set as serial, multipurpose data indicates the serial data and is 32 bits width.
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
dataMultipurpose data to set.
static void SINC_SetChannelPfOrder ( SINC_Type *  base,
sinc_channel_id_t  chId,
sinc_primary_filter_order_t  pfOrder 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
pfOrderPrimary filter order to set, please refer to sinc_primary_filter_order_t
static void SINC_SetChannelPfOsr ( SINC_Type *  base,
sinc_channel_id_t  chId,
uint16_t  pfOsr 
)
inlinestatic
Note
If PF order is third order and data format is signed, the maximum OSR value is 1289, if PF order is third order and data format is unsigned, the maximum OSR value is 1624, otherwise the maximum OSR value is 2047.
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
pfOsrControl the channel's PF OSR, the minimum permissible value is 3, low value produce unpredictable result, the maximum permissible value depend on PF order and the desired data format.
static void SINC_SetChannelPfHpfAlphaCoeff ( SINC_Type *  base,
sinc_channel_id_t  chId,
sin_primary_filter_hpf_alpha_coeff_t  pfHpfAlphaCoeff 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
pfHpfAlphaCoeffSpecify the HPF alpha coefficient or disable HPF as described in sin_primary_filter_hpf_alpha_coeff_t.
static void SINC_SetChannelPfShiftConfig ( SINC_Type *  base,
sinc_channel_id_t  chId,
sinc_primary_filter_shift_direction_t  pfShiftDirection,
uint8_t  pfShiftBitsNum 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
pfShiftDirectionSpecify the PF shift direction, including right and left.
pfShiftBitsNumSpecify the PF shift value, range from 0 to 15.
static void SINC_SetChannelPfBiasConfig ( SINC_Type *  base,
sinc_channel_id_t  chId,
sinc_primary_filter_bias_sign_t  pfBiasSign,
uint32_t  pfBiasValue 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
pfBiasSignSpecify the bias sign, please refer to sinc_primary_filter_bias_sign_t for details.
pfBiasValueThe bias value to subtracted from the output of PF shift block, range from 0 to 0x7FFFFFUL.
static void SINC_EnableChannelPrimaryFilter ( SINC_Type *  base,
sinc_channel_id_t  chId,
bool  enable 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
enableUsed to enable primary filter:
  • true Enable channel's PF;
  • false Disable channel's PF.
static bool SINC_CheckChannelParallelSerialDataReady ( SINC_Type *  base,
sinc_channel_id_t  chId 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, refer to sinc_channel_id_t for details.
Return values
trueSelected channel's multipurpose data is ready to write parallel or serial data.
falseSelected channel's multipurpose data is not ready to write parallel or serial data.
static bool SINC_CheckChannelPrimaryCICSaturation ( SINC_Type *  base,
sinc_channel_id_t  chId 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, refer to sinc_channel_id_t for details.
Return values
trueSelected channel's primary CIC filter saturation occurred.
falseSelected channel's primary CIC filter saturation did not occurred.
static bool SINC_CheckChannelHPFSaturation ( SINC_Type *  base,
sinc_channel_id_t  chId 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, refer to sinc_channel_id_t for details.
Return values
trueSelected channel's HPF saturation occurred.
falseSelected channel's HPF saturation did not occurred.
static bool SINC_CheckChannelShiftSaturation ( SINC_Type *  base,
sinc_channel_id_t  chId 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, refer to sinc_channel_id_t for details.
Return values
trueSelected channel's shift saturation occurred.
falseSelected channel's shift saturation did not occurred.
static bool SINC_CheckChannelBiasSaturation ( SINC_Type *  base,
sinc_channel_id_t  chId 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, refer to sinc_channel_id_t for details.
Return values
trueSelected channel's bias saturation occurred.
falseSelected channel's bias saturation did not occurred.
uint8_t SINC_GetChannelConversionCount ( SINC_Type *  base,
sinc_channel_id_t  chId 
)
Parameters
baseSINC peripheral base address.
chIdSelected channel id, refer to sinc_channel_id_t for details.
Returns
uint8_t Selected channel's number of conversions.
static bool SINC_CheckChannelConvProgress ( SINC_Type *  base,
sinc_channel_id_t  chId 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdThe id of sinc channel to check.
Return values
falseSelected channel conversion not in progress.
trueSelected channel conversion in progress.
static bool SINC_CheckChannelReadyForConv ( SINC_Type *  base,
sinc_channel_id_t  chId 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdThe id of sinc channel to check.
Return values
trueSelected channel is ready for conversion.
falseSelected channel is not ready for conversion.
static void SINC_SetChannelLowLimitThreshold ( SINC_Type *  base,
sinc_channel_id_t  chId,
uint32_t  lowLimitThreshold 
)
inlinestatic
Note
When the data exceeds the low-limit threshold value, a low-limit event occurs, and the limit threshold format is determines by channel's result data format sinc_result_data_format_t.
Low limit value must lower than high limit value, otherwise the low-limit threshold does not work.
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
lowLimitThresholdSpecify the low-limit threshold value, range from 0 to 0xFFFFFFUL.
static void SINC_SetChannelHighLimitThreshold ( SINC_Type *  base,
sinc_channel_id_t  chId,
uint32_t  highLimitThreshold 
)
inlinestatic
Note
When the data exceeds the high-limit threshold value, a high-limit event occurs, and the limit threshold format is determines by channel's result data format sinc_result_data_format_t.
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
highLimitThresholdSpecify the high-limit threshold value, range from 0 to 0xFFFFFFUL.
static void SINC_SetChannelLimitDetectorMode ( SINC_Type *  base,
sinc_channel_id_t  chId,
sinc_limit_detector_mode_t  mode 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
modeSpecify the mode of limit detector, please refer to sinc_limit_detector_mode_t.
static void SINC_EnableChannelHighLimitBreakSignal ( SINC_Type *  base,
sinc_channel_id_t  chId,
bool  enable 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
enableUsed to enable/disable high limit break signal:
  • true Enable the automatic assertion of the BREAK_HIGH signal when SINC detects a high-limit event on the selected channel.
  • false Disable high limit break signal.
static void SINC_EnableChannelWindowLimitBreakSignal ( SINC_Type *  base,
sinc_channel_id_t  chId,
bool  enable 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
enableUsed to enable/disable window limit break signal:
  • true Enable the automatic assertion of the BREAK_WIN signal when SINC detects a window-limit event on the selected channel.
  • false Disable window limit break signal.
static void SINC_EnableChannelLowLimitBreakSignal ( SINC_Type *  base,
sinc_channel_id_t  chId,
bool  enable 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
enableUsed to enable/disable low limit break signal:
  • true Enable the automatic assertion of the BREAK_LOW signal when SINC detects a low-limit event on the selected channel.
  • false Disable low limit break signal.
static void SINC_SetChannelScdOperateMode ( SINC_Type *  base,
sinc_channel_id_t  chId,
sinc_scd_operate_mode_t  opMode 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
opModeSpecify the operate mode to set, please refer to sinc_scd_operate_mode_t.
static void SINC_SetChannelScdLimitThreshold ( SINC_Type *  base,
sinc_channel_id_t  chId,
uint8_t  u8ScdLimitThreshold 
)
inlinestatic
Note
The SCD counter tracks the number of received bits with the same repeating value(always 0 or always 1, set by SINC_SetChannelScdOption()), if that number exceeds the scdLimitThreshold, an SCD event occurs on the associated channel.
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
u8ScdLimitThresholdSpecify the threshold value for the SCD counter, range from 2 to 255.
static void SINC_SetChannelScdOption ( SINC_Type *  base,
sinc_channel_id_t  chId,
sinc_scd_option_t  option 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
optionSpecify which repeating bit value increments the SCD counter.
static void SINC_EnableChannelScdBreakSignal ( SINC_Type *  base,
sinc_channel_id_t  chId,
bool  enable 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
enableUsed to enable/disable SCD break signal:
  • true Enable SCD break signal.
  • false Disable SCD break signal.
static void SINC_SetChannelCadLimitThreshold ( SINC_Type *  base,
sinc_channel_id_t  chId,
sinc_cad_threshold_t  cadLimitThreshold 
)
inlinestatic
Note
The CAD counter tracks the number of clock cycles during which SINC does not detect a clock, if that number exceeds the threshold value, a CAD event occurs on the selected channel.
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
cadLimitThresholdSpecify the threshold value for the CAD counter, please refer to sinc_cad_threshold_t.
static void SINC_EnableChannelCadBreakSignal ( SINC_Type *  base,
sinc_channel_id_t  chId,
bool  enable 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
enableUsed to enable/disble CAD break signal:
  • true Enable selected channel's CAD break signal;
  • false Disable selected channel's CAD break signal.
static void SINC_SetChannelZcdOperateMode ( SINC_Type *  base,
sinc_channel_id_t  chId,
sinc_zero_cross_operate_mode_t  opMode 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
opModeSpecify the operate mode, please refer to sinc_zero_cross_operate_mode_t.
static void SINC_SetChannelPulseTriggerMux ( SINC_Type *  base,
sinc_channel_id_t  chId,
sinc_pulse_trigger_mux_t  pulseTrigMux 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
pulseTrigMuxUsed to selected the signal for pulse-trigger output.
static void SINC_SetChannelDebugOutput ( SINC_Type *  base,
sinc_channel_id_t  chId,
sinc_debug_output_t  debugOutput 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
debugOutputUsed to select debug output, please refer to sinc_debug_output_t.
static void SINC_LatchChannelDebugProceduce ( SINC_Type *  base,
sinc_channel_id_t  chId 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
static bool SINC_CheckChannelDebugDataValid ( SINC_Type *  base,
sinc_channel_id_t  chId 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
Return values
trueData is valid.
falseData is invalid.
static uint32_t SINC_GetChannelDebugData ( SINC_Type *  base,
sinc_channel_id_t  chId 
)
inlinestatic
Parameters
baseSINC peripheral base address.
chIdSelected channel id, please refer to sinc_channel_id_t.
Returns
Selected channel's debug data.
static void SINC_EnableInterrupts ( SINC_Type *  base,
uint64_t  interruptMasks 
)
inlinestatic
Parameters
baseSINC peripheral base address.
interruptMasksMask of interrupts to enable, should be the OR'ed value of sinc_interrupt_enable_t.
static void SINC_DisableInterrupts ( SINC_Type *  base,
uint64_t  interruptMasks 
)
inlinestatic
Parameters
baseSINC peripheral base address.
interruptMasksMask of interrupts to disable, should be the OR'ed value of sinc_interrupt_enable_t.
static uint64_t SINC_GetInterruptStatus ( SINC_Type *  base)
inlinestatic
Parameters
baseSINC peripheral base address.
Returns
SINC module's interrupt status flags, the OR'ed value of sinc_interrupt_status_t.
static void SINC_ClearInterruptStatus ( SINC_Type *  base,
uint64_t  statusMasks 
)
inlinestatic
Parameters
baseSINC peripheral base address.
statusMasksThe mask of interrupt status flags to clear, should be the OR'ed value of sinc_interrupt_status_t.