33 lines
624 B
C
33 lines
624 B
C
//
|
|
// Created by cfif on 28.09.22.
|
|
//
|
|
|
|
#ifndef SPIPORT_NATION_H
|
|
#define SPIPORT_NATION_H
|
|
|
|
#include "SpiPort.h"
|
|
#include "n32g45x.h"
|
|
#include "cmsis_os2.h"
|
|
#include "GpioPinInterface.h"
|
|
|
|
typedef struct {
|
|
SPI_Module *spi;
|
|
//решение на случай одного чипа на шине
|
|
tGpioPin *chipSelect;
|
|
} tSpiPortNation;
|
|
|
|
tSpiPortNation SpiPort_Init(
|
|
SPI_Module *spi,
|
|
uint16_t spiFrameBit,
|
|
tGpioPin *chipSelect
|
|
);
|
|
|
|
|
|
#define SpiPort_InitName(NAME, spiFrameBit, CS) \
|
|
SpiPort_Init(NAME, spiFrameBit, CS)
|
|
|
|
|
|
tSpiPortIO SpiPort_GetIo(tSpiPortNation *env);
|
|
|
|
#endif //SPIPORT_NATION_H
|