45

Dependencies:   mbed BufferedSerial LS7366LIB FastPWM

spi_setup.h

Committer:
lsh2205
Date:
2020-03-23
Revision:
0:c21936a3520a

File content as of revision 0:c21936a3520a:

#include "LS7366.h"

SPI spi1(SPI_MOSI, SPI_MISO, SPI_SCK);

LS7366 encoder1(spi1, ENCODER_CS1);
LS7366 encoder2(spi1, ENCODER_CS2);
LS7366 encoder3(spi1, ENCODER_CS3);
LS7366 encoder4(spi1, ENCODER_CS4);
LS7366 encoder5(spi1, ENCODER_CS5);
LS7366 encoder6(spi1, ENCODER_CS6);
DigitalOut cs(PB_4);

void SPI_INIT()
{
    spi1.format(8,0);
    spi1.frequency(2000000);
}