/*
* M034.h - Library for M034
* Created by brucker 22.03.2023
*/

#ifndef M034_H
#define M034_H

#include <Arduino.h>                    // main arduino library
#include <SPI.h>                        // Arduino SPI library
/*
#include "Pin_Definitions.h"            // pin definitions
#include <Ponoor_PowerSTEP01Library.h>  // stepper motor shield library
#include <SPI.h>                        // Arduino SPI library
#include <EEPROM.h>                     // Arduino EEPROM library
*/

/**********************************************************************
 *                          classes                                   *
 **********************************************************************/
// encoder position class
class NanotecAbsolutEncoder{
  public:
    NanotecAbsolutEncoder(SPIClass *SPIPort);
    void readPosition(void);
    uint16_t getMultiturn(void);
    uint32_t getSingleturn(void);
    uint8_t getStatus(void);
  private:
    uint16_t _startbits = 0;
    uint16_t _multiturn = 0;
    uint32_t _singleturn = 0;
    uint8_t _status = 0;
    uint8_t _readBytes[7];
    SPIClass *_SPI;
};

#endif