From 9439c6f1caffd938673018f3af7460b33a12528e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 20 Mar 2016 16:39:30 +0100 Subject: Another work progress --- docs/modules/spi.md | 69 ----------------------------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 docs/modules/spi.md (limited to 'docs/modules/spi.md') diff --git a/docs/modules/spi.md b/docs/modules/spi.md deleted file mode 100644 index 3ae730c..0000000 --- a/docs/modules/spi.md +++ /dev/null @@ -1,69 +0,0 @@ -Serial peripheral interface -=========================== -This interface is link to MOSI and MISO pins. Also SS pin is used when slave mode initialized. - -## References -### spi\_init -```C -static inline void spi_init(enum spiMode mode) -``` -Initializes SPI interface. -Parameters: - mode - Specify mode of SPI interface - -NOTE: Global interrupts must be enabled for right function of SPI. - -### spi\_busy -```C -static inline int8_t spi_busy(void) -``` -Returns NULL when device is not busy. -When device is busy return values in non-zero. - -### spi\_join -```C -static inline void spi_join(void) -``` -Blocks processor until device is not busy. - -### spi\_send -```C -static inline uint8_t spi_send(uint8_t data) -``` -Swap bytes with slave over SPI. -This function blocks execution until device isn't busy (transfer completed). -WARNING: Invoke this only when interface is initialized in MASTER mode. - -### spi\_transfer -```C -static inline void spi_transfer(uint8_t data) -``` -Transfer byte to slave over SPI. -This function isn't blocking execution until transfer is complete. -Always call spi\_join before this function when called outside of spi\_receive(). -WARNING: Invoke this only when interface is initialized in MASTER mode. - -### spi\_expose -```C -static inline void spi_expose(uint8_t data) -``` -Expose data for next master request. -Please don't use this when device is busy. -Best place to call this is spi\_receive(). -WARNING: Invoke this only when interface is initialized in SLAVE mode. - -## Function pointer spi\_receive -```C -extern void (*spi_receive)(uint8_t data) -``` -This function is called every time transfer is finished. -And until return from this function interrupts are disabled. - -## Enum spiMode -```C -enum spiMode { - SPI_MODE_MASTER, - SPI_MODE_SLAVE -}; -``` -This is used as parameter for spi\_init function. -- cgit v1.2.3