Style-related fixes, mainly white space.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14999 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
ba6f180920
commit
dcc0824e97
|
@ -31,7 +31,7 @@
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#if STM32_ADC_DUAL_MODE == TRUE
|
#if STM32_ADC_DUAL_MODE == TRUE
|
||||||
#define ADC12_CCR_DUAL ADC_CCR_DUAL_REG_SIMULT
|
#define ADC12_CCR_DUAL ADC_CCR_DUAL_REG_SIMULT
|
||||||
#if STM32_ADC_SAMPLES_SIZE == 8
|
#if STM32_ADC_SAMPLES_SIZE == 8
|
||||||
/* Compact type dual mode, 2x8-bit.*/
|
/* Compact type dual mode, 2x8-bit.*/
|
||||||
#define ADC12_DMA_SIZE (STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_PSIZE_HWORD)
|
#define ADC12_DMA_SIZE (STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_PSIZE_HWORD)
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
#endif /* STM32_ADC_SAMPLES_SIZE == 8 */
|
#endif /* STM32_ADC_SAMPLES_SIZE == 8 */
|
||||||
|
|
||||||
#else /* STM32_ADC_DUAL_MODE == FALSE */
|
#else /* STM32_ADC_DUAL_MODE == FALSE */
|
||||||
#define ADC12_CCR_DUAL ADC_CCR_DUAL_INDEPENDENT
|
#define ADC12_CCR_DUAL ADC_CCR_DUAL_INDEPENDENT
|
||||||
#if STM32_ADC_SAMPLES_SIZE == 8
|
#if STM32_ADC_SAMPLES_SIZE == 8
|
||||||
/* Compact type single mode, 8-bit.*/
|
/* Compact type single mode, 8-bit.*/
|
||||||
#define ADC12_DMA_SIZE (STM32_DMA_CR_MSIZE_BYTE | STM32_DMA_CR_PSIZE_BYTE)
|
#define ADC12_DMA_SIZE (STM32_DMA_CR_MSIZE_BYTE | STM32_DMA_CR_PSIZE_BYTE)
|
||||||
|
@ -641,9 +641,9 @@ void adc_lld_start_conversion(ADCDriver *adcp) {
|
||||||
adcp->adcm->ISR = adcp->adcm->ISR;
|
adcp->adcm->ISR = adcp->adcm->ISR;
|
||||||
/* If a callback is set enable the overflow and analog watch dog interrupts. */
|
/* If a callback is set enable the overflow and analog watch dog interrupts. */
|
||||||
if (grpp->error_cb != NULL) {
|
if (grpp->error_cb != NULL) {
|
||||||
adcp->adcm->IER = ADC_IER_OVRIE | ADC_IER_AWD1IE
|
adcp->adcm->IER = ADC_IER_OVRIE | ADC_IER_AWD1IE |
|
||||||
| ADC_IER_AWD2IE
|
ADC_IER_AWD2IE |
|
||||||
| ADC_IER_AWD3IE;
|
ADC_IER_AWD3IE;
|
||||||
}
|
}
|
||||||
#if STM32_ADC_DUAL_MODE == TRUE && STM32_ADC_USE_ADC12 == TRUE
|
#if STM32_ADC_DUAL_MODE == TRUE && STM32_ADC_USE_ADC12 == TRUE
|
||||||
/* Configuration for dual mode ADC12 */
|
/* Configuration for dual mode ADC12 */
|
||||||
|
@ -652,9 +652,10 @@ void adc_lld_start_conversion(ADCDriver *adcp) {
|
||||||
adcp->adcs->ISR = adcp->adcs->ISR;
|
adcp->adcs->ISR = adcp->adcs->ISR;
|
||||||
/* If a callback is set enable the overflow and analog watch dog interrupts. */
|
/* If a callback is set enable the overflow and analog watch dog interrupts. */
|
||||||
if (grpp->error_cb != NULL) {
|
if (grpp->error_cb != NULL) {
|
||||||
adcp->adcs->IER = ADC_IER_OVRIE | ADC_IER_AWD1IE
|
adcp->adcs->IER = ADC_IER_OVRIE | ADC_IER_AWD1IE |
|
||||||
| ADC_IER_AWD2IE
|
ADC_IER_AWD2IE |
|
||||||
| ADC_IER_AWD3IE;
|
ADC_IER_AWD3IE;
|
||||||
|
|
||||||
/* Configuring the CCR register with the user-specified settings
|
/* Configuring the CCR register with the user-specified settings
|
||||||
in the conversion group configuration structure, static settings are
|
in the conversion group configuration structure, static settings are
|
||||||
preserved.*/
|
preserved.*/
|
||||||
|
|
|
@ -374,8 +374,8 @@
|
||||||
#error "Invalid IRQ priority assigned to ADC3"
|
#error "Invalid IRQ priority assigned to ADC3"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ((STM32_ADC_SAMPLES_SIZE != 8) && \
|
#if ((STM32_ADC_SAMPLES_SIZE != 8) && \
|
||||||
(STM32_ADC_SAMPLES_SIZE != 16) && \
|
(STM32_ADC_SAMPLES_SIZE != 16) && \
|
||||||
(STM32_ADC_SAMPLES_SIZE != 32))
|
(STM32_ADC_SAMPLES_SIZE != 32))
|
||||||
#error "STM32_ADC_SAMPLES_SIZE must be 8, 16 or 32"
|
#error "STM32_ADC_SAMPLES_SIZE must be 8, 16 or 32"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -254,7 +254,6 @@
|
||||||
#error "ADC DMA stream not defined"
|
#error "ADC DMA stream not defined"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* ADC clock source checks.*/
|
/* ADC clock source checks.*/
|
||||||
#if STM32_ADC_PRESCALER_VALUE == 2
|
#if STM32_ADC_PRESCALER_VALUE == 2
|
||||||
#define STM32_ADC_PRESC 1U
|
#define STM32_ADC_PRESC 1U
|
||||||
|
|
|
@ -1540,7 +1540,7 @@ cryerror_t cry_lld_SHA256_init(CRYDriver *cryp, SHA256Context *sha256ctxp) {
|
||||||
sha256ctxp->last_size = 0U;
|
sha256ctxp->last_size = 0U;
|
||||||
|
|
||||||
/* Initializing operation.*/
|
/* Initializing operation.*/
|
||||||
HASH->CR = /*HASH_CR_MDMAT |*/ HASH_CR_ALGO_1 | HASH_CR_ALGO_0 |
|
HASH->CR = /* HASH_CR_MDMAT |*/ HASH_CR_ALGO_1 | HASH_CR_ALGO_0 |
|
||||||
HASH_CR_DATATYPE_1 | HASH_CR_INIT;
|
HASH_CR_DATATYPE_1 | HASH_CR_INIT;
|
||||||
|
|
||||||
return CRY_NOERROR;
|
return CRY_NOERROR;
|
||||||
|
|
|
@ -89,7 +89,6 @@
|
||||||
#define SRAMCAN_SIZE ((uint32_t)(SRAMCAN_TMSA + \
|
#define SRAMCAN_SIZE ((uint32_t)(SRAMCAN_TMSA + \
|
||||||
(STM32_FDCAN_TM_NBR * SRAMCAN_TM_SIZE)))
|
(STM32_FDCAN_TM_NBR * SRAMCAN_TM_SIZE)))
|
||||||
|
|
||||||
|
|
||||||
#define TIMEOUT_INIT_MS 250U
|
#define TIMEOUT_INIT_MS 250U
|
||||||
#define TIMEOUT_CSA_MS 250U
|
#define TIMEOUT_CSA_MS 250U
|
||||||
|
|
||||||
|
@ -567,7 +566,7 @@ void can_lld_serve_interrupt(CANDriver *canp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Overflow events.*/
|
/* Overflow events.*/
|
||||||
if (((ir & FDCAN_IR_RF0L) != 0U) || ((ir & FDCAN_IR_RF1L) != 0U) ) {
|
if (((ir & FDCAN_IR_RF0L) != 0U) || ((ir & FDCAN_IR_RF1L) != 0U)) {
|
||||||
_can_error_isr(canp, CAN_OVERFLOW_ERROR);
|
_can_error_isr(canp, CAN_OVERFLOW_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -287,7 +287,6 @@ typedef struct {
|
||||||
};
|
};
|
||||||
} CANRxStandardFilter;
|
} CANRxStandardFilter;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief CAN extended filter.
|
* @brief CAN extended filter.
|
||||||
* @note Accessing the frame data as word16 or word32 is not portable
|
* @note Accessing the frame data as word16 or word32 is not portable
|
||||||
|
@ -311,7 +310,6 @@ typedef struct {
|
||||||
};
|
};
|
||||||
} CANRxExtendedFilter;
|
} CANRxExtendedFilter;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Type of a CAN configuration structure.
|
* @brief Type of a CAN configuration structure.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -284,7 +284,7 @@ static void i2c_lld_serve_event_interrupt(I2CDriver *i2cp) {
|
||||||
break;
|
break;
|
||||||
case I2C_EV8_2_MASTER_BYTE_TRANSMITTED:
|
case I2C_EV8_2_MASTER_BYTE_TRANSMITTED:
|
||||||
/* Catches BTF event after the end of transmission.*/
|
/* Catches BTF event after the end of transmission.*/
|
||||||
(void)dp->DR; /* clear BTF.*/
|
(void)dp->DR; /* Clear BTF.*/
|
||||||
if (dmaStreamGetTransactionSize(i2cp->dmarx) > 0) {
|
if (dmaStreamGetTransactionSize(i2cp->dmarx) > 0) {
|
||||||
/* Starts "read after write" operation, LSB = 1 -> receive.*/
|
/* Starts "read after write" operation, LSB = 1 -> receive.*/
|
||||||
i2cp->addr |= 0x01;
|
i2cp->addr |= 0x01;
|
||||||
|
@ -306,7 +306,7 @@ static void i2c_lld_serve_event_interrupt(I2CDriver *i2cp) {
|
||||||
if (event & (I2C_SR1_ADDR | I2C_SR1_ADD10))
|
if (event & (I2C_SR1_ADDR | I2C_SR1_ADD10))
|
||||||
(void)dp->SR2;
|
(void)dp->SR2;
|
||||||
|
|
||||||
/* BERR flag doesn’t happen anymore in event handling */
|
/* BERR flag doesn<EFBFBD>t happen anymore in event handling */
|
||||||
#if 0
|
#if 0
|
||||||
/* Errata 2.4.6 for STM32F40x, Spurious Bus Error detection in Master mode.*/
|
/* Errata 2.4.6 for STM32F40x, Spurious Bus Error detection in Master mode.*/
|
||||||
if (event & I2C_SR1_BERR) {
|
if (event & I2C_SR1_BERR) {
|
||||||
|
|
|
@ -279,7 +279,7 @@ OSAL_IRQ_HANDLER(STM32_ETH_HANDLER) {
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
void mac_lld_init(void) {
|
void mac_lld_init(void) {
|
||||||
unsigned i,j;
|
unsigned i, j;
|
||||||
|
|
||||||
macObjectInit(ÐD1);
|
macObjectInit(ÐD1);
|
||||||
ETHD1.link_up = false;
|
ETHD1.link_up = false;
|
||||||
|
@ -292,7 +292,7 @@ void mac_lld_init(void) {
|
||||||
__eth_rd[i].rdes2 = 0;
|
__eth_rd[i].rdes2 = 0;
|
||||||
__eth_rd[i].rdes3 = STM32_RDES3_OWN | STM32_RDES3_IOC | STM32_RDES3_BUF1V;
|
__eth_rd[i].rdes3 = STM32_RDES3_OWN | STM32_RDES3_IOC | STM32_RDES3_BUF1V;
|
||||||
for (j = 0; j < BUFFER_SIZE; j++) {
|
for (j = 0; j < BUFFER_SIZE; j++) {
|
||||||
__eth_rb[i][j] = 825373492; /* telltale "1234" */
|
__eth_rb[i][j] = 825373492; /* Telltale "1234".*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (i = 0; i < STM32_MAC_TRANSMIT_BUFFERS; i++) {
|
for (i = 0; i < STM32_MAC_TRANSMIT_BUFFERS; i++) {
|
||||||
|
@ -301,7 +301,7 @@ void mac_lld_init(void) {
|
||||||
__eth_td[i].tdes2 = 0;
|
__eth_td[i].tdes2 = 0;
|
||||||
__eth_td[i].tdes3 = 0;
|
__eth_td[i].tdes3 = 0;
|
||||||
for (j = 0; j < BUFFER_SIZE; j++) {
|
for (j = 0; j < BUFFER_SIZE; j++) {
|
||||||
__eth_tb[i][j] = 892745528; /* telltale "5678" */
|
__eth_tb[i][j] = 892745528; /* Telltale "5678".*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -426,7 +426,6 @@ void mac_lld_start(MACDriver *macp) {
|
||||||
ETH->DMACSR = ETH_DMACSR_NIS;
|
ETH->DMACSR = ETH_DMACSR_NIS;
|
||||||
ETH->DMACIER = ETH_DMACIER_NIE | ETH_DMACIER_RIE | ETH_DMACIER_TIE;
|
ETH->DMACIER = ETH_DMACIER_NIE | ETH_DMACIER_RIE | ETH_DMACIER_TIE;
|
||||||
|
|
||||||
|
|
||||||
/* Check because errata on some devices. There should be no need to
|
/* Check because errata on some devices. There should be no need to
|
||||||
disable flushing because the TXFIFO should be empty on macStart().*/
|
disable flushing because the TXFIFO should be empty on macStart().*/
|
||||||
#if !defined(STM32_MAC_DISABLE_TX_FLUSH)
|
#if !defined(STM32_MAC_DISABLE_TX_FLUSH)
|
||||||
|
@ -440,9 +439,8 @@ void mac_lld_start(MACDriver *macp) {
|
||||||
ETH->MTLRQOMR = ETH_MTLRQOMR_DISTCPEF | ETH_MTLRQOMR_RSF;
|
ETH->MTLRQOMR = ETH_MTLRQOMR_DISTCPEF | ETH_MTLRQOMR_RSF;
|
||||||
ETH->MTLTQOMR = ETH_MTLTQOMR_TSF;
|
ETH->MTLTQOMR = ETH_MTLTQOMR_TSF;
|
||||||
ETH->DMACTCR = ETH_DMACTCR_ST | ETH_DMACTCR_TPBL_1PBL;
|
ETH->DMACTCR = ETH_DMACTCR_ST | ETH_DMACTCR_TPBL_1PBL;
|
||||||
ETH->DMACRCR = ETH_DMACRCR_SR | ETH_DMACRCR_RPBL_1PBL
|
ETH->DMACRCR = ETH_DMACRCR_SR | ETH_DMACRCR_RPBL_1PBL |
|
||||||
| (STM32_MAC_BUFFERS_SIZE << ETH_DMACRCR_RBSZ_Pos
|
(STM32_MAC_BUFFERS_SIZE << ETH_DMACRCR_RBSZ_Pos & ETH_DMACRCR_RBSZ);
|
||||||
& ETH_DMACRCR_RBSZ);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -503,9 +501,9 @@ msg_t mac_lld_get_transmit_descriptor(MACDriver *macp,
|
||||||
return MSG_TIMEOUT;
|
return MSG_TIMEOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
tdes->tdes0 = (uint32_t )__eth_tb[macp->tdindex];
|
tdes->tdes0 = (uint32_t)__eth_tb[macp->tdindex];
|
||||||
/* Marks the current descriptor as locked using a reserved bit.*/
|
/* Marks the current descriptor as locked using a reserved bit.
|
||||||
/*tdes->tdes0 |= STM32_TDES0_LOCKED; */
|
tdes->tdes0 |= STM32_TDES0_LOCKED; */
|
||||||
tdes->tdes1++;
|
tdes->tdes1++;
|
||||||
|
|
||||||
/* Next TX descriptor to use.*/
|
/* Next TX descriptor to use.*/
|
||||||
|
@ -589,7 +587,7 @@ msg_t mac_lld_get_receive_descriptor(MACDriver *macp,
|
||||||
&& (rdes->rdes3 & STM32_RDES3_FD) && (rdes->rdes3 & STM32_RDES3_LD)) {
|
&& (rdes->rdes3 & STM32_RDES3_FD) && (rdes->rdes3 & STM32_RDES3_LD)) {
|
||||||
/* Found a valid one.*/
|
/* Found a valid one.*/
|
||||||
rdp->offset = 0;
|
rdp->offset = 0;
|
||||||
rdp->size = (rdes->rdes3 & STM32_RDES3_PL_MASK) -2; /* Lose CRC */
|
rdp->size = (rdes->rdes3 & STM32_RDES3_PL_MASK) -2; /* Lose CRC.*/
|
||||||
rdp->physdesc = rdes;
|
rdp->physdesc = rdes;
|
||||||
/* Reposition in ring.*/
|
/* Reposition in ring.*/
|
||||||
macp->rdindex++;
|
macp->rdindex++;
|
||||||
|
|
|
@ -510,12 +510,14 @@ static void otg_isoc_out_failed_handler(USBDriver *usbp) {
|
||||||
for (ep = 0; ep <= usbp->otgparams->num_endpoints; ep++) {
|
for (ep = 0; ep <= usbp->otgparams->num_endpoints; ep++) {
|
||||||
if (((otgp->oe[ep].DOEPCTL & DOEPCTL_EPTYP_MASK) == DOEPCTL_EPTYP_ISO) &&
|
if (((otgp->oe[ep].DOEPCTL & DOEPCTL_EPTYP_MASK) == DOEPCTL_EPTYP_ISO) &&
|
||||||
((otgp->oe[ep].DOEPCTL & DOEPCTL_EPENA) != 0)) {
|
((otgp->oe[ep].DOEPCTL & DOEPCTL_EPENA) != 0)) {
|
||||||
/* Endpoint enabled -> ISOC OUT transfer failed */
|
#if 0
|
||||||
/* Disable endpoint */
|
/* Endpoint enabled -> ISOC OUT transfer failed.*/
|
||||||
|
/* Disable endpoint.*/
|
||||||
/* CHTODO:: Core stucks here */
|
/* CHTODO:: Core stucks here */
|
||||||
/*otgp->oe[ep].DOEPCTL |= (DOEPCTL_EPDIS | DOEPCTL_SNAK);
|
otgp->oe[ep].DOEPCTL |= (DOEPCTL_EPDIS | DOEPCTL_SNAK);
|
||||||
while (otgp->oe[ep].DOEPCTL & DOEPCTL_EPENA)
|
while (otgp->oe[ep].DOEPCTL & DOEPCTL_EPENA)
|
||||||
;*/
|
;
|
||||||
|
#endif
|
||||||
/* Prepare transfer for next frame.*/
|
/* Prepare transfer for next frame.*/
|
||||||
_usb_isr_invoke_out_cb(usbp, ep);
|
_usb_isr_invoke_out_cb(usbp, ep);
|
||||||
}
|
}
|
||||||
|
@ -1148,7 +1150,7 @@ void usb_lld_start_out(USBDriver *usbp, usbep_t ep) {
|
||||||
usbp->epc[ep]->out_maxsize;
|
usbp->epc[ep]->out_maxsize;
|
||||||
rxsize = (pcnt * usbp->epc[ep]->out_maxsize + 3U) & 0xFFFFFFFCU;
|
rxsize = (pcnt * usbp->epc[ep]->out_maxsize + 3U) & 0xFFFFFFFCU;
|
||||||
|
|
||||||
/*Setting up transaction parameters in DOEPTSIZ.*/
|
/* Setting up transaction parameters in DOEPTSIZ.*/
|
||||||
usbp->otg->oe[ep].DOEPTSIZ = DOEPTSIZ_STUPCNT(3) | DOEPTSIZ_PKTCNT(pcnt) |
|
usbp->otg->oe[ep].DOEPTSIZ = DOEPTSIZ_STUPCNT(3) | DOEPTSIZ_PKTCNT(pcnt) |
|
||||||
DOEPTSIZ_XFRSIZ(rxsize);
|
DOEPTSIZ_XFRSIZ(rxsize);
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -249,7 +249,6 @@ typedef struct hal_rtc_wakeup {
|
||||||
/* Pointer to TAMPER registers block. */ \
|
/* Pointer to TAMPER registers block. */ \
|
||||||
TAMP_TypeDef *tamp
|
TAMP_TypeDef *tamp
|
||||||
|
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver macros. */
|
/* Driver macros. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
|
@ -319,7 +319,6 @@
|
||||||
#error "invalid DMA stream associated to SPI3 TX"
|
#error "invalid DMA stream associated to SPI3 TX"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif /* STM32_ADVANCED_DMA && !STM32_DMA_SUPPORTS_DMAMUX */
|
#endif /* STM32_ADVANCED_DMA && !STM32_DMA_SUPPORTS_DMAMUX */
|
||||||
|
|
||||||
#if !defined(STM32_DMA_REQUIRED)
|
#if !defined(STM32_DMA_REQUIRED)
|
||||||
|
|
|
@ -277,7 +277,7 @@ static void spi_lld_serve_tx_interrupt(SPIDriver *spip, uint32_t flags) {
|
||||||
* @return The operation status.
|
* @return The operation status.
|
||||||
*/
|
*/
|
||||||
static msg_t spi_lld_get_dma(SPIDriver *spip, uint32_t rxstream,
|
static msg_t spi_lld_get_dma(SPIDriver *spip, uint32_t rxstream,
|
||||||
uint32_t txstream, uint32_t priority){
|
uint32_t txstream, uint32_t priority) {
|
||||||
|
|
||||||
spip->dmarx = dmaStreamAllocI(rxstream, priority,
|
spip->dmarx = dmaStreamAllocI(rxstream, priority,
|
||||||
(stm32_dmaisr_t)spi_lld_serve_rx_interrupt,
|
(stm32_dmaisr_t)spi_lld_serve_rx_interrupt,
|
||||||
|
|
|
@ -396,7 +396,7 @@ static void spi_lld_serve_interrupt(SPIDriver *spip) {
|
||||||
* @return The operation status.
|
* @return The operation status.
|
||||||
*/
|
*/
|
||||||
static msg_t spi_lld_get_dma(SPIDriver *spip, uint32_t rxstream,
|
static msg_t spi_lld_get_dma(SPIDriver *spip, uint32_t rxstream,
|
||||||
uint32_t txstream, uint32_t priority){
|
uint32_t txstream, uint32_t priority) {
|
||||||
|
|
||||||
spip->rx.dma = dmaStreamAllocI(rxstream, priority,
|
spip->rx.dma = dmaStreamAllocI(rxstream, priority,
|
||||||
(stm32_dmaisr_t)spi_lld_serve_dma_rx_interrupt,
|
(stm32_dmaisr_t)spi_lld_serve_dma_rx_interrupt,
|
||||||
|
@ -428,7 +428,7 @@ static msg_t spi_lld_get_dma(SPIDriver *spip, uint32_t rxstream,
|
||||||
* @return The operation status.
|
* @return The operation status.
|
||||||
*/
|
*/
|
||||||
static msg_t spi_lld_get_bdma(SPIDriver *spip, uint32_t rxstream,
|
static msg_t spi_lld_get_bdma(SPIDriver *spip, uint32_t rxstream,
|
||||||
uint32_t txstream, uint32_t priority){
|
uint32_t txstream, uint32_t priority) {
|
||||||
|
|
||||||
spip->rx.bdma = bdmaStreamAllocI(rxstream, priority,
|
spip->rx.bdma = bdmaStreamAllocI(rxstream, priority,
|
||||||
(stm32_bdmaisr_t)spi_lld_serve_bdma_rx_interrupt,
|
(stm32_bdmaisr_t)spi_lld_serve_bdma_rx_interrupt,
|
||||||
|
|
|
@ -137,7 +137,7 @@
|
||||||
#if !defined(STM32_HAS_TIM22)
|
#if !defined(STM32_HAS_TIM22)
|
||||||
#define STM32_HAS_TIM22 FALSE
|
#define STM32_HAS_TIM22 FALSE
|
||||||
#endif
|
#endif
|
||||||
/**/
|
/* End of checks to be removed.*/
|
||||||
|
|
||||||
#if OSAL_ST_MODE == OSAL_ST_MODE_FREERUNNING
|
#if OSAL_ST_MODE == OSAL_ST_MODE_FREERUNNING
|
||||||
|
|
||||||
|
@ -684,7 +684,6 @@ extern "C" {
|
||||||
/* Driver inline functions. */
|
/* Driver inline functions. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
|
||||||
#if (OSAL_ST_MODE == OSAL_ST_MODE_FREERUNNING) || defined(__DOXYGEN__)
|
#if (OSAL_ST_MODE == OSAL_ST_MODE_FREERUNNING) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -786,7 +785,6 @@ static inline bool st_lld_is_alarm_active(void) {
|
||||||
*/
|
*/
|
||||||
static inline void st_lld_start_alarm_n(unsigned alarm, systime_t abstime) {
|
static inline void st_lld_start_alarm_n(unsigned alarm, systime_t abstime) {
|
||||||
|
|
||||||
|
|
||||||
STM32_ST_TIM->CCR[alarm] = (uint32_t)abstime;
|
STM32_ST_TIM->CCR[alarm] = (uint32_t)abstime;
|
||||||
STM32_ST_TIM->SR = 0;
|
STM32_ST_TIM->SR = 0;
|
||||||
STM32_ST_TIM->DIER |= (STM32_TIM_DIER_CC1IE << alarm);
|
STM32_ST_TIM->DIER |= (STM32_TIM_DIER_CC1IE << alarm);
|
||||||
|
|
|
@ -117,7 +117,7 @@ void st_lld_init(void) {
|
||||||
|
|
||||||
/* Wait for shadow reg. update.*/
|
/* Wait for shadow reg. update.*/
|
||||||
while ((RTC->ICSR & RTC_ICSR_RSF) == 0U) {
|
while ((RTC->ICSR & RTC_ICSR_RSF) == 0U) {
|
||||||
// wait RSF flag
|
/* Wait RSF flag.*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Compare all Sub Seconds 32 bits for RTC Alarm A.*/
|
/* Compare all Sub Seconds 32 bits for RTC Alarm A.*/
|
||||||
|
|
|
@ -84,7 +84,6 @@
|
||||||
#error "RTC does not support binary mode"
|
#error "RTC does not support binary mode"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if (OSAL_ST_RESOLUTION != 32)
|
#if (OSAL_ST_RESOLUTION != 32)
|
||||||
#error "ST based on RTC requires 32bits resolution. Set CH_CFG_ST_RESOLUTION to 32."
|
#error "ST based on RTC requires 32bits resolution. Set CH_CFG_ST_RESOLUTION to 32."
|
||||||
#endif
|
#endif
|
||||||
|
@ -177,7 +176,6 @@ static inline void st_lld_set_alarm(systime_t abstime) {
|
||||||
st_lld_start_alarm(abstime);
|
st_lld_start_alarm(abstime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Determines if the alarm is active.
|
* @brief Determines if the alarm is active.
|
||||||
*
|
*
|
||||||
|
|
|
@ -377,7 +377,6 @@ msg_t sio_lld_start(SIODriver *siop) {
|
||||||
siop->sync_rx = NULL;
|
siop->sync_rx = NULL;
|
||||||
siop->sync_tx = NULL;
|
siop->sync_tx = NULL;
|
||||||
siop->sync_txend = NULL;
|
siop->sync_txend = NULL;
|
||||||
// siop->events = 0U;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -387,7 +386,6 @@ msg_t sio_lld_start(SIODriver *siop) {
|
||||||
return HAL_RET_SUCCESS;
|
return HAL_RET_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Deactivates the SIO peripheral.
|
* @brief Deactivates the SIO peripheral.
|
||||||
*
|
*
|
||||||
|
|
|
@ -385,7 +385,6 @@ msg_t sio_lld_start(SIODriver *siop) {
|
||||||
siop->sync_rx = NULL;
|
siop->sync_rx = NULL;
|
||||||
siop->sync_tx = NULL;
|
siop->sync_tx = NULL;
|
||||||
siop->sync_txend = NULL;
|
siop->sync_txend = NULL;
|
||||||
// siop->events = 0U;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,7 +394,6 @@ msg_t sio_lld_start(SIODriver *siop) {
|
||||||
return HAL_RET_SUCCESS;
|
return HAL_RET_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Deactivates the SIO peripheral.
|
* @brief Deactivates the SIO peripheral.
|
||||||
*
|
*
|
||||||
|
|
|
@ -539,8 +539,8 @@ void usb_lld_reset(USBDriver *usbp) {
|
||||||
STM32_USB->BTABLE = BTABLE_ADDR;
|
STM32_USB->BTABLE = BTABLE_ADDR;
|
||||||
STM32_USB->ISTR = 0;
|
STM32_USB->ISTR = 0;
|
||||||
STM32_USB->DADDR = DADDR_EF;
|
STM32_USB->DADDR = DADDR_EF;
|
||||||
cntr = /*CNTR_ESOFM | */ CNTR_RESETM | CNTR_SUSPM |
|
cntr = /* CNTR_ESOFM | */ CNTR_RESETM | CNTR_SUSPM |
|
||||||
CNTR_WKUPM | /*CNTR_ERRM | CNTR_PMAOVRM |*/ CNTR_CTRM;
|
CNTR_WKUPM | /* CNTR_ERRM | CNTR_PMAOVRM |*/ CNTR_CTRM;
|
||||||
/* The SOF interrupt is only enabled if a callback is defined for
|
/* The SOF interrupt is only enabled if a callback is defined for
|
||||||
this service because it is an high rate source.*/
|
this service because it is an high rate source.*/
|
||||||
if (usbp->config->sof_cb != NULL)
|
if (usbp->config->sof_cb != NULL)
|
||||||
|
|
|
@ -65,8 +65,8 @@ EFlashDriver EFLD1;
|
||||||
/* Driver local variables and types. */
|
/* Driver local variables and types. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#if defined(STM32F413xx) || defined(STM32F412xx) || defined(STM32F40_41xxx) \
|
#if defined(STM32F413xx) || defined(STM32F412xx) || \
|
||||||
|| defined(__DOXYGEN__)
|
defined(STM32F40_41xxx) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/* Sector table for 1.5M device. */
|
/* Sector table for 1.5M device. */
|
||||||
static const flash_sector_descriptor_t efl_lld_sect1[STM32_FLASH1_SECTORS_TOTAL] = {
|
static const flash_sector_descriptor_t efl_lld_sect1[STM32_FLASH1_SECTORS_TOTAL] = {
|
||||||
|
|
|
@ -51,8 +51,8 @@
|
||||||
/* Derived constants and error checks. */
|
/* Derived constants and error checks. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#if defined(STM32F413xx) || defined(STM32F412xx) || defined(STM32F40_41xxx) \
|
#if defined(STM32F413xx) || defined(STM32F412xx) || \
|
||||||
|| defined(__DOXYGEN__)
|
defined(STM32F40_41xxx) || defined(__DOXYGEN__)
|
||||||
|
|
||||||
/* Flash size register. */
|
/* Flash size register. */
|
||||||
#define STM32_FLASH_SIZE_REGISTER 0x1FFF7A22
|
#define STM32_FLASH_SIZE_REGISTER 0x1FFF7A22
|
||||||
|
|
|
@ -193,8 +193,8 @@ void efl_lld_init(void) {
|
||||||
/* Find the size of the flash and set descriptor reference. */
|
/* Find the size of the flash and set descriptor reference. */
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
for (i = 0; i < (sizeof(efl_lld_flash_sizes) / sizeof(efl_lld_size_t)); i++) {
|
for (i = 0; i < (sizeof(efl_lld_flash_sizes) / sizeof(efl_lld_size_t)); i++) {
|
||||||
if (efl_lld_flash_sizes[i].desc->size == stm32_flash_get_size()) {
|
if (efl_lld_flash_sizes[i].desc->size == stm32_flash_get_size()) {
|
||||||
EFLD1.descriptor = efl_lld_flash_sizes[i].desc;
|
EFLD1.descriptor = efl_lld_flash_sizes[i].desc;
|
||||||
if (stm32_flash_dual_bank(&EFLD1)) {
|
if (stm32_flash_dual_bank(&EFLD1)) {
|
||||||
/* Point to the dual bank descriptor. */
|
/* Point to the dual bank descriptor. */
|
||||||
EFLD1.descriptor++;
|
EFLD1.descriptor++;
|
||||||
|
|
|
@ -51,8 +51,8 @@
|
||||||
/* Derived constants and error checks. */
|
/* Derived constants and error checks. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#if defined(STM32G070xx) || defined(STM32G071xx) || \
|
#if defined(STM32G070xx) || defined(STM32G071xx) || \
|
||||||
defined(STM32G081xx) || \
|
defined(STM32G081xx) || \
|
||||||
defined(__DOXYGEN__)
|
defined(__DOXYGEN__)
|
||||||
|
|
||||||
/* Flash size register. */
|
/* Flash size register. */
|
||||||
|
|
|
@ -354,7 +354,7 @@ static bool hal_lld_clock_check_tree(const halclkcfg_t *ccp) {
|
||||||
/* PLL VCO frequency.*/
|
/* PLL VCO frequency.*/
|
||||||
pllvcoclk = (pllselclk / (halfreq_t)pllmdiv) * (halfreq_t)pllndiv;
|
pllvcoclk = (pllselclk / (halfreq_t)pllmdiv) * (halfreq_t)pllndiv;
|
||||||
|
|
||||||
if((pllvcoclk < slp->pllvco_min) || (pllvcoclk > slp->pllvco_max)) {
|
if ((pllvcoclk < slp->pllvco_min) || (pllvcoclk > slp->pllvco_max)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -363,7 +363,7 @@ static bool hal_lld_clock_check_tree(const halclkcfg_t *ccp) {
|
||||||
if ((ccp->rcc_pllcfgr & RCC_PLLCFGR_PLLPEN) != 0U) {
|
if ((ccp->rcc_pllcfgr & RCC_PLLCFGR_PLLPEN) != 0U) {
|
||||||
pllpclk = pllvcoclk / pllpdiv;
|
pllpclk = pllvcoclk / pllpdiv;
|
||||||
|
|
||||||
if((pllpclk < slp->pllp_min) || (pllpclk > slp->pllp_max)) {
|
if ((pllpclk < slp->pllp_min) || (pllpclk > slp->pllp_max)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -373,7 +373,7 @@ static bool hal_lld_clock_check_tree(const halclkcfg_t *ccp) {
|
||||||
if ((ccp->rcc_pllcfgr & RCC_PLLCFGR_PLLQEN) != 0U) {
|
if ((ccp->rcc_pllcfgr & RCC_PLLCFGR_PLLQEN) != 0U) {
|
||||||
pllqclk = pllvcoclk / pllqdiv;
|
pllqclk = pllvcoclk / pllqdiv;
|
||||||
|
|
||||||
if((pllqclk < slp->pllq_min) || (pllqclk > slp->pllq_max)) {
|
if ((pllqclk < slp->pllq_min) || (pllqclk > slp->pllq_max)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -383,14 +383,14 @@ static bool hal_lld_clock_check_tree(const halclkcfg_t *ccp) {
|
||||||
if ((ccp->rcc_pllcfgr & RCC_PLLCFGR_PLLREN) != 0U) {
|
if ((ccp->rcc_pllcfgr & RCC_PLLCFGR_PLLREN) != 0U) {
|
||||||
pllrclk = pllvcoclk / pllrdiv;
|
pllrclk = pllvcoclk / pllrdiv;
|
||||||
|
|
||||||
if((pllrclk < slp->pllr_min) || (pllrclk > slp->pllr_max)) {
|
if ((pllrclk < slp->pllr_min) || (pllrclk > slp->pllr_max)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* SYSCLK frequency.*/
|
/* SYSCLK frequency.*/
|
||||||
switch(ccp->rcc_cfgr & RCC_CFGR_SW_Msk) {
|
switch (ccp->rcc_cfgr & RCC_CFGR_SW_Msk) {
|
||||||
case RCC_CFGR_SW_HSI:
|
case RCC_CFGR_SW_HSI:
|
||||||
sysclk = hsisysclk;
|
sysclk = hsisysclk;
|
||||||
break;
|
break;
|
||||||
|
@ -427,7 +427,7 @@ static bool hal_lld_clock_check_tree(const halclkcfg_t *ccp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MCO clock.*/
|
/* MCO clock.*/
|
||||||
switch(ccp->rcc_cfgr & RCC_CFGR_MCOSEL_Msk) {
|
switch (ccp->rcc_cfgr & RCC_CFGR_MCOSEL_Msk) {
|
||||||
case STM32_MCOSEL_NOCLOCK:
|
case STM32_MCOSEL_NOCLOCK:
|
||||||
mcoclk = 0U;
|
mcoclk = 0U;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -288,7 +288,6 @@
|
||||||
#define STM32_ADCSEL_HSI16 (2U << 30U) /**< ADC source is HSI16. */
|
#define STM32_ADCSEL_HSI16 (2U << 30U) /**< ADC source is HSI16. */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name RCC_CCIPR2 register bits definitions
|
* @name RCC_CCIPR2 register bits definitions
|
||||||
* @{
|
* @{
|
||||||
|
@ -1569,7 +1568,6 @@
|
||||||
#elif STM32_RNGSEL == STM32_RNGSEL_PLLQCLK
|
#elif STM32_RNGSEL == STM32_RNGSEL_PLLQCLK
|
||||||
#define STM32_RNGCLK (hal_lld_get_clock_point(CLK_PLLQCLK) / STM32_RNGDIV_VALUE)
|
#define STM32_RNGCLK (hal_lld_get_clock_point(CLK_PLLQCLK) / STM32_RNGDIV_VALUE)
|
||||||
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#error "invalid source selected for RNG clock"
|
#error "invalid source selected for RNG clock"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -95,7 +95,6 @@
|
||||||
|
|
||||||
#define STM32_RCC_HAS_PLL TRUE
|
#define STM32_RCC_HAS_PLL TRUE
|
||||||
#define STM32_RCC_PLL_HAS_P TRUE
|
#define STM32_RCC_PLL_HAS_P TRUE
|
||||||
/*#define STM32_RCC_PLL_HAS_Q TRUE*/ /* Varies, see below.*/
|
|
||||||
#define STM32_RCC_PLL_HAS_R TRUE
|
#define STM32_RCC_PLL_HAS_R TRUE
|
||||||
|
|
||||||
#define STM32_RCC_HAS_PLLSAI1 FALSE
|
#define STM32_RCC_HAS_PLLSAI1 FALSE
|
||||||
|
|
|
@ -364,7 +364,7 @@ static bool hal_lld_clock_check_tree(const halclkcfg_t *ccp) {
|
||||||
/* PLL VCO frequency.*/
|
/* PLL VCO frequency.*/
|
||||||
pllvcoclk = (pllselclk / (halfreq_t)pllmdiv) * (halfreq_t)pllndiv;
|
pllvcoclk = (pllselclk / (halfreq_t)pllmdiv) * (halfreq_t)pllndiv;
|
||||||
|
|
||||||
if((pllvcoclk < slp->pllvco_min) || (pllvcoclk > slp->pllvco_max)) {
|
if ((pllvcoclk < slp->pllvco_min) || (pllvcoclk > slp->pllvco_max)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,7 +384,7 @@ static bool hal_lld_clock_check_tree(const halclkcfg_t *ccp) {
|
||||||
if ((ccp->rcc_pllcfgr & RCC_PLLCFGR_PLLPEN) != 0U) {
|
if ((ccp->rcc_pllcfgr & RCC_PLLCFGR_PLLPEN) != 0U) {
|
||||||
pllpclk = pllvcoclk / pllpdiv;
|
pllpclk = pllvcoclk / pllpdiv;
|
||||||
|
|
||||||
if((pllpclk < slp->pllp_min) || (pllpclk > slp->pllp_max)) {
|
if ((pllpclk < slp->pllp_min) || (pllpclk > slp->pllp_max)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -394,7 +394,7 @@ static bool hal_lld_clock_check_tree(const halclkcfg_t *ccp) {
|
||||||
if ((ccp->rcc_pllcfgr & RCC_PLLCFGR_PLLQEN) != 0U) {
|
if ((ccp->rcc_pllcfgr & RCC_PLLCFGR_PLLQEN) != 0U) {
|
||||||
pllqclk = pllvcoclk / pllqdiv;
|
pllqclk = pllvcoclk / pllqdiv;
|
||||||
|
|
||||||
if((pllqclk < slp->pllq_min) || (pllqclk > slp->pllq_max)) {
|
if ((pllqclk < slp->pllq_min) || (pllqclk > slp->pllq_max)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -404,14 +404,14 @@ static bool hal_lld_clock_check_tree(const halclkcfg_t *ccp) {
|
||||||
if ((ccp->rcc_pllcfgr & RCC_PLLCFGR_PLLREN) != 0U) {
|
if ((ccp->rcc_pllcfgr & RCC_PLLCFGR_PLLREN) != 0U) {
|
||||||
pllrclk = pllvcoclk / pllrdiv;
|
pllrclk = pllvcoclk / pllrdiv;
|
||||||
|
|
||||||
if((pllrclk < slp->pllr_min) || (pllrclk > slp->pllr_max)) {
|
if ((pllrclk < slp->pllr_min) || (pllrclk > slp->pllr_max)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* SYSCLK frequency.*/
|
/* SYSCLK frequency.*/
|
||||||
switch(ccp->rcc_cfgr & RCC_CFGR_SW_Msk) {
|
switch (ccp->rcc_cfgr & RCC_CFGR_SW_Msk) {
|
||||||
case RCC_CFGR_SW_HSI:
|
case RCC_CFGR_SW_HSI:
|
||||||
sysclk = hsi16clk;
|
sysclk = hsi16clk;
|
||||||
break;
|
break;
|
||||||
|
@ -451,7 +451,7 @@ static bool hal_lld_clock_check_tree(const halclkcfg_t *ccp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MCO clock.*/
|
/* MCO clock.*/
|
||||||
switch(ccp->rcc_cfgr & RCC_CFGR_MCOSEL_Msk) {
|
switch (ccp->rcc_cfgr & RCC_CFGR_MCOSEL_Msk) {
|
||||||
case STM32_MCOSEL_NOCLOCK:
|
case STM32_MCOSEL_NOCLOCK:
|
||||||
mcoclk = 0U;
|
mcoclk = 0U;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -166,7 +166,6 @@
|
||||||
#define STM32_EXTI_IMR1_MASK 0x1F840000U
|
#define STM32_EXTI_IMR1_MASK 0x1F840000U
|
||||||
#define STM32_EXTI_IMR2_MASK 0xFFFFFF3CU
|
#define STM32_EXTI_IMR2_MASK 0xFFFFFF3CU
|
||||||
|
|
||||||
|
|
||||||
/* Flash attributes.*/
|
/* Flash attributes.*/
|
||||||
#define STM32_FLASH_NUMBER_OF_BANKS 2
|
#define STM32_FLASH_NUMBER_OF_BANKS 2
|
||||||
|
|
||||||
|
@ -381,7 +380,6 @@
|
||||||
#define STM32_EXTI_IMR1_MASK 0x1F840000U
|
#define STM32_EXTI_IMR1_MASK 0x1F840000U
|
||||||
#define STM32_EXTI_IMR2_MASK 0xFFFFFF3CU
|
#define STM32_EXTI_IMR2_MASK 0xFFFFFF3CU
|
||||||
|
|
||||||
|
|
||||||
/* Flash attributes.*/
|
/* Flash attributes.*/
|
||||||
#define STM32_FLASH_NUMBER_OF_BANKS 2
|
#define STM32_FLASH_NUMBER_OF_BANKS 2
|
||||||
|
|
||||||
|
@ -596,7 +594,6 @@
|
||||||
#define STM32_EXTI_IMR1_MASK 0x1F840000U
|
#define STM32_EXTI_IMR1_MASK 0x1F840000U
|
||||||
#define STM32_EXTI_IMR2_MASK 0xFFFFFF3CU
|
#define STM32_EXTI_IMR2_MASK 0xFFFFFF3CU
|
||||||
|
|
||||||
|
|
||||||
/* Flash attributes.*/
|
/* Flash attributes.*/
|
||||||
#define STM32_FLASH_NUMBER_OF_BANKS 2
|
#define STM32_FLASH_NUMBER_OF_BANKS 2
|
||||||
|
|
||||||
|
|
|
@ -1296,35 +1296,35 @@
|
||||||
#error "Using a wrong mcuconf.h file, STM32H7xx_MCUCONF not defined"
|
#error "Using a wrong mcuconf.h file, STM32H7xx_MCUCONF not defined"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(STM32H750xx)&& !defined(STM32H750_MCUCONF)
|
#if defined(STM32H750xx) && !defined(STM32H750_MCUCONF)
|
||||||
#error "Using a wrong mcuconf.h file, STM32H750_MCUCONF not defined"
|
#error "Using a wrong mcuconf.h file, STM32H750_MCUCONF not defined"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(STM32H742xx)&& !defined(STM32H742_MCUCONF)
|
#if defined(STM32H742xx) && !defined(STM32H742_MCUCONF)
|
||||||
#error "Using a wrong mcuconf.h file, STM32H742_MCUCONF not defined"
|
#error "Using a wrong mcuconf.h file, STM32H742_MCUCONF not defined"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(STM32H743xx)&& !defined(STM32H743_MCUCONF)
|
#if defined(STM32H743xx) && !defined(STM32H743_MCUCONF)
|
||||||
#error "Using a wrong mcuconf.h file, STM32H743_MCUCONF not defined"
|
#error "Using a wrong mcuconf.h file, STM32H743_MCUCONF not defined"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(STM32H753xx)&& !defined(STM32H753_MCUCONF)
|
#if defined(STM32H753xx) && !defined(STM32H753_MCUCONF)
|
||||||
#error "Using a wrong mcuconf.h file, STM32H753_MCUCONF not defined"
|
#error "Using a wrong mcuconf.h file, STM32H753_MCUCONF not defined"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(STM32H745xx)&& !defined(STM32H745_MCUCONF)
|
#if defined(STM32H745xx) && !defined(STM32H745_MCUCONF)
|
||||||
#error "Using a wrong mcuconf.h file, STM32H745_MCUCONF not defined"
|
#error "Using a wrong mcuconf.h file, STM32H745_MCUCONF not defined"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(STM32H755xx)&& !defined(STM32H755_MCUCONF)
|
#if defined(STM32H755xx) && !defined(STM32H755_MCUCONF)
|
||||||
#error "Using a wrong mcuconf.h file, STM32H755_MCUCONF not defined"
|
#error "Using a wrong mcuconf.h file, STM32H755_MCUCONF not defined"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(STM32H747xx)&& !defined(STM32H747_MCUCONF)
|
#if defined(STM32H747xx) && !defined(STM32H747_MCUCONF)
|
||||||
#error "Using a wrong mcuconf.h file, STM32H747_MCUCONF not defined"
|
#error "Using a wrong mcuconf.h file, STM32H747_MCUCONF not defined"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(STM32H757xx)&& !defined(STM32H757_MCUCONF)
|
#if defined(STM32H757xx) && !defined(STM32H757_MCUCONF)
|
||||||
#error "Using a wrong mcuconf.h file, STM32H757_MCUCONF not defined"
|
#error "Using a wrong mcuconf.h file, STM32H757_MCUCONF not defined"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -574,7 +574,6 @@
|
||||||
#define STM32_HAS_CRC TRUE
|
#define STM32_HAS_CRC TRUE
|
||||||
#define STM32_CRC_PROGRAMMABLE TRUE
|
#define STM32_CRC_PROGRAMMABLE TRUE
|
||||||
|
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* STM32L052xx, STM32L062xx, STM32L053xx, STM32L063xx. */
|
/* STM32L052xx, STM32L062xx, STM32L053xx, STM32L063xx. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
|
@ -348,7 +348,7 @@ static bool hal_lld_check_pll(const system_limits_t *slp,
|
||||||
/* PLL VCO frequency.*/
|
/* PLL VCO frequency.*/
|
||||||
vcoclk = (selclk / (halfreq_t)mdiv) * (halfreq_t)ndiv;
|
vcoclk = (selclk / (halfreq_t)mdiv) * (halfreq_t)ndiv;
|
||||||
|
|
||||||
if((vcoclk < slp->pllvco_min) || (vcoclk > slp->pllvco_max)) {
|
if ((vcoclk < slp->pllvco_min) || (vcoclk > slp->pllvco_max)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -368,7 +368,7 @@ static bool hal_lld_check_pll(const system_limits_t *slp,
|
||||||
if ((cfgr & RCC_PLLCFGR_PLLPEN) != 0U) {
|
if ((cfgr & RCC_PLLCFGR_PLLPEN) != 0U) {
|
||||||
pclk = vcoclk / pdiv;
|
pclk = vcoclk / pdiv;
|
||||||
|
|
||||||
if((pclk < slp->pllp_min) || (pclk > slp->pllp_max)) {
|
if ((pclk < slp->pllp_min) || (pclk > slp->pllp_max)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -378,7 +378,7 @@ static bool hal_lld_check_pll(const system_limits_t *slp,
|
||||||
if ((cfgr & RCC_PLLCFGR_PLLQEN) != 0U) {
|
if ((cfgr & RCC_PLLCFGR_PLLQEN) != 0U) {
|
||||||
qclk = vcoclk / qdiv;
|
qclk = vcoclk / qdiv;
|
||||||
|
|
||||||
if((qclk < slp->pllq_min) || (qclk > slp->pllq_max)) {
|
if ((qclk < slp->pllq_min) || (qclk > slp->pllq_max)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -388,7 +388,7 @@ static bool hal_lld_check_pll(const system_limits_t *slp,
|
||||||
if ((cfgr & RCC_PLLCFGR_PLLREN) != 0U) {
|
if ((cfgr & RCC_PLLCFGR_PLLREN) != 0U) {
|
||||||
rclk = vcoclk / rdiv;
|
rclk = vcoclk / rdiv;
|
||||||
|
|
||||||
if((rclk < slp->pllr_min) || (rclk > slp->pllr_max)) {
|
if ((rclk < slp->pllr_min) || (rclk > slp->pllr_max)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -502,7 +502,7 @@ static bool hal_lld_clock_check_tree(const halclkcfg_t *ccp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* SYSCLK frequency.*/
|
/* SYSCLK frequency.*/
|
||||||
switch(ccp->rcc_cfgr & RCC_CFGR_SW_Msk) {
|
switch (ccp->rcc_cfgr & RCC_CFGR_SW_Msk) {
|
||||||
case RCC_CFGR_SW_MSI:
|
case RCC_CFGR_SW_MSI:
|
||||||
sysclk = msiclk;
|
sysclk = msiclk;
|
||||||
break;
|
break;
|
||||||
|
@ -545,7 +545,7 @@ static bool hal_lld_clock_check_tree(const halclkcfg_t *ccp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MCO clock.*/
|
/* MCO clock.*/
|
||||||
switch(ccp->rcc_cfgr & RCC_CFGR_MCOSEL_Msk) {
|
switch (ccp->rcc_cfgr & RCC_CFGR_MCOSEL_Msk) {
|
||||||
case STM32_MCOSEL_NOCLOCK:
|
case STM32_MCOSEL_NOCLOCK:
|
||||||
mcoclk = 0U;
|
mcoclk = 0U;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -160,7 +160,6 @@
|
||||||
#define STM32_I2C4_ERROR_NUMBER 83
|
#define STM32_I2C4_ERROR_NUMBER 83
|
||||||
#define STM32_I2C4_EVENT_NUMBER 84
|
#define STM32_I2C4_EVENT_NUMBER 84
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* OCTOSPI unit.
|
* OCTOSPI unit.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -525,7 +525,7 @@
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
#define rccResetGTZC() /*rccResetAHB1(RCC_AHB1RST_GTZCRST)*/
|
#define rccResetGTZC() /* Disabled rccResetAHB1(RCC_AHB1RST_GTZCRST) */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -238,7 +238,6 @@
|
||||||
#define STM32_HSI_ENABLED TRUE
|
#define STM32_HSI_ENABLED TRUE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief HSI divider setting.
|
* @brief HSI divider setting.
|
||||||
* @note This initialization is performed only if TZEN=0 or MCKPROT=0
|
* @note This initialization is performed only if TZEN=0 or MCKPROT=0
|
||||||
|
|
|
@ -1251,7 +1251,6 @@
|
||||||
#define STM32_ACTIVATE_PLL FALSE
|
#define STM32_ACTIVATE_PLL FALSE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief STM32_PLLPEN field.
|
* @brief STM32_PLLPEN field.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -279,7 +279,7 @@ static bool hal_lld_check_pll(const system_limits_t *slp,
|
||||||
/* PLL VCO frequency.*/
|
/* PLL VCO frequency.*/
|
||||||
vcoclk = (selclk / (halfreq_t)mdiv) * (halfreq_t)ndiv;
|
vcoclk = (selclk / (halfreq_t)mdiv) * (halfreq_t)ndiv;
|
||||||
|
|
||||||
if((vcoclk < slp->pllvco_min) || (vcoclk > slp->pllvco_max)) {
|
if ((vcoclk < slp->pllvco_min) || (vcoclk > slp->pllvco_max)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,9 +291,9 @@ static bool hal_lld_check_pll(const system_limits_t *slp,
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((cfgr & RCC_PLLCFGR_PLLPEN) != 0U) {
|
if ((cfgr & RCC_PLLCFGR_PLLPEN) != 0U) {
|
||||||
pclk = vcoclk / pdiv ;
|
pclk = vcoclk / pdiv;
|
||||||
|
|
||||||
if((pclk < slp->pllp_min) || (pclk > slp->pllp_max)) {
|
if ((pclk < slp->pllp_min) || (pclk > slp->pllp_max)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -308,7 +308,7 @@ static bool hal_lld_check_pll(const system_limits_t *slp,
|
||||||
if ((cfgr & RCC_PLLCFGR_PLLQEN) != 0U) {
|
if ((cfgr & RCC_PLLCFGR_PLLQEN) != 0U) {
|
||||||
qclk = vcoclk / qdiv;
|
qclk = vcoclk / qdiv;
|
||||||
|
|
||||||
if((qclk < slp->pllq_min) || (qclk > slp->pllq_max)) {
|
if ((qclk < slp->pllq_min) || (qclk > slp->pllq_max)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -323,7 +323,7 @@ static bool hal_lld_check_pll(const system_limits_t *slp,
|
||||||
if ((cfgr & RCC_PLLCFGR_PLLREN) != 0U) {
|
if ((cfgr & RCC_PLLCFGR_PLLREN) != 0U) {
|
||||||
rclk = vcoclk / rdiv;
|
rclk = vcoclk / rdiv;
|
||||||
|
|
||||||
if((rclk < slp->pllr_min) || (rclk > slp->pllr_max)) {
|
if ((rclk < slp->pllr_min) || (rclk > slp->pllr_max)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -415,7 +415,7 @@ static bool hal_lld_clock_check_tree(const halclkcfg_t *ccp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* SYSCLK frequency.*/
|
/* SYSCLK frequency.*/
|
||||||
switch(ccp->rcc_cfgr & RCC_CFGR_SW_Msk) {
|
switch (ccp->rcc_cfgr & RCC_CFGR_SW_Msk) {
|
||||||
case STM32_SW_HSI16:
|
case STM32_SW_HSI16:
|
||||||
sysclk = hsi16clk;
|
sysclk = hsi16clk;
|
||||||
break;
|
break;
|
||||||
|
@ -437,7 +437,7 @@ static bool hal_lld_clock_check_tree(const halclkcfg_t *ccp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* LPRUN sysclk check.*/
|
/* LPRUN sysclk check.*/
|
||||||
if (((ccp->pwr_cr1 & PWR_CR1_LPR_Msk) != 0U) && (sysclk > STM32_LPRUN_SYSCLK_MAX) ) {
|
if (((ccp->pwr_cr1 & PWR_CR1_LPR_Msk) != 0U) && (sysclk > STM32_LPRUN_SYSCLK_MAX)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -469,7 +469,7 @@ static bool hal_lld_clock_check_tree(const halclkcfg_t *ccp) {
|
||||||
hclk3 = sysclk / hprediv[(ccp->rcc_extcfgr & RCC_EXTCFGR_SHDHPRE_Msk) >> RCC_EXTCFGR_SHDHPRE_Pos];
|
hclk3 = sysclk / hprediv[(ccp->rcc_extcfgr & RCC_EXTCFGR_SHDHPRE_Msk) >> RCC_EXTCFGR_SHDHPRE_Pos];
|
||||||
|
|
||||||
/* MCO clock.*/
|
/* MCO clock.*/
|
||||||
switch(ccp->rcc_cfgr & RCC_CFGR_MCOSEL_Msk) {
|
switch (ccp->rcc_cfgr & RCC_CFGR_MCOSEL_Msk) {
|
||||||
case STM32_MCOSEL_NOCLOCK:
|
case STM32_MCOSEL_NOCLOCK:
|
||||||
mcoclk = 0U;
|
mcoclk = 0U;
|
||||||
break;
|
break;
|
||||||
|
@ -662,7 +662,6 @@ void hal_lld_init(void) {
|
||||||
irqInit();
|
irqInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief STM32WLxx clocks and PLL initialization.
|
* @brief STM32WLxx clocks and PLL initialization.
|
||||||
* @note All the involved constants come from the file @p board.h.
|
* @note All the involved constants come from the file @p board.h.
|
||||||
|
|
|
@ -473,7 +473,6 @@
|
||||||
#define STM32_LSI_ENABLED TRUE
|
#define STM32_LSI_ENABLED TRUE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief LSI prescaler value.
|
* @brief LSI prescaler value.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -418,7 +418,7 @@ typedef uint8_t ucnt_t; /**< Generic unsigned counter. */
|
||||||
#error "unsupported PORT_ARCH_REGISTERS_WIDTH value"
|
#error "unsupported PORT_ARCH_REGISTERS_WIDTH value"
|
||||||
#endif
|
#endif
|
||||||
/** @} */
|
/** @} */
|
||||||
#endif /* defined(PORT_DOES_NOT_PROVIDE_TYPES) */
|
#endif
|
||||||
|
|
||||||
#if (CH_CFG_ST_RESOLUTION == 32) || defined(__DOXYGEN__)
|
#if (CH_CFG_ST_RESOLUTION == 32) || defined(__DOXYGEN__)
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -200,7 +200,6 @@ static oc_object_t *lru_get_last_s(objects_cache_t *ocp) {
|
||||||
return objp;
|
return objp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Out of critical section.*/
|
/* Out of critical section.*/
|
||||||
chSysUnlock();
|
chSysUnlock();
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ typedef uint8_t ucnt_t; /**< Generic unsigned counter. */
|
||||||
#error "unsupported PORT_ARCH_REGISTERS_WIDTH value"
|
#error "unsupported PORT_ARCH_REGISTERS_WIDTH value"
|
||||||
#endif
|
#endif
|
||||||
/** @} */
|
/** @} */
|
||||||
#endif /* defined(PORT_DOES_NOT_PROVIDE_TYPES) */
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Type of a core identifier.
|
* @brief Type of a core identifier.
|
||||||
|
@ -195,16 +195,16 @@ typedef struct ch_os_instance os_instance_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Safe cast of a queue pointer to a thread pointer.
|
* @brief Safe cast of a queue pointer to a thread pointer.
|
||||||
* @note Casting to a thread pointer should always be performed using
|
* @note Casting to a thread pointer should always be performed using
|
||||||
* this macro. Casting to threads pointer is allowed by design
|
* this macro. Casting to threads pointer is allowed by design
|
||||||
* and this is the single check point for this operation.
|
* and this is the single check point for this operation.
|
||||||
*
|
*
|
||||||
* @param[in] p pointer to a queue/list structure
|
* @param[in] p pointer to a queue/list structure
|
||||||
* @return The pointer to the thread containing the queue/list
|
* @return The pointer to the thread containing the queue/list
|
||||||
* element.
|
* element.
|
||||||
*/
|
*/
|
||||||
#define threadref(p) ((thread_t *)(void *)(p))
|
#define threadref(p) ((thread_t *)(void *)(p))
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* External declarations. */
|
/* External declarations. */
|
||||||
|
|
|
@ -91,7 +91,7 @@
|
||||||
#else
|
#else
|
||||||
#define currcore (&ch0)
|
#define currcore (&ch0)
|
||||||
#endif
|
#endif
|
||||||
#endif /* defined(PORT_INSTANCE_ACCESS) */
|
#endif
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Module macros. */
|
/* Module macros. */
|
||||||
|
|
Loading…
Reference in New Issue