Paparazzi UAS  v4.2.2_stable-4-gcc32f65
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
spi_slave_hs_arch.c File Reference
#include "spi_slave_hs_arch.h"
#include "mcu_periph/spi.h"
#include "interrupt_hw.h"
#include "std.h"
#include "mcu.h"
#include "led.h"
#include "LPC21xx.h"
#include "ssp_hw.h"
#include "pprz_debug.h"
#include "armVIC.h"
+ Include dependency graph for spi_slave_hs_arch.c:

Go to the source code of this file.

Macros

#define SSP_DDS   0x07 << 0 /* data size : 8 bits */
 
#define SSP_FRF   0x00 << 4 /* frame format : SPI */
 
#define SSP_CPOL   0x00 << 6 /* clock polarity : data captured on first clock transition */
 
#define SSP_CPHA   0x00 << 7 /* clock phase : SCK idles low */
 
#define SSP_SCR   0x00 << 8 /* serial clock rate : divide by 1 */
 
#define SSPCR0_VAL   (SSP_DDS | SSP_FRF | SSP_CPOL | SSP_CPHA | SSP_SCR )
 
#define SSP_LBM   0x00 << 0 /* loopback mode : disabled */
 
#define SSP_SSE   0x00 << 1 /* SSP enable : enable later when init ready */
 
#define SSP_MS   0x01 << 2 /* master slave mode : slave */
 
#define SSP_SOD   0x00 << 3 /* slave output disable : don't care when master */
 
#define SSPCR1_VAL   (SSP_LBM | SSP_SSE | SSP_MS | SSP_SOD )
 
#define SSP_PINSEL1_SCK   (2<<2)
 
#define SSP_PINSEL1_MISO   (2<<4)
 
#define SSP_PINSEL1_MOSI   (2<<6)
 
#define SSP_PINSEL1_SSEL   (2<<8)
 
#define SSP_Write(X)   SSPDR=(X)
 
#define SSP_Read()   SSPDR
 
#define SSP_Status()   SSPSR
 

Functions

static void SSP_ISR (void)
 

Variables

uint16_t spi_slave_hs_rx_insert_idx
 
uint16_t spi_slave_hs_rx_extract_idx
 
uint8_t spi_slave_hs_rx_buffer [SPI_SLAVE_HS_RX_BUFFER_SIZE]
 
uint8_t spi_slave_hs_tx_insert_idx
 
uint8_t spi_slave_hs_tx_extract_idx
 
uint8_t spi_slave_hs_tx_buffer [SPI_SLAVE_HS_TX_BUFFER_SIZE]
 

Macro Definition Documentation

#define SSP_CPHA   0x00 << 7 /* clock phase : SCK idles low */
#define SSP_CPOL   0x00 << 6 /* clock polarity : data captured on first clock transition */
#define SSP_DDS   0x07 << 0 /* data size : 8 bits */
#define SSP_FRF   0x00 << 4 /* frame format : SPI */
#define SSP_LBM   0x00 << 0 /* loopback mode : disabled */
#define SSP_MS   0x01 << 2 /* master slave mode : slave */
#define SSP_PINSEL1_MISO   (2<<4)
#define SSP_PINSEL1_MOSI   (2<<6)
#define SSP_PINSEL1_SCK   (2<<2)
#define SSP_PINSEL1_SSEL   (2<<8)

Referenced by max11040_hw_init(), and SSP_ISR().

#define SSP_Read ( )    SSPDR
#define SSP_SCR   0x00 << 8 /* serial clock rate : divide by 1 */
#define SSP_SOD   0x00 << 3 /* slave output disable : don't care when master */
#define SSP_SSE   0x00 << 1 /* SSP enable : enable later when init ready */
#define SSP_Status ( )    SSPSR
#define SSP_Write (   X)    SSPDR=(X)
#define SSPCR0_VAL   (SSP_DDS | SSP_FRF | SSP_CPOL | SSP_CPHA | SSP_SCR )
#define SSPCR1_VAL   (SSP_LBM | SSP_SSE | SSP_MS | SSP_SOD )

Function Documentation

Variable Documentation

uint8_t spi_slave_hs_rx_buffer[SPI_SLAVE_HS_RX_BUFFER_SIZE]

Definition at line 40 of file spi_slave_hs_arch.c.

uint16_t spi_slave_hs_rx_extract_idx

Definition at line 39 of file spi_slave_hs_arch.c.

uint16_t spi_slave_hs_rx_insert_idx

Definition at line 39 of file spi_slave_hs_arch.c.

uint8_t spi_slave_hs_tx_buffer[SPI_SLAVE_HS_TX_BUFFER_SIZE]

Definition at line 42 of file spi_slave_hs_arch.c.

uint8_t spi_slave_hs_tx_extract_idx

Definition at line 41 of file spi_slave_hs_arch.c.

uint8_t spi_slave_hs_tx_insert_idx

Definition at line 41 of file spi_slave_hs_arch.c.