本文整理汇总了C++中palSetPad函数的典型用法代码示例。如果您正苦于以下问题:C++ palSetPad函数的具体用法?C++ palSetPad怎么用?C++ palSetPad使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了palSetPad函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Thread1
static msg_t Thread1(void *arg) {
(void)arg;
chRegSetThreadName("blinker1");
while (TRUE) {
palClearPad(GPIOC, GPIOC_LED4);
chThdSleepMilliseconds(500);
palSetPad(GPIOC, GPIOC_LED4);
chThdSleepMilliseconds(500);
}
return RDY_OK;
}
示例2: backlight_set
void backlight_set(uint8_t level) {
printf("backlight_set(%d)\n", level);
#ifdef BACKLIGHT_ENABLE
if (level == 0) {
// Turn backlight off
palSetPad(GPIOB, 8);
} else {
// Turn backlight on
palClearPad(GPIOB, 8);
}
#endif
}
示例3: Thread1
static msg_t Thread1(void *arg) {
(void)arg;
chRegSetThreadName("blinker");
while (TRUE) {
palClearPad(BL_PORT, BL_PIN);
chThdSleepMilliseconds(30);
palSetPad(BL_PORT, BL_PIN);
chThdSleepMilliseconds(30);
}
return 0;
}
示例4: THD_FUNCTION
static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("Blinker");
while (true) {
palClearPad(IOPORT5, PORTE_LED);
chThdSleepMilliseconds(1000);
palSetPad(IOPORT5, PORTE_LED);
chThdSleepMilliseconds(100);
}
}
示例5: extcb
static void extcb(EXTDriver *extp, expchannel_t channel) {
(void)extp;
(void)channel;
if (PWR->CSR & PWR_CSR_PVDO){ /* voltage lover than threshold */
palClearPad(GPIOB, GPIOB_LED_B); /* switch off LED*/
}
else{
palSetPad(GPIOB, GPIOB_LED_B); /* switch on LED*/
}
}
示例6: rxchar
/*
* This callback is invoked when a character is received but the application
* was not ready to receive it, the character is passed as parameter.
*/
static void rxchar(UARTDriver *uartp, uint16_t c) {
(void)uartp;
(void)c;
/* Flashing the LED each time a character is received.*/
palSetPad(GPIOD, GPIOD_LED4);
chSysLockFromIsr();
if (chVTIsArmedI(&vt2))
chVTResetI(&vt2);
chVTSetI(&vt2, MS2ST(200), ledoff, NULL);
chSysUnlockFromIsr();
}
示例7: Thread1
static msg_t Thread1(void *arg) {
(void)arg;
chRegSetThreadName("blinker");
while (TRUE) {
systime_t time = serusbcfg.usbp->state == USB_ACTIVE ? 250 : 500;
palClearPad(GPIOC, GPIOC_LED1);
chThdSleepMilliseconds(time);
palSetPad(GPIOC, GPIOC_LED1);
chThdSleepMilliseconds(time);
}
}
示例8: extcb1
/* Triggered when the button is pressed or released. The LED4 is set to ON.*/
static void extcb1(EXTDriver *extp, expchannel_t channel) {
static virtual_timer_t vt4;
(void)extp;
(void)channel;
palSetPad(GPIOB, GPIOB_LED4);
chSysLockFromISR();
chVTResetI(&vt4);
/* LED4 set to OFF after 200mS.*/
chVTDoSetI(&vt4, MS2ST(200), led4off, NULL);
chSysUnlockFromISR();
}
示例9: Thread1
static msg_t Thread1(void *p) {
(void)p;
chRegSetThreadName("blinker");
while (TRUE) {
palSetPad(IOPORT2, PIOB_LCD_BL);
chThdSleepMilliseconds(100);
palClearPad(IOPORT2, PIOB_LCD_BL);
chThdSleepMilliseconds(900);
}
return 0;
}
示例10: panic
void panic(const char *err)
{
kfly_error = err;
while (1)
{
palClearPad(GPIOC, GPIOC_LED_ERR);
chThdSleepMilliseconds(200);
palSetPad(GPIOC, GPIOC_LED_ERR);
chThdSleepMilliseconds(200);
}
}
示例11: THD_FUNCTION
static THD_FUNCTION(blinkerThread, arg) {
(void)arg;
chRegSetThreadName("blinkerThread");
while(true) {
systime_t time = USB_DRIVER.state == USB_ACTIVE ? 250 : 500;
palClearPad(LED_GPIO, LED_PIN);
chThdSleepMilliseconds(time);
palSetPad(LED_GPIO, LED_PIN);
chThdSleepMilliseconds(time);
}
}
示例12: Thread1
static msg_t Thread1(void *arg) {
(void)arg;
chRegSetThreadName("blinker");
while (TRUE) {
palSetPad(GPIOE, GPIOE_LED10_RED);
chThdSleepMilliseconds(500);
palClearPad(GPIOE, GPIOE_LED10_RED);
chThdSleepMilliseconds(500);
}
return 0;
}
示例13: THD_FUNCTION
static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("blinker");
while (true) {
palSetPad(GPIOC, GPIOC_LED);
chThdSleepMilliseconds(500);
palClearPad(GPIOC, GPIOC_LED);
chThdSleepMilliseconds(500);
}
}
示例14: Thread2
static msg_t Thread2(void *arg) {
(void)arg;
chRegSetThreadName("blinker2");
while (TRUE) {
palClearPad(IOPORT1, PA_LEDUSB);
chThdSleepMilliseconds(200);
palSetPad(IOPORT1, PA_LEDUSB);
chThdSleepMilliseconds(300);
}
return 0;
}
示例15: THD_FUNCTION
static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("blinker");
while (true) {
systime_t time = serusbcfg.usbp->state == USB_ACTIVE ? 250 : 500;
palClearPad(GPIOA, GPIOA_LED_BLUE);
chThdSleepMilliseconds(time);
palSetPad(GPIOA, GPIOA_LED_BLUE);
chThdSleepMilliseconds(time);
}
}