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
ADS8344.c File Reference
#include "ADS8344.h"
#include "LPC21xx.h"
#include "armVIC.h"
#include <BOARD_CONFIG>
#include "led.h"
#include "mcu_periph/spi.h"
+ Include dependency graph for ADS8344.c:

Go to the source code of this file.

Macros

#define ADS8344_SS_IODIR   IO0DIR
 
#define ADS8344_SS_IOSET   IO0SET
 
#define ADS8344_SS_IOCLR   IO0CLR
 
#define ADS8344_SS_PIN   20
 
#define ADS8344Select()   SetBit(ADS8344_SS_IOCLR,ADS8344_SS_PIN)
 
#define ADS8344Unselect()   SetBit(ADS8344_SS_IOSET,ADS8344_SS_PIN)
 
#define POWER_MODE   (1 << 1 | 1)
 
#define SGL_DIF   1
 
#define SSP_DSS   0x07 << 0 /* data size : 8 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 : 1 */
 
#define SSP_SCR   0x0E << 8 /* serial clock rate : 1MHz */
 
#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 : disabled */
 
#define SPI1_VIC_SLOT   7
 

Functions

static void SPI1_ISR (void)
 
void ADS8344_init (void)
 
static void read_values (void)
 
static void send_request (void)
 
void ADS8344_start (void)
 

Variables

bool_t ADS8344_available
 
uint16_t ADS8344_values [NB_CHANNELS]
 
static uint8_t channel
 

Macro Definition Documentation

#define ADS8344_SS_IOCLR   IO0CLR

Definition at line 32 of file ADS8344.c.

#define ADS8344_SS_IODIR   IO0DIR

Definition at line 30 of file ADS8344.c.

Referenced by ADS8344_init().

#define ADS8344_SS_IOSET   IO0SET

Definition at line 31 of file ADS8344.c.

#define ADS8344_SS_PIN   20

Definition at line 33 of file ADS8344.c.

Referenced by ADS8344_init().

#define ADS8344Select ( )    SetBit(ADS8344_SS_IOCLR,ADS8344_SS_PIN)

Definition at line 35 of file ADS8344.c.

Referenced by ADS8344_start().

#define ADS8344Unselect ( )    SetBit(ADS8344_SS_IOSET,ADS8344_SS_PIN)

Definition at line 36 of file ADS8344.c.

Referenced by ADS8344_init().

#define POWER_MODE   (1 << 1 | 1)

Definition at line 41 of file ADS8344.c.

Referenced by send_request().

#define SGL_DIF   1

Definition at line 42 of file ADS8344.c.

Referenced by send_request().

#define SPI1_VIC_SLOT   7

Definition at line 85 of file ADS8344.c.

Referenced by ADS8344_init(), and imu_crista_arch_init().

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

Definition at line 69 of file ADS8344.c.

Referenced by ADS8344_init().

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

Definition at line 68 of file ADS8344.c.

Referenced by ADS8344_init().

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

Definition at line 66 of file ADS8344.c.

Referenced by ADS8344_init().

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

Definition at line 67 of file ADS8344.c.

Referenced by ADS8344_init().

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

Definition at line 73 of file ADS8344.c.

Referenced by ADS8344_init().

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

Definition at line 75 of file ADS8344.c.

Referenced by ADS8344_init().

#define SSP_SCR   0x0E << 8 /* serial clock rate : 1MHz */

Definition at line 70 of file ADS8344.c.

Referenced by ADS8344_init().

#define SSP_SOD   0x00 << 3 /* slave output disable : disabled */

Definition at line 76 of file ADS8344.c.

Referenced by ADS8344_init().

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

Definition at line 74 of file ADS8344.c.

Function Documentation

void ADS8344_init ( void  )
void ADS8344_start ( void  )

Definition at line 129 of file ADS8344.c.

static void read_values ( void  )
inlinestatic

Definition at line 112 of file ADS8344.c.

References ADS8344_values, channel, foo, and SSPDR.

Referenced by SPI1_ISR().

+ Here is the caller graph for this function:

static void send_request ( void  )
inlinestatic

Definition at line 120 of file ADS8344.c.

References POWER_MODE, SGL_DIF, and SSPDR.

Referenced by ADS8344_start(), and SPI1_ISR().

+ Here is the caller graph for this function:

void SPI1_ISR ( void  )
static

Definition at line 137 of file ADS8344.c.

References ADS8344_available, ISR_ENTRY, ISR_EXIT, LED_TOGGLE, read_values(), send_request(), SpiClearRti(), TRUE, and VICVectAddr.

Referenced by ADS8344_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

bool_t ADS8344_available

Definition at line 38 of file ADS8344.c.

Referenced by ADS8344_init(), dma1_c4_irq_handler(), and SPI1_ISR().

uint16_t ADS8344_values[NB_CHANNELS]

Definition at line 39 of file ADS8344.c.

Referenced by dma1_c4_irq_handler(), and read_values().

uint8_t channel
static

Definition at line 80 of file ADS8344.c.

Referenced by adc_init(), adcISR0(), adcISR1(), and read_values().