Revised port abstraction layer (PAL), STM32 support adjusted.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1023 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
9052311700
commit
a5df28e309
|
@ -66,6 +66,7 @@ CSRC = ../../ports/ARMCM3/chcore.c \
|
||||||
../../ports/ARMCM3-STM32F103/stm32_serial.c \
|
../../ports/ARMCM3-STM32F103/stm32_serial.c \
|
||||||
${KERNSRC} \
|
${KERNSRC} \
|
||||||
${TESTSRC} \
|
${TESTSRC} \
|
||||||
|
../../src/lib/pal.c \
|
||||||
../../src/lib/evtimer.c \
|
../../src/lib/evtimer.c \
|
||||||
board.c main.c
|
board.c main.c
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
#include "board.h"
|
#include "board.h"
|
||||||
#include "stm32_serial.h"
|
#include "stm32_serial.h"
|
||||||
|
|
||||||
|
static IOBUS_DECL(LedBus, IOPORT_C, 1, GPIOC_LED);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Red LEDs blinker thread, times are in milliseconds.
|
* Red LEDs blinker thread, times are in milliseconds.
|
||||||
*/
|
*/
|
||||||
|
@ -35,6 +37,30 @@ static msg_t Thread1(void *arg) {
|
||||||
chThdSleepMilliseconds(500);
|
chThdSleepMilliseconds(500);
|
||||||
palSetPad(IOPORT_C, GPIOC_LED);
|
palSetPad(IOPORT_C, GPIOC_LED);
|
||||||
chThdSleepMilliseconds(500);
|
chThdSleepMilliseconds(500);
|
||||||
|
palTogglePad(IOPORT_C, GPIOC_LED);
|
||||||
|
chThdSleepMilliseconds(500);
|
||||||
|
palTogglePad(IOPORT_C, GPIOC_LED);
|
||||||
|
chThdSleepMilliseconds(500);
|
||||||
|
palWritePad(IOPORT_C, GPIOC_LED, PAL_LOW);
|
||||||
|
chThdSleepMilliseconds(500);
|
||||||
|
palWritePad(IOPORT_C, GPIOC_LED, PAL_HIGH);
|
||||||
|
chThdSleepMilliseconds(500);
|
||||||
|
palWriteGroup(IOPORT_C, 1, GPIOC_LED, PAL_LOW);
|
||||||
|
chThdSleepMilliseconds(500);
|
||||||
|
palWriteGroup(IOPORT_C, 1, GPIOC_LED, PAL_HIGH);
|
||||||
|
chThdSleepMilliseconds(500);
|
||||||
|
palClearPort(IOPORT_C, PAL_PORT_BIT(GPIOC_LED));
|
||||||
|
chThdSleepMilliseconds(500);
|
||||||
|
palSetPort(IOPORT_C, PAL_PORT_BIT(GPIOC_LED));
|
||||||
|
chThdSleepMilliseconds(500);
|
||||||
|
palTogglePort(IOPORT_C, PAL_PORT_BIT(GPIOC_LED));
|
||||||
|
chThdSleepMilliseconds(500);
|
||||||
|
palTogglePort(IOPORT_C, PAL_PORT_BIT(GPIOC_LED));
|
||||||
|
chThdSleepMilliseconds(500);
|
||||||
|
palWriteBus(&LedBus, PAL_LOW);
|
||||||
|
chThdSleepMilliseconds(500);
|
||||||
|
palWriteBus(&LedBus, PAL_HIGH);
|
||||||
|
chThdSleepMilliseconds(500);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -358,7 +358,7 @@
|
||||||
* @defgroup PAL I/O Ports Abstraction Layer (PAL)
|
* @defgroup PAL I/O Ports Abstraction Layer (PAL)
|
||||||
* @brief I/O Ports Abstraction Layer
|
* @brief I/O Ports Abstraction Layer
|
||||||
* @details This module defines an abstract interface for digital I/O ports.
|
* @details This module defines an abstract interface for digital I/O ports.
|
||||||
* Note that I/O ports functions are just a set of macros. The macros
|
* Note that most I/O ports functions are just macros. The macros
|
||||||
* have default software implementations that can be redefined in a
|
* have default software implementations that can be redefined in a
|
||||||
* @ref PAL_LLD if the target hardware supports special features like, as
|
* @ref PAL_LLD if the target hardware supports special features like, as
|
||||||
* example, atomic bit set/reset/masking. Please refer to the ports specific
|
* example, atomic bit set/reset/masking. Please refer to the ports specific
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file src/templates/pal_lld.h
|
* @file src/templates/pal_lld.h
|
||||||
* @brief @ref PAL subsystem low level driver template
|
* @brief PAL subsystem low level driver template
|
||||||
* @addtogroup PAL_LLD
|
* @addtogroup PAL_LLD
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue