dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pios_spi.h
Go to the documentation of this file.
1 
14 /*
15  * This program is free software; you can redistribute it and/or modify
16  * it under the terms of the GNU General Public License as published by
17  * the Free Software Foundation; either version 3 of the License, or
18  * (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful, but
21  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23  * for more details.
24  *
25  * You should have received a copy of the GNU General Public License along
26  * with this program; if not, see <http://www.gnu.org/licenses/>
27  */
28 
29 #ifndef PIOS_SPI_H
30 #define PIOS_SPI_H
31 
32 struct pios_spi_cfg;
33 
34 struct pios_spi_dev;
35 
36 typedef struct pios_spi_dev *pios_spi_t;
37 
38 /* Public Functions */
39 
46 int32_t PIOS_SPI_Init(pios_spi_t * spi_dev, const struct pios_spi_cfg * cfg);
47 
55 int32_t PIOS_SPI_SetClockSpeed(pios_spi_t spi_dev, uint32_t speed);
56 
64 int32_t PIOS_SPI_RC_PinSet(pios_spi_t spi_dev, uint32_t slave_id, bool pin_value);
65 
72 uint8_t PIOS_SPI_TransferByte(pios_spi_t spi_dev, uint8_t b);
73 
84 int32_t PIOS_SPI_TransferBlock(pios_spi_t spi_dev, const uint8_t *send_buffer, uint8_t *receive_buffer, uint16_t len);
85 
92 int32_t PIOS_SPI_ClaimBus(pios_spi_t spi_dev);
93 
99 int32_t PIOS_SPI_ReleaseBus(pios_spi_t spi_dev);
100 
101 #endif /* PIOS_SPI_H */
102 
uint16_t speed
Definition: msp_messages.h:101
int32_t PIOS_SPI_RC_PinSet(pios_spi_t spi_dev, uint32_t slave_id, bool pin_value)
int32_t PIOS_SPI_ClaimBus(pios_spi_t spi_dev)
struct pios_spi_dev * pios_spi_t
Definition: pios_spi.h:36
static struct flyingpicmd_cfg_fa cfg
Definition: main.c:49
uint8_t PIOS_SPI_TransferByte(pios_spi_t spi_dev, uint8_t b)
int32_t PIOS_SPI_SetClockSpeed(pios_spi_t spi_dev, uint32_t speed)
int32_t PIOS_SPI_Init(pios_spi_t *spi_dev, const struct pios_spi_cfg *cfg)
int32_t PIOS_SPI_TransferBlock(pios_spi_t spi_dev, const uint8_t *send_buffer, uint8_t *receive_buffer, uint16_t len)
int32_t PIOS_SPI_ReleaseBus(pios_spi_t spi_dev)