本文整理汇总了C++中palSetPad函数的典型用法代码示例。如果您正苦于以下问题:C++ palSetPad函数的具体用法?C++ palSetPad怎么用?C++ palSetPad使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了palSetPad函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:dobromyslov,项目名称:stm32f0-chibios-template,代码行数:12,代码来源:main.c
示例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
}
开发者ID:0tsuki,项目名称:qmk_firmware,代码行数:12,代码来源:led.c
示例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;
}
开发者ID:jharvey,项目名称:rusefi,代码行数:12,代码来源:main.c
示例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);
}
}
开发者ID:rusefi,项目名称:ChibiOS,代码行数:12,代码来源:main.c
示例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*/
}
}
开发者ID:Ankhbayar,项目名称:mlab-chibios,代码行数:12,代码来源:main.c
示例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();
}
开发者ID:Ozhvankov,项目名称:STM32-GPS-Tracker,代码行数:16,代码来源:main.c
示例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);
}
}
开发者ID:mgsdk,项目名称:ChibiOS,代码行数:12,代码来源:main.c
示例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();
}
开发者ID:uavcam,项目名称:ChibiOS,代码行数:13,代码来源:main.c
示例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;
}
开发者ID:CNCBASHER,项目名称:ChibiOS,代码行数:12,代码来源:main.c
示例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);
}
}
开发者ID:MauroMombelli,项目名称:KFly_ChibiOS,代码行数:12,代码来源:main.c
示例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);
}
}
开发者ID:flabbergast,项目名称:chibios-projects,代码行数:12,代码来源:main.c
示例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;
}
开发者ID:GuzTech,项目名称:senoko-chibios-3,代码行数:12,代码来源:main.c
示例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);
}
}
开发者ID:GuzTech,项目名称:senoko-chibios-3,代码行数:12,代码来源:main.c
示例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;
}
开发者ID:AbuShaqra,项目名称:chibios-rt-arduino-due,代码行数:12,代码来源:main.c
示例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);
}
}
开发者ID:Babody,项目名称:ChibiOS,代码行数:12,代码来源:main.c
示例16: main
int main(void)
{
static const evhandler_t evhndl[] = {InsertHandler, RemoveHandler};
struct EventListener el0, el1;
// os init
halInit();
chSysInit();
// setup LED pads
palSetPadMode(GPIOD, 12, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST);
palClearPad(GPIOD, 12); // green LED
palSetPadMode(GPIOD, 15, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST);
palClearPad(GPIOD, 15); // blue LED
// setup pads to USART2 function (connect these pads through RS232 transceiver with PC, terminal emu needs 38400 baud)
sdStart(&SD2, NULL);
palSetPadMode(GPIOA, 2, PAL_MODE_ALTERNATE(7) | PAL_STM32_OSPEED_HIGHEST); // TX
palSetPadMode(GPIOA, 3, PAL_MODE_ALTERNATE(7)); // RX
// setup pads to SPI1 function (connect these pads to your SD card accordingly)
palSetPadMode(GPIOC, 4, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); // NSS
palSetPadMode(GPIOA, 5, PAL_MODE_ALTERNATE(5) | PAL_STM32_OSPEED_HIGHEST); // SCK
palSetPadMode(GPIOA, 6, PAL_MODE_ALTERNATE(5)); // MISO
palSetPadMode(GPIOA, 7, PAL_MODE_ALTERNATE(5) | PAL_STM32_OSPEED_HIGHEST); // MOSI
palSetPad(GPIOC, 4); // set NSS high
// initialize MMC driver
mmcObjectInit(&MMCD1, &SPID1, &ls_spicfg, &hs_spicfg, mmc_is_protected, mmc_is_inserted);
mmcStart(&MMCD1, NULL);
// ChibiOS has no I2S support yet;
// codec.c initializes everything necessary
// except the I2S TX DMA interrupt vector (because it would
// conflict with the ChibiOS kernel)
// we can make ChibiOS call our own handler by letting
// it create the DMA stream for SPI3
dmaStreamAllocate(SPID3.dmatx,
STM32_SPI_SPI3_IRQ_PRIORITY,
(stm32_dmaisr_t)I2SDmaTxInterrupt,
&SPID3);
// blink thread; also checks the user button
chThdCreateStatic(waBlinkThread, sizeof(waBlinkThread), NORMALPRIO, BlinkThread, NULL);
chEvtRegister(&MMCD1.inserted_event, &el0, 0);
chEvtRegister(&MMCD1.removed_event, &el1, 1);
while(TRUE)
{
chEvtDispatch(evhndl, chEvtWaitOne(ALL_EVENTS));
}
}
开发者ID:ADTL,项目名称:ARMWork,代码行数:52,代码来源:main.c
示例17: THD_FUNCTION
static THD_FUNCTION(blinkerThread,arg) {
UNUSED(arg);
while(TRUE){
while (isLogging) {
palSetPad(GPIOE, GPIOE_LED10_RED);
chThdSleepMilliseconds(500);
palClearPad(GPIOE, GPIOE_LED10_RED);
chThdSleepMilliseconds(500);
}
chThdSleepMilliseconds(1);
}
return 0;
}
开发者ID:ka-ross,项目名称:Digital-Systems-Labs,代码行数:13,代码来源:main.c
示例18: THD_FUNCTION
static THD_FUNCTION(ThreadLED, arg)
{
(void)arg;
chRegSetThreadName("HeartBeat");
while (true) {
palSetPad(GPIOG, GPIOG_LED3_GREEN);
chThdSleepMilliseconds(100);
palClearPad(GPIOG, GPIOG_LED3_GREEN);
chThdSleepMilliseconds(1000);
}
}
开发者ID:FriedCircuits,项目名称:USBMultimeter,代码行数:13,代码来源:main.c
示例19: extcb1
/* Triggered when the button is pressed or released. The LED4 is set to ON.*/
static void extcb1(EXTDriver *extp, expchannel_t channel) {
static VirtualTimer vt4;
(void)extp;
(void)channel;
palSetPad(GPIOC, GPIOC_LED4);
chSysLockFromIsr();
if (chVTIsArmedI(&vt4))
chVTResetI(&vt4);
/* LED4 set to OFF after 200mS.*/
chVTSetI(&vt4, MS2ST(200), led4off, NULL);
chSysUnlockFromIsr();
}
开发者ID:ColonelPanic42,项目名称:ChibiOS-RPi,代码行数:14,代码来源:main.c
示例20: THD_FUNCTION
static THD_FUNCTION(Thread2, arg){
(void)arg;
chRegSetThreadName("trigger-thread");
systime_t time = chVTGetSystemTimeX();
while(true){
time += MS2ST(500);
palSetPad(TRIGGER_PORT, TRIGGER_PIN);
chThdSleepMicroseconds(10);
palClearPad(TRIGGER_PORT, TRIGGER_PIN);
chThdSleepUntil(time);
}
}
开发者ID:tateba,项目名称:ST_NUCLEO_F401RE-HCSR04,代码行数:13,代码来源:main.c
注:本文中的palSetPad函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论