3#include "tutti_gli_header.h"
147extern ARM_DRIVER_SPI Driver_SPI0;
148ARM_DRIVER_SPI *SPIdrv= &Driver_SPI0;
178 case ARM_SPI_EVENT_TRANSFER_COMPLETE:
183 case ARM_SPI_EVENT_DATA_LOST:
188 case ARM_SPI_EVENT_MODE_FAULT:
207 SPIdrv->PowerControl (ARM_POWER_OFF);
208 SPIdrv->Uninitialize ();
210 status = SPIdrv->PowerControl(ARM_POWER_FULL);
215 SPIdrv->Control (ARM_SPI_CONTROL_SS, ARM_SPI_SS_INACTIVE);
240 SPIdrv->PowerControl (ARM_POWER_OFF);
241 SPIdrv->Uninitialize ();
244 SPIdrv->PowerControl(ARM_POWER_FULL);
249 SPIdrv->Control (ARM_SPI_CONTROL_SS, ARM_SPI_SS_INACTIVE);
257void SPItx_16_per_il_DAC(uint16_t dato)
261 while (!((LPC_SPI->SPSR & 0x80) == 0x80)){}
270unsigned char SPIrx(
void)
275 while (!((LPC_SPI->SPSR&0x80) == 0x80)){}
285unsigned long int SPIrx24(
void)
288 unsigned long int dato;
290 dato=dato+(SPIrx()<<8);
#define spi_clock_for_relais
[ref_spi_clock_for_relais]
volatile uint32_t Error_bad_operation
exploited to mark the errors
void SPI_callback(uint32_t event)
After that the SPI ends its operations and the interrupt is generated this signal function is called ...
void SPI_Inizialize_per_il_DAC(void)
SPI is initialized here for DAC. Remember to set the variable SPI_speed before the call....
uint32_t SPI_speed
The speed to be set to SPI. It could varies from chip to chip.
void SPI_Inizialize(void)
SPI is initialized here. Its ise t at 8 bits and 100 KHz, as default.
uint32_t evento_SPI
This is the variable which resembles the flags from the communication.
#define SPI_control_for_relay_driver
[ref_SPI_control_for_relay_driver]
#define SPI_control_for_DAC
[ref_SPI_control_for_relay_driver]