trikRuntime
|
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <termios.h>
#include <QtCore/QByteArray>
#include <QtCore/QString>
#include <QtCore/QObject>
#include <QtCore/QThread>
#include <QsLog.h>
#include "usbMSP430Defines.h"
#include "usbMSP430Interface.h"
Classes | |
class | Sleeper |
Delays class. More... | |
Functions | |
uint32_t | hex2num (char *string, uint16_t pos, uint16_t numsize) |
Extract number from packet. More... | |
void | makeWriteRegPacket (char *msp_packet, uint8_t dev_addr, uint8_t reg_addr, uint32_t reg_val) |
Make write register packet. More... | |
void | makeReadRegPacket (char *msp_packet, uint8_t dev_addr, uint8_t reg_addr) |
Make read register packet. More... | |
uint32_t | decodeReceivedPacket (char *msp_packet, uint8_t &dev_addr, uint8_t &func_code, uint8_t ®_addr, uint32_t ®_val) |
Function for decoding received packet. More... | |
uint32_t | init_USBTTYDevice () |
Init USB TTY device. More... | |
uint32_t | sendUSBPacket (char *in_msp_packet, char *out_msp_packet) |
Send USB packet. More... | |
uint32_t | init_motors_USBMSP () |
Init power motors. More... | |
uint32_t | init_servomotors_USBMSP () |
Init servo motors. More... | |
uint32_t | init_encoders_USBMSP () |
Init encoders. More... | |
uint32_t | init_sensors_USBMSP () |
Init sensors. More... | |
uint32_t | init_dhtxx_sensors_USBMSP () |
Init DHTxx sensors. More... | |
uint32_t | init_i2c_sensors_USBMSP () |
Init I2C sensors. More... | |
uint32_t | connect_USBMSP () |
Connect to USB MSP430 device. More... | |
uint32_t | disconnect_USBMSP () |
Disconnect from USB MSP430 device. More... | |
uint32_t | power_Motor (QByteArray const &i2c_data) |
Motor power control function. More... | |
uint32_t | freq_Motor (QByteArray const &i2c_data) |
Set motor frequency function. More... | |
uint32_t | reset_Encoder (QByteArray const &i2c_data) |
Reset encoder function. More... | |
uint32_t | read_Encoder (QByteArray const &i2c_data) |
Read encoder function. More... | |
uint32_t | init_URM04 (uint8_t i2c_addr, uint8_t usart_addr) |
Init I2C + USART + URM04. More... | |
uint32_t | read_URM04_dist (uint8_t dev_addr, uint8_t urm04_addr) |
Read URM04 distance function. More... | |
uint32_t | read_Sensor (QByteArray const &i2c_data) |
Read sensor function. More... | |
uint32_t | send_USBMSP (QByteArray const &i2c_data) |
Send data to MSP430 via USB. More... | |
uint32_t | read_USBMSP (QByteArray const &i2c_data) |
Read data from MSP430 via USB. More... | |
Variables | |
volatile uint16_t | mper |
volatile uint16_t | sper |
int | usb_out_descr |
struct termios | usb_tty |
volatile uint8_t | alt_func_flag |
uint8_t | addr_table_i2c_usb [84] |
uint32_t connect_USBMSP | ( | ) |
Connect to USB MSP430 device.
uint32_t decodeReceivedPacket | ( | char * | msp_packet, |
uint8_t & | dev_addr, | ||
uint8_t & | func_code, | ||
uint8_t & | reg_addr, | ||
uint32_t & | reg_val | ||
) |
Function for decoding received packet.
uint32_t disconnect_USBMSP | ( | ) |
Disconnect from USB MSP430 device.
uint32_t freq_Motor | ( | QByteArray const & | i2c_data | ) |
Set motor frequency function.
uint32_t hex2num | ( | char * | string, |
uint16_t | pos, | ||
uint16_t | numsize | ||
) |
Extract number from packet.
uint32_t init_dhtxx_sensors_USBMSP | ( | ) |
Init DHTxx sensors.
uint32_t init_encoders_USBMSP | ( | ) |
Init encoders.
uint32_t init_i2c_sensors_USBMSP | ( | ) |
Init I2C sensors.
uint32_t init_motors_USBMSP | ( | ) |
Init power motors.
Init motors.
uint32_t init_sensors_USBMSP | ( | ) |
Init sensors.
uint32_t init_servomotors_USBMSP | ( | ) |
Init servo motors.
uint32_t init_URM04 | ( | uint8_t | i2c_addr, |
uint8_t | usart_addr | ||
) |
Init I2C + USART + URM04.
uint32_t init_USBTTYDevice | ( | ) |
Init USB TTY device.
void makeReadRegPacket | ( | char * | msp_packet, |
uint8_t | dev_addr, | ||
uint8_t | reg_addr | ||
) |
Make read register packet.
void makeWriteRegPacket | ( | char * | msp_packet, |
uint8_t | dev_addr, | ||
uint8_t | reg_addr, | ||
uint32_t | reg_val | ||
) |
Make write register packet.
uint32_t power_Motor | ( | QByteArray const & | i2c_data | ) |
Motor power control function.
uint32_t read_Encoder | ( | QByteArray const & | i2c_data | ) |
Read encoder function.
uint32_t read_Sensor | ( | QByteArray const & | i2c_data | ) |
Read sensor function.
uint32_t read_URM04_dist | ( | uint8_t | dev_addr, |
uint8_t | urm04_addr | ||
) |
Read URM04 distance function.
uint32_t read_USBMSP | ( | QByteArray const & | i2c_data | ) |
Read data from MSP430 via USB.
uint32_t reset_Encoder | ( | QByteArray const & | i2c_data | ) |
Reset encoder function.
uint32_t send_USBMSP | ( | QByteArray const & | i2c_data | ) |
Send data to MSP430 via USB.
uint32_t sendUSBPacket | ( | char * | in_msp_packet, |
char * | out_msp_packet | ||
) |
Send USB packet.
uint8_t addr_table_i2c_usb[84] |
volatile uint8_t alt_func_flag |
volatile uint16_t mper |
volatile uint16_t sper |
int usb_out_descr |
struct termios usb_tty |