libraries / Mitov / Mitov_Arduino_SPI.hon commit Added link to project report (97a3ba0)
   1////////////////////////////////////////////////////////////////////////////////
   2//                                                                            //
   3//     This software is supplied under the terms of a license agreement or    //
   4//     nondisclosure agreement with Mitov Software and may not be copied      //
   5//     or disclosed except in accordance with the terms of that agreement.    //
   6//         Copyright(c) 2002-2016 Mitov Software. All Rights Reserved.        //
   7//                                                                            //
   8////////////////////////////////////////////////////////////////////////////////
   9
  10#ifndef _MITOV_ARDUINO_SPI_h
  11#define _MITOV_ARDUINO_SPI_h
  12
  13#include <Mitov.h>
  14#include <Mitov_Basic_SPI.h>
  15
  16namespace Mitov
  17{
  18        class ArduinoSPI : public Mitov::BasicSPI
  19        {
  20                typedef Mitov::BasicSPI inherited;
  21
  22        public:
  23                virtual uint16_t transfer16(uint16_t data)
  24                {
  25                        return SPI.transfer16( data );
  26                }
  27
  28                virtual uint8_t transfer(uint8_t data)
  29                {
  30                        return SPI.transfer( data );
  31                }
  32
  33                virtual void transfer(void *buf, size_t count)
  34                {
  35                        SPI.transfer( buf, count );
  36                }
  37
  38                virtual void beginTransaction(SPISettings settings)
  39                {
  40                        SPI.beginTransaction( settings );
  41                }
  42
  43                virtual void endTransaction()
  44                {
  45                        SPI.endTransaction();
  46                }
  47
  48        protected:
  49                virtual void SystemInit()
  50                {
  51                        inherited::SystemInit();
  52                        SPI.begin();
  53                }
  54        };
  55//---------------------------------------------------------------------------
  56}
  57#endif