no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
mbed_spi.h
Go to the documentation of this file.
1/***************************************************************************/
31
32#ifndef MBED_SPI_H_
33#define MBED_SPI_H_
34
35// Platform support needs to be C-compatible to work with other drivers
36#ifdef __cplusplus
37extern "C"
38{
39#endif
40
41#include <stdio.h>
42#include <stdbool.h>
43
44/*
45 * Note: The structure members are not strongly typed, as this file is included
46 * in application specific '.c' files. The mbed code structure does not
47 * allow inclusion of mbed driver files (e.g. mbed.h) into '.c' files.
48 * All the members are hence typecasted to mbed specific type during
49 * spi init and read/write operations.
50 **/
51
57 uint16_t spi_miso_pin; // SPI MISO pin (PinName)
58 uint16_t spi_mosi_pin; // SPI MOSI pin (PinName)
59 uint16_t spi_clk_pin; // SPI CLK pin (PinName)
60 bool use_sw_csb; // Software/Hardware control of CSB pin
61};
62
68 void *spi_port; // SPI port instance (mbed::SPI)
69 void *csb_gpio; // SPI chip select gpio instance (DigitalOut)
70 bool use_sw_csb; // Software/Hardware control of CSB pin
71};
72
76extern const struct no_os_spi_platform_ops mbed_spi_ops;
77
78#ifdef __cplusplus // Closing extern c
79}
80#endif
81
82#endif /* MBED_SPI_H_ */
const struct no_os_spi_platform_ops mbed_spi_ops
Mbed platform specific SPI platform ops structure.
SPI specific descriptor for the mbed platform.
Definition mbed_spi.h:67
void * csb_gpio
Definition mbed_spi.h:69
void * spi_port
Definition mbed_spi.h:68
bool use_sw_csb
Definition mbed_spi.h:70
Structure holding the SPI init parameters for mbed platform.
Definition mbed_spi.h:56
uint16_t spi_mosi_pin
Definition mbed_spi.h:58
bool use_sw_csb
Definition mbed_spi.h:60
uint16_t spi_miso_pin
Definition mbed_spi.h:57
uint16_t spi_clk_pin
Definition mbed_spi.h:59
Structure holding SPI function pointers that point to the platform specific function.
Definition no_os_spi.h:210