// ----------------------------------------------------------------------------- /// @file spiDevice.h /// @brief File description // ----------------------------------------------------------------------------- // Micro-Key bv // Industrieweg 28, 9804 TG Noordhorn // Postbus 92, 9800 AB Zuidhorn // The Netherlands // Tel: +31 594 503020 // Fax: +31 594 505825 // Email: support@microkey.nl // Web: www.microkey.nl // ----------------------------------------------------------------------------- /// $Revision$ /// $Author$ /// $Date$ // (c) 2015 Micro-Key bv // ----------------------------------------------------------------------------- /// @defgroup {group_name} {group_description} /// Description /// @file spiDevice.h /// @ingroup {group_name} #ifndef PLATFORM_INC_SPIDEVICE_H_ #define PLATFORM_INC_SPIDEVICE_H_ // ----------------------------------------------------------------------------- // Include files // ----------------------------------------------------------------------------- #include "IODevice.h" #include "spi.h" // ----------------------------------------------------------------------------- // Constant and macro definitions // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- // Type definitions. // ----------------------------------------------------------------------------- struct SpiDevice { struct IODevice device; struct Spi* spi; struct SpiParameters parameters; T_PL_GPIO SPI_CE; }; // ----------------------------------------------------------------------------- // Function declarations // ----------------------------------------------------------------------------- extern ErrorStatus SpiDevice_construct(struct SpiDevice* self, struct Spi* spi, const struct SpiParameters* parameters); /** ---------------------------------------------------------------------------- * Spi_Write * Write the data in buffer to the SPI in argument self * * @param self The UART class object * @param buffer Message string to send * @parm length Message length * * @return ErrorStatus SUCCESS if writing message was successful * ERROR otherwise * * @todo * ----------------------------------------------------------------------------- */ extern ErrorStatus SpiDevice_write (const struct SpiDevice* self, const char* buffer, int length); #endif /* PLATFORM_INC_SPIDEVICE_H_ */