Added ADC and DAC pins.
Signed-off-by: Yilin Sun <imi415@imi.moe>
This commit is contained in:
parent
3a90636406
commit
fa42e0a9a0
56
LPC804.mex
56
LPC804.mex
|
@ -103,6 +103,62 @@
|
||||||
</pin>
|
</pin>
|
||||||
</pins>
|
</pins>
|
||||||
</function>
|
</function>
|
||||||
|
<function name="BOARD_InitADCPins">
|
||||||
|
<description>Configures pin routing and optionally pin electrical features.</description>
|
||||||
|
<options>
|
||||||
|
<callFromInitBoot>true</callFromInitBoot>
|
||||||
|
<coreID>core0</coreID>
|
||||||
|
<enableClock>true</enableClock>
|
||||||
|
</options>
|
||||||
|
<dependencies>
|
||||||
|
<dependency resourceType="Peripheral" resourceId="ADC0" description="Peripheral ADC0 is not initialized" problem_level="1" source="Pins:BOARD_InitADCPins">
|
||||||
|
<feature name="initialized" evaluation="equal">
|
||||||
|
<data>true</data>
|
||||||
|
</feature>
|
||||||
|
</dependency>
|
||||||
|
<dependency resourceType="SWComponent" resourceId="platform.drivers.common" description="Pins initialization requires the COMMON Driver in the project." problem_level="2" source="Pins:BOARD_InitADCPins">
|
||||||
|
<feature name="enabled" evaluation="equal" configuration="core0">
|
||||||
|
<data>true</data>
|
||||||
|
</feature>
|
||||||
|
</dependency>
|
||||||
|
<dependency resourceType="SWComponent" resourceId="platform.drivers.swm" description="Pins initialization requires the SWM Driver in the project." problem_level="2" source="Pins:BOARD_InitADCPins">
|
||||||
|
<feature name="enabled" evaluation="equal" configuration="core0">
|
||||||
|
<data>true</data>
|
||||||
|
</feature>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<pins>
|
||||||
|
<pin peripheral="ADC0" signal="CH, 2" pin_num="25" pin_signal="PIO0_14/ACMP_I3/ADC_2"/>
|
||||||
|
</pins>
|
||||||
|
</function>
|
||||||
|
<function name="BOARD_InitDACPins">
|
||||||
|
<description>Configures pin routing and optionally pin electrical features.</description>
|
||||||
|
<options>
|
||||||
|
<callFromInitBoot>true</callFromInitBoot>
|
||||||
|
<coreID>core0</coreID>
|
||||||
|
<enableClock>true</enableClock>
|
||||||
|
</options>
|
||||||
|
<dependencies>
|
||||||
|
<dependency resourceType="Peripheral" resourceId="DAC0" description="Peripheral DAC0 is not initialized" problem_level="1" source="Pins:BOARD_InitDACPins">
|
||||||
|
<feature name="initialized" evaluation="equal">
|
||||||
|
<data>true</data>
|
||||||
|
</feature>
|
||||||
|
</dependency>
|
||||||
|
<dependency resourceType="SWComponent" resourceId="platform.drivers.common" description="Pins initialization requires the COMMON Driver in the project." problem_level="2" source="Pins:BOARD_InitDACPins">
|
||||||
|
<feature name="enabled" evaluation="equal" configuration="core0">
|
||||||
|
<data>true</data>
|
||||||
|
</feature>
|
||||||
|
</dependency>
|
||||||
|
<dependency resourceType="SWComponent" resourceId="platform.drivers.swm" description="Pins initialization requires the SWM Driver in the project." problem_level="2" source="Pins:BOARD_InitDACPins">
|
||||||
|
<feature name="enabled" evaluation="equal" configuration="core0">
|
||||||
|
<data>true</data>
|
||||||
|
</feature>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<pins>
|
||||||
|
<pin peripheral="DAC0" signal="DACOUT0" pin_num="26" pin_signal="PIO0_19/DACOUT"/>
|
||||||
|
</pins>
|
||||||
|
</function>
|
||||||
</functions_list>
|
</functions_list>
|
||||||
</pins>
|
</pins>
|
||||||
<clocks name="Clocks" version="11.0" enabled="true" update_project_code="true">
|
<clocks name="Clocks" version="11.0" enabled="true" update_project_code="true">
|
||||||
|
|
|
@ -34,6 +34,8 @@ pin_labels:
|
||||||
void BOARD_InitBootPins(void)
|
void BOARD_InitBootPins(void)
|
||||||
{
|
{
|
||||||
BOARD_InitLEDPins();
|
BOARD_InitLEDPins();
|
||||||
|
BOARD_InitADCPins();
|
||||||
|
BOARD_InitDACPins();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
|
@ -142,6 +144,66 @@ void BOARD_InitLEDPins(void)
|
||||||
/* Disable clock for switch matrix. */
|
/* Disable clock for switch matrix. */
|
||||||
CLOCK_DisableClock(kCLOCK_Swm);
|
CLOCK_DisableClock(kCLOCK_Swm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* clang-format off */
|
||||||
|
/*
|
||||||
|
* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
|
||||||
|
BOARD_InitADCPins:
|
||||||
|
- options: {callFromInitBoot: 'true', coreID: core0, enableClock: 'true'}
|
||||||
|
- pin_list:
|
||||||
|
- {pin_num: '25', peripheral: ADC0, signal: 'CH, 2', pin_signal: PIO0_14/ACMP_I3/ADC_2}
|
||||||
|
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
|
||||||
|
*/
|
||||||
|
/* clang-format on */
|
||||||
|
|
||||||
|
/* FUNCTION ************************************************************************************************************
|
||||||
|
*
|
||||||
|
* Function Name : BOARD_InitADCPins
|
||||||
|
* Description : Configures pin routing and optionally pin electrical features.
|
||||||
|
*
|
||||||
|
* END ****************************************************************************************************************/
|
||||||
|
/* Function assigned for the Cortex-M0P */
|
||||||
|
void BOARD_InitADCPins(void)
|
||||||
|
{
|
||||||
|
/* Enables clock for switch matrix.: enable */
|
||||||
|
CLOCK_EnableClock(kCLOCK_Swm);
|
||||||
|
|
||||||
|
/* ADC_CHN2 connect to P0_14 */
|
||||||
|
SWM_SetFixedPinSelect(SWM0, kSWM_ADC_CHN2, true);
|
||||||
|
|
||||||
|
/* Disable clock for switch matrix. */
|
||||||
|
CLOCK_DisableClock(kCLOCK_Swm);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* clang-format off */
|
||||||
|
/*
|
||||||
|
* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
|
||||||
|
BOARD_InitDACPins:
|
||||||
|
- options: {callFromInitBoot: 'true', coreID: core0, enableClock: 'true'}
|
||||||
|
- pin_list:
|
||||||
|
- {pin_num: '26', peripheral: DAC0, signal: DACOUT0, pin_signal: PIO0_19/DACOUT}
|
||||||
|
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
|
||||||
|
*/
|
||||||
|
/* clang-format on */
|
||||||
|
|
||||||
|
/* FUNCTION ************************************************************************************************************
|
||||||
|
*
|
||||||
|
* Function Name : BOARD_InitDACPins
|
||||||
|
* Description : Configures pin routing and optionally pin electrical features.
|
||||||
|
*
|
||||||
|
* END ****************************************************************************************************************/
|
||||||
|
/* Function assigned for the Cortex-M0P */
|
||||||
|
void BOARD_InitDACPins(void)
|
||||||
|
{
|
||||||
|
/* Enables clock for switch matrix.: enable */
|
||||||
|
CLOCK_EnableClock(kCLOCK_Swm);
|
||||||
|
|
||||||
|
/* DAC_OUT0 connect to P0_19 */
|
||||||
|
SWM_SetFixedPinSelect(SWM0, kSWM_DAC_OUT0, true);
|
||||||
|
|
||||||
|
/* Disable clock for switch matrix. */
|
||||||
|
CLOCK_DisableClock(kCLOCK_Swm);
|
||||||
|
}
|
||||||
/***********************************************************************************************************************
|
/***********************************************************************************************************************
|
||||||
* EOF
|
* EOF
|
||||||
**********************************************************************************************************************/
|
**********************************************************************************************************************/
|
||||||
|
|
|
@ -80,6 +80,18 @@ void BOARD_InitDbgUARTPins(void); /* Function assigned for the Cortex-M0P */
|
||||||
*/
|
*/
|
||||||
void BOARD_InitLEDPins(void); /* Function assigned for the Cortex-M0P */
|
void BOARD_InitLEDPins(void); /* Function assigned for the Cortex-M0P */
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Configures pin routing and optionally pin electrical features.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void BOARD_InitADCPins(void); /* Function assigned for the Cortex-M0P */
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Configures pin routing and optionally pin electrical features.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void BOARD_InitDACPins(void); /* Function assigned for the Cortex-M0P */
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue