Paparazzi UAS  v5.15_devel-88-gb3ad7fe
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
mag_micromag_fw_hw.h File Reference
#include <stdlib.h>
#include "std.h"
#include "LPC21xx.h"
#include "mcu.h"
#include "mcu_periph/spi.h"
#include <BOARD_CONFIG>
#include "generated/airframe.h"
+ Include dependency graph for mag_micromag_fw_hw.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MM_DIVISOR_128   2
 
#define MM_DIVISOR_256   3
 
#define MM_DIVISOR_512   4
 
#define MM_DIVISOR_1024   5
 
#define MM_DIVISOR   MM_DIVISOR_512
 
#define MmSelect()   SetBit(MM_SS_IOCLR,MM_SS_PIN)
 
#define MmUnselect()   SetBit(MM_SS_IOSET,MM_SS_PIN)
 
#define MmReset()   SetBit(MM_RESET_IOCLR,MM_RESET_PIN)
 
#define MmSet()   SetBit(MM_RESET_IOSET,MM_RESET_PIN)
 
#define MmOnSpiIt()
 
#define MmSendReq()
 
#define MmReadRes()
 

Functions

void micromag_hw_init (void)
 

Variables

volatile uint8_t micromag_cur_axe
 

Macro Definition Documentation

#define MM_DIVISOR   MM_DIVISOR_512

Definition at line 20 of file mag_micromag_fw_hw.h.

#define MM_DIVISOR_1024   5

Definition at line 18 of file mag_micromag_fw_hw.h.

#define MM_DIVISOR_128   2

Definition at line 15 of file mag_micromag_fw_hw.h.

#define MM_DIVISOR_256   3

Definition at line 16 of file mag_micromag_fw_hw.h.

#define MM_DIVISOR_512   4

Definition at line 17 of file mag_micromag_fw_hw.h.

#define MmOnSpiIt ( )

Definition at line 31 of file mag_micromag_fw_hw.h.

Referenced by SSP_ISR().

#define MmReadRes ( )
Value:
{ \
/* trigger 2 bytes read */ \
SSPDR = 0; \
SSPDR = 0; \
}
static void SpiClearRti(struct spi_periph *p)
Definition: spi_arch.c:161
#define MmSelect()
static void SpiEnableRti(struct spi_periph *p)
Definition: spi_arch.c:151
#define SpiEnable()
#define SSPDR
Definition: LPC21xx.h:224
#define MM_READING_RES
volatile uint8_t micromag_status

Definition at line 80 of file mag_micromag_fw_hw.h.

Referenced by micromag_periodic(), and micromag_read().

#define MmReset ( )    SetBit(MM_RESET_IOCLR,MM_RESET_PIN)

Definition at line 28 of file mag_micromag_fw_hw.h.

Referenced by micromag_hw_init().

#define MmSelect ( )    SetBit(MM_SS_IOCLR,MM_SS_PIN)

Definition at line 25 of file mag_micromag_fw_hw.h.

#define MmSendReq ( )
Value:
{ \
uint8_t control_byte = (micromag_cur_axe+1) << 0 | MM_DIVISOR_1024 << 4; \
SSPDR = control_byte; \
}
#define MmReset()
static void SpiClearRti(struct spi_periph *p)
Definition: spi_arch.c:161
#define MmSelect()
static void SpiEnableRti(struct spi_periph *p)
Definition: spi_arch.c:151
#define SpiEnable()
#define MM_DIVISOR_1024
#define MmSet()
unsigned char uint8_t
Definition: types.h:14
#define SSPDR
Definition: LPC21xx.h:224
volatile uint8_t micromag_cur_axe
#define MM_SENDING_REQ
volatile uint8_t micromag_status

Definition at line 68 of file mag_micromag_fw_hw.h.

Referenced by micromag_periodic(), and micromag_read().

#define MmSet ( )    SetBit(MM_RESET_IOSET,MM_RESET_PIN)

Definition at line 29 of file mag_micromag_fw_hw.h.

#define MmUnselect ( )    SetBit(MM_SS_IOSET,MM_SS_PIN)

Definition at line 26 of file mag_micromag_fw_hw.h.

Referenced by micromag_hw_init().

Function Documentation

void micromag_hw_init ( void  )

Definition at line 48 of file mag_micromag_fw_hw.c.

References _VIC_ADDR, _VIC_CNTL, EXTINT, EXTINT_ISR(), EXTMODE, EXTPOLAR, MmReset, MmUnselect, PINSEL1, SPI1_VIC_SLOT, SSP_ISR(), SSP_PINSEL1_MISO, SSP_PINSEL1_MOSI, SSP_PINSEL1_SCK, SSPCPSR, SSPCR0, SSPCR0_VAL, SSPCR1, SSPCR1_VAL, VIC_BIT, VIC_ENABLE, VIC_SPI1, VICIntEnable, and VICIntSelect.

Referenced by micromag_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

volatile uint8_t micromag_cur_axe

Definition at line 13 of file mag_micromag_fw_hw.c.