本文整理汇总了C++中palClearPad函数的典型用法代码示例。如果您正苦于以下问题:C++ palClearPad函数的具体用法?C++ palClearPad怎么用?C++ palClearPad使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了palClearPad函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: nand_wp_assert
static void nand_wp_assert(void) {
palClearPad(GPIOB, GPIOB_NAND_WP);
}
示例2: ledoff
static void ledoff(void *p) {
(void)p;
palClearPad(GPIOC, GPIOC_LED4);
}
示例3: Thread1
static msg_t Thread1(void *arg) {
(void)arg;
chRegSetThreadName("blinker");
while (TRUE) {
unsigned i;
for (i = 0; i < 4; i++) {
palClearPad(PORT_D, PD_LED1);
chThdSleepMilliseconds(100);
palClearPad(PORT_D, PD_LED2);
chThdSleepMilliseconds(100);
palClearPad(PORT_D, PD_LED3);
chThdSleepMilliseconds(100);
palClearPad(PORT_D, PD_LED4);
chThdSleepMilliseconds(100);
palSetPad(PORT_D, PD_LED1);
chThdSleepMilliseconds(100);
palSetPad(PORT_D, PD_LED2);
chThdSleepMilliseconds(100);
palSetPad(PORT_D, PD_LED3);
chThdSleepMilliseconds(100);
palSetPad(PORT_D, PD_LED4);
chThdSleepMilliseconds(300);
}
for (i = 0; i < 4; i++) {
palTogglePort(PORT_D, PAL_PORT_BIT(PD_LED1) | PAL_PORT_BIT(PD_LED2) |
PAL_PORT_BIT(PD_LED3) | PAL_PORT_BIT(PD_LED4));
chThdSleepMilliseconds(500);
palTogglePort(PORT_D, PAL_PORT_BIT(PD_LED1) | PAL_PORT_BIT(PD_LED2) |
PAL_PORT_BIT(PD_LED3) | PAL_PORT_BIT(PD_LED4));
chThdSleepMilliseconds(500);
}
for (i = 0; i < 4; i++) {
palTogglePad(PORT_D, PD_LED1);
chThdSleepMilliseconds(250);
palTogglePad(PORT_D, PD_LED1);
palTogglePad(PORT_D, PD_LED2);
chThdSleepMilliseconds(250);
palTogglePad(PORT_D, PD_LED2);
palTogglePad(PORT_D, PD_LED3);
chThdSleepMilliseconds(250);
palTogglePad(PORT_D, PD_LED3);
palTogglePad(PORT_D, PD_LED4);
chThdSleepMilliseconds(250);
palTogglePad(PORT_D, PD_LED4);
}
for (i = 0; i < 4; i++) {
palClearPort(PORT_D, PAL_PORT_BIT(PD_LED1) | PAL_PORT_BIT(PD_LED3));
palSetPort(PORT_D, PAL_PORT_BIT(PD_LED2) | PAL_PORT_BIT(PD_LED4));
chThdSleepMilliseconds(500);
palClearPort(PORT_D, PAL_PORT_BIT(PD_LED2) | PAL_PORT_BIT(PD_LED4));
palSetPort(PORT_D, PAL_PORT_BIT(PD_LED1) | PAL_PORT_BIT(PD_LED3));
chThdSleepMilliseconds(500);
}
palSetPort(PORT_D, PAL_PORT_BIT(PD_LED1) | PAL_PORT_BIT(PD_LED2) |
PAL_PORT_BIT(PD_LED3) | PAL_PORT_BIT(PD_LED4));
}
return 0;
}
示例4: ledon2
/*
* Turn LED on
* Arguments
* num GPIOB_LED1, GPIOB_LED2
*/
void ledon2(void *num) {
(void)num;
palClearPad(IOPORT2, GPIOB_LED2);
}
示例5: lcd_cmd
void lcd_cmd(uint8_t c){
palClearPad(GPIOB, RS);
lcd_sendByte(c);
chThdSleepMicroseconds(50);
}
示例6: main
/*
* Application entry point.
*/
int main(void) {
/* Initialization of all the imported components in the order specified in
the application wizard. The function is generated automatically.*/
componentsInit();
palClearPad(PORT11, P11_LED4);
/*
* Initializes the PWM driver 8 and ICU driver 1.
* PIN80 is the PWM output.
* PIN63 is the ICU input.
* The two pins have to be externally connected together.
*/
/* Sets PIN63 alternative function.*/
SIU.PCR[179].R = 0b0000011000001100;
/* Sets PIN65 alternative function.*/
SIU.PCR[181].R = 0b0000010100001100;
icuStart(&ICUD2, &icucfg);
icuEnable(&ICUD2);
pwmStart(&PWMD1, &pwmcfg);
chThdSleepMilliseconds(2000);
/*
* Starts the PWM channel 0 using 75% duty cycle.
*/
pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 7500));
chThdSleepMilliseconds(5000);
/*
* Changes the PWM channel 0 to 50% duty cycle.
*/
pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 5000));
chThdSleepMilliseconds(5000);
/*
* Changes the PWM channel 0 to 25% duty cycle.
*/
pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 2500));
chThdSleepMilliseconds(5000);
/*
* Changes PWM period and the PWM channel 0 to 50% duty cycle.
*/
pwmChangePeriod(&PWMD1, 25000);
pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 5000));
chThdSleepMilliseconds(5000);
/*
* Disables PWM channel 0 and stops the drivers.
*/
pwmDisableChannel(&PWMD1, 0);
pwmStop(&PWMD1);
/*
* Disables and stops the ICU drivers.
*/
icuDisable(&ICUD2);
icuStop(&ICUD2);
palClearPad(PORT11, P11_LED3);
palClearPad(PORT11, P11_LED4);
/*
* Normal main() thread activity, in this demo it does nothing.
*/
while (TRUE) {
chThdSleepMilliseconds(500);
}
return 0;
}
示例7: icuperiodcb
static void icuperiodcb(ICUDriver *icup) {
palClearPad(GPIOB, GPIOB_LED2);
last_period = icuGetPeriodX(icup);
}
示例8: main
/*
* Application entry point.
*/
int main(void) {
/*
* System initializations.
* - HAL initialization, this also initializes the configured device drivers
* and performs the board-specific initializations.
* - Kernel initialization, the main() function becomes a thread and the
* RTOS is active.
*/
halInit();
chSysInit();
/*
* Initializes the PWM driver 1 and ICU driver 1.
* GPIOD10 is the PWM output.
* GPIOA0 is the ICU input.
* The two pins have to be externally connected together.
*/
icuStart(&ICUD1, &icucfg);
icuEnable(&ICUD1);
/* Sets A0 alternative function.*/
SIU.PCR[0].R = 0b0100010100000100;
pwmStart(&PWMD1, &pwmcfg);
/* Sets D10 alternative function.*/
SIU.PCR[58].R = 0b0100010100000100;
chThdSleepMilliseconds(2000);
/*
* Starts the PWM channel 0 using 75% duty cycle.
*/
pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 7500));
chThdSleepMilliseconds(5000);
/*
* Changes the PWM channel 0 to 50% duty cycle.
*/
pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 5000));
chThdSleepMilliseconds(5000);
/*
* Changes the PWM channel 0 to 25% duty cycle.
*/
pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 2500));
chThdSleepMilliseconds(5000);
/*
* Changes PWM period and the PWM channel 0 to 50% duty cycle.
*/
pwmChangePeriod(&PWMD1, 25000);
pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 5000));
chThdSleepMilliseconds(5000);
/*
* Disables channel 0 and stops the drivers.
*/
pwmDisableChannel(&PWMD1, 0);
pwmStop(&PWMD1);
icuDisable(&ICUD1);
icuStop(&ICUD1);
palClearPad(PORT_D, PD_LED3);
palClearPad(PORT_D, PD_LED4);
/*
* Normal main() thread activity, in this demo it does nothing.
*/
while (TRUE) {
chThdSleepMilliseconds(500);
}
return 0;
}
示例9: THD_FUNCTION
static THD_FUNCTION(Thread1, arg) {
(void)arg;
/*
* Activates the serial driver 1 using the driver default configuration.
*/
sdStart(&SD1, NULL);
while (TRUE) {
unsigned i;
chnWriteTimeout(&SD1, (uint8_t *)"Hello World!\r\n", 14, TIME_INFINITE);
for (i = 0; i < 4; i++) {
palClearPad(PORT_E, PE_LED1);
chThdSleepMilliseconds(100);
palClearPad(PORT_E, PE_LED2);
chThdSleepMilliseconds(100);
palClearPad(PORT_E, PE_LED3);
chThdSleepMilliseconds(100);
palClearPad(PORT_E, PE_LED4);
chThdSleepMilliseconds(100);
palSetPad(PORT_E, PE_LED1);
chThdSleepMilliseconds(100);
palSetPad(PORT_E, PE_LED2);
chThdSleepMilliseconds(100);
palSetPad(PORT_E, PE_LED3);
chThdSleepMilliseconds(100);
palSetPad(PORT_E, PE_LED4);
chThdSleepMilliseconds(300);
}
for (i = 0; i < 4; i++) {
palTogglePort(PORT_E, PAL_PORT_BIT(PE_LED1) | PAL_PORT_BIT(PE_LED2) |
PAL_PORT_BIT(PE_LED3) | PAL_PORT_BIT(PE_LED4));
chThdSleepMilliseconds(500);
palTogglePort(PORT_E, PAL_PORT_BIT(PE_LED1) | PAL_PORT_BIT(PE_LED2) |
PAL_PORT_BIT(PE_LED3) | PAL_PORT_BIT(PE_LED4));
chThdSleepMilliseconds(500);
}
for (i = 0; i < 4; i++) {
palTogglePad(PORT_E, PE_LED1);
chThdSleepMilliseconds(250);
palTogglePad(PORT_E, PE_LED1);
palTogglePad(PORT_E, PE_LED2);
chThdSleepMilliseconds(250);
palTogglePad(PORT_E, PE_LED2);
palTogglePad(PORT_E, PE_LED3);
chThdSleepMilliseconds(250);
palTogglePad(PORT_E, PE_LED3);
palTogglePad(PORT_E, PE_LED4);
chThdSleepMilliseconds(250);
palTogglePad(PORT_E, PE_LED4);
}
for (i = 0; i < 4; i++) {
palClearPort(PORT_E, PAL_PORT_BIT(PE_LED1) | PAL_PORT_BIT(PE_LED3));
palSetPort(PORT_E, PAL_PORT_BIT(PE_LED2) | PAL_PORT_BIT(PE_LED4));
chThdSleepMilliseconds(500);
palClearPort(PORT_E, PAL_PORT_BIT(PE_LED2) | PAL_PORT_BIT(PE_LED4));
palSetPort(PORT_E, PAL_PORT_BIT(PE_LED1) | PAL_PORT_BIT(PE_LED3));
chThdSleepMilliseconds(500);
}
palSetPort(PORT_E, PAL_PORT_BIT(PE_LED1) | PAL_PORT_BIT(PE_LED2) |
PAL_PORT_BIT(PE_LED3) | PAL_PORT_BIT(PE_LED4));
}
}
示例10: ledoff
static void ledoff(void *p) {
(void)p;
palClearPad(TEENSY_PIN13_IOPORT, TEENSY_PIN13);
}
示例11: pwmpcb
static void pwmpcb(PWMDriver *pwmp) {
(void)pwmp;
palClearPad(PORT_D, PD_LED1);
}
示例12: green_led_off
static inline void green_led_off(void) {palClearPad(GPIOI, GPIOI_LED_G);}
示例13: red_led_off
static inline void red_led_off(void) {palClearPad(GPIOI, GPIOI_LED_R);}
示例14: red_led_off
static void red_led_off(void) {
palClearPad(GPIOE, GPIOE_LED_R);
}
示例15: pwmpcb
static void pwmpcb(PWMDriver *pwmp) {
(void)pwmp;
palClearPad(PORT11, P11_LED1);
}