Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
amt22.h
Go to the documentation of this file.
1#pragma once
2
3#include "mcu_periph/spi.h"
5
12
13typedef struct {
14 struct spi_periph *p;
18
19typedef struct {
21
22 // private
24 volatile uint8_t spi_input_buf[4];
25 volatile uint8_t spi_output_buf[4];
26
29
33} amt22_t;
34
void amt22_init(amt22_t *amt22, amt22_config_t *conf)
Definition amt22.c:12
uint16_t amt22_get_position(amt22_t *amt22)
Definition amt22.c:111
uint8_t slave_idx
Definition amt22.h:15
int16_t turns
Definition amt22.h:28
struct spi_periph * p
Definition amt22.h:14
pprz_mutex_t mtx
Definition amt22.h:32
pprz_bsem_t bsem_amt22_read
Definition amt22.h:31
enum amt22_type type
Definition amt22.h:16
void amt22_periodic(amt22_t *amt22)
Definition amt22.c:52
uint16_t position
Definition amt22.h:27
int16_t amt22_get_turns(amt22_t *amt22)
Definition amt22.c:118
amt22_config_t * config
Definition amt22.h:20
pprz_thread_t thd_handle
Definition amt22.h:30
amt22_type
Definition amt22.h:6
@ AMT22_14_SINGLE
14-bits, single-turn
Definition amt22.h:8
@ AMT22_14_MULTI
14-bits, multi-turn
Definition amt22.h:10
@ AMT22_12_SINGLE
12-bits, single-turn
Definition amt22.h:7
@ AMT22_12_MULTI
12-bits, multi-turn
Definition amt22.h:9
thread_t * pprz_thread_t
static amt22_t amt22
struct spi_transaction * trans[SPI_TRANSACTION_QUEUE_LEN]
circular buffer holding transactions
Definition spi.h:173
SPI peripheral structure.
Definition spi.h:171
SPI transaction structure.
Definition spi.h:144
Architecture independent SPI (Serial Peripheral Interface) API.
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
short int16_t
Typedef defining 16 bit short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.