Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ms2100_arch.h File Reference
#include <stm32/gpio.h>
#include <stm32/spi.h>
+ Include dependency graph for ms2100_arch.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define Ms2100Select()   GPIOC->BRR = GPIO_Pin_12
 
#define Ms2100Unselect()   GPIOC->BSRR = GPIO_Pin_12
 
#define Ms2100Reset()   GPIOC->BSRR = GPIO_Pin_13;
 
#define Ms2100Set()   GPIOC->BRR = GPIO_Pin_13
 
#define Ms2100HasEOC()   GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_5)
 
#define Ms2100SendReq()
 
#define Ms2100ReadRes()
 
#define Ms2100OnDmaIrq()
 
#define Ms2100OnSpiIrq()
 

Variables

uint8_t ms2100_cur_axe
 
int16_t ms2100_last_reading
 

Macro Definition Documentation

#define Ms2100HasEOC ( )    GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_5)

Definition at line 39 of file ms2100_arch.h.

Referenced by dma1_c4_irq_handler(), and main_periodic_task().

#define Ms2100OnDmaIrq ( )
Value:
{ \
/* ASSERT((ms2100_status == MS2100_READING_RES), \
* DEBUG_MS2100, MS2100_ERR_SPURIOUS_DMA_IRQ); \
*/ \
if (abs(ms2100_last_reading) < 1000) \
if (ms2100_cur_axe > 2) { \
} \
SPI_Cmd(SPI2, DISABLE); \
DMA_ITConfig(DMA1_Channel4, DMA_IT_TC, DISABLE); \
}
volatile int16_t ms2100_values[MS2100_NB_AXIS]
Definition: ms2100.c:27
volatile uint8_t ms2100_cur_axe
Definition: ms2100_arch.c:11
#define Ms2100Unselect()
Definition: ms2100_arch.h:34
#define MS2100_DATA_AVAILABLE
Definition: ms2100.h:41
int16_t ms2100_last_reading
Definition: ms2100_arch.c:33
volatile uint8_t ms2100_status
Definition: ms2100.c:26
#define MS2100_IDLE
Definition: ms2100.h:35

Definition at line 125 of file ms2100_arch.h.

Referenced by dma1_c4_irq_handler().

#define Ms2100OnSpiIrq ( )
Value:
{ \
/* ASSERT((ms2100_status == MS2100_SENDING_REQ), \
* DEBUG_MS2100, MS2100_ERR_SPURIOUS_SPI_IRQ); \
*/ \
/* read unused control byte reply */ \
uint8_t foo __attribute__ ((unused)) = SPI_I2S_ReceiveData(SPI2); \
SPI_Cmd(SPI2, DISABLE); \
SPI_I2S_ITConfig(SPI2, SPI_I2S_IT_RXNE, DISABLE); \
}
#define Ms2100Unselect()
Definition: ms2100_arch.h:34
#define MS2100_WAITING_EOC
Definition: ms2100.h:38
volatile uint8_t ms2100_status
Definition: ms2100.c:26
uint16_t foo
Definition: main_demo5.c:54
unsigned char uint8_t
Definition: types.h:14
__attribute__((always_inline))
Definition: i2c_arch.c:35

Definition at line 143 of file ms2100_arch.h.

Referenced by spi2_irq_handler().

#define Ms2100ReadRes ( )

Definition at line 68 of file ms2100_arch.h.

#define Ms2100Reset ( )    GPIOC->BSRR = GPIO_Pin_13;

Definition at line 36 of file ms2100_arch.h.

#define Ms2100Select ( )    GPIOC->BRR = GPIO_Pin_12

Definition at line 33 of file ms2100_arch.h.

#define Ms2100SendReq ( )
Value:
{ \
__IO uint32_t nCount = 4;for(; nCount != 0; nCount--); \
nCount = 4;for(; nCount != 0; nCount--); \
uint16_t ctl_byte = ((ms2100_cur_axe+1) | (MS2100_DIVISOR << 4)); \
nCount = 20;for(; nCount != 0; nCount--); \
SPI_Cmd(SPI2, DISABLE); \
SPI_InitTypeDef SPI_InitStructure = { \
.SPI_Direction = SPI_Direction_2Lines_FullDuplex, \
.SPI_Mode = SPI_Mode_Master, \
.SPI_DataSize = SPI_DataSize_8b, \
.SPI_CPOL = SPI_CPOL_Low, \
.SPI_CPHA = SPI_CPHA_1Edge, \
.SPI_NSS = SPI_NSS_Soft, \
.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_64, \
.SPI_FirstBit = SPI_FirstBit_MSB, \
.SPI_CRCPolynomial = 7 \
}; \
SPI_Init(SPI2, &SPI_InitStructure); \
SPI_I2S_ITConfig(SPI2, SPI_I2S_IT_RXNE, ENABLE); \
SPI_Cmd(SPI2, ENABLE); \
SPI_I2S_SendData(SPI2, ctl_byte); \
}
unsigned short uint16_t
Definition: types.h:16
volatile uint8_t ms2100_cur_axe
Definition: ms2100_arch.c:11
#define Ms2100Set()
Definition: ms2100_arch.h:37
#define MS2100_DIVISOR
Definition: ms2100.h:56
#define MS2100_SENDING_REQ
Definition: ms2100.h:37
#define Ms2100Select()
Definition: ms2100_arch.h:33
unsigned long uint32_t
Definition: types.h:18
volatile uint8_t ms2100_status
Definition: ms2100.c:26
#define Ms2100Reset()
Definition: ms2100_arch.h:36

Definition at line 41 of file ms2100_arch.h.

#define Ms2100Set ( )    GPIOC->BRR = GPIO_Pin_13

Definition at line 37 of file ms2100_arch.h.

#define Ms2100Unselect ( )    GPIOC->BSRR = GPIO_Pin_12

Definition at line 34 of file ms2100_arch.h.

Variable Documentation

uint8_t ms2100_cur_axe

Definition at line 11 of file ms2100_arch.c.

Referenced by EXTINT_ISR(), and ms2100_arch_init().

int16_t ms2100_last_reading

Definition at line 33 of file ms2100_arch.c.