diff options
Diffstat (limited to 'os/hal')
24 files changed, 24 insertions, 71 deletions
diff --git a/os/hal/include/pal.h b/os/hal/include/pal.h index fc0045bf4..2e5b78c03 100644 --- a/os/hal/include/pal.h +++ b/os/hal/include/pal.h @@ -127,7 +127,7 @@ typedef struct { /**
* @brief Offset, within the port, of the least significant bit of the bus.
*/
- uint_fast8_t offset;
+ iomode_t offset;
} IOBus;
/*===========================================================================*/
diff --git a/os/hal/platforms/AT91SAM7/pal_lld.c b/os/hal/platforms/AT91SAM7/pal_lld.c index 5422756ac..b392d627c 100644 --- a/os/hal/platforms/AT91SAM7/pal_lld.c +++ b/os/hal/platforms/AT91SAM7/pal_lld.c @@ -121,7 +121,7 @@ void _pal_lld_init(const PALConfig *config) { */
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
- uint_fast8_t mode) {
+ iomode_t mode) {
switch (mode) {
case PAL_MODE_RESET:
diff --git a/os/hal/platforms/AT91SAM7/pal_lld.h b/os/hal/platforms/AT91SAM7/pal_lld.h index 7aeb3b933..53fdd417e 100644 --- a/os/hal/platforms/AT91SAM7/pal_lld.h +++ b/os/hal/platforms/AT91SAM7/pal_lld.h @@ -241,7 +241,7 @@ extern "C" { void _pal_lld_init(const PALConfig *config);
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
- uint_fast8_t mode);
+ iomode_t mode);
#ifdef __cplusplus
}
#endif
diff --git a/os/hal/platforms/LPC11xx/pal_lld.c b/os/hal/platforms/LPC11xx/pal_lld.c index a78bf973f..b4332e3f9 100644 --- a/os/hal/platforms/LPC11xx/pal_lld.c +++ b/os/hal/platforms/LPC11xx/pal_lld.c @@ -87,7 +87,7 @@ void _pal_lld_init(const PALConfig *config) { */
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
- uint_fast8_t mode) {
+ iomode_t mode) {
switch (mode) {
case PAL_MODE_RESET:
diff --git a/os/hal/platforms/LPC11xx/pal_lld.h b/os/hal/platforms/LPC11xx/pal_lld.h index ef3f41a43..b46362aeb 100644 --- a/os/hal/platforms/LPC11xx/pal_lld.h +++ b/os/hal/platforms/LPC11xx/pal_lld.h @@ -327,7 +327,7 @@ extern "C" { void _pal_lld_init(const PALConfig *config);
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
- uint_fast8_t mode);
+ iomode_t mode);
#ifdef __cplusplus
}
#endif
diff --git a/os/hal/platforms/LPC13xx/pal_lld.c b/os/hal/platforms/LPC13xx/pal_lld.c index 719329160..faaa99567 100644 --- a/os/hal/platforms/LPC13xx/pal_lld.c +++ b/os/hal/platforms/LPC13xx/pal_lld.c @@ -87,7 +87,7 @@ void _pal_lld_init(const PALConfig *config) { */
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
- uint_fast8_t mode) {
+ iomode_t mode) {
switch (mode) {
case PAL_MODE_RESET:
diff --git a/os/hal/platforms/LPC13xx/pal_lld.h b/os/hal/platforms/LPC13xx/pal_lld.h index 1090ca2f5..6e291dfc9 100644 --- a/os/hal/platforms/LPC13xx/pal_lld.h +++ b/os/hal/platforms/LPC13xx/pal_lld.h @@ -327,7 +327,7 @@ extern "C" { void _pal_lld_init(const PALConfig *config);
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
- uint_fast8_t mode);
+ iomode_t mode);
#ifdef __cplusplus
}
#endif
diff --git a/os/hal/platforms/LPC214x/pal_lld.c b/os/hal/platforms/LPC214x/pal_lld.c index 2e503c631..2ba036e20 100644 --- a/os/hal/platforms/LPC214x/pal_lld.c +++ b/os/hal/platforms/LPC214x/pal_lld.c @@ -96,7 +96,7 @@ void _pal_lld_init(const PALConfig *config) { */
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
- uint_fast8_t mode) {
+ iomode_t mode) {
switch (mode) {
case PAL_MODE_RESET:
diff --git a/os/hal/platforms/LPC214x/pal_lld.h b/os/hal/platforms/LPC214x/pal_lld.h index 90ea9cfae..688e687cc 100644 --- a/os/hal/platforms/LPC214x/pal_lld.h +++ b/os/hal/platforms/LPC214x/pal_lld.h @@ -250,7 +250,7 @@ extern "C" { void _pal_lld_init(const PALConfig *config);
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
- uint_fast8_t mode);
+ iomode_t mode);
#ifdef __cplusplus
}
#endif
diff --git a/os/hal/platforms/MSP430/pal_lld.c b/os/hal/platforms/MSP430/pal_lld.c index 073a6af93..aef4d986a 100644 --- a/os/hal/platforms/MSP430/pal_lld.c +++ b/os/hal/platforms/MSP430/pal_lld.c @@ -121,7 +121,7 @@ void _pal_lld_init(const PALConfig *config) { */
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
- uint_fast8_t mode) {
+ iomode_t mode) {
switch (mode) {
case PAL_MODE_RESET:
diff --git a/os/hal/platforms/MSP430/pal_lld.h b/os/hal/platforms/MSP430/pal_lld.h index 1c0bc5900..282ed4e75 100644 --- a/os/hal/platforms/MSP430/pal_lld.h +++ b/os/hal/platforms/MSP430/pal_lld.h @@ -288,7 +288,7 @@ extern "C" { void _pal_lld_init(const PALConfig *config);
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
- uint_fast8_t mode);
+ iomode_t mode);
#ifdef __cplusplus
}
#endif
diff --git a/os/hal/platforms/Posix/pal_lld.c b/os/hal/platforms/Posix/pal_lld.c index c3d88a8fb..675ddc6c2 100644 --- a/os/hal/platforms/Posix/pal_lld.c +++ b/os/hal/platforms/Posix/pal_lld.c @@ -79,7 +79,7 @@ sim_vio_port_t vio_port_2; */
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
- uint_fast8_t mode) {
+ iomode_t mode) {
switch (mode) {
case PAL_MODE_RESET:
diff --git a/os/hal/platforms/Posix/pal_lld.h b/os/hal/platforms/Posix/pal_lld.h index d02b56dec..d76eacf25 100644 --- a/os/hal/platforms/Posix/pal_lld.h +++ b/os/hal/platforms/Posix/pal_lld.h @@ -196,7 +196,7 @@ extern "C" { #endif
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
- uint_fast8_t mode);
+ iomode_t mode);
#ifdef __cplusplus
}
#endif
diff --git a/os/hal/platforms/STM32/pal_lld.c b/os/hal/platforms/STM32/pal_lld.c index c56996db7..a0a1fb6e5 100644 --- a/os/hal/platforms/STM32/pal_lld.c +++ b/os/hal/platforms/STM32/pal_lld.c @@ -132,7 +132,7 @@ void _pal_lld_init(const PALConfig *config) { */
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
- uint_fast8_t mode) {
+ iomode_t mode) {
static const uint8_t cfgtab[] = {
4, /* PAL_MODE_RESET, implemented as input.*/
2, /* PAL_MODE_UNCONNECTED, implemented as push pull output 2MHz.*/
diff --git a/os/hal/platforms/STM32/pal_lld.h b/os/hal/platforms/STM32/pal_lld.h index 53067765a..fe2102637 100644 --- a/os/hal/platforms/STM32/pal_lld.h +++ b/os/hal/platforms/STM32/pal_lld.h @@ -332,7 +332,7 @@ extern "C" { void _pal_lld_init(const PALConfig *config);
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
- uint_fast8_t mode);
+ iomode_t mode);
#ifdef __cplusplus
}
#endif
diff --git a/os/hal/platforms/STM32L1xx/pal_lld.c b/os/hal/platforms/STM32L1xx/pal_lld.c index ee32d5dbc..3637c99ca 100644 --- a/os/hal/platforms/STM32L1xx/pal_lld.c +++ b/os/hal/platforms/STM32L1xx/pal_lld.c @@ -137,55 +137,7 @@ void _pal_lld_init(const PALConfig *config) { */
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
- uint_fast8_t mode) {
-#if 0
- static const uint8_t cfgtab[] = {
- 4, /* PAL_MODE_RESET, implemented as input.*/
- 2, /* PAL_MODE_UNCONNECTED, implemented as push pull output 2MHz.*/
- 4, /* PAL_MODE_INPUT */
- 8, /* PAL_MODE_INPUT_PULLUP */
- 8, /* PAL_MODE_INPUT_PULLDOWN */
- 0, /* PAL_MODE_INPUT_ANALOG */
- 3, /* PAL_MODE_OUTPUT_PUSHPULL, 50MHz.*/
- 7, /* PAL_MODE_OUTPUT_OPENDRAIN, 50MHz.*/
- 8, /* Reserved.*/
- 8, /* Reserved.*/
- 8, /* Reserved.*/
- 8, /* Reserved.*/
- 8, /* Reserved.*/
- 8, /* Reserved.*/
- 8, /* Reserved.*/
- 8, /* Reserved.*/
- 0xB, /* PAL_MODE_STM32_ALTERNATE_PUSHPULL, 50MHz.*/
- 0xF, /* PAL_MODE_STM32_ALTERNATE_OPENDRAIN, 50MHz.*/
- };
- uint32_t mh, ml, crh, crl, cfg;
- unsigned i;
-
- if (mode == PAL_MODE_INPUT_PULLUP)
- port->BSRR = mask;
- else if (mode == PAL_MODE_INPUT_PULLDOWN)
- port->BRR = mask;
- cfg = cfgtab[mode];
- mh = ml = crh = crl = 0;
- for (i = 0; i < 8; i++) {
- ml <<= 4;
- mh <<= 4;
- crl <<= 4;
- crh <<= 4;
- if ((mask & 0x0080) == 0)
- ml |= 0xf;
- else
- crl |= cfg;
- if ((mask & 0x8000) == 0)
- mh |= 0xf;
- else
- crh |= cfg;
- mask <<= 1;
- }
- port->CRH = (port->CRH & mh) | crh;
- port->CRL = (port->CRL & ml) | crl;
-#endif
+ iomode_t mode) {
}
#endif /* HAL_USE_PAL */
diff --git a/os/hal/platforms/STM32L1xx/pal_lld.h b/os/hal/platforms/STM32L1xx/pal_lld.h index 130490fb8..99b4f48f4 100644 --- a/os/hal/platforms/STM32L1xx/pal_lld.h +++ b/os/hal/platforms/STM32L1xx/pal_lld.h @@ -448,7 +448,7 @@ extern "C" { void _pal_lld_init(const PALConfig *config);
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
- uint_fast8_t mode);
+ iomode_t mode);
#ifdef __cplusplus
}
#endif
diff --git a/os/hal/platforms/STM32L1xx/platform.mk b/os/hal/platforms/STM32L1xx/platform.mk index f870811fc..5b46c7389 100644 --- a/os/hal/platforms/STM32L1xx/platform.mk +++ b/os/hal/platforms/STM32L1xx/platform.mk @@ -1,5 +1,6 @@ # List of all the STM32 platform files.
PLATFORMSRC = ${CHIBIOS}/os/hal/platforms/STM32L1xx/hal_lld.c \
+ ${CHIBIOS}/os/hal/platforms/STM32L1xx/pal_lld.c \
${CHIBIOS}/os/hal/platforms/STM32L1xx/stm32_dma.c
# Required include directories
diff --git a/os/hal/platforms/STM8L/pal_lld.c b/os/hal/platforms/STM8L/pal_lld.c index 5480ad28c..40dcdf8d2 100644 --- a/os/hal/platforms/STM8L/pal_lld.c +++ b/os/hal/platforms/STM8L/pal_lld.c @@ -67,7 +67,7 @@ */
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
- uint_fast8_t mode) {
+ iomode_t mode) {
switch (mode) {
case PAL_MODE_RESET:
diff --git a/os/hal/platforms/STM8L/pal_lld.h b/os/hal/platforms/STM8L/pal_lld.h index a8ae458f3..30fef0e82 100644 --- a/os/hal/platforms/STM8L/pal_lld.h +++ b/os/hal/platforms/STM8L/pal_lld.h @@ -244,7 +244,7 @@ extern "C" { #endif
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
- uint_fast8_t mode);
+ iomode_t mode);
#ifdef __cplusplus
}
#endif
diff --git a/os/hal/platforms/STM8S/pal_lld.c b/os/hal/platforms/STM8S/pal_lld.c index 385347c97..cebf349aa 100644 --- a/os/hal/platforms/STM8S/pal_lld.c +++ b/os/hal/platforms/STM8S/pal_lld.c @@ -67,7 +67,7 @@ */
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
- uint_fast8_t mode) {
+ iomode_t mode) {
switch (mode) {
case PAL_MODE_RESET:
diff --git a/os/hal/platforms/STM8S/pal_lld.h b/os/hal/platforms/STM8S/pal_lld.h index 0742c21ef..954a11361 100644 --- a/os/hal/platforms/STM8S/pal_lld.h +++ b/os/hal/platforms/STM8S/pal_lld.h @@ -229,7 +229,7 @@ extern "C" { #endif
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
- uint_fast8_t mode);
+ iomode_t mode);
#ifdef __cplusplus
}
#endif
diff --git a/os/hal/platforms/Win32/pal_lld.c b/os/hal/platforms/Win32/pal_lld.c index b2a83d77f..755d77a09 100644 --- a/os/hal/platforms/Win32/pal_lld.c +++ b/os/hal/platforms/Win32/pal_lld.c @@ -79,7 +79,7 @@ sim_vio_port_t vio_port_2; */
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
- uint_fast8_t mode) {
+ iomode_t mode) {
switch (mode) {
case PAL_MODE_RESET:
diff --git a/os/hal/platforms/Win32/pal_lld.h b/os/hal/platforms/Win32/pal_lld.h index 6ddfcdefd..ad70eeebc 100644 --- a/os/hal/platforms/Win32/pal_lld.h +++ b/os/hal/platforms/Win32/pal_lld.h @@ -196,7 +196,7 @@ extern "C" { #endif
void _pal_lld_setgroupmode(ioportid_t port,
ioportmask_t mask,
- uint_fast8_t mode);
+ iomode_t mode);
#ifdef __cplusplus
}
#endif
|