Modular Electronics  0.1
 All Classes Namespaces Functions Variables Pages
Public Member Functions | List of all members
EepromSpi Class Reference

#include <eeprom.h>

Public Member Functions

 EepromSpi (uint8_t sync_pin, uint8_t spi_bus_config_pin, uint8_t clock_divider=7, BitOrder bit_order=MSBFIRST, uint8_t spi_mode=SPI_MODE3)
 
uint8_t Begin (void)
 

Detailed Description

Eeprom class

Author
Carlos Kometter
Version
0.1
Date
2018

Constructor & Destructor Documentation

EepromSpi::EepromSpi ( uint8_t  sync_pin,
uint8_t  spi_bus_config_pin,
uint8_t  clock_divider = 7,
BitOrder  bit_order = MSBFIRST,
uint8_t  spi_mode = SPI_MODE3 
)

Constructor

Parameters
[in]sync_pinThe sync or chip select of the dac chip. Different than spi_bus_config_pin
[in]spi_bus_config_pinThe pin that identifies the bus. More than one dac can share the same pin.
[in]clock_dividerSets the spi frequency. spi_freq = clock_freq (84 MHz for arduino due) / clock_divider (default: 4)
[in]bit_orderPossible values:
  • MSBFIRST Most significant bit first. (default)
  • LSBFIRST Least significant bit first.
[in]spi_modePossible values:
  • SPI_MODE0
  • SPI_MODE1
  • SPI_MODE2
  • SPI_MODE3 (default)

Member Function Documentation

uint8_t EepromSpi::Begin ( void  )

Configures pins for SPI and initializes SPI communication. This function must be called before calling any other function.

Returns
0 if successful

The documentation for this class was generated from the following files: