Contains all functions support for spin firmware library on A31L12x. More...
Go to the source code of this file.
Functions | |
static void | spi_set_divisors (SPIn_Type *SPIx, uint32_t baudrate) |
Determines best dividers to get a target clock rate. More... | |
HAL_Status_Type | HAL_SPIn_Init (SPIn_Type *SPIx, SPIn_CFG_Type *SPIn_Config) |
Initialize the SPIn peripheral with the specified parameters. More... | |
HAL_Status_Type | SPIn_DeInit (SPIn_Type *SPIx) |
Deinitialize the SPIn peripheral registers to their default reset values. More... | |
HAL_Status_Type | SPIn_ConfigStructInit (SPIn_CFG_Type *SPIn_Config) |
Fills each SPIn_CFG_Type structure member with its default value: More... | |
HAL_Status_Type | SPIn_ConfigInterrupt (SPIn_Type *SPIx, SPIn_INT_Type SPIn_IntCfg, FunctionalState NewState) |
Configure the interrupt source of selected SPIn peripheral. More... | |
HAL_Status_Type | SPIn_DataControlConfig (SPIn_Type *SPIx, SPIn_CONTROL_Type Control, FunctionalState NewState) |
Configure Data Control mode for SPIn peripheral. More... | |
HAL_Status_Type | SPIn_Enable (SPIn_Type *SPIx, FunctionalState state) |
SPIn enable control. More... | |
HAL_Status_Type | SPIn_ClearStatus (SPIn_Type *SPIx, SPIn_STATUS_Type Status) |
This function clears the flag bit of Status Register. More... | |
uint8_t | SPIn_GetStatus (SPIn_Type *SPIx) |
This function returns the current value of Status Register. More... | |
HAL_Status_Type | SPIn_SendByte (SPIn_Type *SPIx, uint8_t Data) |
Transmit a single data through SPIn peripheral. More... | |
uint8_t | SPIn_ReceiveByte (SPIn_Type *SPIx) |
Receive a single data from SPIn peripheral. More... | |
uint32_t | SPIn_Send (SPIn_Type *SPIx, uint8_t *txbuf, uint32_t buflen, TRANSFER_BLOCK_Type flag) |
Send a block of data via SPIn peripheral. More... | |
uint32_t | SPIn_Receive (SPIn_Type *SPIx, uint8_t *rxbuf, uint32_t buflen, TRANSFER_BLOCK_Type flag) |
Receive a block of data via SPIn peripheral. More... | |
Variables | |
uint32_t | SPIn_BaseClock |
Bool | SPIn_RXC = FALSE |
Contains all functions support for spin firmware library on A31L12x.
Copyright(C) 2019, ABOV Semiconductor All rights reserved.
ABOV Disclaimer
IMPORTANT NOTICE ? PLEASE READ CAREFULLY ABOV Semiconductor ("ABOV") reserves the right to make changes, corrections, enhancements, modifications, and improvements to ABOV products and/or to this document at any time without notice. ABOV does not give warranties as to the accuracy or completeness of the information included herein. Purchasers should obtain the latest relevant information of ABOV products before placing orders. Purchasers are entirely responsible for the choice, selection, and use of ABOV products and ABOV assumes no liability for application assistance or the design of purchasers' products. No license, express or implied, to any intellectual property rights is granted by ABOV herein. ABOV disclaims all express and implied warranties and shall not be responsible or liable for any injuries or damages related to use of ABOV products in such unauthorized applications. ABOV and the ABOV logo are trademarks of ABOV. All other product or service names are the property of their respective owners. Information in this document supersedes and replaces the information previously supplied in any former versions of this document. 2020 ABOV Semiconductor All rights reserved
Definition in file A31L12x_hal_spin.c.
HAL_Status_Type HAL_SPIn_Init | ( | SPIn_Type * | SPIx, |
SPIn_CFG_Type * | SPIn_Config | ||
) |
Initialize the SPIn peripheral with the specified parameters.
[in] | SPIx | Pointer to the target SPI
|
[in] | SPIn_Config | Pointer to a SPIn_CFG_Type structure that contains the configuration information for the specified peripheral. |
Definition at line 101 of file A31L12x_hal_spin.c.
References SPIn_CFG_Type::ACK, SPIn_CFG_Type::Baudrate, SPIn_CFG_Type::Edge, FALSE, HAL_ERROR, HAL_OK, HAL_SCU_Peripheral_EnableClock2(), HAL_SCU_Peripheral_SetReset2(), SPIn_CFG_Type::Order, spi_set_divisors(), SPIn_BaseClock, SPIn_ReceiveByte(), and SPIn_RXC.
|
static |
Determines best dividers to get a target clock rate.
[in] | SPIx | Pointer to the target SPI
|
[in] | baudrate | Desired baudrate |
Definition at line 64 of file A31L12x_hal_spin.c.
References SPIn_BaseClock.
Referenced by HAL_SPIn_Init().
HAL_Status_Type SPIn_ClearStatus | ( | SPIn_Type * | SPIx, |
SPIn_STATUS_Type | Status | ||
) |
This function clears the flag bit of Status Register.
[in] | SPIx | Pointer to the target SPI
|
[in] | Status |
|
Definition at line 393 of file A31L12x_hal_spin.c.
References HAL_ERROR, HAL_OK, and SPIn_STATUS_SPInIFLAG.
Referenced by SPIn_Send().
HAL_Status_Type SPIn_ConfigInterrupt | ( | SPIn_Type * | SPIx, |
SPIn_INT_Type | SPIn_IntCfg, | ||
FunctionalState | NewState | ||
) |
Configure the interrupt source of selected SPIn peripheral.
[in] | SPIx | Pointer to the target SPI
|
[in] | SPIn_IntCfg | Specifies the interrupt source
|
[in] | NewState | Next State of Interrupt Operation
|
Definition at line 248 of file A31L12x_hal_spin.c.
References ENABLE, HAL_ERROR, HAL_OK, and SPIn_INTCFG_SPInIEN.
HAL_Status_Type SPIn_ConfigStructInit | ( | SPIn_CFG_Type * | SPIn_Config | ) |
Fills each SPIn_CFG_Type structure member with its default value:
[out] | SPIn_Config | Pointer to a SPIn_CFG_Type structure which will be initialized. |
Definition at line 200 of file A31L12x_hal_spin.c.
References SPIn_CFG_Type::ACK, SPIn_CFG_Type::Baudrate, SPIn_CFG_Type::Edge, HAL_ERROR, HAL_OK, SPIn_CFG_Type::Order, SPIn_LSB_FIRST, SPIn_TX_FALLING, SPIn_TX_LEADEDGE_SAMPLE, SPIn_TX_LEADEDGE_SETUP, and SPIn_TX_RISING.
HAL_Status_Type SPIn_DataControlConfig | ( | SPIn_Type * | SPIx, |
SPIn_CONTROL_Type | Control, | ||
FunctionalState | NewState | ||
) |
Configure Data Control mode for SPIn peripheral.
[in] | SPIx | Pointer to the target SPI
|
[in] | Mode | Data Control Mode
|
[in] | NewState | Next State of Functional Operation
|
Definition at line 298 of file A31L12x_hal_spin.c.
References ENABLE, HAL_ERROR, HAL_OK, SPIn_CONTROL_FXCHn, SPIn_CONTROL_SPInMS, and SPIn_CONTROL_SSnEN.
HAL_Status_Type SPIn_DeInit | ( | SPIn_Type * | SPIx | ) |
Deinitialize the SPIn peripheral registers to their default reset values.
[in] | SPIx | Pointer to the target SPI
|
Definition at line 161 of file A31L12x_hal_spin.c.
References HAL_ERROR, HAL_OK, HAL_SCU_Peripheral_EnableClock2(), and HAL_SCU_Peripheral_SetReset2().
HAL_Status_Type SPIn_Enable | ( | SPIn_Type * | SPIx, |
FunctionalState | state | ||
) |
SPIn enable control.
[in] | SPIx | Pointer to the target SPI
|
[in] | state |
|
Definition at line 364 of file A31L12x_hal_spin.c.
uint8_t SPIn_GetStatus | ( | SPIn_Type * | SPIx | ) |
This function returns the current value of Status Register.
[in] | SPIx | Pointer to the target SPI
|
Definition at line 428 of file A31L12x_hal_spin.c.
uint32_t SPIn_Receive | ( | SPIn_Type * | SPIx, |
uint8_t * | rxbuf, | ||
uint32_t | buflen, | ||
TRANSFER_BLOCK_Type | flag | ||
) |
Receive a block of data via SPIn peripheral.
[in] | SPIx | Pointer to the target SPI
|
[out] | rxbuf | Pointer to Received buffer |
[in] | buflen | Length of Received buffer |
[in] | flag | Flag mode
|
Definition at line 571 of file A31L12x_hal_spin.c.
References BLOCKING, FALSE, SPIn_ReceiveByte(), and SPIn_RXC.
uint8_t SPIn_ReceiveByte | ( | SPIn_Type * | SPIx | ) |
Receive a single data from SPIn peripheral.
[in] | SPIx | Pointer to the target SPI
|
Definition at line 462 of file A31L12x_hal_spin.c.
Referenced by HAL_SPIn_Init(), and SPIn_Receive().
uint32_t SPIn_Send | ( | SPIn_Type * | SPIx, |
uint8_t * | txbuf, | ||
uint32_t | buflen, | ||
TRANSFER_BLOCK_Type | flag | ||
) |
Send a block of data via SPIn peripheral.
[in] | SPIx | Pointer to the target SPI
|
[in] | txbuf | Pointer to Transmit buffer |
[in] | buflen | Length of Transmit buffer |
[in] | flag | Flag used in USART transfer
|
Definition at line 484 of file A31L12x_hal_spin.c.
References BLOCKING, SPIn_ClearStatus(), SPIn_RXC, SPIn_SendByte(), SPIn_STATUS_SPInIFLAG, and TRUE.
HAL_Status_Type SPIn_SendByte | ( | SPIn_Type * | SPIx, |
uint8_t | Data | ||
) |
Transmit a single data through SPIn peripheral.
[in] | SPIx | Pointer to the target SPI
|
[in] | Data | Data to transmit (must be 8-bit long) |
Definition at line 442 of file A31L12x_hal_spin.c.
References HAL_ERROR, and HAL_OK.
Referenced by SPIn_Send().
uint32_t SPIn_BaseClock |
Definition at line 47 of file A31L12x_hal_spin.c.
Referenced by HAL_SPIn_Init(), and spi_set_divisors().
Definition at line 48 of file A31L12x_hal_spin.c.
Referenced by HAL_SPIn_Init(), SPIn_Receive(), and SPIn_Send().