本帖最后由 xyz549040622 于 2023-4-26 10:55 编辑
#include "ti_msp_dl_config.h"
int main(void)
{
/* Power on GPIO, initialize pins as digital outputs */
SYSCFG_DL_init();
/* Default: LED1 and LED3 ON, LED2 OFF */
DL_GPIO_clearPins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED_2_PIN);
DL_GPIO_setPins(
GPIO_LEDS_PORT, GPIO_LEDS_USER_LED_1_PIN | GPIO_LEDS_USER_LED_3_PIN);
while (1) {
/*
* Call togglePins API to flip the current value of LEDs 1-3. This
* API causes the corresponding HW bits to be flipped by the GPIO HW
* without need for additional R-M-W cycles by the processor.
*/
delay_cycles(10000000);
DL_GPIO_togglePins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED_1_PIN |
GPIO_LEDS_USER_LED_2_PIN |
GPIO_LEDS_USER_LED_3_PIN);
}
}
|