CROSS Technical Documentation User Manual and Technical Doc.
INFN Milano Bicocca
Loading...
Searching...
No Matches
Spi.h
Go to the documentation of this file.
1
2/// \file
3#include <stdint.h>
4#include "Driver_SPI.h"
5
6//INizio CROSS
7#define SPI_DAC_SPEED 5e5 /*!< The speed for the DAC speed*/
8
9//! [ref_SPI_control_for_relay_driver]
10#define SPI_control_for_relay_driver (ARM_SPI_MODE_MASTER | ARM_SPI_CPOL1_CPHA1 | ARM_SPI_MSB_LSB | ARM_SPI_SS_MASTER_SW | ARM_SPI_DATA_BITS(8) ) /*!< ''*/
11//! [ref_SPI_control_for_relay_driver]
12
13#define SPI_control_for_DAC (ARM_SPI_MODE_MASTER | ARM_SPI_CPOL0_CPHA1 | ARM_SPI_MSB_LSB | ARM_SPI_SS_MASTER_SW | ARM_SPI_DATA_BITS(16) ) /*!< ''*/
14
15extern ARM_DRIVER_SPI Driver_SPI2; // Viene inclusa la Periferica SPI2
16extern ARM_DRIVER_SPI *SPIdrv; // Viene creato un puntatore a Driver_SPI2
17extern uint32_t evento_SPI; ///< This is the variable which resembles the flags from the communication
18extern uint32_t SPI_speed ; //!< The speed to be set to SPI. It could varies from chip to chip
19
20
21
22void SPI_Inizialize(void);
23void SPI_callback(uint32_t event);
24//Fine CROSS
25// Viene inizializzato un parametro
26extern int32_t status;
27
28//SPI.h
29
30
32void SPItx(unsigned char dato);
33void SPItx_16_per_il_DAC(uint16_t dato);
34unsigned char SPIrx(void);
35unsigned long int SPIrx24(void);
void SPI_callback(uint32_t event)
After that the SPI ends its operations and the interrupt is generated this signal function is called ...
Definition: Spi.c:173
void SPItx(unsigned char dato)
This is a blocking function that transmits one byte over the SPI.
Definition: Adc.c:971
void SPI_Inizialize_per_il_DAC(void)
SPI is initialized here for DAC. Remember to set the variable SPI_speed before the call....
Definition: Spi.c:237
uint32_t SPI_speed
The speed to be set to SPI. It could varies from chip to chip.
Definition: Spi.c:152
void SPI_Inizialize(void)
SPI is initialized here. Its ise t at 8 bits and 100 KHz, as default.
Definition: Spi.c:205
uint32_t evento_SPI
This is the variable which resembles the flags from the communication.
Definition: Spi.c:151