|
AMU Library 3.0
C/C++ library for communicating with AMU (Aerospace Measurement Unit) devices
|
Go to the source code of this file.
Macros | |
| #define | AMU_TWI_DEFAULT_ADDRESS 0x0F |
| #define | AMU_TWI_ALLCALL_ADDRESS 0x0A |
| #define | AMU_EYAS_ADDRESS 0x07 |
| #define | AMU_MAX_CONNECTED_DEVICES 16 |
| #define | AMU_DEVICE_STR_LEN 10 |
| #define | AMU_MANUFACTURER_STR_LEN 20 |
| #define | AMU_SERIALNUM_STR_LEN 26 |
| #define | AMU_FIRMWARE_STR_LEN 16 |
| #define | AMU_DEVICE_DEFAULT_STR "AMU-M0+" |
| #define | AMU_MANUFACTURER_DEFAULT_STR "AEROSPACE" |
| #define | AMU_SERIALNUM_DEFAULT_STR "0x01" |
| #define | AMU_FIRMWARE_DEFAULT_STR "amu-" |
| #define | AMU_TWI_TRANSFER_READ 1 |
| #define | AMU_TWI_TRANSFER_WRITE 0 |
| #define | __TRANSFER_READ_(TYPE) |
| #define | __TRANSFER_READ_OFFSET(TYPE) |
| #define | __TRANSFER_WRITE_(TYPE) |
| #define | __TRANSFER_WRITE_OFFSET(TYPE) |
Functions | |
| volatile amu_device_t * | amu_dev_init (amu_transfer_fptr_t) |
| TODO. | |
| int8_t | amu_dev_transfer (uint8_t address, uint8_t reg, uint8_t *data, size_t len, uint8_t rw) |
| Transfering... TODO. | |
| uint8_t | amu_dev_busy (uint8_t address) |
| Checks to see if the AMU device is busy. | |
| int8_t | amu_dev_send_command (uint8_t address, CMD_t command) |
| Sends a command to an AMU device. | |
| int8_t | amu_dev_send_command_data (uint8_t address, CMD_t command, uint8_t len) |
| Move local transfer reg to remote transfer reg, then send command. | |
| int8_t | amu_dev_query_command (uint8_t address, CMD_t command, uint8_t commandDataLen, uint8_t responseLength) |
| TODO. | |
| static CMD_t | amu_get_next_twi_command (void) |
| static void | amu_command_complete (void) |
| uint8_t | amu_scan_for_devices (uint8_t startAddress, uint8_t endAddress) |
| Scans for any devices that might be connected in order to identify them. | |
| int8_t | amu_get_num_devices (void) |
| int8_t | amu_get_num_connected_devices (void) |
| uint8_t | amu_get_device_address (uint8_t deviceNum) |
| Device addresses are used for TODO. | |
| uint8_t | _amu_route_command (uint8_t deviceNum, CMD_t cmd, size_t transferLen, bool query) |
| TODO. | |
| void | _amu_transfer_read (size_t offset, void *data, size_t len) |
| TODO: explain the transfer part of a transfer read. | |
| void | _amu_transfer_write (size_t offset, void *data, size_t len) |
| TODO: explain the transfer part of a transfer write. | |
| volatile uint8_t * | amu_dev_get_transfer_reg_ptr (void) |
| amu_data_reg_t * | amu_get_register_ptr (uint8_t amu_register) |
| static uint8_t | transfer_read_uint8_t (void) |
| static uint16_t | transfer_read_uint16_t (void) |
| static uint32_t | transfer_read_uint32_t (void) |
| static int32_t | transfer_read_int32_t (void) |
| static float | transfer_read_float (void) |
| static amu_coeff_t | transfer_read_amu_coeff_t (void) |
| static amu_pid_t | transfer_read_amu_pid_t (void) |
| static press_data_t | transfer_read_press_data_t (void) |
| static ss_angle_t | transfer_read_ss_angle_t (void) |
| static amu_meas_t | transfer_read_amu_meas_t (void) |
| static uint8_t | transfer_read_offset_uint8_t (void) |
| static uint16_t | transfer_read_offset_uint16_t (void) |
| static uint32_t | transfer_read_offset_uint32_t (void) |
| static int32_t | transfer_read_offset_int32_t (void) |
| static float | transfer_read_offset_float (void) |
| static void | transfer_write_uint8_t (uint8_t data) |
| static void | transfer_write_uint16_t (uint16_t data) |
| static void | transfer_write_uint32_t (uint32_t data) |
| static void | transfer_write_int32_t (int32_t data) |
| static void | transfer_write_float (float data) |
| static void | transfer_write_amu_coeff_t (amu_coeff_t data) |
| static void | transfer_write_amu_pid_t (amu_pid_t data) |
| static void | transfer_write_press_data_t (press_data_t data) |
| static void | transfer_write_ss_angle_t (ss_angle_t data) |
| static void | transfer_write_offset_float (uint8_t num, float data) |
| static void | transfer_write_str (const char *str, uint8_t len) |
| static void | transfer_read_str (const char *str, uint8_t len) |
Variables | |
| volatile amu_device_t | amu_device |
| char | dev_deviceType_str [10] |
| char | dev_manufacturer_str [20] |
| char | dev_serialNumber_str [26] |
| char | dev_firmware_str [16] |
Definition in file amu_device.h.
| #define __TRANSFER_READ_ | ( | TYPE | ) |
Definition at line 98 of file amu_device.h.
| #define __TRANSFER_READ_OFFSET | ( | TYPE | ) |
Definition at line 99 of file amu_device.h.
| #define __TRANSFER_WRITE_ | ( | TYPE | ) |
Definition at line 100 of file amu_device.h.
| #define __TRANSFER_WRITE_OFFSET | ( | TYPE | ) |
Definition at line 101 of file amu_device.h.
| #define AMU_DEVICE_DEFAULT_STR "AMU-M0+" |
Definition at line 31 of file amu_device.h.
| #define AMU_DEVICE_STR_LEN 10 |
Definition at line 26 of file amu_device.h.
| #define AMU_EYAS_ADDRESS 0x07 |
Definition at line 18 of file amu_device.h.
| #define AMU_FIRMWARE_DEFAULT_STR "amu-" |
Definition at line 34 of file amu_device.h.
| #define AMU_FIRMWARE_STR_LEN 16 |
Definition at line 29 of file amu_device.h.
| #define AMU_MANUFACTURER_DEFAULT_STR "AEROSPACE" |
Definition at line 32 of file amu_device.h.
| #define AMU_MANUFACTURER_STR_LEN 20 |
Definition at line 27 of file amu_device.h.
| #define AMU_MAX_CONNECTED_DEVICES 16 |
Definition at line 21 of file amu_device.h.
| #define AMU_SERIALNUM_DEFAULT_STR "0x01" |
Definition at line 33 of file amu_device.h.
| #define AMU_SERIALNUM_STR_LEN 26 |
Definition at line 28 of file amu_device.h.
| #define AMU_TWI_ALLCALL_ADDRESS 0x0A |
Definition at line 17 of file amu_device.h.
| #define AMU_TWI_DEFAULT_ADDRESS 0x0F |
Definition at line 16 of file amu_device.h.
| #define AMU_TWI_TRANSFER_READ 1 |
Definition at line 36 of file amu_device.h.
| #define AMU_TWI_TRANSFER_WRITE 0 |
Definition at line 37 of file amu_device.h.
TODO.
TODO
| deviceNum | TODO |
| cmd | TODO |
| transferLen | TODO |
| query | TODO |
< Root command for I2C/USB commands
< Root command for I2C/USB commands
Definition at line 242 of file amu_device.c.
| void _amu_transfer_read | ( | size_t | offset, |
| void * | data, | ||
| size_t | len ) |
TODO: explain the transfer part of a transfer read.
| offset | TODO |
| data | TODO |
| len | TODO |
Definition at line 307 of file amu_device.c.
| void _amu_transfer_write | ( | size_t | offset, |
| void * | data, | ||
| size_t | len ) |
TODO: explain the transfer part of a transfer write.
| offset | TODO |
| data | TODO |
| len | TODO |
Definition at line 322 of file amu_device.c.
|
inlinestatic |
Definition at line 59 of file amu_device.h.
| uint8_t amu_dev_busy | ( | uint8_t | address | ) |
Checks to see if the AMU device is busy.
| address | TODO |
Definition at line 107 of file amu_device.c.
| volatile uint8_t * amu_dev_get_transfer_reg_ptr | ( | void | ) |
Definition at line 331 of file amu_device.c.
| volatile amu_device_t * amu_dev_init | ( | amu_transfer_fptr_t | transfer_ptr | ) |
| int8_t amu_dev_query_command | ( | uint8_t | address, |
| CMD_t | command, | ||
| uint8_t | commandDataLen, | ||
| uint8_t | responseLength ) |
TODO.
| address | TODO |
| command | TODO |
| commandDataLen | TODO |
| responseLength | TODO |
Definition at line 152 of file amu_device.c.
| int8_t amu_dev_send_command | ( | uint8_t | address, |
| CMD_t | command ) |
Sends a command to an AMU device.
| address | TODO |
| command | Command for the device |
Definition at line 125 of file amu_device.c.
| int8_t amu_dev_send_command_data | ( | uint8_t | address, |
| CMD_t | command, | ||
| uint8_t | len ) |
Move local transfer reg to remote transfer reg, then send command.
| address | TODO |
| command | Command for the device |
| len | Length of TODO |
Definition at line 137 of file amu_device.c.
| int8_t amu_dev_transfer | ( | uint8_t | address, |
| uint8_t | reg, | ||
| uint8_t * | data, | ||
| size_t | len, | ||
| uint8_t | rw ) |
Transfering... TODO.
| address | TODO |
| reg | TODO |
| data | TODO |
| len | TODO |
| rw | TODO |
Definition at line 97 of file amu_device.c.
| uint8_t amu_get_device_address | ( | uint8_t | deviceNum | ) |
Device addresses are used for TODO.
| deviceNum | Device number of interest |
Definition at line 224 of file amu_device.c.
|
inlinestatic |
< Root command for I2C/USB commands
Definition at line 58 of file amu_device.h.
| int8_t amu_get_num_connected_devices | ( | void | ) |
Definition at line 214 of file amu_device.c.
| int8_t amu_get_num_devices | ( | void | ) |
Definition at line 210 of file amu_device.c.
| amu_data_reg_t * amu_get_register_ptr | ( | uint8_t | amu_register | ) |
Definition at line 333 of file amu_device.c.
| uint8_t amu_scan_for_devices | ( | uint8_t | startAddress, |
| uint8_t | endAddress ) |
Scans for any devices that might be connected in order to identify them.
| startAddress | Start address of the scan range |
| endAddress | End address of the scan range |
Definition at line 179 of file amu_device.c.
|
inlinestatic |
Definition at line 108 of file amu_device.h.
|
inlinestatic |
Definition at line 112 of file amu_device.h.
|
inlinestatic |
Definition at line 109 of file amu_device.h.
|
inlinestatic |
Definition at line 107 of file amu_device.h.
|
inlinestatic |
Definition at line 106 of file amu_device.h.
|
inlinestatic |
Definition at line 118 of file amu_device.h.
|
inlinestatic |
Definition at line 117 of file amu_device.h.
|
inlinestatic |
Definition at line 115 of file amu_device.h.
|
inlinestatic |
Definition at line 116 of file amu_device.h.
|
inlinestatic |
Definition at line 114 of file amu_device.h.
|
inlinestatic |
Definition at line 110 of file amu_device.h.
|
inlinestatic |
Definition at line 111 of file amu_device.h.
|
inlinestatic |
Definition at line 133 of file amu_device.h.
|
inlinestatic |
Definition at line 104 of file amu_device.h.
|
inlinestatic |
Definition at line 105 of file amu_device.h.
|
inlinestatic |
Definition at line 103 of file amu_device.h.
|
inlinestatic |
Definition at line 125 of file amu_device.h.
|
inlinestatic |
Definition at line 126 of file amu_device.h.
|
inlinestatic |
Definition at line 124 of file amu_device.h.
|
inlinestatic |
Definition at line 123 of file amu_device.h.
|
inlinestatic |
Definition at line 130 of file amu_device.h.
|
inlinestatic |
Definition at line 127 of file amu_device.h.
|
inlinestatic |
Definition at line 128 of file amu_device.h.
|
inlinestatic |
Definition at line 132 of file amu_device.h.
|
inlinestatic |
Definition at line 121 of file amu_device.h.
|
inlinestatic |
Definition at line 122 of file amu_device.h.
|
inlinestatic |
Definition at line 120 of file amu_device.h.
|
extern |
Definition at line 40 of file amu_device.c.
|
extern |
|
extern |
|
extern |
|
extern |