MISRA pass on low level device drivers templates.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7739 35acf78f-673a-0410-8e92-d51de3d6d3f4master
parent
ce7f7103df
commit
b7985b957d
|
@ -190,7 +190,9 @@ void extSetChannelModeI(EXTDriver *extp,
|
||||||
|
|
||||||
/* Note that here the access is enforced as non-const, known access
|
/* Note that here the access is enforced as non-const, known access
|
||||||
violation.*/
|
violation.*/
|
||||||
|
/*lint -save -e9005 [11.8] Known issue, the driver needs rework here.*/
|
||||||
oldcp = (EXTChannelConfig *)&extp->config->channels[channel];
|
oldcp = (EXTChannelConfig *)&extp->config->channels[channel];
|
||||||
|
/*lint -restore*/
|
||||||
|
|
||||||
/* Overwiting the old channels configuration then the channel is reconfigured
|
/* Overwiting the old channels configuration then the channel is reconfigured
|
||||||
by the low level driver.*/
|
by the low level driver.*/
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
|
|
||||||
#if HAL_USE_ADC || defined(__DOXYGEN__)
|
#if (HAL_USE_ADC == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver local definitions. */
|
/* Driver local definitions. */
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief ADC1 driver identifier.
|
* @brief ADC1 driver identifier.
|
||||||
*/
|
*/
|
||||||
#if PLATFORM_ADC_USE_ADC1 || defined(__DOXYGEN__)
|
#if (PLATFORM_ADC_USE_ADC1 == TRUE) || defined(__DOXYGEN__)
|
||||||
ADCDriver ADCD1;
|
ADCDriver ADCD1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -64,10 +64,10 @@ ADCDriver ADCD1;
|
||||||
*/
|
*/
|
||||||
void adc_lld_init(void) {
|
void adc_lld_init(void) {
|
||||||
|
|
||||||
#if PLATFORM_ADC_USE_ADC1
|
#if PLATFORM_ADC_USE_ADC1 == TRUE
|
||||||
/* Driver initialization.*/
|
/* Driver initialization.*/
|
||||||
adcObjectInit(&ADCD1);
|
adcObjectInit(&ADCD1);
|
||||||
#endif /* PLATFORM_ADC_USE_ADC1 */
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -81,11 +81,11 @@ void adc_lld_start(ADCDriver *adcp) {
|
||||||
|
|
||||||
if (adcp->state == ADC_STOP) {
|
if (adcp->state == ADC_STOP) {
|
||||||
/* Enables the peripheral.*/
|
/* Enables the peripheral.*/
|
||||||
#if PLATFORM_ADC_USE_ADC1
|
#if PLATFORM_ADC_USE_ADC1 == TRUE
|
||||||
if (&ADCD1 == adcp) {
|
if (&ADCD1 == adcp) {
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* PLATFORM_ADC_USE_ADC1 */
|
#endif
|
||||||
}
|
}
|
||||||
/* Configures the peripheral.*/
|
/* Configures the peripheral.*/
|
||||||
|
|
||||||
|
@ -104,11 +104,11 @@ void adc_lld_stop(ADCDriver *adcp) {
|
||||||
/* Resets the peripheral.*/
|
/* Resets the peripheral.*/
|
||||||
|
|
||||||
/* Disables the peripheral.*/
|
/* Disables the peripheral.*/
|
||||||
#if PLATFORM_ADC_USE_ADC1
|
#if PLATFORM_ADC_USE_ADC1 == TRUE
|
||||||
if (&ADCD1 == adcp) {
|
if (&ADCD1 == adcp) {
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* PLATFORM_ADC_USE_ADC1 */
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,6 +136,6 @@ void adc_lld_stop_conversion(ADCDriver *adcp) {
|
||||||
(void)adcp;
|
(void)adcp;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAL_USE_ADC */
|
#endif /* HAL_USE_ADC == TRUE */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#ifndef _ADC_LLD_H_
|
#ifndef _ADC_LLD_H_
|
||||||
#define _ADC_LLD_H_
|
#define _ADC_LLD_H_
|
||||||
|
|
||||||
#if HAL_USE_ADC || defined(__DOXYGEN__)
|
#if (HAL_USE_ADC == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver constants. */
|
/* Driver constants. */
|
||||||
|
@ -162,18 +162,18 @@ struct ADCDriver {
|
||||||
* @brief Current conversion group pointer or @p NULL.
|
* @brief Current conversion group pointer or @p NULL.
|
||||||
*/
|
*/
|
||||||
const ADCConversionGroup *grpp;
|
const ADCConversionGroup *grpp;
|
||||||
#if ADC_USE_WAIT || defined(__DOXYGEN__)
|
#if (ADC_USE_WAIT == TRUE) || defined(__DOXYGEN__)
|
||||||
/**
|
/**
|
||||||
* @brief Waiting thread.
|
* @brief Waiting thread.
|
||||||
*/
|
*/
|
||||||
thread_reference_t thread;
|
thread_reference_t thread;
|
||||||
#endif
|
#endif
|
||||||
#if ADC_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
#if (ADC_USE_MUTUAL_EXCLUSION == TRUE) || defined(__DOXYGEN__)
|
||||||
/**
|
/**
|
||||||
* @brief Mutex protecting the peripheral.
|
* @brief Mutex protecting the peripheral.
|
||||||
*/
|
*/
|
||||||
mutex_t mutex;
|
mutex_t mutex;
|
||||||
#endif /* ADC_USE_MUTUAL_EXCLUSION */
|
#endif
|
||||||
#if defined(ADC_DRIVER_EXT_FIELDS)
|
#if defined(ADC_DRIVER_EXT_FIELDS)
|
||||||
ADC_DRIVER_EXT_FIELDS
|
ADC_DRIVER_EXT_FIELDS
|
||||||
#endif
|
#endif
|
||||||
|
@ -188,7 +188,7 @@ struct ADCDriver {
|
||||||
/* External declarations. */
|
/* External declarations. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#if PLATFORM_ADC_USE_ADC1 && !defined(__DOXYGEN__)
|
#if (PLATFORM_ADC_USE_ADC1 == TRUE) && !defined(__DOXYGEN__)
|
||||||
extern ADCDriver ADCD1;
|
extern ADCDriver ADCD1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -204,7 +204,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* HAL_USE_ADC */
|
#endif /* HAL_USE_ADC == TRUE */
|
||||||
|
|
||||||
#endif /* _ADC_LLD_H_ */
|
#endif /* _ADC_LLD_H_ */
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
|
|
||||||
#if HAL_USE_CAN || defined(__DOXYGEN__)
|
#if (HAL_USE_CAN == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver local definitions. */
|
/* Driver local definitions. */
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief CAN1 driver identifier.
|
* @brief CAN1 driver identifier.
|
||||||
*/
|
*/
|
||||||
#if PLATFORM_CAN_USE_CAN1 || defined(__DOXYGEN__)
|
#if (PLATFORM_CAN_USE_CAN1 == TRUE) || defined(__DOXYGEN__)
|
||||||
CANDriver CAND1;
|
CANDriver CAND1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -64,10 +64,10 @@ CANDriver CAND1;
|
||||||
*/
|
*/
|
||||||
void can_lld_init(void) {
|
void can_lld_init(void) {
|
||||||
|
|
||||||
#if PLATFORM_CAN_USE_CAN1
|
#if PLATFORM_CAN_USE_CAN1 == TRUE
|
||||||
/* Driver initialization.*/
|
/* Driver initialization.*/
|
||||||
canObjectInit(&CAND1);
|
canObjectInit(&CAND1);
|
||||||
#endif /* PLATFORM_CAN_USE_CAN1 */
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -81,11 +81,11 @@ void can_lld_start(CANDriver *canp) {
|
||||||
|
|
||||||
if (canp->state == CAN_STOP) {
|
if (canp->state == CAN_STOP) {
|
||||||
/* Enables the peripheral.*/
|
/* Enables the peripheral.*/
|
||||||
#if PLATFORM_CAN_USE_CAN1
|
#if PLATFORM_CAN_USE_CAN1 == TRUE
|
||||||
if (&CAND1 == canp) {
|
if (&CAND1 == canp) {
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* PLATFORM_CAN_USE_CAN1 */
|
#endif
|
||||||
}
|
}
|
||||||
/* Configures the peripheral.*/
|
/* Configures the peripheral.*/
|
||||||
|
|
||||||
|
@ -104,11 +104,11 @@ void can_lld_stop(CANDriver *canp) {
|
||||||
/* Resets the peripheral.*/
|
/* Resets the peripheral.*/
|
||||||
|
|
||||||
/* Disables the peripheral.*/
|
/* Disables the peripheral.*/
|
||||||
#if PLATFORM_CAN_USE_CAN1
|
#if PLATFORM_CAN_USE_CAN1 == TRUE
|
||||||
if (&CAND1 == canp) {
|
if (&CAND1 == canp) {
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* PLATFORM_CAN_USE_CAN1 */
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,15 +130,15 @@ bool can_lld_is_tx_empty(CANDriver *canp, canmbx_t mailbox) {
|
||||||
|
|
||||||
switch (mailbox) {
|
switch (mailbox) {
|
||||||
case CAN_ANY_MAILBOX:
|
case CAN_ANY_MAILBOX:
|
||||||
return FALSE;
|
return false;
|
||||||
case 1:
|
case 1:
|
||||||
return FALSE;
|
return false;
|
||||||
case 2:
|
case 2:
|
||||||
return FALSE;
|
return false;
|
||||||
case 3:
|
case 3:
|
||||||
return FALSE;
|
return false;
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,13 +180,13 @@ bool can_lld_is_rx_nonempty(CANDriver *canp, canmbx_t mailbox) {
|
||||||
|
|
||||||
switch (mailbox) {
|
switch (mailbox) {
|
||||||
case CAN_ANY_MAILBOX:
|
case CAN_ANY_MAILBOX:
|
||||||
return FALSE;
|
return false;
|
||||||
case 1:
|
case 1:
|
||||||
return FALSE;
|
return false;
|
||||||
case 2:
|
case 2:
|
||||||
return FALSE;
|
return false;
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,7 +209,7 @@ void can_lld_receive(CANDriver *canp,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CAN_USE_SLEEP_MODE || defined(__DOXYGEN__)
|
#if (CAN_USE_SLEEP_MODE == TRUE) || defined(__DOXYGEN__)
|
||||||
/**
|
/**
|
||||||
* @brief Enters the sleep mode.
|
* @brief Enters the sleep mode.
|
||||||
*
|
*
|
||||||
|
@ -235,8 +235,8 @@ void can_lld_wakeup(CANDriver *canp) {
|
||||||
(void)canp;
|
(void)canp;
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* CAN_USE_SLEEP_MODE */
|
#endif /* CAN_USE_SLEEP_MOD == TRUEE */
|
||||||
|
|
||||||
#endif /* HAL_USE_CAN */
|
#endif /* HAL_USE_CAN == TRUE */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#ifndef _CAN_LLD_H_
|
#ifndef _CAN_LLD_H_
|
||||||
#define _CAN_LLD_H_
|
#define _CAN_LLD_H_
|
||||||
|
|
||||||
#if HAL_USE_CAN || defined(__DOXYGEN__)
|
#if (HAL_USE_CAN == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver constants. */
|
/* Driver constants. */
|
||||||
|
@ -52,6 +52,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief CAN1 driver enable switch.
|
* @brief CAN1 driver enable switch.
|
||||||
* @details If set to @p TRUE the support for CAN1 is included.
|
* @details If set to @p TRUE the support for CAN1 is included.
|
||||||
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(PLATFORM_CAN_USE_CAN1) || defined(__DOXYGEN__)
|
#if !defined(PLATFORM_CAN_USE_CAN1) || defined(__DOXYGEN__)
|
||||||
#define PLATFORM_CAN_USE_CAN1 FALSE
|
#define PLATFORM_CAN_USE_CAN1 FALSE
|
||||||
|
@ -77,19 +78,16 @@ typedef uint32_t canmbx_t;
|
||||||
* machine data endianness, it can be still useful for a quick filling.
|
* machine data endianness, it can be still useful for a quick filling.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
struct {
|
/*lint -save -e46 [6.1] Standard types are fine too.*/
|
||||||
uint8_t DLC:4; /**< @brief Data length. */
|
uint8_t DLC:4; /**< @brief Data length. */
|
||||||
uint8_t RTR:1; /**< @brief Frame type. */
|
uint8_t RTR:1; /**< @brief Frame type. */
|
||||||
uint8_t IDE:1; /**< @brief Identifier type. */
|
uint8_t IDE:1; /**< @brief Identifier type. */
|
||||||
};
|
|
||||||
union {
|
union {
|
||||||
struct {
|
uint32_t SID:11; /**< @brief Standard identifier.*/
|
||||||
uint32_t SID:11; /**< @brief Standard identifier.*/
|
uint32_t EID:29; /**< @brief Extended identifier.*/
|
||||||
};
|
uint32_t _align1;
|
||||||
struct {
|
|
||||||
uint32_t EID:29; /**< @brief Extended identifier.*/
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
/*lint -restore*/
|
||||||
union {
|
union {
|
||||||
uint8_t data8[8]; /**< @brief Frame data. */
|
uint8_t data8[8]; /**< @brief Frame data. */
|
||||||
uint16_t data16[4]; /**< @brief Frame data. */
|
uint16_t data16[4]; /**< @brief Frame data. */
|
||||||
|
@ -103,23 +101,18 @@ typedef struct {
|
||||||
* machine data endianness, it can be still useful for a quick filling.
|
* machine data endianness, it can be still useful for a quick filling.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
struct {
|
/*lint -save -e46 [6.1] Standard types are fine too.*/
|
||||||
uint8_t FMI; /**< @brief Filter id. */
|
uint8_t FMI; /**< @brief Filter id. */
|
||||||
uint16_t TIME; /**< @brief Time stamp. */
|
uint16_t TIME; /**< @brief Time stamp. */
|
||||||
};
|
uint8_t DLC:4; /**< @brief Data length. */
|
||||||
struct {
|
uint8_t RTR:1; /**< @brief Frame type. */
|
||||||
uint8_t DLC:4; /**< @brief Data length. */
|
uint8_t IDE:1; /**< @brief Identifier type. */
|
||||||
uint8_t RTR:1; /**< @brief Frame type. */
|
|
||||||
uint8_t IDE:1; /**< @brief Identifier type. */
|
|
||||||
};
|
|
||||||
union {
|
union {
|
||||||
struct {
|
uint32_t SID:11; /**< @brief Standard identifier.*/
|
||||||
uint32_t SID:11; /**< @brief Standard identifier.*/
|
uint32_t EID:29; /**< @brief Extended identifier.*/
|
||||||
};
|
uint32_t _align1;
|
||||||
struct {
|
|
||||||
uint32_t EID:29; /**< @brief Extended identifier.*/
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
/*lint -restore*/
|
||||||
union {
|
union {
|
||||||
uint8_t data8[8]; /**< @brief Frame data. */
|
uint8_t data8[8]; /**< @brief Frame data. */
|
||||||
uint16_t data16[4]; /**< @brief Frame data. */
|
uint16_t data16[4]; /**< @brief Frame data. */
|
||||||
|
@ -181,7 +174,7 @@ typedef struct {
|
||||||
* error(s) that have occurred.
|
* error(s) that have occurred.
|
||||||
*/
|
*/
|
||||||
event_source_t error_event;
|
event_source_t error_event;
|
||||||
#if CAN_USE_SLEEP_MODE || defined (__DOXYGEN__)
|
#if (CAN_USE_SLEEP_MODE == TRUE) || defined (__DOXYGEN__)
|
||||||
/**
|
/**
|
||||||
* @brief Entering sleep state event.
|
* @brief Entering sleep state event.
|
||||||
*/
|
*/
|
||||||
|
@ -190,7 +183,7 @@ typedef struct {
|
||||||
* @brief Exiting sleep state event.
|
* @brief Exiting sleep state event.
|
||||||
*/
|
*/
|
||||||
event_source_t wakeup_event;
|
event_source_t wakeup_event;
|
||||||
#endif /* CAN_USE_SLEEP_MODE */
|
#endif
|
||||||
/* End of the mandatory fields.*/
|
/* End of the mandatory fields.*/
|
||||||
} CANDriver;
|
} CANDriver;
|
||||||
|
|
||||||
|
@ -202,7 +195,7 @@ typedef struct {
|
||||||
/* External declarations. */
|
/* External declarations. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#if PLATFORM_CAN_USE_CAN1 && !defined(__DOXYGEN__)
|
#if (PLATFORM_CAN_USE_CAN1 == TRUE) && !defined(__DOXYGEN__)
|
||||||
extern CANDriver CAND1;
|
extern CANDriver CAND1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -215,20 +208,20 @@ extern "C" {
|
||||||
bool can_lld_is_tx_empty(CANDriver *canp, canmbx_t mailbox);
|
bool can_lld_is_tx_empty(CANDriver *canp, canmbx_t mailbox);
|
||||||
void can_lld_transmit(CANDriver *canp,
|
void can_lld_transmit(CANDriver *canp,
|
||||||
canmbx_t mailbox,
|
canmbx_t mailbox,
|
||||||
const CANTxFrame *crfp);
|
const CANTxFrame *ctfp);
|
||||||
bool can_lld_is_rx_nonempty(CANDriver *canp, canmbx_t mailbox);
|
bool can_lld_is_rx_nonempty(CANDriver *canp, canmbx_t mailbox);
|
||||||
void can_lld_receive(CANDriver *canp,
|
void can_lld_receive(CANDriver *canp,
|
||||||
canmbx_t mailbox,
|
canmbx_t mailbox,
|
||||||
CANRxFrame *ctfp);
|
CANRxFrame *crfp);
|
||||||
#if CAN_USE_SLEEP_MODE
|
#if CAN_USE_SLEEP_MODE == TRUE
|
||||||
void can_lld_sleep(CANDriver *canp);
|
void can_lld_sleep(CANDriver *canp);
|
||||||
void can_lld_wakeup(CANDriver *canp);
|
void can_lld_wakeup(CANDriver *canp);
|
||||||
#endif /* CAN_USE_SLEEP_MODE */
|
#endif
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* HAL_USE_CAN */
|
#endif /* HAL_USE_CAN == TRUE */
|
||||||
|
|
||||||
#endif /* _CAN_LLD_H_ */
|
#endif /* _CAN_LLD_H_ */
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
|
|
||||||
#if HAL_USE_EXT || defined(__DOXYGEN__)
|
#if (HAL_USE_EXT == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver local definitions. */
|
/* Driver local definitions. */
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief EXT1 driver identifier.
|
* @brief EXT1 driver identifier.
|
||||||
*/
|
*/
|
||||||
#if PLATFORM_EXT_USE_EXT1 || defined(__DOXYGEN__)
|
#if (PLATFORM_EXT_USE_EXT1 == TRUE) || defined(__DOXYGEN__)
|
||||||
EXTDriver EXTD1;
|
EXTDriver EXTD1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -64,10 +64,10 @@ EXTDriver EXTD1;
|
||||||
*/
|
*/
|
||||||
void ext_lld_init(void) {
|
void ext_lld_init(void) {
|
||||||
|
|
||||||
#if PLATFORM_EXT_USE_EXT1
|
#if PLATFORM_EXT_USE_EXT1 == TRUE
|
||||||
/* Driver initialization.*/
|
/* Driver initialization.*/
|
||||||
extObjectInit(&EXTD1);
|
extObjectInit(&EXTD1);
|
||||||
#endif /* PLATFORM_EXT_USE_EXT1 */
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -81,11 +81,11 @@ void ext_lld_start(EXTDriver *extp) {
|
||||||
|
|
||||||
if (extp->state == EXT_STOP) {
|
if (extp->state == EXT_STOP) {
|
||||||
/* Enables the peripheral.*/
|
/* Enables the peripheral.*/
|
||||||
#if PLATFORM_EXT_USE_EXT1
|
#if PLATFORM_EXT_USE_EXT1 == TRUE
|
||||||
if (&EXTD1 == extp) {
|
if (&EXTD1 == extp) {
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* PLATFORM_EXT_USE_EXT1 */
|
#endif
|
||||||
}
|
}
|
||||||
/* Configures the peripheral.*/
|
/* Configures the peripheral.*/
|
||||||
|
|
||||||
|
@ -104,11 +104,11 @@ void ext_lld_stop(EXTDriver *extp) {
|
||||||
/* Resets the peripheral.*/
|
/* Resets the peripheral.*/
|
||||||
|
|
||||||
/* Disables the peripheral.*/
|
/* Disables the peripheral.*/
|
||||||
#if PLATFORM_EXT_USE_EXT1
|
#if PLATFORM_EXT_USE_EXT1 == TRUE
|
||||||
if (&EXTD1 == extp) {
|
if (&EXTD1 == extp) {
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* PLATFORM_EXT_USE_EXT1 */
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,6 +142,6 @@ void ext_lld_channel_disable(EXTDriver *extp, expchannel_t channel) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAL_USE_EXT */
|
#endif /* HAL_USE_EXT == TRUE */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#ifndef _EXT_LLD_H_
|
#ifndef _EXT_LLD_H_
|
||||||
#define _EXT_LLD_H_
|
#define _EXT_LLD_H_
|
||||||
|
|
||||||
#if HAL_USE_EXT || defined(__DOXYGEN__)
|
#if (HAL_USE_EXT == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver constants. */
|
/* Driver constants. */
|
||||||
|
@ -47,6 +47,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief EXT driver enable switch.
|
* @brief EXT driver enable switch.
|
||||||
* @details If set to @p TRUE the support for EXT1 is included.
|
* @details If set to @p TRUE the support for EXT1 is included.
|
||||||
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(PLATFORM_EXT_USE_EXT1) || defined(__DOXYGEN__)
|
#if !defined(PLATFORM_EXT_USE_EXT1) || defined(__DOXYGEN__)
|
||||||
#define PLATFORM_EXT_USE_EXT1 FALSE
|
#define PLATFORM_EXT_USE_EXT1 FALSE
|
||||||
|
@ -126,7 +127,7 @@ struct EXTDriver {
|
||||||
/* External declarations. */
|
/* External declarations. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#if PLATFORM_EXT_USE_EXT1 && !defined(__DOXYGEN__)
|
#if (PLATFORM_EXT_USE_EXT1 == TRUE) && !defined(__DOXYGEN__)
|
||||||
extern EXTDriver EXTD1;
|
extern EXTDriver EXTD1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -142,7 +143,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* HAL_USE_EXT */
|
#endif /* HAL_USE_EXT == TRUE */
|
||||||
|
|
||||||
#endif /* _EXT_LLD_H_ */
|
#endif /* _EXT_LLD_H_ */
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
|
|
||||||
#if HAL_USE_GPT || defined(__DOXYGEN__)
|
#if (HAL_USE_GPT == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver local definitions. */
|
/* Driver local definitions. */
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief GPTD1 driver identifier.
|
* @brief GPTD1 driver identifier.
|
||||||
*/
|
*/
|
||||||
#if PLATFORM_GPT_USE_GPT1 || defined(__DOXYGEN__)
|
#if (PLATFORM_GPT_USE_GPT1 == TRUE) || defined(__DOXYGEN__)
|
||||||
GPTDriver GPTD1;
|
GPTDriver GPTD1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ GPTDriver GPTD1;
|
||||||
*/
|
*/
|
||||||
void gpt_lld_init(void) {
|
void gpt_lld_init(void) {
|
||||||
|
|
||||||
#if PLATFORM2_GPT_USE_TIM1
|
#if PLATFORM_GPT_USE_GPT1 == TRUE
|
||||||
/* Driver initialization.*/
|
/* Driver initialization.*/
|
||||||
gptObjectInit(&GPTD1);
|
gptObjectInit(&GPTD1);
|
||||||
#endif
|
#endif
|
||||||
|
@ -81,11 +81,11 @@ void gpt_lld_start(GPTDriver *gptp) {
|
||||||
|
|
||||||
if (gptp->state == GPT_STOP) {
|
if (gptp->state == GPT_STOP) {
|
||||||
/* Enables the peripheral.*/
|
/* Enables the peripheral.*/
|
||||||
#if PLATFORM_GPT_USE_GPT1
|
#if PLATFORM_GPT_USE_GPT1 == TRUE
|
||||||
if (&GPTD1 == gptp) {
|
if (&GPTD1 == gptp) {
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* PLATFORM_GPT_USE_GPT1 */
|
#endif
|
||||||
}
|
}
|
||||||
/* Configures the peripheral.*/
|
/* Configures the peripheral.*/
|
||||||
|
|
||||||
|
@ -104,11 +104,11 @@ void gpt_lld_stop(GPTDriver *gptp) {
|
||||||
/* Resets the peripheral.*/
|
/* Resets the peripheral.*/
|
||||||
|
|
||||||
/* Disables the peripheral.*/
|
/* Disables the peripheral.*/
|
||||||
#if PLATFORM_GPT_USE_GPT1
|
#if PLATFORM_GPT_USE_GPT1 == TRUE
|
||||||
if (&GPTD1 == gptp) {
|
if (&GPTD1 == gptp) {
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* PLATFORM_GPT_USE_GPT1 */
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,6 +158,6 @@ void gpt_lld_polled_delay(GPTDriver *gptp, gptcnt_t interval) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAL_USE_GPT */
|
#endif /* HAL_USE_GPT == TRUE */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#ifndef _GPT_LLD_H_
|
#ifndef _GPT_LLD_H_
|
||||||
#define _GPT_LLD_H_
|
#define _GPT_LLD_H_
|
||||||
|
|
||||||
#if HAL_USE_GPT || defined(__DOXYGEN__)
|
#if (HAL_USE_GPT == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver constants. */
|
/* Driver constants. */
|
||||||
|
@ -42,10 +42,10 @@
|
||||||
/**
|
/**
|
||||||
* @brief GPTD1 driver enable switch.
|
* @brief GPTD1 driver enable switch.
|
||||||
* @details If set to @p TRUE the support for GPTD1 is included.
|
* @details If set to @p TRUE the support for GPTD1 is included.
|
||||||
* @note The default is @p TRUE.
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(STM32_GPT_USE_TIM1) || defined(__DOXYGEN__)
|
#if !defined(PLATFORM_GPT_USE_GPT1) || defined(__DOXYGEN__)
|
||||||
#define STM32_GPT_USE_TIM1 FALSE
|
#define PLATFORM_GPT_USE_GPT1 FALSE
|
||||||
#endif
|
#endif
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
@ -130,23 +130,24 @@ struct GPTDriver {
|
||||||
/* External declarations. */
|
/* External declarations. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#if STM32_GPT_USE_TIM1 && !defined(__DOXYGEN__)
|
#if (PLATFORM_GPT_USE_GPT1 == TRUE) && !defined(__DOXYGEN__)
|
||||||
extern GPTDriver GPTD1;
|
extern GPTDriver GPTD1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
void gpt_lld_init(void);
|
void gpt_lld_init(void);
|
||||||
void gpt_lld_start(GPTDriver *gptp);
|
void gpt_lld_start(GPTDriver *gptp);
|
||||||
void gpt_lld_stop(GPTDriver *gptp);
|
void gpt_lld_stop(GPTDriver *gptp);
|
||||||
void gpt_lld_start_timer(GPTDriver *gptp, gptcnt_t period);
|
void gpt_lld_start_timer(GPTDriver *gptp, gptcnt_t interval);
|
||||||
void gpt_lld_stop_timer(GPTDriver *gptp);
|
void gpt_lld_stop_timer(GPTDriver *gptp);
|
||||||
void gpt_lld_polled_delay(GPTDriver *gptp, gptcnt_t interval);
|
void gpt_lld_polled_delay(GPTDriver *gptp, gptcnt_t interval);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* HAL_USE_GPT */
|
#endif /* HAL_USE_GPT == TRUE */
|
||||||
|
|
||||||
#endif /* _GPT_LLD_H_ */
|
#endif /* _GPT_LLD_H_ */
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
|
|
||||||
#if HAL_USE_I2C || defined(__DOXYGEN__)
|
#if (HAL_USE_I2C == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver local definitions. */
|
/* Driver local definitions. */
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief I2C1 driver identifier.
|
* @brief I2C1 driver identifier.
|
||||||
*/
|
*/
|
||||||
#if PLATFORM_I2C_USE_I2C1 || defined(__DOXYGEN__)
|
#if (PLATFORM_I2C_USE_I2C1 == TRUE) || defined(__DOXYGEN__)
|
||||||
I2CDriver I2CD1;
|
I2CDriver I2CD1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -64,9 +64,9 @@ I2CDriver I2CD1;
|
||||||
*/
|
*/
|
||||||
void i2c_lld_init(void) {
|
void i2c_lld_init(void) {
|
||||||
|
|
||||||
#if PLATFORM_I2C_USE_I2C1
|
#if PLATFORM_I2C_USE_I2C1 == TRUE
|
||||||
i2cObjectInit(&I2CD1);
|
i2cObjectInit(&I2CD1);
|
||||||
#endif /* PLATFORM_I2C_USE_I2C1 */
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -80,11 +80,11 @@ void i2c_lld_start(I2CDriver *i2cp) {
|
||||||
|
|
||||||
if (i2cp->state == I2C_STOP) {
|
if (i2cp->state == I2C_STOP) {
|
||||||
/* Enables the peripheral.*/
|
/* Enables the peripheral.*/
|
||||||
#if PLATFORM_I2C_USE_I2C1
|
#if PLATFORM_I2C_USE_I2C1 == TRUE
|
||||||
if (&I2CD1 == i2cp) {
|
if (&I2CD1 == i2cp) {
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* PLATFORM_I2C_USE_I2C1 */
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -101,11 +101,11 @@ void i2c_lld_stop(I2CDriver *i2cp) {
|
||||||
if (i2cp->state != I2C_STOP) {
|
if (i2cp->state != I2C_STOP) {
|
||||||
|
|
||||||
/* Disables the peripheral.*/
|
/* Disables the peripheral.*/
|
||||||
#if PLATFORM_I2C_USE_I2C1
|
#if PLATFORM_I2C_USE_I2C1 == TRUE
|
||||||
if (&I2CD1 == i2cp) {
|
if (&I2CD1 == i2cp) {
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* PLATFORM_I2C_USE_I2C1 */
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,6 +182,6 @@ msg_t i2c_lld_master_transmit_timeout(I2CDriver *i2cp, i2caddr_t addr,
|
||||||
return MSG_OK;
|
return MSG_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAL_USE_I2C */
|
#endif /* HAL_USE_I2C == TRUE */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#ifndef _I2C_LLD_H_
|
#ifndef _I2C_LLD_H_
|
||||||
#define _I2C_LLD_H_
|
#define _I2C_LLD_H_
|
||||||
|
|
||||||
#if HAL_USE_I2C || defined(__DOXYGEN__)
|
#if (HAL_USE_I2C == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver constants. */
|
/* Driver constants. */
|
||||||
|
@ -98,9 +98,9 @@ struct I2CDriver {
|
||||||
* @brief Error flags.
|
* @brief Error flags.
|
||||||
*/
|
*/
|
||||||
i2cflags_t errors;
|
i2cflags_t errors;
|
||||||
#if I2C_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
#if (I2C_USE_MUTUAL_EXCLUSION == TRUE) || defined(__DOXYGEN__)
|
||||||
mutex_t mutex;
|
mutex_t mutex;
|
||||||
#endif /* I2C_USE_MUTUAL_EXCLUSION */
|
#endif
|
||||||
#if defined(I2C_DRIVER_EXT_FIELDS)
|
#if defined(I2C_DRIVER_EXT_FIELDS)
|
||||||
I2C_DRIVER_EXT_FIELDS
|
I2C_DRIVER_EXT_FIELDS
|
||||||
#endif
|
#endif
|
||||||
|
@ -124,11 +124,9 @@ struct I2CDriver {
|
||||||
/* External declarations. */
|
/* External declarations. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#if !defined(__DOXYGEN__)
|
#if (PLATFORM_I2C_USE_I2C1 == TRUE) && !defined(__DOXYGEN__)
|
||||||
#if PLATFORM_I2C_USE_I2C1
|
|
||||||
extern I2CDriver I2CD1;
|
extern I2CDriver I2CD1;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -147,7 +145,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* HAL_USE_I2C */
|
#endif /* HAL_USE_I2C == TRUE */
|
||||||
|
|
||||||
#endif /* _I2C_LLD_H_ */
|
#endif /* _I2C_LLD_H_ */
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#ifndef _I2S_LLD_H_
|
#ifndef _I2S_LLD_H_
|
||||||
#define _I2S_LLD_H_
|
#define _I2S_LLD_H_
|
||||||
|
|
||||||
#if HAL_USE_I2S || defined(__DOXYGEN__)
|
#if (HAL_USE_I2S == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver constants. */
|
/* Driver constants. */
|
||||||
|
@ -40,9 +40,9 @@
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @brief I2S2 driver enable switch.
|
* @brief I2SD1 driver enable switch.
|
||||||
* @details If set to @p TRUE the support for I2S2 is included.
|
* @details If set to @p TRUE the support for I2S1 is included.
|
||||||
* @note The default is @p TRUE.
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(PLATFORM_I2S_USE_I2S1) || defined(__DOXYGEN__)
|
#if !defined(PLATFORM_I2S_USE_I2S1) || defined(__DOXYGEN__)
|
||||||
#define PLATFORM_I2S_USE_I2S1 FALSE
|
#define PLATFORM_I2S_USE_I2S1 FALSE
|
||||||
|
@ -120,7 +120,7 @@ struct I2SDriver {
|
||||||
/* External declarations. */
|
/* External declarations. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#if PLATFORM_I2S_USE_I2S1 && !defined(__DOXYGEN__)
|
#if (PLATFORM_I2S_USE_I2S1 == TRUE) && !defined(__DOXYGEN__)
|
||||||
extern I2SDriver I2SD1;
|
extern I2SDriver I2SD1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* HAL_USE_I2S */
|
#endif /* HAL_USE_I2S == TRUE */
|
||||||
|
|
||||||
#endif /* _I2S_LLD_H_ */
|
#endif /* _I2S_LLD_H_ */
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
|
|
||||||
#if HAL_USE_ICU || defined(__DOXYGEN__)
|
#if (HAL_USE_ICU == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver local definitions. */
|
/* Driver local definitions. */
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
* @brief ICUD1 driver identifier.
|
* @brief ICUD1 driver identifier.
|
||||||
* @note The driver ICUD1 allocates the complex timer TIM1 when enabled.
|
* @note The driver ICUD1 allocates the complex timer TIM1 when enabled.
|
||||||
*/
|
*/
|
||||||
#if PLATFORM_ICU_USE_ICU1 || defined(__DOXYGEN__)
|
#if (PLATFORM_ICU_USE_ICU1 == TRUE) || defined(__DOXYGEN__)
|
||||||
ICUDriver ICUD1;
|
ICUDriver ICUD1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ ICUDriver ICUD1;
|
||||||
*/
|
*/
|
||||||
void icu_lld_init(void) {
|
void icu_lld_init(void) {
|
||||||
|
|
||||||
#if PLATFORM_ICU_USE_ICU1
|
#if PLATFORM_ICU_USE_ICU1 == TRUE
|
||||||
/* Driver initialization.*/
|
/* Driver initialization.*/
|
||||||
icuObjectInit(&ICUD1);
|
icuObjectInit(&ICUD1);
|
||||||
#endif
|
#endif
|
||||||
|
@ -82,7 +82,7 @@ void icu_lld_start(ICUDriver *icup) {
|
||||||
|
|
||||||
if (icup->state == ICU_STOP) {
|
if (icup->state == ICU_STOP) {
|
||||||
/* Clock activation and timer reset.*/
|
/* Clock activation and timer reset.*/
|
||||||
#if PLATFORM_ICU_USE_ICU1
|
#if PLATFORM_ICU_USE_ICU1 == TRUE
|
||||||
if (&ICUD1 == icup) {
|
if (&ICUD1 == icup) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ void icu_lld_stop(ICUDriver *icup) {
|
||||||
|
|
||||||
if (icup->state == ICU_READY) {
|
if (icup->state == ICU_READY) {
|
||||||
/* Clock deactivation.*/
|
/* Clock deactivation.*/
|
||||||
#if PLATFORM_ICU_USE_ICU1
|
#if PLATFORM_ICU_USE_ICU1 == TRUE
|
||||||
if (&ICUD1 == icup) {
|
if (&ICUD1 == icup) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -180,6 +180,6 @@ void icu_lld_disable_notifications(ICUDriver *icup) {
|
||||||
(void)icup;
|
(void)icup;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAL_USE_ICU */
|
#endif /* HAL_USE_ICU == TRUE */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#ifndef _ICU_LLD_H_
|
#ifndef _ICU_LLD_H_
|
||||||
#define _ICU_LLD_H_
|
#define _ICU_LLD_H_
|
||||||
|
|
||||||
#if HAL_USE_ICU || defined(__DOXYGEN__)
|
#if (HAL_USE_ICU == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver constants. */
|
/* Driver constants. */
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief ICUD1 driver enable switch.
|
* @brief ICUD1 driver enable switch.
|
||||||
* @details If set to @p TRUE the support for ICUD1 is included.
|
* @details If set to @p TRUE the support for ICUD1 is included.
|
||||||
* @note The default is @p TRUE.
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(PLATFORM_ICU_USE_ICU1) || defined(__DOXYGEN__)
|
#if !defined(PLATFORM_ICU_USE_ICU1) || defined(__DOXYGEN__)
|
||||||
#define PLATFORM_ICU_USE_ICU1 FALSE
|
#define PLATFORM_ICU_USE_ICU1 FALSE
|
||||||
|
@ -62,7 +62,7 @@
|
||||||
*/
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ICU_INPUT_ACTIVE_HIGH = 0, /**< Trigger on rising edge. */
|
ICU_INPUT_ACTIVE_HIGH = 0, /**< Trigger on rising edge. */
|
||||||
ICU_INPUT_ACTIVE_LOW = 1, /**< Trigger on falling edge. */
|
ICU_INPUT_ACTIVE_LOW = 1 /**< Trigger on falling edge. */
|
||||||
} icumode_t;
|
} icumode_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -167,7 +167,7 @@ struct ICUDriver {
|
||||||
/* External declarations. */
|
/* External declarations. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#if PLATFORM_ICU_USE_ICU1 && !defined(__DOXYGEN__)
|
#if (PLATFORM_ICU_USE_ICU1 == TRUE) && !defined(__DOXYGEN__)
|
||||||
extern ICUDriver ICUD1;
|
extern ICUDriver ICUD1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* HAL_USE_ICU */
|
#endif /* HAL_USE_ICU == TRUE */
|
||||||
|
|
||||||
#endif /* _ICU_LLD_H_ */
|
#endif /* _ICU_LLD_H_ */
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
|
|
||||||
#if HAL_USE_MAC || defined(__DOXYGEN__)
|
#if (HAL_USE_MAC == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
#include "mii.h"
|
#include "mii.h"
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief MAC1 driver identifier.
|
* @brief MAC1 driver identifier.
|
||||||
*/
|
*/
|
||||||
#if PLATFORM_MAC_USE_MAC1 || defined(__DOXYGEN__)
|
#if (PLATFORM_MAC_USE_MAC1 == TRUE) || defined(__DOXYGEN__)
|
||||||
MACDriver ETHD1;
|
MACDriver ETHD1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -68,10 +68,10 @@ MACDriver ETHD1;
|
||||||
*/
|
*/
|
||||||
void mac_lld_init(void) {
|
void mac_lld_init(void) {
|
||||||
|
|
||||||
#if PLATFORM_MAC_USE_MAC1
|
#if PLATFORM_MAC_USE_MAC1 == TRUE
|
||||||
/* Driver initialization.*/
|
/* Driver initialization.*/
|
||||||
macObjectInit(&MACD1);
|
macObjectInit(&MACD1);
|
||||||
#endif /* PLATFORM_MAC_USE_MAC1 */
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -85,11 +85,11 @@ void mac_lld_start(MACDriver *macp) {
|
||||||
|
|
||||||
if (macp->state == MAC_STOP) {
|
if (macp->state == MAC_STOP) {
|
||||||
/* Enables the peripheral.*/
|
/* Enables the peripheral.*/
|
||||||
#if PLATFORM_MAC_USE_MAC1
|
#if PLATFORM_MAC_USE_MAC1 == TRUE
|
||||||
if (&MACD1 == macp) {
|
if (&MACD1 == macp) {
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* PLATFORM_MAC_USE_MAC1 */
|
#endif
|
||||||
}
|
}
|
||||||
/* Configures the peripheral.*/
|
/* Configures the peripheral.*/
|
||||||
|
|
||||||
|
@ -108,11 +108,11 @@ void mac_lld_stop(MACDriver *macp) {
|
||||||
/* Resets the peripheral.*/
|
/* Resets the peripheral.*/
|
||||||
|
|
||||||
/* Disables the peripheral.*/
|
/* Disables the peripheral.*/
|
||||||
#if PLATFORM_MAC_USE_MAC1
|
#if PLATFORM_MAC_USE_MAC1 == TRUE
|
||||||
if (&MACD1 == macp) {
|
if (&MACD1 == macp) {
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* PLATFORM_MAC_USE_MAC1 */
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -251,7 +251,7 @@ size_t mac_lld_read_receive_descriptor(MACReceiveDescriptor *rdp,
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MAC_USE_ZERO_COPY || defined(__DOXYGEN__)
|
#if (MAC_USE_ZERO_COPY == TRUE) || defined(__DOXYGEN__)
|
||||||
/**
|
/**
|
||||||
* @brief Returns a pointer to the next transmit buffer in the descriptor
|
* @brief Returns a pointer to the next transmit buffer in the descriptor
|
||||||
* chain.
|
* chain.
|
||||||
|
@ -306,8 +306,8 @@ const uint8_t *mac_lld_get_next_receive_buffer(MACReceiveDescriptor *rdp,
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif /* MAC_USE_ZERO_COPY */
|
#endif /* MAC_USE_ZERO_COPY == TRUE */
|
||||||
|
|
||||||
#endif /* HAL_USE_MAC */
|
#endif /* HAL_USE_MAC == TRUE */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#ifndef _MAC_LLD_H_
|
#ifndef _MAC_LLD_H_
|
||||||
#define _MAC_LLD_H_
|
#define _MAC_LLD_H_
|
||||||
|
|
||||||
#if HAL_USE_MAC || defined(__DOXYGEN__)
|
#if (HAL_USE_MAC == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver constants. */
|
/* Driver constants. */
|
||||||
|
@ -47,6 +47,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief MAC driver enable switch.
|
* @brief MAC driver enable switch.
|
||||||
* @details If set to @p TRUE the support for MAC1 is included.
|
* @details If set to @p TRUE the support for MAC1 is included.
|
||||||
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(PLATFORM_MAC_USE_MAC1) || defined(__DOXYGEN__)
|
#if !defined(PLATFORM_MAC_USE_MAC1) || defined(__DOXYGEN__)
|
||||||
#define PLATFORM_MAC_USE_MAC1 FALSE
|
#define PLATFORM_MAC_USE_MAC1 FALSE
|
||||||
|
@ -92,7 +93,7 @@ struct MACDriver {
|
||||||
* @brief Receive semaphore.
|
* @brief Receive semaphore.
|
||||||
*/
|
*/
|
||||||
threads_queue_t rdqueue;
|
threads_queue_t rdqueue;
|
||||||
#if MAC_USE_EVENTS || defined(__DOXYGEN__)
|
#if (MAC_USE_EVENTS == TRUE) || defined(__DOXYGEN__)
|
||||||
/**
|
/**
|
||||||
* @brief Receive event.
|
* @brief Receive event.
|
||||||
*/
|
*/
|
||||||
|
@ -139,7 +140,7 @@ typedef struct {
|
||||||
/* External declarations. */
|
/* External declarations. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#if PLATFORM_MAC_USE_MAC1 && !defined(__DOXYGEN__)
|
#if (PLATFORM_MAC_USE_MAC1 == TRUE) && !defined(__DOXYGEN__)
|
||||||
extern MACDriver ETHD1;
|
extern MACDriver ETHD1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -162,18 +163,18 @@ extern "C" {
|
||||||
size_t mac_lld_read_receive_descriptor(MACReceiveDescriptor *rdp,
|
size_t mac_lld_read_receive_descriptor(MACReceiveDescriptor *rdp,
|
||||||
uint8_t *buf,
|
uint8_t *buf,
|
||||||
size_t size);
|
size_t size);
|
||||||
#if MAC_USE_ZERO_COPY
|
#if MAC_USE_ZERO_COPY == TRUE
|
||||||
uint8_t *mac_lld_get_next_transmit_buffer(MACTransmitDescriptor *tdp,
|
uint8_t *mac_lld_get_next_transmit_buffer(MACTransmitDescriptor *tdp,
|
||||||
size_t size,
|
size_t size,
|
||||||
size_t *sizep);
|
size_t *sizep);
|
||||||
const uint8_t *mac_lld_get_next_receive_buffer(MACReceiveDescriptor *rdp,
|
const uint8_t *mac_lld_get_next_receive_buffer(MACReceiveDescriptor *rdp,
|
||||||
size_t *sizep);
|
size_t *sizep);
|
||||||
#endif /* MAC_USE_ZERO_COPY */
|
#endif
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* HAL_USE_MAC */
|
#endif /* HAL_USE_MAC == TRUE */
|
||||||
|
|
||||||
#endif /* _MAC_LLD_H_ */
|
#endif /* _MAC_LLD_H_ */
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
|
|
||||||
#if HAL_USE_PAL || defined(__DOXYGEN__)
|
#if (HAL_USE_PAL == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver local definitions. */
|
/* Driver local definitions. */
|
||||||
|
@ -85,6 +85,6 @@ void _pal_lld_setgroupmode(ioportid_t port,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAL_USE_PAL */
|
#endif /* HAL_USE_PAL == TRUE */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#ifndef _PAL_LLD_H_
|
#ifndef _PAL_LLD_H_
|
||||||
#define _PAL_LLD_H_
|
#define _PAL_LLD_H_
|
||||||
|
|
||||||
#if HAL_USE_PAL || defined(__DOXYGEN__)
|
#if (HAL_USE_PAL == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Unsupported modes and specific modes */
|
/* Unsupported modes and specific modes */
|
||||||
|
@ -375,7 +375,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* HAL_USE_PAL */
|
#endif /* HAL_USE_PAL == TRUE */
|
||||||
|
|
||||||
#endif /* _PAL_LLD_H_ */
|
#endif /* _PAL_LLD_H_ */
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
|
|
||||||
#if HAL_USE_PWM || defined(__DOXYGEN__)
|
#if (HAL_USE_PWM == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver local definitions. */
|
/* Driver local definitions. */
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
* @brief PWMD1 driver identifier.
|
* @brief PWMD1 driver identifier.
|
||||||
* @note The driver PWMD1 allocates the complex timer TIM1 when enabled.
|
* @note The driver PWMD1 allocates the complex timer TIM1 when enabled.
|
||||||
*/
|
*/
|
||||||
#if PLATFORM_PWM_USE_PWM1 || defined(__DOXYGEN__)
|
#if (PLATFORM_PWM_USE_PWM1 == TRUE) || defined(__DOXYGEN__)
|
||||||
PWMDriver PWMD1;
|
PWMDriver PWMD1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ PWMDriver PWMD1;
|
||||||
*/
|
*/
|
||||||
void pwm_lld_init(void) {
|
void pwm_lld_init(void) {
|
||||||
|
|
||||||
#if PLATFORM_PWM_USE_PWM1
|
#if PLATFORM_PWM_USE_PWM1 == TRUE
|
||||||
/* Driver initialization.*/
|
/* Driver initialization.*/
|
||||||
pwmObjectInit(&PWMD1);
|
pwmObjectInit(&PWMD1);
|
||||||
#endif
|
#endif
|
||||||
|
@ -84,7 +84,7 @@ void pwm_lld_start(PWMDriver *pwmp) {
|
||||||
|
|
||||||
if (pwmp->state == PWM_STOP) {
|
if (pwmp->state == PWM_STOP) {
|
||||||
/* Clock activation and timer reset.*/
|
/* Clock activation and timer reset.*/
|
||||||
#if PLATFORM_PWM_USE_PWM1
|
#if PLATFORM_PWM_USE_PWM1 == TRUE
|
||||||
if (&PWMD1 == pwmp) {
|
if (&PWMD1 == pwmp) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@ void pwm_lld_stop(PWMDriver *pwmp) {
|
||||||
|
|
||||||
/* If in ready state then disables the PWM clock.*/
|
/* If in ready state then disables the PWM clock.*/
|
||||||
if (pwmp->state == PWM_READY) {
|
if (pwmp->state == PWM_READY) {
|
||||||
#if PLATFORM_PWM_USE_PWM1
|
#if PLATFORM_PWM_USE_PWM1 == TRUE
|
||||||
if (&PWMD1 == pwmp) {
|
if (&PWMD1 == pwmp) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -215,6 +215,6 @@ void pwm_lld_disable_channel_notification(PWMDriver *pwmp,
|
||||||
(void)channel;
|
(void)channel;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAL_USE_PWM */
|
#endif /* HAL_USE_PWM == TRUE */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#ifndef _PWM_LLD_H_
|
#ifndef _PWM_LLD_H_
|
||||||
#define _PWM_LLD_H_
|
#define _PWM_LLD_H_
|
||||||
|
|
||||||
#if HAL_USE_PWM || defined(__DOXYGEN__)
|
#if (HAL_USE_PWM == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver constants. */
|
/* Driver constants. */
|
||||||
|
@ -45,13 +45,12 @@
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @brief If advanced timer features switch.
|
* @brief PWMD1 driver enable switch.
|
||||||
* @details If set to @p TRUE the advanced features for TIM1 and TIM8 are
|
* @details If set to @p TRUE the support for PWM1 is included.
|
||||||
* enabled.
|
* @note The default is @p FALSE.
|
||||||
* @note The default is @p TRUE.
|
|
||||||
*/
|
*/
|
||||||
#if !defined(PLATFORM_PWM_USE_ADVANCED) || defined(__DOXYGEN__)
|
#if !defined(PLATFORM_PWM_USE_PWM1) || defined(__DOXYGEN__)
|
||||||
#define PLATFORM_PWM_USE_ADVANCED FALSE
|
#define PLATFORM_PWM_USE_PWM1 FALSE
|
||||||
#endif
|
#endif
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
@ -185,7 +184,7 @@ struct PWMDriver {
|
||||||
/* External declarations. */
|
/* External declarations. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#if PLATFORM_PWM_USE_PWM1 && !defined(__DOXYGEN__)
|
#if (PLATFORM_PWM_USE_PWM1 == TRUE) && !defined(__DOXYGEN__)
|
||||||
extern PWMDriver PWMD1;
|
extern PWMDriver PWMD1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -209,7 +208,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* HAL_USE_PWM */
|
#endif /* HAL_USE_PWM == TRUE */
|
||||||
|
|
||||||
#endif /* _PWM_LLD_H_ */
|
#endif /* _PWM_LLD_H_ */
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#ifndef _RTC_LLD_H_
|
#ifndef _RTC_LLD_H_
|
||||||
#define _RTC_LLD_H_
|
#define _RTC_LLD_H_
|
||||||
|
|
||||||
#if HAL_USE_RTC || defined(__DOXYGEN__)
|
#if (HAL_USE_RTC == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver constants. */
|
/* Driver constants. */
|
||||||
|
@ -62,6 +62,14 @@
|
||||||
* @name PLATFORM configuration options
|
* @name PLATFORM configuration options
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
/**
|
||||||
|
* @brief RTCD1 driver enable switch.
|
||||||
|
* @details If set to @p TRUE the support for RTC1 is included.
|
||||||
|
* @note The default is @p FALSE.
|
||||||
|
*/
|
||||||
|
#if !defined(PLATFORM_RTC_USE_RTC1) || defined(__DOXYGEN__)
|
||||||
|
#define PLATFORM_RTC_USE_RTC1 FALSE
|
||||||
|
#endif
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
@ -120,7 +128,7 @@ struct RTCDriverVMT {
|
||||||
* @brief Structure representing an RTC driver.
|
* @brief Structure representing an RTC driver.
|
||||||
*/
|
*/
|
||||||
struct RTCDriver {
|
struct RTCDriver {
|
||||||
#if RTC_HAS_STORAGE || defined(__DOXYGEN__)
|
#if (RTC_HAS_STORAGE == TRUE) || defined(__DOXYGEN__)
|
||||||
/**
|
/**
|
||||||
* @brief Virtual Methods Table.
|
* @brief Virtual Methods Table.
|
||||||
*/
|
*/
|
||||||
|
@ -138,11 +146,12 @@ struct RTCDriver {
|
||||||
/* External declarations. */
|
/* External declarations. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#if !defined(__DOXYGEN__)
|
#if (PLATFORM_RTC_USE_RTC1 == TRUE) && !defined(__DOXYGEN__)
|
||||||
extern RTCDriver RTCD1;
|
extern RTCDriver RTCD1;
|
||||||
#if RTC_HAS_STORAGE
|
|
||||||
extern struct RTCDriverVMT _rtc_lld_vmt;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (RTC_HAS_STORAGE == TRUE) && !defined(__DOXYGEN__)
|
||||||
|
extern struct RTCDriverVMT _rtc_lld_vmt;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -166,7 +175,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* HAL_USE_RTC */
|
#endif /* HAL_USE_RTC == TRUE */
|
||||||
|
|
||||||
#endif /* _RTC_LLD_H_ */
|
#endif /* _RTC_LLD_H_ */
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
|
|
||||||
#if HAL_USE_SDC || defined(__DOXYGEN__)
|
#if (HAL_USE_SDC == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver local definitions. */
|
/* Driver local definitions. */
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief SDCD1 driver identifier.
|
* @brief SDCD1 driver identifier.
|
||||||
*/
|
*/
|
||||||
#if PLATFORM_SDC_USE_SDC1 || defined(__DOXYGEN__)
|
#if (PLATFORM_SDC_USE_SDC1 == TRUE) || defined(__DOXYGEN__)
|
||||||
SDCDriver SDCD1;
|
SDCDriver SDCD1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -64,7 +64,9 @@ SDCDriver SDCD1;
|
||||||
*/
|
*/
|
||||||
void sdc_lld_init(void) {
|
void sdc_lld_init(void) {
|
||||||
|
|
||||||
|
#if PLATFORM_SDC_USE_SDC1 == TRUE
|
||||||
sdcObjectInit(&SDCD1);
|
sdcObjectInit(&SDCD1);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -153,6 +155,9 @@ void sdc_lld_set_bus_mode(SDCDriver *sdcp, sdcbusmode_t mode) {
|
||||||
break;
|
break;
|
||||||
case SDC_MODE_8BIT:
|
case SDC_MODE_8BIT:
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
osalDbgAssert(false, "invalid bus mode");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -249,56 +254,6 @@ bool sdc_lld_send_cmd_long_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg,
|
||||||
return HAL_SUCCESS;
|
return HAL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Reads one or more blocks.
|
|
||||||
*
|
|
||||||
* @param[in] sdcp pointer to the @p SDCDriver object
|
|
||||||
* @param[in] startblk first block to read
|
|
||||||
* @param[out] buf pointer to the read buffer
|
|
||||||
* @param[in] n number of blocks to read
|
|
||||||
*
|
|
||||||
* @return The operation status.
|
|
||||||
* @retval HAL_SUCCESS operation succeeded.
|
|
||||||
* @retval HAL_FAILED operation failed.
|
|
||||||
*
|
|
||||||
* @notapi
|
|
||||||
*/
|
|
||||||
bool sdc_lld_read_aligned(SDCDriver *sdcp, uint32_t startblk,
|
|
||||||
uint8_t *buf, uint32_t n) {
|
|
||||||
|
|
||||||
(void)sdcp;
|
|
||||||
(void)startblk;
|
|
||||||
(void)buf;
|
|
||||||
(void)n;
|
|
||||||
|
|
||||||
return HAL_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Writes one or more blocks.
|
|
||||||
*
|
|
||||||
* @param[in] sdcp pointer to the @p SDCDriver object
|
|
||||||
* @param[in] startblk first block to write
|
|
||||||
* @param[out] buf pointer to the write buffer
|
|
||||||
* @param[in] n number of blocks to write
|
|
||||||
*
|
|
||||||
* @return The operation status.
|
|
||||||
* @retval HAL_SUCCESS operation succeeded.
|
|
||||||
* @retval HAL_FAILED operation failed.
|
|
||||||
*
|
|
||||||
* @notapi
|
|
||||||
*/
|
|
||||||
bool sdc_lld_write_aligned(SDCDriver *sdcp, uint32_t startblk,
|
|
||||||
const uint8_t *buf, uint32_t n) {
|
|
||||||
|
|
||||||
(void)sdcp;
|
|
||||||
(void)startblk;
|
|
||||||
(void)buf;
|
|
||||||
(void)n;
|
|
||||||
|
|
||||||
return HAL_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Reads one or more blocks.
|
* @brief Reads one or more blocks.
|
||||||
*
|
*
|
||||||
|
@ -367,6 +322,6 @@ bool sdc_lld_sync(SDCDriver *sdcp) {
|
||||||
return HAL_SUCCESS;
|
return HAL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAL_USE_SDC */
|
#endif /* HAL_USE_SDC == TRUE */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#ifndef _SDC_LLD_H_
|
#ifndef _SDC_LLD_H_
|
||||||
#define _SDC_LLD_H_
|
#define _SDC_LLD_H_
|
||||||
|
|
||||||
#if HAL_USE_SDC || defined(__DOXYGEN__)
|
#if (HAL_USE_SDC == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver constants. */
|
/* Driver constants. */
|
||||||
|
@ -39,6 +39,14 @@
|
||||||
* @name PLATFORM configuration options
|
* @name PLATFORM configuration options
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
/**
|
||||||
|
* @brief PWMD1 driver enable switch.
|
||||||
|
* @details If set to @p TRUE the support for PWM1 is included.
|
||||||
|
* @note The default is @p FALSE.
|
||||||
|
*/
|
||||||
|
#if !defined(PLATFORM_SDC_USE_SDC1) || defined(__DOXYGEN__)
|
||||||
|
#define PLATFORM_SDC_USE_SDC1 FALSE
|
||||||
|
#endif
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
@ -135,7 +143,7 @@ struct SDCDriver {
|
||||||
/* External declarations. */
|
/* External declarations. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#if !defined(__DOXYGEN__)
|
#if (PLATFORM_SDC_USE_SDC1 == TRUE) && !defined(__DOXYGEN__)
|
||||||
extern SDCDriver SDCD1;
|
extern SDCDriver SDCD1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -159,9 +167,9 @@ extern "C" {
|
||||||
bool sdc_lld_read_special(SDCDriver *sdcp, uint8_t *buf, size_t bytes,
|
bool sdc_lld_read_special(SDCDriver *sdcp, uint8_t *buf, size_t bytes,
|
||||||
uint8_t cmd, uint32_t argument);
|
uint8_t cmd, uint32_t argument);
|
||||||
bool sdc_lld_read(SDCDriver *sdcp, uint32_t startblk,
|
bool sdc_lld_read(SDCDriver *sdcp, uint32_t startblk,
|
||||||
uint8_t *buf, uint32_t blocks);
|
uint8_t *buf, uint32_t n);
|
||||||
bool sdc_lld_write(SDCDriver *sdcp, uint32_t startblk,
|
bool sdc_lld_write(SDCDriver *sdcp, uint32_t startblk,
|
||||||
const uint8_t *buf, uint32_t blocks);
|
const uint8_t *buf, uint32_t n);
|
||||||
bool sdc_lld_sync(SDCDriver *sdcp);
|
bool sdc_lld_sync(SDCDriver *sdcp);
|
||||||
bool sdc_lld_is_card_inserted(SDCDriver *sdcp);
|
bool sdc_lld_is_card_inserted(SDCDriver *sdcp);
|
||||||
bool sdc_lld_is_write_protected(SDCDriver *sdcp);
|
bool sdc_lld_is_write_protected(SDCDriver *sdcp);
|
||||||
|
@ -169,7 +177,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* HAL_USE_SDC */
|
#endif /* HAL_USE_SDC == TRUE */
|
||||||
|
|
||||||
#endif /* _SDC_LLD_H_ */
|
#endif /* _SDC_LLD_H_ */
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
|
|
||||||
#if HAL_USE_SERIAL || defined(__DOXYGEN__)
|
#if (HAL_USE_SERIAL == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver local definitions. */
|
/* Driver local definitions. */
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
/** @brief USART1 serial driver identifier.*/
|
/** @brief USART1 serial driver identifier.*/
|
||||||
#if PLATFORM_SERIAL_USE_USART1 || defined(__DOXYGEN__)
|
#if (PLATFORM_SERIAL_USE_USART1 == TRUE) || defined(__DOXYGEN__)
|
||||||
SerialDriver SD1;
|
SerialDriver SD1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ static const SerialConfig default_config = {
|
||||||
*/
|
*/
|
||||||
void sd_lld_init(void) {
|
void sd_lld_init(void) {
|
||||||
|
|
||||||
#if PLATFORM_SERIAL_USE_USART1
|
#if PLATFORM_SERIAL_USE_USART1 == TRUE
|
||||||
sdObjectInit(&SD1, NULL, notify1);
|
sdObjectInit(&SD1, NULL, notify1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -86,18 +86,20 @@ void sd_lld_init(void) {
|
||||||
*/
|
*/
|
||||||
void sd_lld_start(SerialDriver *sdp, const SerialConfig *config) {
|
void sd_lld_start(SerialDriver *sdp, const SerialConfig *config) {
|
||||||
|
|
||||||
if (config == NULL)
|
if (config == NULL) {
|
||||||
config = &default_config;
|
config = &default_config;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (sdp->state == SD_STOP) {
|
if (sdp->state == SD_STOP) {
|
||||||
#if PLATFORM_SERIAL_USE_USART1
|
#if PLATFORM_SERIAL_USE_USART1 == TRUE
|
||||||
if (&SD1 == sdp) {
|
if (&SD1 == sdp) {
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
/* Configures the peripheral.*/
|
/* Configures the peripheral.*/
|
||||||
|
(void)config; /* Warning suppression, remove this.*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -112,7 +114,7 @@ void sd_lld_start(SerialDriver *sdp, const SerialConfig *config) {
|
||||||
void sd_lld_stop(SerialDriver *sdp) {
|
void sd_lld_stop(SerialDriver *sdp) {
|
||||||
|
|
||||||
if (sdp->state == SD_READY) {
|
if (sdp->state == SD_READY) {
|
||||||
#if PLATFORM_SERIAL_USE_USART1
|
#if PLATFORM_SERIAL_USE_USART1 == TRUE
|
||||||
if (&SD1 == sdp) {
|
if (&SD1 == sdp) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -120,6 +122,6 @@ void sd_lld_stop(SerialDriver *sdp) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAL_USE_SERIAL */
|
#endif /* HAL_USE_SERIAL == TRUE */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#ifndef _SERIAL_LLD_H_
|
#ifndef _SERIAL_LLD_H_
|
||||||
#define _SERIAL_LLD_H_
|
#define _SERIAL_LLD_H_
|
||||||
|
|
||||||
#if HAL_USE_SERIAL || defined(__DOXYGEN__)
|
#if (HAL_USE_SERIAL == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver constants. */
|
/* Driver constants. */
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief USART1 driver enable switch.
|
* @brief USART1 driver enable switch.
|
||||||
* @details If set to @p TRUE the support for USART1 is included.
|
* @details If set to @p TRUE the support for USART1 is included.
|
||||||
* @note The default is @p TRUE.
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(PLATFORM_SERIAL_USE_USART1) || defined(__DOXYGEN__)
|
#if !defined(PLATFORM_SERIAL_USE_USART1) || defined(__DOXYGEN__)
|
||||||
#define PLATFORM_SERIAL_USE_USART1 FALSE
|
#define PLATFORM_SERIAL_USE_USART1 FALSE
|
||||||
|
@ -98,7 +98,7 @@ typedef struct {
|
||||||
/* External declarations. */
|
/* External declarations. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#if PLATFORM_SERIAL_USE_USART1 && !defined(__DOXYGEN__)
|
#if (PLATFORM_SERIAL_USE_USART1 == TRUE) && !defined(__DOXYGEN__)
|
||||||
extern SerialDriver SD1;
|
extern SerialDriver SD1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* HAL_USE_SERIAL */
|
#endif /* HAL_USE_SERIAL == TRUE */
|
||||||
|
|
||||||
#endif /* _SERIAL_LLD_H_ */
|
#endif /* _SERIAL_LLD_H_ */
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
|
|
||||||
#if HAL_USE_SPI || defined(__DOXYGEN__)
|
#if (HAL_USE_SPI == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver local definitions. */
|
/* Driver local definitions. */
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief SPI1 driver identifier.
|
* @brief SPI1 driver identifier.
|
||||||
*/
|
*/
|
||||||
#if PLATFORM_SPI_USE_SPI1 || defined(__DOXYGEN__)
|
#if (PLATFORM_SPI_USE_SPI1 == TRUE) || defined(__DOXYGEN__)
|
||||||
SPIDriver SPID1;
|
SPIDriver SPID1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -64,10 +64,10 @@ SPIDriver SPID1;
|
||||||
*/
|
*/
|
||||||
void spi_lld_init(void) {
|
void spi_lld_init(void) {
|
||||||
|
|
||||||
#if PLATFORM_SPI_USE_SPI1
|
#if PLATFORM_SPI_USE_SPI1 == TRUE
|
||||||
/* Driver initialization.*/
|
/* Driver initialization.*/
|
||||||
spiObjectInit(&SPID1);
|
spiObjectInit(&SPID1);
|
||||||
#endif /* PLATFORM_SPI_USE_SPI1 */
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -81,11 +81,11 @@ void spi_lld_start(SPIDriver *spip) {
|
||||||
|
|
||||||
if (spip->state == SPI_STOP) {
|
if (spip->state == SPI_STOP) {
|
||||||
/* Enables the peripheral.*/
|
/* Enables the peripheral.*/
|
||||||
#if PLATFORM_SPI_USE_SPI1
|
#if PLATFORM_SPI_USE_SPI1 == TRUE
|
||||||
if (&SPID1 == spip) {
|
if (&SPID1 == spip) {
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* PLATFORM_SPI_USE_SPI1 */
|
#endif
|
||||||
}
|
}
|
||||||
/* Configures the peripheral.*/
|
/* Configures the peripheral.*/
|
||||||
|
|
||||||
|
@ -102,11 +102,11 @@ void spi_lld_stop(SPIDriver *spip) {
|
||||||
|
|
||||||
if (spip->state == SPI_READY) {
|
if (spip->state == SPI_READY) {
|
||||||
/* Disables the peripheral.*/
|
/* Disables the peripheral.*/
|
||||||
#if PLATFORM_SPI_USE_SPI1
|
#if PLATFORM_SPI_USE_SPI1 == TRUE
|
||||||
if (&SPID1 == spip) {
|
if (&SPID1 == spip) {
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* PLATFORM_SPI_USE_SPI1 */
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,6 +242,6 @@ uint16_t spi_lld_polled_exchange(SPIDriver *spip, uint16_t frame) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAL_USE_SPI */
|
#endif /* HAL_USE_SPI == TRUE */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#ifndef _SPI_LLD_H_
|
#ifndef _SPI_LLD_H_
|
||||||
#define _SPI_LLD_H_
|
#define _SPI_LLD_H_
|
||||||
|
|
||||||
#if HAL_USE_SPI || defined(__DOXYGEN__)
|
#if (HAL_USE_SPI == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver constants. */
|
/* Driver constants. */
|
||||||
|
@ -41,6 +41,8 @@
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @brief SPI1 driver enable switch.
|
* @brief SPI1 driver enable switch.
|
||||||
|
* @details If set to @p TRUE the support for SPI1 is included.
|
||||||
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(PLATFORM_SPI_USE_SPI1) || defined(__DOXYGEN__)
|
#if !defined(PLATFORM_SPI_USE_SPI1) || defined(__DOXYGEN__)
|
||||||
#define PLATFORM_SPI_USE_SPI1 FALSE
|
#define PLATFORM_SPI_USE_SPI1 FALSE
|
||||||
|
@ -95,18 +97,18 @@ struct SPIDriver {
|
||||||
* @brief Current configuration data.
|
* @brief Current configuration data.
|
||||||
*/
|
*/
|
||||||
const SPIConfig *config;
|
const SPIConfig *config;
|
||||||
#if SPI_USE_WAIT || defined(__DOXYGEN__)
|
#if (SPI_USE_WAIT == TRUE) || defined(__DOXYGEN__)
|
||||||
/**
|
/**
|
||||||
* @brief Waiting thread.
|
* @brief Waiting thread.
|
||||||
*/
|
*/
|
||||||
thread_reference_t thread;
|
thread_reference_t thread;
|
||||||
#endif /* SPI_USE_WAIT */
|
#endif
|
||||||
#if SPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
#if (SPI_USE_MUTUAL_EXCLUSION == TRUE) || defined(__DOXYGEN__)
|
||||||
/**
|
/**
|
||||||
* @brief Mutex protecting the peripheral.
|
* @brief Mutex protecting the peripheral.
|
||||||
*/
|
*/
|
||||||
mutex_t mutex;
|
mutex_t mutex;
|
||||||
#endif /* SPI_USE_MUTUAL_EXCLUSION */
|
#endif
|
||||||
#if defined(SPI_DRIVER_EXT_FIELDS)
|
#if defined(SPI_DRIVER_EXT_FIELDS)
|
||||||
SPI_DRIVER_EXT_FIELDS
|
SPI_DRIVER_EXT_FIELDS
|
||||||
#endif
|
#endif
|
||||||
|
@ -121,7 +123,7 @@ struct SPIDriver {
|
||||||
/* External declarations. */
|
/* External declarations. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#if PLATFORM_SPI_USE_SPI1 && !defined(__DOXYGEN__)
|
#if (PLATFORM_SPI_USE_SPI1 == TRUE) && !defined(__DOXYGEN__)
|
||||||
extern SPIDriver SPID1;
|
extern SPIDriver SPID1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -143,7 +145,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* HAL_USE_SPI */
|
#endif /* HAL_USE_SPI == TRUE */
|
||||||
|
|
||||||
#endif /* _SPI_LLD_H_ */
|
#endif /* _SPI_LLD_H_ */
|
||||||
|
|
||||||
|
|
|
@ -80,13 +80,13 @@ static inline systime_t st_lld_get_counter(void) {
|
||||||
* @note Makes sure that no spurious alarms are triggered after
|
* @note Makes sure that no spurious alarms are triggered after
|
||||||
* this call.
|
* this call.
|
||||||
*
|
*
|
||||||
* @param[in] time the time to be set for the first alarm
|
* @param[in] abstime the time to be set for the first alarm
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static inline void st_lld_start_alarm(systime_t time) {
|
static inline void st_lld_start_alarm(systime_t abstime) {
|
||||||
|
|
||||||
(void)time;
|
(void)abstime;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -101,13 +101,13 @@ static inline void st_lld_stop_alarm(void) {
|
||||||
/**
|
/**
|
||||||
* @brief Sets the alarm time.
|
* @brief Sets the alarm time.
|
||||||
*
|
*
|
||||||
* @param[in] time the time to be set for the next alarm
|
* @param[in] abstime the time to be set for the next alarm
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static inline void st_lld_set_alarm(systime_t time) {
|
static inline void st_lld_set_alarm(systime_t abstime) {
|
||||||
|
|
||||||
(void)time;
|
(void)abstime;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
|
|
||||||
#if HAL_USE_UART || defined(__DOXYGEN__)
|
#if (HAL_USE_UART == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver local definitions. */
|
/* Driver local definitions. */
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief UART1 driver identifier.
|
* @brief UART1 driver identifier.
|
||||||
*/
|
*/
|
||||||
#if PLATFORM_UART_USE_UART1 || defined(__DOXYGEN__)
|
#if (PLATFORM_UART_USE_UART1 == TRUE) || defined(__DOXYGEN__)
|
||||||
UARTDriver UARTD1;
|
UARTDriver UARTD1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -64,10 +64,10 @@ UARTDriver UARTD1;
|
||||||
*/
|
*/
|
||||||
void uart_lld_init(void) {
|
void uart_lld_init(void) {
|
||||||
|
|
||||||
#if PLATFORM_UART_USE_UART1
|
#if PLATFORM_UART_USE_UART1 == TRUE
|
||||||
/* Driver initialization.*/
|
/* Driver initialization.*/
|
||||||
uartObjectInit(&UARTD1);
|
uartObjectInit(&UARTD1);
|
||||||
#endif /* PLATFORM_UART_USE_UART1 */
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -81,11 +81,11 @@ void uart_lld_start(UARTDriver *uartp) {
|
||||||
|
|
||||||
if (uartp->state == UART_STOP) {
|
if (uartp->state == UART_STOP) {
|
||||||
/* Enables the peripheral.*/
|
/* Enables the peripheral.*/
|
||||||
#if PLATFORM_UART_USE_UART1
|
#if PLATFORM_UART_USE_UART1 == TRUE
|
||||||
if (&UARTD1 == uartp) {
|
if (&UARTD1 == uartp) {
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* PLATFORM_UART_USE_UART1 */
|
#endif
|
||||||
}
|
}
|
||||||
/* Configures the peripheral.*/
|
/* Configures the peripheral.*/
|
||||||
|
|
||||||
|
@ -104,11 +104,11 @@ void uart_lld_stop(UARTDriver *uartp) {
|
||||||
/* Resets the peripheral.*/
|
/* Resets the peripheral.*/
|
||||||
|
|
||||||
/* Disables the peripheral.*/
|
/* Disables the peripheral.*/
|
||||||
#if PLATFORM_UART_USE_UART1
|
#if PLATFORM_UART_USE_UART1 == TRUE
|
||||||
if (&UARTD1 == uartp) {
|
if (&UARTD1 == uartp) {
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* PLATFORM_UART_USE_UART1 */
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,6 +186,6 @@ size_t uart_lld_stop_receive(UARTDriver *uartp) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAL_USE_UART */
|
#endif /* HAL_USE_UART == TRUE */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#ifndef _UART_LLD_H_
|
#ifndef _UART_LLD_H_
|
||||||
#define _UART_LLD_H_
|
#define _UART_LLD_H_
|
||||||
|
|
||||||
#if HAL_USE_UART || defined(__DOXYGEN__)
|
#if (HAL_USE_UART == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver constants. */
|
/* Driver constants. */
|
||||||
|
@ -42,6 +42,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief UART driver enable switch.
|
* @brief UART driver enable switch.
|
||||||
* @details If set to @p TRUE the support for UART1 is included.
|
* @details If set to @p TRUE the support for UART1 is included.
|
||||||
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(PLATFORM_UART_USE_UART1) || defined(__DOXYGEN__)
|
#if !defined(PLATFORM_UART_USE_UART1) || defined(__DOXYGEN__)
|
||||||
#define PLATFORM_UART_USE_UART1 FALSE
|
#define PLATFORM_UART_USE_UART1 FALSE
|
||||||
|
@ -156,7 +157,7 @@ struct UARTDriver {
|
||||||
/* External declarations. */
|
/* External declarations. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#if PLATFORM_UART_USE_UART1 && !defined(__DOXYGEN__)
|
#if (PLATFORM_UART_USE_UART1 == TRUE) && !defined(__DOXYGEN__)
|
||||||
extern UARTDriver UARTD1;
|
extern UARTDriver UARTD1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -174,7 +175,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* HAL_USE_UART */
|
#endif /* HAL_USE_UART == TRUE */
|
||||||
|
|
||||||
#endif /* _UART_LLD_H_ */
|
#endif /* _UART_LLD_H_ */
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
|
|
||||||
#if HAL_USE_USB || defined(__DOXYGEN__)
|
#if (HAL_USE_USB == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver local definitions. */
|
/* Driver local definitions. */
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief USB1 driver identifier.
|
* @brief USB1 driver identifier.
|
||||||
*/
|
*/
|
||||||
#if PLATFORM_USB_USE_USB1 || defined(__DOXYGEN__)
|
#if (PLATFORM_USB_USE_USB1 == TRUE) || defined(__DOXYGEN__)
|
||||||
USBDriver USBD1;
|
USBDriver USBD1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -98,10 +98,10 @@ static const USBEndpointConfig ep0config = {
|
||||||
*/
|
*/
|
||||||
void usb_lld_init(void) {
|
void usb_lld_init(void) {
|
||||||
|
|
||||||
#if PLATFORM_USB_USE_USB1
|
#if PLATFORM_USB_USE_USB1 == TRUE
|
||||||
/* Driver initialization.*/
|
/* Driver initialization.*/
|
||||||
usbObjectInit(&USBD1);
|
usbObjectInit(&USBD1);
|
||||||
#endif /* PLATFORM_USB_USE_USB1 */
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -115,11 +115,11 @@ void usb_lld_start(USBDriver *usbp) {
|
||||||
|
|
||||||
if (usbp->state == USB_STOP) {
|
if (usbp->state == USB_STOP) {
|
||||||
/* Enables the peripheral.*/
|
/* Enables the peripheral.*/
|
||||||
#if PLATFORM_USB_USE_USB1
|
#if PLATFORM_USB_USE_USB1 == TRUE
|
||||||
if (&USBD1 == usbp) {
|
if (&USBD1 == usbp) {
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* PLATFORM_USB_USE_USB1 */
|
#endif
|
||||||
}
|
}
|
||||||
/* Configures the peripheral.*/
|
/* Configures the peripheral.*/
|
||||||
|
|
||||||
|
@ -138,11 +138,11 @@ void usb_lld_stop(USBDriver *usbp) {
|
||||||
/* Resets the peripheral.*/
|
/* Resets the peripheral.*/
|
||||||
|
|
||||||
/* Disables the peripheral.*/
|
/* Disables the peripheral.*/
|
||||||
#if PLATFORM_USB_USE_USB1
|
#if PLATFORM_USB_USE_USB1 == TRUE
|
||||||
if (&USBD1 == usbp) {
|
if (&USBD1 == usbp) {
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* PLATFORM_USB_USE_USB1 */
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -385,6 +385,6 @@ void usb_lld_clear_in(USBDriver *usbp, usbep_t ep) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAL_USE_USB */
|
#endif /* HAL_USE_USB == TRUE */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#ifndef _USB_LLD_H_
|
#ifndef _USB_LLD_H_
|
||||||
#define _USB_LLD_H_
|
#define _USB_LLD_H_
|
||||||
|
|
||||||
#if HAL_USE_USB || defined(__DOXYGEN__)
|
#if (HAL_USE_USB == TRUE) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver constants. */
|
/* Driver constants. */
|
||||||
|
@ -62,6 +62,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief USB driver enable switch.
|
* @brief USB driver enable switch.
|
||||||
* @details If set to @p TRUE the support for USB1 is included.
|
* @details If set to @p TRUE the support for USB1 is included.
|
||||||
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(PLATFORM_USB_USE_USB1) || defined(__DOXYGEN__)
|
#if !defined(PLATFORM_USB_USE_USB1) || defined(__DOXYGEN__)
|
||||||
#define PLATFORM_USB_USE_USB1 FALSE
|
#define PLATFORM_USB_USE_USB1 FALSE
|
||||||
|
@ -351,7 +352,7 @@ struct USBDriver {
|
||||||
/* External declarations. */
|
/* External declarations. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#if PLATFORM_USB_USE_USB1 && !defined(__DOXYGEN__)
|
#if (PLATFORM_USB_USE_USB1 == TRUE) && !defined(__DOXYGEN__)
|
||||||
extern USBDriver USBD1;
|
extern USBDriver USBD1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -380,7 +381,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* HAL_USE_USB */
|
#endif /* HAL_USE_USB == TRUE */
|
||||||
|
|
||||||
#endif /* _USB_LLD_H_ */
|
#endif /* _USB_LLD_H_ */
|
||||||
|
|
||||||
|
|
|
@ -5,13 +5,17 @@
|
||||||
+libclass(angle,ansi)
|
+libclass(angle,ansi)
|
||||||
+libh(core_cm4.h)
|
+libh(core_cm4.h)
|
||||||
+libh(stm32f4xx.h)
|
+libh(stm32f4xx.h)
|
||||||
+libh(*LLD.h)
|
|
||||||
|
/* Permitting anonymous unions.*/
|
||||||
|
+fan
|
||||||
|
|
||||||
/* Silencing common non-MISRA info generated by PCLint in -w3 mode. All of
|
/* Silencing common non-MISRA info generated by PCLint in -w3 mode. All of
|
||||||
them have been controlled. Other infos have been fixed in the code.*/
|
them have been controlled. Other infos have been fixed in the code.
|
||||||
-e526 -e537
|
Remove temporarily the following -e in order to perform extra code quality
|
||||||
|
checks.*/
|
||||||
|
-e526 -e537 -e552
|
||||||
-e613
|
-e613
|
||||||
-e714 -e716 -e717 -e749 -e757 -e758 -e759 -e768 -e773 -e778 -e793
|
-e714 -e716 -e717 -e749 -e757 -e758 -e759 -e766 -e768 -e769 -e773 -e778 -e793
|
||||||
-e826 -e830 -e835 -e845
|
-e826 -e830 -e835 -e845
|
||||||
|
|
||||||
/* Removing *advisory* directives and rules that would negatively impact
|
/* Removing *advisory* directives and rules that would negatively impact
|
||||||
|
|
|
@ -5,13 +5,18 @@
|
||||||
+libclass(angle,ansi)
|
+libclass(angle,ansi)
|
||||||
+libh(core_cm4.h)
|
+libh(core_cm4.h)
|
||||||
+libh(stm32f4xx.h)
|
+libh(stm32f4xx.h)
|
||||||
+libh(*LLD.h)
|
+libh(*_lld.h)
|
||||||
|
|
||||||
|
/* Permitting anonymous unions.*/
|
||||||
|
+fan
|
||||||
|
|
||||||
/* Silencing common non-MISRA info generated by PCLint in -w3 mode. All of
|
/* Silencing common non-MISRA info generated by PCLint in -w3 mode. All of
|
||||||
them have been controlled. Other infos have been fixed in the code.*/
|
them have been controlled. Other infos have been fixed in the code.
|
||||||
-e526 -e537
|
Remove temporarily the following -e in order to perform extra code quality
|
||||||
|
checks.*/
|
||||||
|
-e526 -e537 -e552
|
||||||
-e613
|
-e613
|
||||||
-e714 -e716 -e717 -e749 -e757 -e758 -e759 -e768 -e773 -e778 -e793
|
-e714 -e716 -e717 -e749 -e757 -e758 -e759 -e766 -e768 -e769 -e773 -e778 -e793
|
||||||
-e826 -e830 -e835 -e845
|
-e826 -e830 -e835 -e845
|
||||||
|
|
||||||
/* Removing *advisory* directives and rules that would negatively impact
|
/* Removing *advisory* directives and rules that would negatively impact
|
||||||
|
|
Loading…
Reference in New Issue