![]() |
MSPM0_ValvanoWare
1.0
ECE445L starter code
|
RTOS robot sensors. More...
Files | |
| file | BNO085.h |
| Interfacing the BNO085 IMU. | |
| file | TFLuna1.h |
| Initialize TFLuna1, interrupt synchronization. | |
| file | TFLuna2.h |
| Initialize TFLuna2, interrupt synchronization. | |
| file | TFLuna3.h |
| Initialize TFLuna3, interrupt synchronization. | |
Functions | |
| void | BNO085_Reset (uint32_t time) |
| Reset the BNO085. More... | |
| void | BNO085_Init (void(*function)(int16_t data[6])) |
| Initialize 9-DOF BNO085 IMU. More... | |
| void | TFLuna1_Init (void(*function)(uint32_t)) |
| Initialize TFLuna1. More... | |
| void | TFLuna1_Format_Standard_mm (void) |
| mm units More... | |
| void | TFLuna1_Format_Standard_cm (void) |
| cm units More... | |
| void | TFLuna1_Format_Pixhawk (void) |
| Pixhawk. More... | |
| void | TFLuna1_Frame_Rate (void) |
| sampling rate More... | |
| void | TFLuna1_SaveSettings (void) |
| save format and rate More... | |
| void | TFLuna1_System_Reset (void) |
| start measurements More... | |
| void | TFLuna1_Output_Enable (void) |
| enable More... | |
| void | TFLuna1_Output_Disable (void) |
| disable More... | |
| void | TFLuna1_SendMessage (const uint8_t msg[]) |
| output message to TFLuna More... | |
| uint8_t | TFLuna1_InChar (void) |
| uint32_t | TFLuna1_InStatus (void) |
| uint32_t | TFLuna1_OutStatus (void) |
| void | TFLuna1_OutString (uint8_t *pt) |
| output string to TFLuna More... | |
| void | TFLuna1_OutChar (uint8_t data) |
| output character to TFLuna More... | |
| void | TFLuna2_Init (void(*function)(uint32_t)) |
| Initialize TFLuna2. More... | |
| void | TFLuna2_Format_Standard_mm (void) |
| mm units More... | |
| void | TFLuna2_Format_Standard_cm (void) |
| cm units More... | |
| void | TFLuna2_Format_Pixhawk (void) |
| Pixhawk. More... | |
| void | TFLuna2_Frame_Rate (void) |
| sampling rate More... | |
| void | TFLuna2_SaveSettings (void) |
| save format and rate More... | |
| void | TFLuna2_System_Reset (void) |
| start measurements More... | |
| void | TFLuna2_Output_Enable (void) |
| enable More... | |
| void | TFLuna2_Output_Disable (void) |
| disable More... | |
| void | TFLuna2_SendMessage (const uint8_t msg[]) |
| output message to TFLuna2 More... | |
| uint8_t | TFLuna2_InChar (void) |
| uint32_t | TFLuna2_InStatus (void) |
| uint32_t | TFLuna2_OutStatus (void) |
| void | TFLuna2_OutString (uint8_t *pt) |
| output string to TFLuna2 More... | |
| void | TFLuna2_OutChar (uint8_t data) |
| output character to TFLuna2 More... | |
| void | TFLuna3_Init (void(*function)(uint32_t)) |
| Initialize TFLuna3. More... | |
| void | TFLuna3_Format_Standard_mm (void) |
| mm units More... | |
| void | TFLuna3_Format_Standard_cm (void) |
| cm units More... | |
| void | TFLuna3_Format_Pixhawk (void) |
| Pixhawk. More... | |
| void | TFLuna3_Frame_Rate (void) |
| sampling rate More... | |
| void | TFLuna3_SaveSettings (void) |
| save format and rate More... | |
| void | TFLuna3_System_Reset (void) |
| start measurements More... | |
| void | TFLuna3_Output_Enable (void) |
| enable More... | |
| void | TFLuna3_Output_Disable (void) |
| disable More... | |
| void | TFLuna3_SendMessage (const uint8_t msg[]) |
| output message to TFLuna3 More... | |
| uint8_t | TFLuna3_InChar (void) |
| uint32_t | TFLuna3_InStatus (void) |
| uint32_t | TFLuna3_OutStatus (void) |
| void | TFLuna3_OutString (uint8_t *pt) |
| output string to TFLuna3 More... | |
| void | TFLuna3_OutChar (uint8_t data) |
| output character to TFLuna3 More... | |
RTOS robot sensors.
| BNO085 | MSPM0 |
|---|---|
| Vcc | 3.3V Power |
| GND | GND |
| SCL | left not connected |
| SDA | PB13 RxD: is UART3 Rx (BNO085 to MSPM0) baud=115200 bps |
| AD0 | left not connected |
| CS | left not connected |
| INT | left not connected |
| RST | PB12 GPIO output (drive low to reset) |
| PS1 | left not connected (pulled low) |
| PS0 | 3.3V to select UART-RVC mode (there is a solder jumper on back) |
| TFLuna Pin | Description |
|---|---|
| 1 | Red 5V |
| 2 | Serial TxD: PA8/PA17/PB4/PB6 is UART1 Tx (MSPM0 to TFLuna1) |
| 3 | Serial RxD: PA9/PA18/PB5/PB7 is UART1 Rx (TFLuna1 to MSPM0) |
| 4 | black ground |
| TFLuna Pin | Description |
|---|---|
| 1 | Red 5V |
| 2 | Serial TxD: PA21/PA23/PB15/PB17 is UART2 Tx (MSPM0 to TFLuna2) |
| 3 | Serial RxD: PA22/PA24/PB16/PB18 is UART2 Rx (TFLuna2 to MSPM0) |
| 4 | black ground |
| TFLuna Pin | Description |
|---|---|
| 1 | Red 5V |
| 2 | Serial TxD: PA14/PA26/PB2/PB12 is UART3 Tx (MSPM0 to TFLuna3) |
| 3 | Serial RxD: PA13/PA25/PB3/PB13 is UART3 Rx (TFLuna3 to MSPM0) |
| 4 | black ground |
| void BNO085_Init | ( | void(*)(int16_t data[6]) | function | ) |
Initialize 9-DOF BNO085 IMU.
Initialize the UART3 for 115,200 baud rate
8 bit word length, no parity bits, one stop bit, FIFO enabled
Callback function will be called at 100 Hz
data[0] Yaw 0.01 deg
data[1] Pitch 0.01 deg
data[2] Roll 0.01 deg
data[3] X-acceleration 0.001g
data[4] Y-acceleration 0.001g
data[5] Z-acceleration 0.001g
| function | pointer to callback function to which is passed an 6-element array |
| void BNO085_Reset | ( | uint32_t | time | ) |
Reset the BNO085.
Reset the 9-DOF BNO085 IMU
RST =0
wait time bus cycles
RST =1
| time | number of bus cycles to hold RST low |
| void TFLuna1_Format_Pixhawk | ( | void | ) |
Pixhawk.
Configure TFLuna for Pixhawk
| none |
| void TFLuna1_Format_Standard_cm | ( | void | ) |
cm units
Configure TFLuna for measuring distance in cm
| none |
| void TFLuna1_Format_Standard_mm | ( | void | ) |
mm units
Configure TFLuna for measuring distance in mm
| none |
| void TFLuna1_Frame_Rate | ( | void | ) |
sampling rate
Configure TFLuna sampling rate
rate defined in #define TFLunaRate
| none |
| uint8_t TFLuna1_InChar | ( | void | ) |
Wait for new serial port input
Uses interrupt synchronization
This function waits if the receive software FIFO is empty
| Input | none |
| void TFLuna1_Init | ( | void(*)(uint32_t) | function | ) |
Initialize TFLuna1.
initialize UART1 for 115200 bps baud rate.
to use PA9/PA18/PB5/PB7, for PA9 set jumper J14
interrupt synchronization, priority=1
| function | pointer to a callback function |
| uint32_t TFLuna1_InStatus | ( | void | ) |
Returns how much data available for reading
| none |
| void TFLuna1_OutChar | ( | uint8_t | data | ) |
output character to TFLuna
Output 8-bit to serial port TFLuna
Uses interrupt synchronization
This function waits if the transmit software FIFO is full
| data | is an 8-bit ASCII character to be transferred |
| void TFLuna1_Output_Disable | ( | void | ) |
disable
Disable TFLuna output
| none |
| void TFLuna1_Output_Enable | ( | void | ) |
enable
Enable TFLuna output
| none |
| uint32_t TFLuna1_OutStatus | ( | void | ) |
Returns how many bytes are in the transmission software FIFO
| none |
| void TFLuna1_OutString | ( | uint8_t * | pt | ) |
output string to TFLuna
Output string to serial port TFLuna
Uses interrupt synchronization
This function waits if the transmit software FIFO is full
| pt | pointer to a NULL-terminated string to be transferred |
| void TFLuna1_SaveSettings | ( | void | ) |
save format and rate
execute TFLuna_SaveSettings to activate changes to Format and Frame_Rate
| none |
| void TFLuna1_SendMessage | ( | const uint8_t | msg[] | ) |
output message to TFLuna
Output message to serial port TFLuna
Uses interrupt synchronization
msg[0] is 0x5A for command type
msg[1] is length=n
msg[2] is command
msg[3]-msg[n-2] is optional payload
msg[n-1] is 8-bit checksum
E.g., 0x5A,0x05,0x05,0x06,0x6A sets format to mm
This function waits if the transmit software FIFO is full
| msg | pointer to a message to be transferred |
| void TFLuna1_System_Reset | ( | void | ) |
start measurements
execute TFLuna_System_Reset to start measurements
| none |
| void TFLuna2_Format_Pixhawk | ( | void | ) |
Pixhawk.
Configure TFLuna2 for Pixhawk
| none |
| void TFLuna2_Format_Standard_cm | ( | void | ) |
cm units
Configure TFLuna2 for measuring distance in cm
| none |
| void TFLuna2_Format_Standard_mm | ( | void | ) |
mm units
Configure TFLuna2 for measuring distance in mm
| none |
| void TFLuna2_Frame_Rate | ( | void | ) |
sampling rate
Configure TFLuna2 sampling rate
rate defined in #define TFLunaRate
| none |
| uint8_t TFLuna2_InChar | ( | void | ) |
Wait for new serial port input
Uses interrupt synchronization
This function waits if the receive software FIFO is empty
| Input | none |
| void TFLuna2_Init | ( | void(*)(uint32_t) | function | ) |
Initialize TFLuna2.
initialize UART2 for 115200 bps baud rate.
interrupt synchronization, priority=1
| function | pointer to a callback function |
| uint32_t TFLuna2_InStatus | ( | void | ) |
Returns how much data available for reading
| none |
| void TFLuna2_OutChar | ( | uint8_t | data | ) |
output character to TFLuna2
Output 8-bit to serial port TFLuna2
Uses interrupt synchronization
This function waits if the transmit software FIFO is full
| data | is an 8-bit ASCII character to be transferred |
| void TFLuna2_Output_Disable | ( | void | ) |
disable
Disable TFLuna output
| none |
| void TFLuna2_Output_Enable | ( | void | ) |
enable
Enable TFLuna output
| none |
| uint32_t TFLuna2_OutStatus | ( | void | ) |
Returns how many bytes are in the transmission software FIFO
| none |
| void TFLuna2_OutString | ( | uint8_t * | pt | ) |
output string to TFLuna2
Output string to serial port TFLuna2
Uses interrupt synchronization
This function waits if the transmit software FIFO is full
| pt | pointer to a NULL-terminated string to be transferred |
| void TFLuna2_SaveSettings | ( | void | ) |
save format and rate
execute TFLuna2_SaveSettings to activate changes to Format and Frame_Rate
| none |
| void TFLuna2_SendMessage | ( | const uint8_t | msg[] | ) |
output message to TFLuna2
Output message to serial port TFLuna2
Uses interrupt synchronization
msg[0] is 0x5A for command type
msg[1] is length=n
msg[2] is command
msg[3]-msg[n-2] is optional payload
msg[n-1] is 8-bit checksum
E.g., 0x5A,0x05,0x05,0x06,0x6A sets format to mm
This function waits if the transmit software FIFO is full
| msg | pointer to a message to be transferred |
| void TFLuna2_System_Reset | ( | void | ) |
start measurements
execute TFLuna2_System_Reset to start measurements
| none |
| void TFLuna3_Format_Pixhawk | ( | void | ) |
Pixhawk.
Configure TFLuna3 for Pixhawk
| none |
| void TFLuna3_Format_Standard_cm | ( | void | ) |
cm units
Configure TFLuna3 for measuring distance in cm
| none |
| void TFLuna3_Format_Standard_mm | ( | void | ) |
mm units
Configure TFLuna3 for measuring distance in mm
| none |
| void TFLuna3_Frame_Rate | ( | void | ) |
sampling rate
Configure TFLuna3 sampling rate
rate defined in #define TFLunaRate
| none |
| uint8_t TFLuna3_InChar | ( | void | ) |
Wait for new serial port input
Uses interrupt synchronization
This function waits if the receive software FIFO is empty
| Input | none |
| void TFLuna3_Init | ( | void(*)(uint32_t) | function | ) |
Initialize TFLuna3.
initialize UART3 for 115200 bps baud rate.
interrupt synchronization, priority=1
| function | pointer to a callback function |
| uint32_t TFLuna3_InStatus | ( | void | ) |
Returns how much data available for reading
| none |
| void TFLuna3_OutChar | ( | uint8_t | data | ) |
output character to TFLuna3
Output 8-bit to serial port TFLuna3
Uses interrupt synchronization
This function waits if the transmit software FIFO is full
| data | is an 8-bit ASCII character to be transferred |
| void TFLuna3_Output_Disable | ( | void | ) |
disable
Disable TFLuna3 output
| none |
| void TFLuna3_Output_Enable | ( | void | ) |
enable
Enable TFLuna3 output
| none |
| uint32_t TFLuna3_OutStatus | ( | void | ) |
Returns how many bytes are in the transmission software FIFO
| none |
| void TFLuna3_OutString | ( | uint8_t * | pt | ) |
output string to TFLuna3
Output string to serial port TFLuna3
Uses interrupt synchronization
This function waits if the transmit software FIFO is full
| pt | pointer to a NULL-terminated string to be transferred |
| void TFLuna3_SaveSettings | ( | void | ) |
save format and rate
execute TFLuna3_SaveSettings to activate changes to Format and Frame_Rate
| none |
| void TFLuna3_SendMessage | ( | const uint8_t | msg[] | ) |
output message to TFLuna3
Output message to serial port TFLuna
Uses interrupt synchronization
msg[0] is 0x5A for command type
msg[1] is length=n
msg[2] is command
msg[3]-msg[n-2] is optional payload
msg[n-1] is 8-bit checksum
E.g., 0x5A,0x05,0x05,0x06,0x6A sets format to mm
This function waits if the transmit software FIFO is full
| msg | pointer to a message to be transferred |
| void TFLuna3_System_Reset | ( | void | ) |
start measurements
execute TFLuna3_System_Reset to start measurements
| none |