Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
amt22.h File Reference
+ Include dependency graph for amt22.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  amt22_config_t
 
struct  amt22_t
 

Enumerations

enum  amt22_type { AMT22_12_SINGLE , AMT22_14_SINGLE , AMT22_12_MULTI , AMT22_14_MULTI }
 

Functions

void amt22_init (amt22_t *amt22, amt22_config_t *conf)
 
void amt22_periodic (amt22_t *amt22)
 
uint16_t amt22_get_position (amt22_t *amt22)
 
int16_t amt22_get_turns (amt22_t *amt22)
 

Data Structure Documentation

◆ amt22_config_t

struct amt22_config_t

Definition at line 13 of file amt22.h.

+ Collaboration diagram for amt22_config_t:
Data Fields
struct spi_periph * p
uint8_t slave_idx
enum amt22_type type

◆ amt22_t

struct amt22_t

Definition at line 19 of file amt22.h.

+ Collaboration diagram for amt22_t:
Data Fields
pprz_bsem_t bsem_amt22_read
amt22_config_t * config
pprz_mutex_t mtx
uint16_t position
volatile uint8_t spi_input_buf[4]
volatile uint8_t spi_output_buf[4]
pprz_thread_t thd_handle
struct spi_transaction trans
int16_t turns

Enumeration Type Documentation

◆ amt22_type

Enumerator
AMT22_12_SINGLE 

12-bits, single-turn

AMT22_14_SINGLE 

14-bits, single-turn

AMT22_12_MULTI 

12-bits, multi-turn

AMT22_14_MULTI 

14-bits, multi-turn

Definition at line 6 of file amt22.h.

Function Documentation

◆ amt22_get_position()

uint16_t amt22_get_position ( amt22_t amt22)

Definition at line 111 of file amt22.c.

References amt, pprz_mtx_lock(), and pprz_mtx_unlock().

Referenced by encoder_amt22_periodic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ amt22_get_turns()

int16_t amt22_get_turns ( amt22_t amt22)

Definition at line 118 of file amt22.c.

References amt, pprz_mtx_lock(), and pprz_mtx_unlock().

Referenced by encoder_amt22_periodic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ amt22_init()

void amt22_init ( amt22_t amt22,
amt22_config_t conf 
)

Definition at line 12 of file amt22.c.

References amt, AMT22_12_SINGLE, AMT22_14_SINGLE, AMT22_SPI_CDIV, amt22_thd(), foo, pprz_bsem_init(), pprz_mtx_init(), PPRZ_NORMAL_PRIO, pprz_thread_create(), SPICphaEdge1, SPICpolIdleLow, SPIDss8bit, SPIMSBFirst, SPISelectUnselect, and SPITransDone.

Referenced by encoder_amt22_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ amt22_periodic()

void amt22_periodic ( amt22_t amt22)

Definition at line 52 of file amt22.c.

References amt, and pprz_bsem_signal().

Referenced by encoder_amt22_periodic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: