Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
max11040_hw.h File Reference
#include "LPC21xx.h"
#include "ssp_hw.h"
#include "generated/airframe.h"
#include <BOARD_CONFIG>
+ Include dependency graph for max11040_hw.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAXM_DIVISOR_128   2
 
#define MAXM_DIVISOR_256   3
 
#define MAXM_DIVISOR_512   4
 
#define MAXM_DIVISOR_1024   5
 
#define MAXM_DIVISOR   MAXM_DIVISOR_512
 
#define SSP_CLOCK   468750
 
#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   0x01 << 7 /* clock phase : SCK idles low */
 
#define SSP_SCR   0x00 << 8 /* serial clock rate : divide by 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 SSPCR0_VAL   (SSP_DDS | SSP_FRF | SSP_CPOL | SSP_CPHA | SSP_SCR )
 
#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_Enable()   SetBit(SSPCR1, SSE);
 
#define SSP_Disable()   ClearBit(SSPCR1, SSE);
 
#define SSP_EnableRxi()   SetBit(SSPIMSC, RXIM)
 
#define SSP_DisableRxi()   ClearBit(SSPIMSC, RXIM)
 
#define SSP_ClearRxi()   SetBit(SSPICR, RXIM);
 
#define SSP_EnableTxi()   SetBit(SSPIMSC, TXIM)
 
#define SSP_DisableTxi()   ClearBit(SSPIMSC, TXIM)
 
#define SSP_ClearTxi()   SetBit(SSPICR, TXIM);
 
#define SSP_EnableRti()   SetBit(SSPIMSC, RTIM);
 
#define SSP_DisableRti()   ClearBit(SSPIMSC, RTIM);
 
#define SSP_ClearRti()   SetBit(SSPICR, RTIC);
 
#define MaxmSelect()   SetBit(MAXM_SS_IOCLR, MAXM_SS_PIN)
 
#define MaxmUnselect()   SetBit(MAXM_SS_IOSET, MAXM_SS_PIN)
 

Functions

void max11040_hw_init (void)
 

Macro Definition Documentation

◆ MAXM_DIVISOR

#define MAXM_DIVISOR   MAXM_DIVISOR_512

Definition at line 17 of file max11040_hw.h.

◆ MAXM_DIVISOR_1024

#define MAXM_DIVISOR_1024   5

Definition at line 15 of file max11040_hw.h.

◆ MAXM_DIVISOR_128

#define MAXM_DIVISOR_128   2

Definition at line 12 of file max11040_hw.h.

◆ MAXM_DIVISOR_256

#define MAXM_DIVISOR_256   3

Definition at line 13 of file max11040_hw.h.

◆ MAXM_DIVISOR_512

#define MAXM_DIVISOR_512   4

Definition at line 14 of file max11040_hw.h.

◆ MaxmSelect

#define MaxmSelect ( )    SetBit(MAXM_SS_IOCLR, MAXM_SS_PIN)

Definition at line 55 of file max11040_hw.h.

◆ MaxmUnselect

#define MaxmUnselect ( )    SetBit(MAXM_SS_IOSET, MAXM_SS_PIN)

Definition at line 56 of file max11040_hw.h.

◆ SSP_ClearRti

#define SSP_ClearRti ( )    SetBit(SSPICR, RTIC);

Definition at line 53 of file max11040_hw.h.

◆ SSP_ClearRxi

#define SSP_ClearRxi ( )    SetBit(SSPICR, RXIM);

Definition at line 47 of file max11040_hw.h.

◆ SSP_ClearTxi

#define SSP_ClearTxi ( )    SetBit(SSPICR, TXIM);

Definition at line 50 of file max11040_hw.h.

◆ SSP_CLOCK

#define SSP_CLOCK   468750

Definition at line 20 of file max11040_hw.h.

◆ SSP_CPHA

#define SSP_CPHA   0x01 << 7 /* clock phase : SCK idles low */

Definition at line 26 of file max11040_hw.h.

◆ SSP_CPOL

#define SSP_CPOL   0x00 << 6 /* clock polarity : data captured on first clock transition */

Definition at line 25 of file max11040_hw.h.

◆ SSP_DDS

#define SSP_DDS   0x07 << 0 /* data size : 8 bits */

Definition at line 23 of file max11040_hw.h.

◆ SSP_Disable

#define SSP_Disable ( )    ClearBit(SSPCR1, SSE);

Definition at line 44 of file max11040_hw.h.

◆ SSP_DisableRti

#define SSP_DisableRti ( )    ClearBit(SSPIMSC, RTIM);

Definition at line 52 of file max11040_hw.h.

◆ SSP_DisableRxi

#define SSP_DisableRxi ( )    ClearBit(SSPIMSC, RXIM)

Definition at line 46 of file max11040_hw.h.

◆ SSP_DisableTxi

#define SSP_DisableTxi ( )    ClearBit(SSPIMSC, TXIM)

Definition at line 49 of file max11040_hw.h.

◆ SSP_Enable

#define SSP_Enable ( )    SetBit(SSPCR1, SSE);

Definition at line 43 of file max11040_hw.h.

◆ SSP_EnableRti

#define SSP_EnableRti ( )    SetBit(SSPIMSC, RTIM);

Definition at line 51 of file max11040_hw.h.

◆ SSP_EnableRxi

#define SSP_EnableRxi ( )    SetBit(SSPIMSC, RXIM)

Definition at line 45 of file max11040_hw.h.

◆ SSP_EnableTxi

#define SSP_EnableTxi ( )    SetBit(SSPIMSC, TXIM)

Definition at line 48 of file max11040_hw.h.

◆ SSP_FRF

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

Definition at line 24 of file max11040_hw.h.

◆ SSP_LBM

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

Definition at line 30 of file max11040_hw.h.

◆ SSP_MS

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

Definition at line 32 of file max11040_hw.h.

◆ SSP_PINSEL1_MISO

#define SSP_PINSEL1_MISO   (2<<4)

Definition at line 39 of file max11040_hw.h.

◆ SSP_PINSEL1_MOSI

#define SSP_PINSEL1_MOSI   (2<<6)

Definition at line 40 of file max11040_hw.h.

◆ SSP_PINSEL1_SCK

#define SSP_PINSEL1_SCK   (2<<2)

Definition at line 38 of file max11040_hw.h.

◆ SSP_PINSEL1_SSEL

#define SSP_PINSEL1_SSEL   (2<<8)

Definition at line 41 of file max11040_hw.h.

◆ SSP_SCR

#define SSP_SCR   0x00 << 8 /* serial clock rate : divide by 16 */

Definition at line 27 of file max11040_hw.h.

◆ SSP_SOD

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

Definition at line 33 of file max11040_hw.h.

◆ SSP_SSE

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

Definition at line 31 of file max11040_hw.h.

◆ SSPCR0_VAL

#define SSPCR0_VAL   (SSP_DDS | SSP_FRF | SSP_CPOL | SSP_CPHA | SSP_SCR )

Definition at line 35 of file max11040_hw.h.

◆ SSPCR1_VAL

#define SSPCR1_VAL   (SSP_LBM | SSP_SSE | SSP_MS | SSP_SOD )

Definition at line 36 of file max11040_hw.h.

Function Documentation

◆ max11040_hw_init()

void max11040_hw_init ( void  )