mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-22 03:09:16 +08:00
@@ -25,6 +25,8 @@ struct rt_device_pin
|
||||
const struct rt_pin_ops *ops;
|
||||
};
|
||||
|
||||
#define PIN_NONE (-1)
|
||||
|
||||
#define PIN_LOW 0x00
|
||||
#define PIN_HIGH 0x01
|
||||
|
||||
@@ -43,7 +45,7 @@ struct rt_device_pin
|
||||
#define PIN_IRQ_DISABLE 0x00
|
||||
#define PIN_IRQ_ENABLE 0x01
|
||||
|
||||
#define PIN_IRQ_PIN_NONE -1
|
||||
#define PIN_IRQ_PIN_NONE PIN_NONE
|
||||
|
||||
struct rt_device_pin_mode
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
#include <drivers/pin.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
@@ -79,7 +79,6 @@ struct rt_spi_configuration
|
||||
rt_uint8_t mode;
|
||||
rt_uint8_t data_width;
|
||||
rt_uint16_t reserved;
|
||||
rt_base_t cs_pin;
|
||||
|
||||
rt_uint32_t max_hz;
|
||||
};
|
||||
@@ -113,6 +112,7 @@ struct rt_spi_device
|
||||
struct rt_spi_bus *bus;
|
||||
|
||||
struct rt_spi_configuration config;
|
||||
rt_base_t cs_pin;
|
||||
void *user_data;
|
||||
};
|
||||
|
||||
|
||||
@@ -80,7 +80,6 @@ rt_err_t rt_spi_configure(struct rt_spi_device *device,
|
||||
device->config.data_width = cfg->data_width;
|
||||
device->config.mode = cfg->mode & RT_SPI_MODE_MASK ;
|
||||
device->config.max_hz = cfg->max_hz ;
|
||||
device->config.cs_pin = cfg->cs_pin ;
|
||||
|
||||
if (device->bus != RT_NULL)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user