Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
max3100_hw.c File Reference
#include "LPC21xx.h"
#include "interrupt_hw.h"
#include "max3100_hw.h"
#include "ap_downlink.h"
#include "mcu_periph/uart.h"
+ Include dependency graph for max3100_hw.c:

Go to the source code of this file.

Macros

#define PINSEL1_SCK   (2 << 2)
 
#define PINSEL1_MISO   (2 << 4)
 
#define PINSEL1_MOSI   (2 << 6)
 
#define PINSEL1_SSEL   (2 << 8)
 
#define SSP_DSS   0x0F << 0 /* data size : 16 bits */
 
#define SSP_FRF   0x00 << 4 /* frame format : SPI */
 
#define SSP_CPOL   0x00 << 6 /* clock polarity : idle low */
 
#define SSP_CPHA   0x00 << 7 /* clock phase : 0 */
 
#define SSP_SCR   0x0F << 8 /* serial clock rate : 29.3kHz, SSP input clock / 16 */
 
#define SSP_LBM   0x00 << 0 /* loopback mode : disabled */
 
#define SSP_SSE   0x00 << 1 /* SSP enable : disabled */
 
#define SSP_MS   0x00 << 2 /* master slave mode : master */
 
#define SSP_SOD   0x00 << 3 /* slave output disable : don't care when master */
 
#define SSPCPSR_VAL   0x04
 
#define SPI1_VIC_SLOT   7
 

Functions

static void EXTINT_ISR (void)
 
static void SPI1_ISR (void)
 
void max3100_init (void)
 
void max3100_debug (void)
 

Variables

uint8_t volatile max3100_status
 
bool volatile max3100_data_available
 
bool volatile max3100_transmit_buffer_empty
 
uint8_t volatile max3100_tx_insert_idx
 
uint8_t volatile max3100_tx_extract_idx
 
uint8_t volatile max3100_rx_insert_idx
 
uint8_t volatile max3100_rx_extract_idx
 
uint8_t volatile max3100_tx_buf [MAX3100_TX_BUF_LEN]
 
uint8_t volatile max3100_rx_buf [MAX3100_RX_BUF_LEN]
 
bool read_bytes = false
 

Macro Definition Documentation

#define PINSEL1_MISO   (2 << 4)

Definition at line 49 of file max3100_hw.c.

Referenced by max3100_init().

#define PINSEL1_MOSI   (2 << 6)

Definition at line 50 of file max3100_hw.c.

Referenced by max3100_init().

#define PINSEL1_SCK   (2 << 2)

Definition at line 48 of file max3100_hw.c.

Referenced by max3100_init().

#define PINSEL1_SSEL   (2 << 8)

Definition at line 51 of file max3100_hw.c.

#define SPI1_VIC_SLOT   7

Definition at line 74 of file max3100_hw.c.

Referenced by max3100_init().

#define SSP_CPHA   0x00 << 7 /* clock phase : 0 */

Definition at line 58 of file max3100_hw.c.

Referenced by max3100_init().

#define SSP_CPOL   0x00 << 6 /* clock polarity : idle low */

Definition at line 57 of file max3100_hw.c.

Referenced by max3100_init().

#define SSP_DSS   0x0F << 0 /* data size : 16 bits */

Definition at line 54 of file max3100_hw.c.

Referenced by max3100_init().

#define SSP_FRF   0x00 << 4 /* frame format : SPI */

Definition at line 56 of file max3100_hw.c.

Referenced by max3100_init().

#define SSP_LBM   0x00 << 0 /* loopback mode : disabled */

Definition at line 62 of file max3100_hw.c.

Referenced by max3100_init().

#define SSP_MS   0x00 << 2 /* master slave mode : master */

Definition at line 64 of file max3100_hw.c.

Referenced by max3100_init().

#define SSP_SCR   0x0F << 8 /* serial clock rate : 29.3kHz, SSP input clock / 16 */

Definition at line 59 of file max3100_hw.c.

Referenced by max3100_init().

#define SSP_SOD   0x00 << 3 /* slave output disable : don't care when master */

Definition at line 65 of file max3100_hw.c.

Referenced by max3100_init().

#define SSP_SSE   0x00 << 1 /* SSP enable : disabled */

Definition at line 63 of file max3100_hw.c.

#define SSPCPSR_VAL   0x04

Definition at line 68 of file max3100_hw.c.

Referenced by max3100_init().

Function Documentation

void EXTINT_ISR ( void  )
static

Definition at line 131 of file max3100_hw.c.

References EXTINT, ISR_ENTRY, ISR_EXIT, max3100_data_available, and VICVectAddr.

Referenced by max3100_init().

+ Here is the caller graph for this function:

void max3100_debug ( void  )

Definition at line 167 of file max3100_hw.c.

Referenced by max3100_event().

+ Here is the caller graph for this function:

void SPI1_ISR ( void  )
static

Definition at line 142 of file max3100_hw.c.

References ISR_ENTRY, ISR_EXIT, MAX3100_R_BIT, max3100_rx_buf, max3100_rx_insert_idx, max3100_status, MAX3100_STATUS_IDLE, MAX3100_STATUS_READING, MAX3100_T_BIT, max3100_transmit_buffer_empty, Max3100Unselect, read_bytes, RNE, SpiClearRti(), SpiDisable, SpiDisableRti(), SSPDR, SSPSR, and VICVectAddr.

Referenced by max3100_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

bool volatile max3100_data_available

Definition at line 32 of file max3100_hw.c.

Referenced by EXTINT_ISR(), max3100_event(), and max3100_init().

uint8_t volatile max3100_rx_buf[MAX3100_RX_BUF_LEN]

Definition at line 39 of file max3100_hw.c.

Referenced by SPI1_ISR().

uint8_t volatile max3100_rx_extract_idx

Definition at line 36 of file max3100_hw.c.

Referenced by max3100_init().

uint8_t volatile max3100_rx_insert_idx

Definition at line 36 of file max3100_hw.c.

Referenced by max3100_init(), and SPI1_ISR().

uint8_t volatile max3100_status
bool volatile max3100_transmit_buffer_empty

Definition at line 33 of file max3100_hw.c.

Referenced by max3100_flush(), max3100_init(), and SPI1_ISR().

uint8_t volatile max3100_tx_buf[MAX3100_TX_BUF_LEN]

Definition at line 38 of file max3100_hw.c.

Referenced by max3100_flush(), and max3100_putchar().

uint8_t volatile max3100_tx_extract_idx

Definition at line 35 of file max3100_hw.c.

Referenced by max3100_flush(), and max3100_init().

uint8_t volatile max3100_tx_insert_idx

Definition at line 35 of file max3100_hw.c.

Referenced by max3100_flush(), max3100_init(), and max3100_putchar().

bool read_bytes = false

Definition at line 42 of file max3100_hw.c.

Referenced by max3100_event(), and SPI1_ISR().