| BlueNRG-1 SDK drivers APIs

- Main Page
- Modules
- Classes
- Files

- File List
- File Members

SDK_EVAL_SPI.h
Go to the documentation of this file.
1
24 /* Define to prevent recursive inclusion -------------------------------------*/
25 #ifndef __SDK_EVAL_SPI_H
26 #define __SDK_EVAL_SPI_H
27
28 /* Includes ------------------------------------------------------------------*/
29 #include "BlueNRG1.h"
30 #include "BlueNRG1_conf.h"
31 #include "SDK_EVAL_Config.h"
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37
38
64 #define SPI_BAUDRATE (1000000)
65
69 #define SPI_DR_BASE_ADDR (SPI_BASE + 0x08)
70
74 #define SPI_BUFF_SIZE (10)
75
79 #define DMA_CH_SPI_TX (DMA_CH5)
80
84 #define DMA_CH_SPI_TX_IT_TC (DMA_FLAG_TC5)
85
89 #define DMA_CH_SPI_RX (DMA_CH4)
90
94 #define DMA_CH_SPI_RX_IT_TC (DMA_FLAG_TC4)
95
116 #define SDK_EVAL_SPI_CS_HIGH() GPIO_SetBits(SDK_EVAL_SPI_PERIPH_SENSOR_PIN)
117
121 #define SDK_EVAL_SPI_CS_LOW() GPIO_ResetBits(SDK_EVAL_SPI_PERIPH_SENSOR_PIN)
122
123
124 ErrorStatus SdkEvalSpiInit(uint32_t baudrate);
125 ErrorStatus SdkEvalSpiRead(uint8_t* pBuffer, uint8_t RegisterAddr, uint8_t NumByteToRead);
126 ErrorStatus SdkEvalSpiWrite(uint8_t* pBuffer, uint8_t RegisterAddr, uint8_t NumByteToWrite);
127
128 ErrorStatus SdkEvalSpiDmaInit(uint32_t baudrate);
129 ErrorStatus SdkEvalSpiDmaRead(uint8_t* pBuffer, uint8_t RegisterAddr, uint8_t NumByteToRead);
130 ErrorStatus SdkEvalSpiDmaWrite(uint8_t* pBuffer, uint8_t RegisterAddr, uint8_t NumByteToWrite);
131 void DmaSpiHandlerCallback(void);
132
133 ErrorStatus SdkEvalSpiIrqInit(uint32_t baudrate);
134 ErrorStatus SdkEvalSpiIrqRead(uint8_t* pBuffer, uint8_t RegisterAddr, uint8_t NumByteToRead);
135 ErrorStatus SdkEvalSpiIrqWrite(uint8_t* pBuffer, uint8_t RegisterAddr, uint8_t NumByteToWrite);
136 void IrqSpiHandlerCallback(void);
137
152 #ifdef __cplusplus
153 }
154 #endif
155
156 #endif
157
158 /******************* (C) COPYRIGHT 2015 STMicroelectronics *****END OF FILE****/
IrqSpiHandlerCallback
void IrqSpiHandlerCallback(void)
SPI IRQ ISR callback function.
Definition: SDK_EVAL_SPI.c:576
SdkEvalSpiDmaWrite
ErrorStatus SdkEvalSpiDmaWrite(uint8_t *pBuffer, uint8_t RegisterAddr, uint8_t NumByteToWrite)
SPI DMA function to write registers of a slave device.
Definition: SDK_EVAL_SPI.c:389
DmaSpiHandlerCallback
void DmaSpiHandlerCallback(void)
SPI DMA ISR callback function.
Definition: SDK_EVAL_SPI.c:420
SDK_EVAL_Config.h
This file contains SDK EVAL configuration and useful defines.
SdkEvalSpiIrqRead
ErrorStatus SdkEvalSpiIrqRead(uint8_t *pBuffer, uint8_t RegisterAddr, uint8_t NumByteToRead)
SPI IRQ function to read registers from a slave device.
Definition: SDK_EVAL_SPI.c:514
SdkEvalSpiIrqInit
ErrorStatus SdkEvalSpiIrqInit(uint32_t baudrate)
Configures SPI interface and the SPI_TX/SPI_RX IRQ sources.
Definition: SDK_EVAL_SPI.c:449
SdkEvalSpiDmaRead
ErrorStatus SdkEvalSpiDmaRead(uint8_t *pBuffer, uint8_t RegisterAddr, uint8_t NumByteToRead)
SPI DMA function to read registers from a slave device.
Definition: SDK_EVAL_SPI.c:349
SdkEvalSpiDmaInit
ErrorStatus SdkEvalSpiDmaInit(uint32_t baudrate)
Configures SPI interface and the SPI_TX/SPI_RX DMA channels.
Definition: SDK_EVAL_SPI.c:261
SdkEvalSpiIrqWrite
ErrorStatus SdkEvalSpiIrqWrite(uint8_t *pBuffer, uint8_t RegisterAddr, uint8_t NumByteToWrite)
SPI IRQ function to write registers of a slave device.
Definition: SDK_EVAL_SPI.c:547
SdkEvalSpiInit
ErrorStatus SdkEvalSpiInit(uint32_t baudrate)
Configures SPI interface.
Definition: SDK_EVAL_SPI.c:133
SdkEvalSpiRead
ErrorStatus SdkEvalSpiRead(uint8_t *pBuffer, uint8_t RegisterAddr, uint8_t NumByteToRead)
SPI function to read registers from a slave device.
Definition: SDK_EVAL_SPI.c:195
SdkEvalSpiWrite
ErrorStatus SdkEvalSpiWrite(uint8_t *pBuffer, uint8_t RegisterAddr, uint8_t NumByteToWrite)
SPI function to write registers of a slave device.
Definition: SDK_EVAL_SPI.c:231