You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
668 B

#ifndef SPI_PROTO_H
#define SPI_PROTO_H
#include <stdint.h>
/***** MASTER *****/
#define SPI_WRITE_DATA 0x01
#define SPI_READ_DATA 0x10
#define SPI_NONE 0
uint16_t spi_master_transceive(uint8_t opcode, uint8_t address, uint16_t value);
uint16_t read_temperature(uint8_t number);
uint8_t read_var8(uint8_t number);
uint16_t read_var16(uint8_t number);
void write_var8(uint8_t number, uint8_t value);
void write_var16(uint8_t number, uint16_t value);
void call_func(uint8_t number);
/***** MASTER END *****/
/***** SLAVE *****/
#include "spi_pointers.h"
uint16_t spi_proto_slaveaction(uint8_t opcode, uint8_t addr, uint16_t data);
/***** SLAVE END *****/
#endif