S32 Design Studio PE工具配置TMR

配置步骤

配置内容

生成的配置结构体如下,在Generated_Code路径下的lpTmr.c文件和lpTmr.h文件。

/*! lpTmr1 configuration structure */
const lptmr_config_t lpTmr1_config0 = {.workMode = LPTMR_WORKMODE_PULSECOUNTER,.dmaRequest = false,.interruptEnable = true,.freeRun = false,.compareValue = 1000U,.counterUnits = LPTMR_COUNTER_UNITS_TICKS,.clockSelect = LPTMR_CLOCKSOURCE_SIRCDIV2,.prescaler = LPTMR_PRESCALE_2,.bypassPrescaler = true,.pinSelect = LPTMR_PINSELECT_TRGMUX,.pinPolarity = LPTMR_PINPOLARITY_RISING,
};

只读也就是这个配置结构体前面加个const

工作模式有Timer计时器和Plus counter脉冲计数器两种

计时器的话就是用作普通计时器,脉冲计数器要选择对应的输入引脚和跟一个叫TRGMUX的模块配合使用。脉冲通过输入引脚给到TRGMUX模块,通过配置SEL寄存器选择输出到TMR模块计算脉冲数量。

DMA请求就是产生对比事件的时候请求DMA帮忙搬运下数据,不然的话就是让CPU来搬运。

中断使能是跟工作模式配合起来的。如果是计时器模式,那就是时间到达产生中断,进入中断函数。如果是脉冲计数器模式,就是脉冲到达一定数量的时候,进入中断函数。

这个中断只是允许定时器产生中断,要调用下INT_SYS_InstallHandler安装中断函数,INT_SYS_EnableIRQ使能。

/* Install IRQ handler for LPTMR interrupt */
INT_SYS_InstallHandler(LPTMR0_IRQn, &lptmrISR, (isr_t *)0);
/* Enable IRQ for LPTMR */
INT_SYS_EnableIRQ(LPTMR0_IRQn);

里面的LPTMR0_IRQn是设备名称,定死的。lptmrISR是中断时进入的函数,自己看着来写就行。

自由运行模式千万不要选,计数器会一直累加,溢出都不管。

对比值就是TMR累加到这个值就产生中断,无论工作模式是计数器模式还是脉冲计数器模式。这个是有最大数值限制的,自己看着来。

对比值单位是根据工作模式来的。如果是计时器模式,就选择微秒。如果是脉冲计数器模式,就选择次数。

输入时钟就是时钟源。

如果工作模式是计数器模式,分频数是自动适配的,不用选择引脚和极性。

如果工作模式是计数器模式,就可以选择分频数和滤波模式,并且选择映射到的引脚和极性。

极性就是在上升沿时刻计数还是下降沿时刻计数。

接口使用

会产生lptmr_driver.c文件和lptmr_driver.h文件,路径在SDK\platform\drivers\src\lptmr和SDK\platform\drivers\inc。

LPTMR_DRV_InitConfigStruct

初始化TMR配置结构体,也就是将配置结构体变成默认配置。

/*FUNCTION************************************************************************ Function Name : LPTMR_DRV_InitConfigStruct* Description   : Initialize a configuration structure with default values.** Implements : LPTMR_DRV_InitConfigStruct_Activity*END**************************************************************************/
void LPTMR_DRV_InitConfigStruct(lptmr_config_t * const config)
{DEV_ASSERT(config != NULL);/* General parameters */config->dmaRequest      = false;config->interruptEnable = false;config->freeRun         = false;config->workMode        = LPTMR_WORKMODE_TIMER;/* Counter parameters */config->clockSelect     = LPTMR_CLOCKSOURCE_SIRCDIV2;config->prescaler       = LPTMR_PRESCALE_2;config->bypassPrescaler = false;config->compareValue    = 0u;config->counterUnits    = LPTMR_COUNTER_UNITS_TICKS;/* Pulse Counter specific parameters */config->pinSelect       = LPTMR_PINSELECT_TRGMUX;config->pinPolarity     = LPTMR_PINPOLARITY_RISING;
}

LPTMR_DRV_Init

初始化函数,入参为TMR序号、配置结构体、是否开始计数。

/*FUNCTION************************************************************************ Function Name : LPTMR_DRV_Init* Description   : Initialize a LPTMR instance based on the input configuration* structure.** When (counterUnits == LPTMR_COUNTER_UNITS_MICROSECONDS) the function will* automatically configure the timer for the input compareValue in microseconds.* The input parameters for 'prescaler' and 'bypassPrescaler' will be ignored* - their values will be adapted by the function, to best fit the input compareValue* (in microseconds) for the operating clock frequency.** LPTMR_COUNTER_UNITS_MICROSECONDS may only be used for LPTMR_WORKMODE_TIMER mode.* Otherwise the function shall not convert 'compareValue' in ticks* and this is likely to cause erroneous behavior.** When (counterUnits == LPTMR_COUNTER_UNITS_TICKS) the function will use the* 'prescaler' and 'bypassPrescaler' provided in the input configuration structure.** When (counterUnits == LPTMR_COUNTER_UNITS_TICKS), 'compareValue' must be lower* than 0xFFFFu. Only the least significant 16bits of 'compareValue' will be used.* When (counterUnits == LPTMR_COUNTER_UNITS_MICROSECONDS), 'compareValue'* may take any 32bits unsigned value.** Implements : LPTMR_DRV_Init_Activity*END**************************************************************************/
void LPTMR_DRV_Init(const uint32_t instance,const lptmr_config_t * const config,const bool startCounter)
{DEV_ASSERT(instance < LPTMR_INSTANCE_COUNT);DEV_ASSERT(config != NULL);LPTMR_Type* const base = g_lptmrBase[instance];LPTMR_DRV_SetConfig(instance, config);/* Start the counter if requested */if (startCounter){LPTMR_Enable(base);}
}

LPTMR_DRV_SetConfig

将配置结构体的配置信息设置到序号里面的TMR当中。

/*FUNCTION************************************************************************ Function Name : LPTMR_DRV_SetConfig* Description   : Configure a LPTMR instance based on the input configuration* structure.** When (counterUnits == LPTMR_COUNTER_UNITS_MICROSECONDS) the function will* automatically configure the timer for the input compareValue in microseconds.* The input parameters for 'prescaler' and 'bypassPrescaler' will be ignored* - their values will be adapted by the function, to best fit the input compareValue* (in microseconds) for the operating clock frequency.** LPTMR_COUNTER_UNITS_MICROSECONDS may only be used for LPTMR_WORKMODE_TIMER mode.* Otherwise the function shall not convert 'compareValue' in ticks* and this is likely to cause erroneous behavior.** When (counterUnits == LPTMR_COUNTER_UNITS_TICKS) the function will use the* 'prescaler' and 'bypassPrescaler' provided in the input configuration structure.** When (counterUnits == LPTMR_COUNTER_UNITS_TICKS), 'compareValue' must be lower* than 0xFFFFu. Only the least significant 16bits of 'compareValue' will be used.* When (counterUnits == LPTMR_COUNTER_UNITS_MICROSECONDS), 'compareValue'* may take any 32bits unsigned value.** Implements : LPTMR_DRV_SetConfig_Activity*END**************************************************************************/
void LPTMR_DRV_SetConfig(const uint32_t instance,const lptmr_config_t * const config)
{DEV_ASSERT(instance < LPTMR_INSTANCE_COUNT);DEV_ASSERT(config != NULL);LPTMR_Type* const base          = g_lptmrBase[instance];uint32_t configCmpValue         = config->compareValue;lptmr_workmode_t configWorkMode = config->workMode;uint16_t cmpValueTicks          = 0U;lptmr_prescaler_t prescVal      = config->prescaler;bool prescBypass                = config->bypassPrescaler;lptmr_counter_units_t configCounterUnits = config->counterUnits;if(configWorkMode == LPTMR_WORKMODE_TIMER){/* A valid clock must be selected when used in Timer Mode. */uint32_t clkFreq;clkFreq = lptmr_GetClkFreq(config->clockSelect, instance);DEV_ASSERT(clkFreq != 0U); /* Clock frequency equal to '0', signals invalid value.  */if(configCounterUnits == LPTMR_COUNTER_UNITS_MICROSECONDS){bool chooseClkConfigStatus;/* When workmode is set to Timer Mode and compare value is provided in microseconds,* then the input parameters for prescale value and prescaleBypass are ignored.* The prescaleValue, prescaleBypass and cmpValue in ticks, are calculated to best fit* the input configCmpValue (in us) for the current operating clk frequency.  */chooseClkConfigStatus = lptmr_ChooseClkConfig(clkFreq, configCmpValue, &prescVal, &prescBypass, &cmpValueTicks);DEV_ASSERT(chooseClkConfigStatus == true);(void) chooseClkConfigStatus;}else{DEV_ASSERT(configCounterUnits == LPTMR_COUNTER_UNITS_TICKS);DEV_ASSERT(configCmpValue <= LPTMR_CMR_COMPARE_MASK); /* Compare Value in Tick Units must fit in CMR. */cmpValueTicks = (uint16_t)(configCmpValue & LPTMR_CMR_COMPARE_MASK);}}else{/* If configWorkMode is not LPTMR_WORKMODE_TIMER, then it must be LPTMR_WORKMODE_PULSECOUNTER. */DEV_ASSERT(configWorkMode == LPTMR_WORKMODE_PULSECOUNTER);/* Only LPTMR_COUNTER_UNITS_TICKS can be used when LPTMR is configured as Pulse Counter. */DEV_ASSERT(config->counterUnits == LPTMR_COUNTER_UNITS_TICKS);/* A valid clock must be selected when glitch filter is enabled (prescaler not bypassed). */DEV_ASSERT((lptmr_GetClkFreq(config->clockSelect, instance) != 0u) || prescBypass);/* Glitch filter does not support LPTMR_PRESCALE_2. */DEV_ASSERT(prescBypass || (prescVal != LPTMR_PRESCALE_2));DEV_ASSERT(configCmpValue <= LPTMR_CMR_COMPARE_MASK); /* Compare Value in Tick Units must fit in CMR. */cmpValueTicks = (uint16_t)(configCmpValue & LPTMR_CMR_COMPARE_MASK);}/* Initialize and write configuration parameters. */LPTMR_Init(base);LPTMR_SetDmaRequest   (base, config->dmaRequest);LPTMR_SetInterrupt    (base, config->interruptEnable);LPTMR_SetFreeRunning  (base, config->freeRun);LPTMR_SetWorkMode     (base, configWorkMode);LPTMR_SetPrescaler    (base, prescVal);LPTMR_SetBypass       (base, prescBypass);LPTMR_SetClockSelect  (base, config->clockSelect);LPTMR_SetCompareValue (base, cmpValueTicks);LPTMR_SetPinSelect    (base, config->pinSelect);LPTMR_SetPinPolarity  (base, config->pinPolarity);
}

LPTMR_DRV_GetConfig

获取配置结构体信息

/*FUNCTION************************************************************************ Function Name : LPTMR_DRV_GetConfig* Description   : Get the current configuration of the LPTMR instance.* Always returns compareValue in LPTMR_COUNTER_UNITS_TICKS.** Implements : LPTMR_DRV_GetConfig_Activity*END**************************************************************************/
void LPTMR_DRV_GetConfig(const uint32_t instance,lptmr_config_t * const config)
{DEV_ASSERT(instance < LPTMR_INSTANCE_COUNT);DEV_ASSERT(config != NULL);const LPTMR_Type* const base = g_lptmrBase[instance];/* Read current configuration */config->dmaRequest      = LPTMR_GetDmaRequest(base);config->interruptEnable = LPTMR_GetInterruptEnable(base);config->freeRun         = LPTMR_GetFreeRunning(base);config->workMode        = LPTMR_GetWorkMode(base);config->prescaler       = LPTMR_GetPrescaler(base);config->bypassPrescaler = LPTMR_GetBypass(base);config->clockSelect     = LPTMR_GetClockSelect(base);config->compareValue    = LPTMR_GetCompareValue(base);config->counterUnits    = LPTMR_COUNTER_UNITS_TICKS;config->pinSelect       = LPTMR_GetPinSelect(base);config->pinPolarity     = LPTMR_GetPinPolarity(base);
}

LPTMR_DRV_Deinit

逆初始化

/*FUNCTION************************************************************************ Function Name : LPTMR_DRV_Deinit* Description   : De-initialize the LPTMR (stop the counter and reset all registers to default value).** Implements : LPTMR_DRV_Deinit_Activity*END**************************************************************************/
void LPTMR_DRV_Deinit(const uint32_t instance)
{DEV_ASSERT(instance < LPTMR_INSTANCE_COUNT);LPTMR_Type* const base = g_lptmrBase[instance];LPTMR_Disable(base);LPTMR_Init(base);
}

LPTMR_DRV_SetCompareValueByCount

设置对比值

/*FUNCTION************************************************************************ Function Name : LPTMR_DRV_SetCompareValueByCount* Description   : Set the compare value in counter tick units, for a LPTMR instance.* Possible return values:* - STATUS_SUCCESS: completed successfully* - STATUS_ERROR: cannot reconfigure compare value (TCF not set)* - STATUS_TIMEOUT: compare value is smaller than current counter value** Implements : LPTMR_DRV_SetCompareValueByCount_Activity*END**************************************************************************/
status_t LPTMR_DRV_SetCompareValueByCount(const uint32_t instance,const uint16_t compareValueByCount)
{DEV_ASSERT(instance < LPTMR_INSTANCE_COUNT);LPTMR_Type* const base  = g_lptmrBase[instance];status_t statusCode     = STATUS_SUCCESS;bool timerEnabled = LPTMR_GetEnable(base);bool compareFlag  = LPTMR_GetCompareFlag(base);uint16_t counterVal;/* Check if a valid clock is selected for the timer/glitch filter */
#if (defined (DEV_ERROR_DETECT) || defined (CUSTOM_DEVASSERT))bool bypass = LPTMR_GetBypass(base);lptmr_workmode_t workMode = LPTMR_GetWorkMode(base);(void) bypass;(void) workMode;
#endif /* (defined (DEV_ERROR_DETECT) || defined (CUSTOM_DEVASSERT)) */DEV_ASSERT((lptmr_GetClkFreq(LPTMR_GetClockSelect(base), instance) != 0u) || \(bypass && (workMode == LPTMR_WORKMODE_PULSECOUNTER)));/* The compare value can only be written if counter is disabled or the compare flag is set. */if (timerEnabled && !compareFlag){statusCode = STATUS_ERROR;}else{/* Check if new value is below the current counter value */LPTMR_SetCompareValue(base, compareValueByCount);counterVal = LPTMR_GetCounterValue(base);if (counterVal >= compareValueByCount){statusCode = STATUS_TIMEOUT;}}return statusCode;
}

LPTMR_DRV_GetCompareValueByCount

获取对比值

/*FUNCTION************************************************************************ Function Name : LPTMR_DRV_GetCompareValueByCount* Description   : Get the compare value of timer in ticks units.** Implements : LPTMR_DRV_GetCompareValueByCount_Activity*END**************************************************************************/
void LPTMR_DRV_GetCompareValueByCount(const uint32_t instance,uint16_t * const compareValueByCount)
{DEV_ASSERT(instance < LPTMR_INSTANCE_COUNT);const LPTMR_Type* const base = g_lptmrBase[instance];*compareValueByCount = LPTMR_GetCompareValue(base);
}

LPTMR_DRV_SetCompareValueByUs

设置对比值,需要工作模式为计时器

/*FUNCTION************************************************************************ Function Name : LPTMR_DRV_SetCompareValueUs* Description   : Set the compare value for Timer Mode in microseconds,* for a LPTMR instance.* Can be used only in Timer Mode.* Possible return values:* - STATUS_SUCCESS: completed successfully* - STATUS_ERROR: cannot reconfigure compare value* - STATUS_TIMEOUT: compare value greater then current counter value** Implements : LPTMR_DRV_SetCompareValueByUs_Activity*END**************************************************************************/
status_t LPTMR_DRV_SetCompareValueByUs(const uint32_t instance,const uint32_t compareValueUs)
{DEV_ASSERT(instance < LPTMR_INSTANCE_COUNT);status_t returnCode     = STATUS_SUCCESS;LPTMR_Type* const base  = g_lptmrBase[instance];bool timerEnabled, compareFlag;lptmr_clocksource_t clkSrc;uint32_t clkFreq;uint16_t cmpValTicks, currentCounterVal;lptmr_prescaler_t prescVal;bool prescBypass, conversionStatus;/* This function can only be used if LPTMR is configured in Timer Mode. */DEV_ASSERT(LPTMR_GetWorkMode(base) == LPTMR_WORKMODE_TIMER);timerEnabled = LPTMR_GetEnable(base);compareFlag  = LPTMR_GetCompareFlag(base);/* The compare value can only be written if counter is disabled or the compare flag is set. */if (timerEnabled && !compareFlag){returnCode = STATUS_ERROR;}else{clkSrc  = LPTMR_GetClockSelect(base);clkFreq = lptmr_GetClkFreq(clkSrc, instance);DEV_ASSERT(clkFreq != 0U); /* Check the calculated clock frequency: '0' - invalid*//* Get prescaler value and prescaler bypass state.*/prescVal    = LPTMR_GetPrescaler(base);prescBypass = LPTMR_GetBypass(base);/* Convert new compare value from microseconds to ticks. */conversionStatus = lptmr_Us2Ticks(clkFreq, prescVal, prescBypass, compareValueUs, &cmpValTicks);DEV_ASSERT(conversionStatus == true); /* Check the conversion status: compareValueUs doesn't fit for current prescaller. */(void) conversionStatus;/* Write value and check if written successfully */LPTMR_SetCompareValue(base, cmpValTicks);currentCounterVal = LPTMR_GetCounterValue(base);if (currentCounterVal >= cmpValTicks){returnCode = STATUS_TIMEOUT;}}return returnCode;
}

LPTMR_DRV_GetCompareValueByUs

获取对比值,需要工作模式为计时器

/*FUNCTION************************************************************************ Function Name : LPTMR_DRV_GetCompareValueByUs* Description   : Get the compare value in microseconds representation.* Can be used only in Timer Mode.** Implements : LPTMR_DRV_GetCompareValueByUs_Activity*END**************************************************************************/
void LPTMR_DRV_GetCompareValueByUs(const uint32_t instance,uint32_t * const compareValueUs)
{DEV_ASSERT(instance < LPTMR_INSTANCE_COUNT);DEV_ASSERT(compareValueUs != NULL);const LPTMR_Type* const base = g_lptmrBase[instance];lptmr_clocksource_t clkSrc;uint32_t clkFreq;uint16_t cmpValTicks;lptmr_prescaler_t prescVal;bool prescBypass, conversionStatus;/* This function can only be used if LPTMR is configured in Timer Mode. */DEV_ASSERT(LPTMR_GetWorkMode(base) == LPTMR_WORKMODE_TIMER);clkSrc  = LPTMR_GetClockSelect(base);clkFreq = lptmr_GetClkFreq(clkSrc, instance);/* The clock frequency must be valid. */DEV_ASSERT(clkFreq != 0U);/* Get prescaler value and prescaler bypass state.*/prescVal    = LPTMR_GetPrescaler(base);prescBypass = LPTMR_GetBypass(base);cmpValTicks = LPTMR_GetCompareValue(base);/* Convert current compare value from ticks to microseconds. */conversionStatus = lptmr_Ticks2Us(clkFreq, prescVal, prescBypass, cmpValTicks, compareValueUs);DEV_ASSERT(conversionStatus == true); /* Check the conversion status. */(void) conversionStatus;
}

LPTMR_DRV_GetCompareFlag

它获取的对比标志位的意思是比较事件是否触发

/*FUNCTION************************************************************************ Function Name : LPTMR_DRV_GetCompareFlag* Description   : Get the current state of the Compare Flag of a LPTMR instance** Implements : LPTMR_DRV_GetCompareFlag_Activity*END**************************************************************************/
bool LPTMR_DRV_GetCompareFlag(const uint32_t instance)
{DEV_ASSERT(instance < LPTMR_INSTANCE_COUNT);const LPTMR_Type* const base = g_lptmrBase[instance];bool compareFlag = LPTMR_GetCompareFlag(base);return compareFlag;
}

LPTMR_DRV_ClearCompareFlag

清除对比标志位

/*FUNCTION************************************************************************ Function Name : LPTMR_DRV_ClearCompareFlag* Description   : Clear the Compare Flag.** Implements : LPTMR_DRV_ClearCompareFlag_Activity*END**************************************************************************/
void LPTMR_DRV_ClearCompareFlag(const uint32_t instance)
{DEV_ASSERT(instance < LPTMR_INSTANCE_COUNT);LPTMR_Type* const base = g_lptmrBase[instance];LPTMR_ClearCompareFlag(base);
}

LPTMR_DRV_IsRunning

查看TMR是否在运行

/*FUNCTION************************************************************************ Function Name : LPTMR_DRV_IsRunning* Description   : Get the running state of a LPTMR instance.* Possible return values:* - true: Timer/Counter started* - false: Timer/Counter stopped** Implements : LPTMR_DRV_IsRunning_Activity*END**************************************************************************/
bool LPTMR_DRV_IsRunning(const uint32_t instance)
{DEV_ASSERT(instance < LPTMR_INSTANCE_COUNT);const LPTMR_Type* const base = g_lptmrBase[instance];bool runningState = LPTMR_GetEnable(base);return runningState;
}

LPTMR_DRV_SetInterrupt

设置是否开启中断

/*FUNCTION************************************************************************ Function Name : LPTMR_DRV_SetInterrupt* Description   : Enable/disable the LPTMR interrupt.** Implements : LPTMR_DRV_SetInterrupt_Activity*END**************************************************************************/
void LPTMR_DRV_SetInterrupt(const uint32_t instance,const bool enableInterrupt)
{DEV_ASSERT(instance < LPTMR_INSTANCE_COUNT);LPTMR_Type* const base = g_lptmrBase[instance];LPTMR_SetInterrupt(base, enableInterrupt);
}

LPTMR_DRV_GetCounterValueByCount

获取计数器值,需要工作模式为脉冲计数器

/*FUNCTION************************************************************************ Function Name : LPTMR_DRV_GetCounterValueTicks* Description   : Get the current Counter Value in timer ticks representation.* Return:*  - the counter value.** Implements : LPTMR_DRV_GetCounterValueByCount_Activity*END**************************************************************************/
uint16_t LPTMR_DRV_GetCounterValueByCount(const uint32_t instance)
{DEV_ASSERT(instance < LPTMR_INSTANCE_COUNT);LPTMR_Type* const base = g_lptmrBase[instance];uint16_t counterVal = LPTMR_GetCounterValue(base);return counterVal;
}

LPTMR_DRV_StartCounter

开始计时

/*FUNCTION************************************************************************ Function Name : LPTMR_DRV_StartCounter* Description   : Enable (start) the counter.** Implements : LPTMR_DRV_StartCounter_Activity*END**************************************************************************/
void LPTMR_DRV_StartCounter(const uint32_t instance)
{DEV_ASSERT(instance < LPTMR_INSTANCE_COUNT);LPTMR_Type* const base = g_lptmrBase[instance];/* Check if a valid clock is selected for the timer/glitch filter */
#if (defined (DEV_ERROR_DETECT) || defined (CUSTOM_DEVASSERT))bool bypass = LPTMR_GetBypass(base);lptmr_workmode_t workMode = LPTMR_GetWorkMode(base);(void) bypass;(void) workMode;
#endif /* (defined (DEV_ERROR_DETECT) || defined (CUSTOM_DEVASSERT)) */DEV_ASSERT((lptmr_GetClkFreq(LPTMR_GetClockSelect(base), instance) != 0u) || \(bypass && (workMode == LPTMR_WORKMODE_PULSECOUNTER)));LPTMR_Enable(base);
}

LPTMR_DRV_StopCounter

停止工作

/*FUNCTION************************************************************************ Function Name : LPTMR_DRV_StopCounter* Description   : Disable (stop) the counter.** Implements : LPTMR_DRV_StopCounter_Activity*END**************************************************************************/
void LPTMR_DRV_StopCounter(const uint32_t instance)
{DEV_ASSERT(instance < LPTMR_INSTANCE_COUNT);LPTMR_Type* const base = g_lptmrBase[instance];LPTMR_Disable(base);
}

LPTMR_DRV_SetPinConfiguration

设置脉冲计数的引脚和极性

/*FUNCTION************************************************************************ Function Name : LPTMR_DRV_SetPinConfiguration* Description   : Set the Input Pin configuration for Pulse Counter mode.** Implements : LPTMR_DRV_SetPinConfiguration_Activity*END**************************************************************************/
void LPTMR_DRV_SetPinConfiguration(const uint32_t instance,const lptmr_pinselect_t pinSelect,const lptmr_pinpolarity_t pinPolarity)
{DEV_ASSERT(instance < LPTMR_INSTANCE_COUNT);LPTMR_Type* const base = g_lptmrBase[instance];LPTMR_SetPinSelect(base, pinSelect);LPTMR_SetPinPolarity(base, pinPolarity);
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/703117.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

C++力扣题目 1143--最长公共子序列 1035--不相交的线 53--最大子数组和

1143.最长公共子序列 力扣题目链接(opens new window) 给定两个字符串 text1 和 text2&#xff0c;返回这两个字符串的最长公共子序列的长度。 一个字符串的 子序列 是指这样一个新的字符串&#xff1a;它是由原字符串在不改变字符的相对顺序的情况下删除某些字符&#xff0…

力扣用例题:2的幂

此题的解题方法在于根据用例调整代码 bool isPowerOfTwo(int n) {if(n1){return true;}if(n<0){return false;}while(n>2){if(n%21){return false;}nn/2; }if(n1){return false;}return true;}

Spring的另一大的特征:AOP

目录 AOP &#xff08;Aspect Oriented Programming&#xff09;AOP 入门案例&#xff08;注解版&#xff09;AOP 工作流程——代理AOP切入点表达式AOP 通知类型AOP通知获取数据获取切入点方法的参数获取切入点方法返回值获取切入点方法运行异常信息 百度网盘分享链接输入密码数…

FPGA 与 数字电路的关系 - 这篇文章 将 持续 更新 :)

先说几个逻辑&#xff1a;&#xff08;强调一下在这篇文章 输入路数 只有 1个或2个&#xff0c;输出只有1个&#xff0c;N个输入M个输出以后再说&#xff09; 看下面的几个图&#xff1a; 图一&#xff08; 忘了 这是 啥门&#xff0c;不是门吧 &#xff1a;&#xff09;也就…

2024-02-25 Unity 编辑器开发之编辑器拓展7 —— Inspector 窗口拓展

文章目录 1 SerializedObject 和 SerializedProperty2 自定义显示步骤3 数组、List 自定义显示3.1 基础方式3.2 自定义方式 4 自定义属性自定义显示4.1 基础方式4.2 自定义方式 5 字典自定义显示5.1 SerizlizeField5.2 ISerializationCallbackReceiver5.3 代码示例 1 Serialize…

【新三板年报文本分析】第一辑:python+selium模拟浏览器,批量实现上市公司年报链接

目录 序言函数模块介绍创建模拟浏览器对象只需要执行一次的部分需要批量执行的重复操作部分&#xff08;信息录入excel&#xff09;换页操作主函数 本地文件结构全部代码结果预览 如果直接需要结果的&#xff0c;可以直接见文末&#xff0c;获取资源。 序言 新三板年报链接&am…

emoji选择器

emoji表情 功能描述 这款聊天对话时选择表情的UI插件&#xff0c;是为了提升用户在聊天过程中的互动体验而设计的。它提供了一个直观且易于操作的界面&#xff0c;使用户能够快速地选择并插入各种表情符号&#xff0c;从而丰富他们的聊天内容&#xff0c;增加情感表达的多样性…

Unity3D 使用 Proto

一. 下载与安装 这里下载Google Protobuff下载 1. 源码用来编译CSharp 相关配置 2. win64 用于编译 proto 文件 二. 编译 1. 使用VS 打开 2. 点击最上面菜单栏 工具>NuGet 包管理器>管理解决方案的NuGet 管理包 版本一定要选择咱们一开始下载的对应版本否则不兼容&am…

C语言第三十一弹---自定义类型:结构体(下)

✨个人主页&#xff1a; 熬夜学编程的小林 &#x1f497;系列专栏&#xff1a; 【C语言详解】 【数据结构详解】 目录 1、结构体内存对齐 1.1、为什么存在内存对齐? 1.2、修改默认对齐数 2、结构体传参 3、结构体实现位段 3.1、什么是位段 3.2、位段的内存分配 3.3、…

幻兽帕鲁服务器多少钱?有买过的吗?

幻兽帕鲁服务器多少钱&#xff1f;太卷了&#xff0c;降价到24元1个月&#xff0c;阿里云4核16G10M游戏服务器26元1个月、149元半年&#xff0c;腾讯云4核16G游戏服务器32元、312元一年&#xff0c;华为云26元&#xff0c;京东云主机也是26元起。云服务器吧yunfuwuqiba.com给大…

VUE3环境搭建开发准备

VUE3 Vue (发音为 /vjuː/&#xff0c;类似 view) 是一款用于构建用户界面的 JavaScript 框架。它基于标准 HTML、CSS 和 JavaScript 构建&#xff0c;并提供了一套声明式的、组件化的编程模型&#xff0c;帮助你高效地开发用户界面。无论是简单还是复杂的界面&#xff0c;Vu…

【Prometheus】概念和工作原理介绍

目录 一、概述 1.1 prometheus简介 1.2 prometheus特点 1.3 prometheus架构图 1.4 prometheus组件介绍 1、Prometheus Server 2、Client Library 3、pushgateway 4、Exporters 5、Service Discovery 6、Alertmanager 7、grafana 1.5 Prometheus 数据流向 1.6 Pro…

100天精通Python(实用脚本篇)——第117天:基于selenium实现反反爬策略之代码输入账号信息登录网站

文章目录 专栏导读1. 前言2. 实现步骤3. 基础补充4. 代码实战4.1 创建连接4.2 添加请求头伪装浏览器4.3 隐藏浏览器指纹4.4 最大化窗口4.5 启动网页4.6 点击密码登录4.7 输入账号密码4.8 点击登录按钮4.9 完整代码4.10 GIF动图展示 五、总结 专栏导读 &#x1f525;&#x1f5…

IDEA安装配置以及安装配置Maven

IEDA官方下载地址&#xff0c;有专业版&#xff08;收费&#xff0c;破解&#xff09;&#xff0c;社区版&#xff08;免费&#xff09; 下载 IntelliJ IDEA – 领先的 Java 和 Kotlin IDE 安装配置Maven 1.解压apache-maven-3.6.3-bin.zip&#xff0c;安装maven到D盘softwar…

台湾旺泓-WH4530A三合一光距感 接近传感芯片

WH4530A是一款集成了环境光传感器&#xff08;PS&#xff09;接近传感器&#xff08;ALS&#xff09;和红外LED灯三合一为一体的光距感传感芯片&#xff0c;可以测距从0到100厘米以内范围&#xff1b;并采用I2C接口具有超高的灵敏度和精准的测距检测范围。 该WH4530A​​​​​…

真香!NineData SQL开发全面适配 GaiaDB

2 月&#xff0c;新年伊始&#xff0c;NineData 重磅发布&#xff0c;提供了对百度云原生关系型数据库 GaiaDB 的支持。 这一次的发布不仅仅是简单的数据源支持&#xff0c;而是覆盖了整个 SQL 开发能力的重要发布&#xff0c;意味着您已经可以完整地使用 NineData SQL 开发的…

MySQL 事务原理分析

事务 前提&#xff1a;并发连接访问。定义&#xff1a;事务是用户定义的一系列操作&#xff0c;这些操作要么都做&#xff0c;要么都不做&#xff0c;是一个不可分割的单位。目的&#xff1a;事务将数据库从一种一致性状态转换为另一种一致性状态&#xff0c;保证系统始终处于…

半导体物理基础-笔记(续)

源内容参考&#xff1a;https://www.bilibili.com/video/BV11U4y1k7zn/?spm_id_from333.337.search-card.all.click&vd_source61654d4a6e8d7941436149dd99026962 掺杂半导体的费米能级与温度及杂质浓度的关系图 在温度一定的条件下&#xff0c;施主杂质浓度越高&#xff0…

Oracle EBS GL 外币折算逻辑

背景 由于公司财务在10月份期间某汇率维护错误,导致帐套折算以后并合传送至合并帐套生成合并日记帐凭证的借贷金额特别大,但是财务核对的科目余额有没有问题,始终觉得合并日记帐生成会计分发有问题,需要我们给出外币折算逻辑。 基础设置 汇率 Path: GL->设置->币种-&…

pclpy 最小二乘法拟合平面

pclpy 最小二乘法拟合平面 一、算法原理二、代码三、结果1.左边原点云、右边最小二乘法拟合平面后点云投影 四、相关数据 一、算法原理 平面方程的一般表达式为&#xff1a; A x B y C z D 0 ( C ≠ 0 ) Ax By Cz D 0 \quad (C\neq0) AxByCzD0(C0) 即&#xff1a; …