git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1025 35acf78f-673a-0410-8e92-d51de3d6d3f4

master
gdisirio 2009-06-07 16:54:39 +00:00
parent f9ecd9f46e
commit b2e6f6a6a5
5 changed files with 26 additions and 28 deletions

View File

@ -18,6 +18,7 @@
*/ */
#include <ch.h> #include <ch.h>
#include <pal.h>
#include "lpc214x.h" #include "lpc214x.h"
#include "vic.h" #include "vic.h"
@ -103,11 +104,11 @@ void hwinit0(void) {
PINSEL0 = VAL_PINSEL0; PINSEL0 = VAL_PINSEL0;
PINSEL1 = VAL_PINSEL1; PINSEL1 = VAL_PINSEL1;
PINSEL2 = VAL_PINSEL2; PINSEL2 = VAL_PINSEL2;
ioport_init_lld(); palInit();
ioport_lpc214x_set_direction_lld(IOPORT_A, VAL_FIO0DIR); pal_lld_lpc214x_set_direction(IOPORT_A, VAL_FIO0DIR);
ioport_write_lld(IOPORT_A, 0xFFFFFFFF); palWritePort(IOPORT_A, 0xFFFFFFFF);
ioport_lpc214x_set_direction_lld(IOPORT_B, VAL_FIO1DIR); pal_lld_lpc214x_set_direction(IOPORT_B, VAL_FIO1DIR);
ioport_write_lld(IOPORT_B, 0xFFFFFFFF); palWritePort(IOPORT_B, 0xFFFFFFFF);
} }
/* /*

View File

@ -24,10 +24,6 @@
#include "lpc214x.h" #include "lpc214x.h"
#endif #endif
#ifndef _IOPORTS_LLD_H_
#include "ioports.h"
#endif
#define BOARD_OLIMEX_LCP_P2148 #define BOARD_OLIMEX_LCP_P2148
/* /*
@ -69,16 +65,16 @@
#define VAL_FIO0DIR 0xB0703C00 #define VAL_FIO0DIR 0xB0703C00
#define VAL_FIO1DIR 0x00000000 #define VAL_FIO1DIR 0x00000000
#define PA_LED1 IOPORT_BIT(10) #define PA_LED1 10
#define PA_LED2 IOPORT_BIT(11) #define PA_LED2 11
#define PA_BUZZ1 IOPORT_BIT(12) #define PA_BUZZ1 12
#define PA_BUZZ2 IOPORT_BIT(13) #define PA_BUZZ2 13
#define PA_BSL IOPORT_BIT(14) #define PA_BSL 14
#define PA_BUTTON1 IOPORT_BIT(15) #define PA_BUTTON1 15
#define PA_BUTTON2 IOPORT_BIT(16) #define PA_BUTTON2 16
#define PA_SSEL1 IOPORT_BIT(20) #define PA_SSEL1 20
#define PA_WP1 IOPORT_BIT(24) #define PA_WP1 24
#define PA_CP1 IOPORT_BIT(25) #define PA_CP1 25
#define PA_LEDUSB IOPORT_BIT(31) #define PA_LEDUSB 31
#endif /* _BOARD_H_ */ #endif /* _BOARD_H_ */

View File

@ -18,6 +18,7 @@
*/ */
#include <ch.h> #include <ch.h>
#include <pal.h>
#include "board.h" #include "board.h"
@ -28,13 +29,13 @@ static WORKING_AREA(waThread1, 128);
static msg_t Thread1(void *arg) { static msg_t Thread1(void *arg) {
while (TRUE) { while (TRUE) {
chPortClear(IOPORT_A, PA_LED2); palClearPort(IOPORT_A, PAL_PORT_BIT(PA_LED2));
chThdSleepMilliseconds(200); chThdSleepMilliseconds(200);
chPortSet(IOPORT_A, PA_LED1 | PA_LED2); palSetPort(IOPORT_A, PAL_PORT_BIT(PA_LED1) | PAL_PORT_BIT(PA_LED2));
chThdSleepMilliseconds(800); chThdSleepMilliseconds(800);
chPortClear(IOPORT_A, PA_LED1); palClearPort(IOPORT_A, PAL_PORT_BIT(PA_LED1));
chThdSleepMilliseconds(200); chThdSleepMilliseconds(200);
chPortSet(IOPORT_A, PA_LED1 | PA_LED2); palSetPort(IOPORT_A, PAL_PORT_BIT(PA_LED1) | PAL_PORT_BIT(PA_LED2));
chThdSleepMilliseconds(800); chThdSleepMilliseconds(800);
} }
return 0; return 0;
@ -47,9 +48,9 @@ static WORKING_AREA(waThread2, 128);
static msg_t Thread2(void *arg) { static msg_t Thread2(void *arg) {
while (TRUE) { while (TRUE) {
chPortClear(IOPORT_A, PA_LEDUSB); palClearPad(IOPORT_A, PA_LEDUSB);
chThdSleepMilliseconds(200); chThdSleepMilliseconds(200);
chPortSet(IOPORT_A, PA_LEDUSB); palSetPad(IOPORT_A, PA_LEDUSB);
chThdSleepMilliseconds(300); chThdSleepMilliseconds(300);
} }
return 0; return 0;

View File

@ -18,7 +18,7 @@
*/ */
/** /**
* @file ports/ARM7-LPC214x/ioports_lld.h * @file ports/ARM7-LPC214x/pal_lld.h
* @brief LPC214x FIO low level driver * @brief LPC214x FIO low level driver
* @addtogroup LPC214x_PAL * @addtogroup LPC214x_PAL
* @{ * @{

View File

@ -46,7 +46,7 @@
/** @} */ /** @} */
/** /**
* @defgroup LPC214x_IOPORTS I/O Ports Support * @defgroup LPC214x_PAL I/O Ports Support
* @brief I/O Ports peripherals support. * @brief I/O Ports peripherals support.
* @details This module supports the LPC214x FIO controller. The controller * @details This module supports the LPC214x FIO controller. The controller
* supports the following features (see @ref PAL): * supports the following features (see @ref PAL):