aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--os/hal/include/adc.h10
-rw-r--r--os/hal/include/can.h18
-rw-r--r--os/hal/include/icu.h10
-rw-r--r--os/hal/include/mac.h5
-rw-r--r--os/hal/include/mii.h6
-rw-r--r--os/hal/include/mmc_spi.h10
-rw-r--r--os/hal/include/pal.h15
-rw-r--r--os/hal/include/pwm.h15
-rw-r--r--os/hal/include/sdc.h20
-rw-r--r--os/hal/include/serial.h32
-rw-r--r--os/hal/include/serial_usb.h7
-rw-r--r--os/hal/include/spi.h15
-rw-r--r--os/hal/include/uart.h23
-rw-r--r--os/hal/include/usb.h21
-rw-r--r--os/hal/include/usb_cdc.h5
-rw-r--r--os/hal/src/sdc.c4
-rw-r--r--os/hal/templates/can_lld.h13
-rw-r--r--os/hal/templates/halconf.h90
-rw-r--r--os/hal/templates/mac_lld.h21
-rw-r--r--todo.txt1
20 files changed, 266 insertions, 75 deletions
diff --git a/os/hal/include/adc.h b/os/hal/include/adc.h
index a236a040a..53c7c199a 100644
--- a/os/hal/include/adc.h
+++ b/os/hal/include/adc.h
@@ -40,6 +40,10 @@
/*===========================================================================*/
/**
+ * @name ADC configuration options
+ * @{
+ */
+/**
* @brief Enables synchronous APIs.
* @note Disabling this option saves both code and data space.
*/
@@ -54,6 +58,7 @@
#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
#define ADC_USE_MUTUAL_EXCLUSION TRUE
#endif
+/** @} */
/*===========================================================================*/
/* Derived constants and error checks. */
@@ -84,6 +89,10 @@ typedef enum {
/* Driver macros. */
/*===========================================================================*/
+/**
+ * @name Low Level driver helper macros
+ * @{
+ */
#if ADC_USE_WAIT || defined(__DOXYGEN__)
/**
* @brief Resumes a thread waiting for a conversion completion.
@@ -211,6 +220,7 @@ typedef enum {
_adc_wakeup_isr(adcp); \
} \
}
+/** @} */
/*===========================================================================*/
/* External declarations. */
diff --git a/os/hal/include/can.h b/os/hal/include/can.h
index 538284b3b..44d2cfb19 100644
--- a/os/hal/include/can.h
+++ b/os/hal/include/can.h
@@ -36,6 +36,10 @@
/*===========================================================================*/
/**
+ * @name CAN status flags
+ * @{
+ */
+/**
* @brief Errors rate warning.
*/
#define CAN_LIMIT_WARNING 1
@@ -55,17 +59,26 @@
* @brief Overflow in receive queue.
*/
#define CAN_OVERFLOW_ERROR 16
+/** @} */
/*===========================================================================*/
/* Driver pre-compile time settings. */
/*===========================================================================*/
/**
+ * @name CAN configuration options
+ * @{
+ */
+/**
* @brief Sleep mode related APIs inclusion switch.
+ * @details This option can only be enabled if the CAN implementation supports
+ * the sleep mode, see the macro @p CAN_SUPPORTS_SLEEP exported by
+ * the underlying implementation.
*/
#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
#define CAN_USE_SLEEP_MODE TRUE
#endif
+/** @} */
/*===========================================================================*/
/* Derived constants and error checks. */
@@ -97,6 +110,10 @@ typedef enum {
/*===========================================================================*/
/**
+ * @name Macro Functions
+ * @{
+ */
+/**
* @brief Adds some flags to the CAN status mask.
*
* @param[in] canp pointer to the @p CANDriver object
@@ -105,6 +122,7 @@ typedef enum {
* @iclass
*/
#define canAddFlagsI(canp, mask) ((canp)->status |= (mask))
+/** @} */
/*===========================================================================*/
/* External declarations. */
diff --git a/os/hal/include/icu.h b/os/hal/include/icu.h
index 38fed2788..65d7794e5 100644
--- a/os/hal/include/icu.h
+++ b/os/hal/include/icu.h
@@ -78,6 +78,10 @@ typedef void (*icucallback_t)(ICUDriver *icup);
/*===========================================================================*/
/**
+ * @name Macro Functions
+ * @{
+ */
+/**
* @brief Enables the input capture.
*
* @param[in] icup pointer to the @p ICUDriver object
@@ -118,8 +122,13 @@ typedef void (*icucallback_t)(ICUDriver *icup);
* @iclass
*/
#define icuGetPeriodI(icup) icu_lld_get_period(icup)
+/** @} */
/**
+ * @name Low Level driver helper macros
+ * @{
+ */
+/**
* @brief Common ISR code, ICU width event.
*
* @param[in] icup pointer to the @p ICUDriver object
@@ -144,6 +153,7 @@ typedef void (*icucallback_t)(ICUDriver *icup);
if (previous_state != ICU_WAITING) \
(icup)->config->period_cb(icup); \
}
+/** @} */
/*===========================================================================*/
/* External declarations. */
diff --git a/os/hal/include/mac.h b/os/hal/include/mac.h
index ad3c7b4dc..37d6bbe9b 100644
--- a/os/hal/include/mac.h
+++ b/os/hal/include/mac.h
@@ -57,6 +57,10 @@
/*===========================================================================*/
/**
+ * @name Macro Functions
+ * @{
+ */
+/**
* @brief Returns the received frames event source.
*
* @param[in] macp pointer to the @p MACDriver object
@@ -98,6 +102,7 @@
*/
#define macReadReceiveDescriptor(rdp, buf, size) \
mac_lld_read_receive_descriptor(rdp, buf, size)
+/** @} */
/*===========================================================================*/
/* External declarations. */
diff --git a/os/hal/include/mii.h b/os/hal/include/mii.h
index 7199ee86d..89ba69810 100644
--- a/os/hal/include/mii.h
+++ b/os/hal/include/mii.h
@@ -18,12 +18,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/*
- * Parts of this file have been borrowed from the Linux include file
- * linux/mii.h:
- * Copyright (C) 1996, 1999, 2001 David S. Miller (davem@redhat.com)
- */
-
/*-*
* @file mii.h
* @brief MII Driver macros and structures.
diff --git a/os/hal/include/mmc_spi.h b/os/hal/include/mmc_spi.h
index 6940ca479..f51bd6765 100644
--- a/os/hal/include/mmc_spi.h
+++ b/os/hal/include/mmc_spi.h
@@ -54,6 +54,10 @@
/*===========================================================================*/
/**
+ * @name MMC_SPI configuration options
+ * @{
+ */
+/**
* @brief Block size for MMC transfers.
*/
#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__)
@@ -86,6 +90,7 @@
#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__)
#define MMC_POLLING_DELAY 10
#endif
+/** @} */
/*===========================================================================*/
/* Derived constants and error checks. */
@@ -182,6 +187,10 @@ typedef struct {
/*===========================================================================*/
/**
+ * @name Macro Functions
+ * @{
+ */
+/**
* @brief Returns the driver state.
*
* @param[in] mmcp pointer to the @p MMCDriver object
@@ -202,6 +211,7 @@ typedef struct {
* @api
*/
#define mmcIsWriteProtected(mmcp) ((mmcp)->is_protected())
+/** @} */
/*===========================================================================*/
/* External declarations. */
diff --git a/os/hal/include/pal.h b/os/hal/include/pal.h
index 2e5b78c03..d844ca8b3 100644
--- a/os/hal/include/pal.h
+++ b/os/hal/include/pal.h
@@ -36,6 +36,10 @@
/*===========================================================================*/
/**
+ * @name Pads mode constants
+ * @{
+ */
+/**
* @brief After reset state.
* @details The state itself is not specified and is architecture dependent,
* it is guaranteed to be equal to the after-reset state. It is
@@ -81,8 +85,13 @@
* @brief Open-drain output pad.
*/
#define PAL_MODE_OUTPUT_OPENDRAIN 7
+/** @} */
/**
+ * @name Logic level constants
+ * @{
+ */
+/**
* @brief Logical low state.
*/
#define PAL_LOW 0
@@ -91,6 +100,7 @@
* @brief Logical high state.
*/
#define PAL_HIGH 1
+/** @} */
/*===========================================================================*/
/* Driver pre-compile time settings. */
@@ -178,6 +188,10 @@ typedef struct {
IOBus name = _IOBUS_DATA(name, port, width, offset)
/**
+ * @name Macro Functions
+ * @{
+ */
+/**
* @brief PAL subsystem initialization.
* @note This function is implicitly invoked by @p halInit(), there is
* no need to explicitly initialize the driver.
@@ -499,6 +513,7 @@ typedef struct {
#else
#define palSetPadMode(port, pad, mode) pal_lld_setpadmode(port, pad, mode)
#endif
+/** @} */
/*===========================================================================*/
/* External declarations. */
diff --git a/os/hal/include/pwm.h b/os/hal/include/pwm.h
index 2ffd3599c..960ac2a69 100644
--- a/os/hal/include/pwm.h
+++ b/os/hal/include/pwm.h
@@ -36,6 +36,10 @@
/*===========================================================================*/
/**
+ * @name PWM output mode macros
+ * @{
+ */
+/**
* @brief Standard output modes mask.
*/
#define PWM_OUTPUT_MASK 0x0F
@@ -54,6 +58,7 @@
* @brief Inverse PWM logic, active is logic level zero.
*/
#define PWM_OUTPUT_ACTIVE_LOW 0x02
+/** @} */
/*===========================================================================*/
/* Driver pre-compile time settings. */
@@ -95,6 +100,10 @@ typedef void (*pwmcallback_t)(PWMDriver *pwmp);
/*===========================================================================*/
/**
+ * @name PWM duty cycle conversion
+ * @{
+ */
+/**
* @brief Converts from fraction to pulse width.
* @note Be careful with rounding errors, this is integer math not magic.
* You can specify tenths of thousandth but make sure you have the
@@ -143,8 +152,13 @@ typedef void (*pwmcallback_t)(PWMDriver *pwmp);
*/
#define PWM_PERCENTAGE_TO_WIDTH(pwmp, percentage) \
PWM_FRACTION_TO_WIDTH(pwmp, 10000, percentage)
+/** @} */
/**
+ * @name Macro Functions
+ * @{
+ */
+/**
* @brief Changes the period the PWM peripheral.
* @details This function changes the period of a PWM unit that has already
* been activated using @p pwmStart().
@@ -197,6 +211,7 @@ typedef void (*pwmcallback_t)(PWMDriver *pwmp);
*/
#define pwmDisableChannelI(pwmp, channel) \
pwm_lld_disable_channel(pwmp, channel)
+/** @} */
/*===========================================================================*/
/* External declarations. */
diff --git a/os/hal/include/sdc.h b/os/hal/include/sdc.h
index afc3a6aba..466c48fa6 100644
--- a/os/hal/include/sdc.h
+++ b/os/hal/include/sdc.h
@@ -42,11 +42,16 @@
*/
#define SDC_CMD8_PATTERN 0x000001AA
+/**
+ * @name SD cart types
+ * @{
+ */
#define SDC_MODE_CARDTYPE_MASK 0xF /**< @brief Card type mask. */
#define SDC_MODE_CARDTYPE_SDV11 0 /**< @brief Card is SD V1.1.*/
#define SDC_MODE_CARDTYPE_SDV20 1 /**< @brief Card is SD V2.0.*/
#define SDC_MODE_CARDTYPE_MMC 2 /**< @brief Card is MMC. */
#define SDC_MODE_HIGH_CAPACITY 0x10 /**< @brief High cap.card. */
+/** @} */
/**
* @brief Mask of error bits in R1 responses.
@@ -88,6 +93,10 @@
/*===========================================================================*/
/**
+ * @name SDC configuration options
+ * @{
+ */
+/**
* @brief Number of initialization attempts before rejecting the card.
* @note Attempts are performed at 10mS intevals.
*/
@@ -113,6 +122,7 @@
#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
#define SDC_NICE_WAITING TRUE
#endif
+/** @} */
/*===========================================================================*/
/* Derived constants and error checks. */
@@ -143,6 +153,10 @@ typedef enum {
/*===========================================================================*/
/**
+ * @name R1 response utilities
+ * @{
+ */
+/**
* @brief Evaluates to @p TRUE if the R1 response contains error flags.
*
* @param[in] r1 the r1 response
@@ -162,8 +176,13 @@ typedef enum {
* @param[in] r1 the r1 response
*/
#define SDC_R1_IS_CARD_LOCKED(r1) (((r1) >> 21) & 1)
+/** @} */
/**
+ * @name Macro Functions
+ * @{
+ */
+/**
* @brief Returns the driver state.
*
* @param[in] sdcp pointer to the @p SDCDriver object
@@ -204,6 +223,7 @@ typedef enum {
* @api
*/
#define sdcIsWriteProtected(sdcp) (sdc_lld_is_write_protected(sdcp))
+/** @} */
/*===========================================================================*/
/* External declarations. */
diff --git a/os/hal/include/serial.h b/os/hal/include/serial.h
index a8c3c1aca..8c610e29e 100644
--- a/os/hal/include/serial.h
+++ b/os/hal/include/serial.h
@@ -35,22 +35,26 @@
/* Driver constants. */
/*===========================================================================*/
-/** @brief Parity error happened.*/
-#define SD_PARITY_ERROR 32
-/** @brief Framing error happened.*/
-#define SD_FRAMING_ERROR 64
-/** @brief Overflow happened.*/
-#define SD_OVERRUN_ERROR 128
-/** @brief Noise on the line.*/
-#define SD_NOISE_ERROR 256
-/** @brief Break detected.*/
-#define SD_BREAK_DETECTED 512
+/**
+ * @name Serial status flags
+ * @{
+ */
+#define SD_PARITY_ERROR 32 /**< @brief Parity error happened. */
+#define SD_FRAMING_ERROR 64 /**< @brief Framing error happened. */
+#define SD_OVERRUN_ERROR 128 /**< @brief Overflow happened. */
+#define SD_NOISE_ERROR 256 /**< @brief Noise on the line. */
+#define SD_BREAK_DETECTED 512 /**< @brief Break detected. */
+/** @} */
/*===========================================================================*/
/* Driver pre-compile time settings. */
/*===========================================================================*/
/**
+ * @name Serial configuration options
+ * @{
+ */
+/**
* @brief Default bit rate.
* @details Configuration parameter, this is the baud rate selected for the
* default configuration.
@@ -69,6 +73,7 @@
#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
#define SERIAL_BUFFERS_SIZE 16
#endif
+/** @} */
/*===========================================================================*/
/* Derived constants and error checks. */
@@ -105,6 +110,8 @@ typedef struct SerialDriver SerialDriver;
_base_asynchronous_channel_methods
/**
+ * @extends BaseAsynchronousChannelVMT
+ *
* @brief @p SerialDriver virtual methods table.
*/
struct SerialDriverVMT {
@@ -129,6 +136,10 @@ struct SerialDriver {
/*===========================================================================*/
/**
+ * @name Macro Functions
+ * @{
+ */
+/**
* @brief Direct output check on a @p SerialDriver.
* @note This function bypasses the indirect access to the channel and
* checks directly the output queue. This is faster but cannot
@@ -281,6 +292,7 @@ struct SerialDriver {
*/
#define sdAsynchronousRead(sdp, b, n) \
chIQReadTimeout(&(sdp)->iqueue, b, n, TIME_IMMEDIATE)
+/** @} */
/*===========================================================================*/
/* External declarations. */
diff --git a/os/hal/include/serial_usb.h b/os/hal/include/serial_usb.h
index 8e518238d..09be9b708 100644
--- a/os/hal/include/serial_usb.h
+++ b/os/hal/include/serial_usb.h
@@ -40,6 +40,10 @@
/*===========================================================================*/
/**
+ * @name SERIAL_USB configuration options
+ * @{
+ */
+/**
* @brief Serial over USB buffers size.
* @details Configuration parameter, the buffer size must be a multiple of
* the USB data endpoint maximum packet size.
@@ -49,6 +53,7 @@
#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
#define SERIAL_USB_BUFFERS_SIZE 64
#endif
+/** @} */
/*===========================================================================*/
/* Derived constants and error checks. */
@@ -119,6 +124,8 @@ typedef struct {
_base_asynchronous_channel_methods
/**
+ * @extends BaseAsynchronousChannelVMT
+ *
* @brief @p SerialDriver virtual methods table.
*/
struct SerialUSBDriverVMT {
diff --git a/os/hal/include/spi.h b/os/hal/include/spi.h
index 104dd9d3e..a07d55cf7 100644
--- a/os/hal/include/spi.h
+++ b/os/hal/include/spi.h
@@ -40,6 +40,10 @@
/*===========================================================================*/
/**
+ * @name SPI configuration options
+ * @{
+ */
+/**
* @brief Enables synchronous APIs.
* @note Disabling this option saves both code and data space.
*/
@@ -54,6 +58,7 @@
#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
#define SPI_USE_MUTUAL_EXCLUSION TRUE
#endif
+/** @} */
/*===========================================================================*/
/* Derived constants and error checks. */
@@ -85,6 +90,10 @@ typedef enum {
/*===========================================================================*/
/**
+ * @name Macro Functions
+ * @{
+ */
+/**
* @brief Asserts the slave select signal and prepares for transfers.
*
* @param[in] spip pointer to the @p SPIDriver object
@@ -201,7 +210,12 @@ typedef enum {
* @return The received data frame from the SPI bus.
*/
#define spiPolledExchange(spip, frame) spi_lld_polled_exchange(spip, frame)
+/** @} */
+/**
+ * @name Low Level driver helper macros
+ * @{
+ */
#if SPI_USE_WAIT || defined(__DOXYGEN__)
/**
* @brief Waits for operation completion.
@@ -268,6 +282,7 @@ typedef enum {
(spip)->state = SPI_READY; \
_spi_wakeup_isr(spip); \
}
+/** @} */
/*===========================================================================*/
/* External declarations. */
diff --git a/os/hal/include/uart.h b/os/hal/include/uart.h
index 148aa6877..6d3d12d5f 100644
--- a/os/hal/include/uart.h
+++ b/os/hal/include/uart.h
@@ -35,18 +35,17 @@
/* Driver constants. */
/*===========================================================================*/
-/** @brief No pending conditions.*/
-#define UART_NO_ERROR 0
-/** @brief Parity error happened.*/
-#define UART_PARITY_ERROR 4
-/** @brief Framing error happened.*/
-#define UART_FRAMING_ERROR 8
-/** @brief Overflow happened.*/
-#define UART_OVERRUN_ERROR 16
-/** @brief Noise on the line.*/
-#define UART_NOISE_ERROR 32
-/** @brief Break detected.*/
-#define UART_BREAK_DETECTED 64
+/**
+ * @name UART status flags
+ * @{
+ */
+#define UART_NO_ERROR 0 /**< @brief No pending conditions. */
+#define UART_PARITY_ERROR 4 /**< @brief Parity error happened. */
+#define UART_FRAMING_ERROR 8 /**< @brief Framing error happened. */
+#define UART_OVERRUN_ERROR 16 /**< @brief Overflow happened. */
+#define UART_NOISE_ERROR 32 /**< @brief Noise on the line. */
+#define UART_BREAK_DETECTED 64 /**< @brief Break detected. */
+/** @} */
/*===========================================================================*/
/* Driver pre-compile time settings. */
diff --git a/os/hal/include/usb.h b/os/hal/include/usb.h
index c4cf68fe2..884b11e8d 100644
--- a/os/hal/include/usb.h
+++ b/os/hal/include/usb.h
@@ -78,6 +78,10 @@
#define USB_LATE_SET_ADDRESS 1
/**
+ * @name Helper macros for USB descriptors
+ * @{
+ */
+/**
* @brief Helper macro for index values into descriptor strings.
*/
#define USB_DESC_INDEX(i) ((uint8_t)(i))
@@ -166,12 +170,17 @@
USB_DESC_BYTE(bmAttributes), \
USB_DESC_WORD(wMaxPacketSize), \
USB_DESC_BYTE(bInterval)
+/** @} */
/**
* @brief Returned by some functions to report a busy endpoint.
*/
#define USB_ENDPOINT_BUSY ((size_t)0xFFFFFFFF)
+/**
+ * @name Endpoint types and settings
+ * @{
+ */
#define USB_EP_MODE_TYPE 0x0003 /**< Endpoint type mask. */
#define USB_EP_MODE_TYPE_CTRL 0x0000 /**< Control endpoint. */
#define USB_EP_MODE_TYPE_ISOC 0x0001 /**< Isochronous endpoint. */
@@ -179,6 +188,7 @@
#define USB_EP_MODE_TYPE_INTR 0x0003 /**< Interrupt endpoint. */
#define USB_EP_MODE_TRANSACTION 0x0000 /**< Transaction mode. */
#define USB_EP_MODE_PACKET 0x0010 /**< Packet mode enabled. */
+/** @} */
/*===========================================================================*/
/* Driver pre-compile time settings. */
@@ -311,6 +321,11 @@ typedef const USBDescriptor * (*usbgetdescriptor_t)(USBDriver *usbp,
/*===========================================================================*/
/* Driver macros. */
/*===========================================================================*/
+
+/**
+ * @name Macro Functions
+ * @{
+ */
/**
* @brief Returns the current frame number.
*
@@ -411,8 +426,13 @@ typedef const USBDescriptor * (*usbgetdescriptor_t)(USBDriver *usbp,
* @special
*/
#define usbReadSetup(usbp, ep, buf) usb_lld_read_setup(usbp, ep, buf)
+/** @} */
/**
+ * @name Low Level driver helper macros
+ * @{
+ */
+/**
* @brief Common ISR code, usb event callback.
*
* @param[in] usbp pointer to the @p USBDriver object
@@ -474,6 +494,7 @@ typedef const USBDescriptor * (*usbgetdescriptor_t)(USBDriver *usbp,
(usbp)->receiving &= ~(1 << (ep)); \
(usbp)->epc[ep]->out_cb(usbp, ep); \
}
+/** @} */
/*===========================================================================*/
/* External declarations. */
diff --git a/os/hal/include/usb_cdc.h b/os/hal/include/usb_cdc.h
index a388f9f70..cd9d78f10 100644
--- a/os/hal/include/usb_cdc.h
+++ b/os/hal/include/usb_cdc.h
@@ -68,6 +68,10 @@
/*===========================================================================*/
/**
+ * @name USB_CDC configuration options
+ * @{
+ */
+/**
* @brief Endpoint number for bulk IN.
*/
#if !defined(DATA_REQUEST_EP) || defined(__DOXYGEN__)
@@ -87,6 +91,7 @@
#if !defined(DATA_AVAILABLE_EP) || defined(__DOXYGEN__)
#define DATA_AVAILABLE_EP 3
#endif
+/** @} */
/*===========================================================================*/
/* Derived constants and error checks. */
diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c
index 59d7db005..6bdaa2b5a 100644
--- a/os/hal/src/sdc.c
+++ b/os/hal/src/sdc.c
@@ -54,7 +54,7 @@
*
* @notapi
*/
-bool_t sdc_wait_for_transfer_state(SDCDriver *sdcp) {
+bool_t _sdc_wait_for_transfer_state(SDCDriver *sdcp) {
uint32_t resp[1];
while (TRUE) {
@@ -314,7 +314,7 @@ bool_t sdcDisconnect(SDCDriver *sdcp) {
chSysUnlock();
/* Waits for eventual pending operations completion.*/
- if (sdc_wait_for_transfer_state(sdcp))
+ if (_sdc_wait_for_transfer_state(sdcp))
return TRUE;
/* Card clock stopped.*/
diff --git a/os/hal/templates/can_lld.h b/os/hal/templates/can_lld.h
index d07bd78cc..d1f8d6044 100644
--- a/os/hal/templates/can_lld.h
+++ b/os/hal/templates/can_lld.h
@@ -45,19 +45,6 @@
/* Driver pre-compile time settings. */
/*===========================================================================*/
-/**
- * @brief Sleep mode related APIs inclusion switch.
- * @note This switch is enforced to @p FALSE if the driver implementation
- * does not support the sleep mode.
- */
-#if CAN_SUPPORTS_SLEEP || defined(__DOXYGEN__)
-#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
-#define CAN_USE_SLEEP_MODE TRUE
-#endif
-#else /* !CAN_SUPPORTS_SLEEP */
-#define CAN_USE_SLEEP_MODE FALSE
-#endif /* !CAN_SUPPORTS_SLEEP */
-
/*===========================================================================*/
/* Derived constants and error checks. */
/*===========================================================================*/
diff --git a/os/hal/templates/halconf.h b/os/hal/templates/halconf.h
index da86f61ed..0e616d3d5 100644
--- a/os/hal/templates/halconf.h
+++ b/os/hal/templates/halconf.h
@@ -35,6 +35,10 @@
#include "mcuconf.h"
/**
+ * @name Drivers enable switches
+ * @{
+ */
+/**
* @brief Enables the PAL subsystem.
*/
#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
@@ -138,9 +142,13 @@
#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
#define HAL_USE_USB TRUE
#endif
+/** @} */
/*===========================================================================*/
-/* ADC driver related settings. */
+/**
+ * @name ADC driver related setting
+ * @{
+ */
/*===========================================================================*/
/**
@@ -158,9 +166,13 @@
#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
#define ADC_USE_MUTUAL_EXCLUSION TRUE
#endif
+/** @} */
/*===========================================================================*/
-/* CAN driver related settings. */
+/**
+ * @name CAN driver related setting
+ * @{
+ */
/*===========================================================================*/
/**
@@ -169,9 +181,13 @@
#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
#define CAN_USE_SLEEP_MODE TRUE
#endif
+/** @} */
/*===========================================================================*/
-/* I2C driver related settings. */
+/**
+ * @name I2C driver related setting
+ * @{
+ */
/*===========================================================================*/
/**
@@ -180,13 +196,21 @@
#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
#define I2C_USE_MUTUAL_EXCLUSION TRUE
#endif
+/** @} */
/*===========================================================================*/
-/* MAC driver related settings. */
+/**
+ * @name MAC driver related setting
+ * @{
+ */
/*===========================================================================*/
+/** @} */
/*===========================================================================*/
-/* MMC_SPI driver related settings. */
+/**
+ * @name MMC_SPI driver related setting
+ * @{
+ */
/*===========================================================================*/
/**
@@ -233,17 +257,29 @@
#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__)
#define MMC_USE_SPI_POLLING TRUE
#endif
+/** @} */
/*===========================================================================*/
-/* PAL driver related settings. */
+/**
+ * @name PAL driver related setting
+ * @{
+ */
/*===========================================================================*/
+/** @} */
/*===========================================================================*/
-/* PWM driver related settings. */
+/**
+ * @name PWM driver related setting
+ * @{
+ */
/*===========================================================================*/
+/** @} */
/*===========================================================================*/
-/* SDC driver related settings. */
+/**
+ * @name SDC driver related setting
+ * @{
+ */
/*===========================================================================*/
/**
* @brief Number of initialization attempts before rejecting the card.
@@ -271,9 +307,13 @@
#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
#define SDC_NICE_WAITING TRUE
#endif
+/** @} */
/*===========================================================================*/
-/* SERIAL driver related settings. */
+/**
+ * @name SERIAL driver related setting
+ * @{
+ */
/*===========================================================================*/
/**
@@ -295,9 +335,32 @@
#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
#define SERIAL_BUFFERS_SIZE 16
#endif
+/** @} */
+
+
+/*===========================================================================*/
+/**
+ * @name SERIAL_USB driver related setting
+ * @{
+ */
+/*===========================================================================*/
+/**
+ * @brief Serial over USB buffers size.
+ * @details Configuration parameter, the buffer size must be a multiple of
+ * the USB data endpoint maximum packet size.
+ * @note The default is 64 bytes for both the transmission and receive
+ * buffers.
+ */
+#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
+#define SERIAL_USB_BUFFERS_SIZE 64
+#endif
+/** @} */
/*===========================================================================*/
-/* SPI driver related settings. */
+/**
+ * @name SPI driver related setting
+ * @{
+ */
/*===========================================================================*/
/**
@@ -315,10 +378,15 @@
#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
#define SPI_USE_MUTUAL_EXCLUSION TRUE
#endif
+/** @} */
/*===========================================================================*/
-/* UART driver related settings. */
+/**
+ * @name UART driver related setting
+ * @{
+ */
/*===========================================================================*/
+/** @} */
#endif /* _HALCONF_H_ */
diff --git a/os/hal/templates/mac_lld.h b/os/hal/templates/mac_lld.h
index e8abe2941..e103128a9 100644
--- a/os/hal/templates/mac_lld.h
+++ b/os/hal/templates/mac_lld.h
@@ -39,27 +39,6 @@
/* Driver pre-compile time settings. */
/*===========================================================================*/
-/**
- * @brief Number of available transmit buffers.
- */
-#if !defined(MAC_TRANSMIT_BUFFERS) || defined(__DOXYGEN__)
-#define MAC_TRANSMIT_BUFFERS 2
-#endif
-
-/**
- * @brief Number of available receive buffers.
- */
-#if !defined(MAC_RECEIVE_BUFFERS) || defined(__DOXYGEN__)
-#define MAC_RECEIVE_BUFFERS 2
-#endif
-
-/**
- * @brief Maximum supported frame size.
- */
-#if !defined(MAC_BUFFERS_SIZE) || defined(__DOXYGEN__)
-#define MAC_BUFFERS_SIZE 1518
-#endif
-
/*===========================================================================*/
/* Derived constants and error checks. */
/*===========================================================================*/
diff --git a/todo.txt b/todo.txt
index 4cd406b16..f64e907cb 100644
--- a/todo.txt
+++ b/todo.txt
@@ -18,6 +18,7 @@ X STM32L support.
X STM32L-Discovery demo and article.
X File System infrastructure.
X STM32F2xx support.
+- MMC_SPI driver revision and speedup.
- Test suite overhaul, the API should be more generic in order to be used
with different subsystems and not just the kernel.
- STM32 USB support for double buffering.