SPI Device with cgo
This commit is contained in:
parent
0e7e9cb4f5
commit
c9347a858f
1 changed files with 3 additions and 0 deletions
|
@ -12,9 +12,12 @@ package rfm69
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <linux/spi/spidev.h>
|
#include <linux/spi/spidev.h>
|
||||||
|
|
||||||
|
#define SPI_SPEED 4000000
|
||||||
|
|
||||||
uint8_t mode=0;
|
uint8_t mode=0;
|
||||||
uint8_t bits=8;
|
uint8_t bits=8;
|
||||||
uint32_t speed=SPI_SPEED;
|
uint32_t speed=SPI_SPEED;
|
||||||
|
uint16_t delay=5;
|
||||||
|
|
||||||
int spi_open(const char *device) {
|
int spi_open(const char *device) {
|
||||||
int fd = open(device, O_RDWR);
|
int fd = open(device, O_RDWR);
|
||||||
|
|
Loading…
Add table
Reference in a new issue