⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mqspi.h

📁 A few drivers for the Motorola C380 s celluar phone hardware with a simple test application. It s co
💻 H
字号:
#ifndef MQSPI_DRV_H
#define MQSPI_DRV_H

#include "../libs/motolibs.h"

/* Tells MQSPI to transmit the least significant byte first */
#define MQSPI_CSCFG_FLAG_LSB_FIRST 8

/* Tells MQSPI to use 0 as active CS value */
#define MQSPI_CSCFG_FLAG_CS_0_ACTIVE 4

/* Tells MQSPI to change MOSI pin level on the rising edge of SPICLK */
#define MQSPI_CSCFG_FLAG_DOPH 2

/* Tells MQSPI to sample MISO pin level on the falling edge of SPICLK */
#define MQSPI_CSCFG_FLAG_DIPH 1

/* A mask to filter MQSPI_CSCFG_FLAG_* flags */
#define MQSPI_CSCFG_FLAGS_MASK 0xF
/* Denote normal trigger priority */
#define MQSPI_PRIORITY_LOW 0#define MQSPI_PRIORITY_NORMAL 0/* Denote high trigger priority */
#define MQSPI_PRIORITY_HIGH 1
/* Choose enable/reset operation to affect the whole MQSPI module */
#define MQSPI_BUS_ALL 0/* Choose the operation to affect or the trigger to use SPI bus A */
#define MQSPI_BUS_1 1#define MQSPI_BUS_A 1/* Choose the operation to affrct or the trigger to use SPI bus B */
#define MQSPI_BUS_2 2#define MQSPI_BUS_B 2

/* Initiate either a global SPI reset or a reset of a single physical SPI */
void mqspi_reset(byte bus);

void mqspi_enable(byte bus, bool enable);
void mqspi_configure_cs(byte cs, byte bus, byte clkdiv, byte flags, byte dat, byte dbt);
byte mqspi_get_trigger(void);
void mqspi_trigger_config(byte trigger, byte priority, byte count, byte cs);
void mqspi_trigger_free_buffs(byte trigger);
bool mqspi_trigger_assign_data(byte trigger, hword * data, byte msglen, bool read);
void mqspi_trigger_activate(byte trigger);
bool mqspi_trigger_check_busy(byte trigger);
void mqspi_trigger_wait(byte trigger);
bool mqspi_trigger_fetch_data(byte trigger, hword * data);
void mqspi_trigger_free(byte trigger);
bool mqspi_transcieve(hword *wdata, hword *rdata, byte length, byte cs, byte count, byte priority);
void mqspi_init(void);
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -