| RTOS_MSPM0 1.1 ECE445M starter code

Files | Functions
LD19

Asynchronous serial communication to LiDAR Sensor LD19 distance sensor. More...

## Files
file | LD19.h
| Initialize LD19, interrupt synchronization.

## Functions
void | LD19_Init (uint16_t *d)
| Initialize LD19. More...
uint8_t | LD19_InChar (void)
uint32_t | LD19_InStatus (void)

## Detailed Description

Asynchronous serial communication to LiDAR Sensor LD19 distance sensor.

LiDAR Sensor LD19 distance sensor interface
Pin | LD19 | MSPM0
--- | --- | ---
1 | Tx | PB13 RxD: is UART3 Rx (LD19 to MSPM0)
2 | PWM | PB12 GPIO write a 0 to run fastest (MSPM0 to LD19)
3 | GND | ground
4 | P5V | 5V

## Function Documentation

## ◆ LD19_InChar()

uint8_t LD19_InChar | ( | void |  | ) |

Wait for new serial port input
Uses interrupt synchronization
This function waits if the receive software FIFO is empty

Parameters

  Input | none

Returns
  8-bit code from TF Luna

## ◆ LD19_Init()

void LD19_Init | ( | uint16_t * | d | ) |

Initialize LD19.

initializeLiDAR Sensor LD19 distance sensor 230400 bps baud rate.
interrupt synchronization

Parameters

  d | 0 for debug, pointer to array of 540 elements for read time

Returns
  none

## ◆ LD19_InStatus()

uint32_t LD19_InStatus | ( | void |  | ) |

Returns how much data available for reading

Parameters

  none |

Returns
  number of elements in receive software FIFO