MiraOS  1.22
mira_spi.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (C) 2016 LumenRadio AB *
3  * *
4  * This file is part of MiraOS. *
5  * *
6  * MiraOS contains software components that are patented by LumenRadio. *
7  * Use of this software is under the terms of the LumenRadio MiraOS *
8  * license.
9  * *
10  * You should have received a copy of the MiraOS license from your *
11  * LumenRadio representative. If not, email to <licenses@lumenradio.com> *
12  ****************************************************************************/
13 
25 #ifndef LIBMIRA_SPI_H_
26 #define LIBMIRA_SPI_H_
27 
28 #include <stdint.h>
29 
37 void mira_spi_init(uint32_t clock_speed);
38 
46 void mira_spi_set_clock_speed(uint32_t clock_speed);
47 
53 uint32_t mira_spi_get_clock_speed(void);
54 
64 void mira_spi_write(uint8_t data);
65 
73 uint8_t mira_spi_read(void);
74 
90 void mira_spi_transfer(uint8_t* source, uint8_t* destination, uint16_t src_length, uint16_t dest_length);
91 
97 void mira_spi_flush(void);
98 
99 #endif /* LIBMIRA_SPI_H_ */
void mira_spi_flush(void)
Flush the SPI driver FIFO.
void mira_spi_init(uint32_t clock_speed)
Initialize the SPI driver.
void mira_spi_write(uint8_t data)
Writes a byte to the SPI bus.
uint8_t mira_spi_read(void)
Reads a byte from the SPI bus.
void mira_spi_set_clock_speed(uint32_t clock_speed)
Updates SPI clock speed.
void mira_spi_transfer(uint8_t *source, uint8_t *destination, uint16_t src_length, uint16_t dest_length)
A full SPI transfer.
uint32_t mira_spi_get_clock_speed(void)
Gets current clock speed.