![]() |
AMS Advanced Air Mobility Sensors UG
|
Classes | |
| union | URXPacketMaxSize |
| union | UTXPacketMaxSize |
Public Types | |
| enum class | EDiagnosticModeStatus : int8_t { eDiagnosticModeStatusErrUART = -3 , eDiagnosticModeStatusErrInvalidSize = -2 , eDiagnosticModeStatusErrDataCorrupted = -1 , eDiagnosticModeStatusNormal = 0 , eDiagnosticModeStatusInDebug = 1 } |
Public Member Functions | |
| void | SetUARTHandle (UART_HandleTypeDef *opUartHandle, DMA_HandleTypeDef *opDMAHandle) |
| void | UARTRxInterruptHandler (uint16_t uSize) |
| void | DiagnosticModeProcess () |
| bool | isDiagnosticModeEnabled () |
Static Public Member Functions | |
| static CDiagnosticMode & | GetInstance () |
Private Member Functions | |
| CDiagnosticMode () | |
| CDiagnosticMode (const CDiagnosticMode &) | |
| CDiagnosticMode & | operator= (CDiagnosticMode &) |
| void | uartDataParser (uint16_t uSize) |
| bool | diagnosticSend () |
| void | fillSendBuffer (const void *pBuffer, uint16_t uSize) |
| bool | handlePacket (CSerialProtocol::EMessageIds ePacketType) |
Private Attributes | |
| uint8_t | auUartRxBuffer_ [skuRXBufferSize_] |
| uint8_t | auUartTxBuffer_ [skuTXBufferSize_] |
| uint16_t | uUartTxSendSize_ { 0u } |
| EDiagnosticModeStatus | eCurrState_ { EDiagnosticModeStatus::eDiagnosticModeStatusNormal } |
| UART_HandleTypeDef * | opUartHandle_ { nullptr } |
| DMA_HandleTypeDef * | opDmaHandle_ { nullptr } |
Static Private Attributes | |
| static constexpr uint64_t | skuUARTSendTimeoutUs_ { 1000000 } |
| static constexpr uint64_t | skuDiagnosticModeTimeoutUs_ { 5000000 } |
| static constexpr uint16_t | skuRXBufferSize_ { sizeof(URXPacketMaxSize) } |
| static constexpr uint16_t | skuTXBufferSize_ { sizeof(UTXPacketMaxSize) } |
|
strong |
|
inlineprivate |
|
private |
| void CDiagnosticMode::DiagnosticModeProcess | ( | ) |
Method: DiagnosticModeProcess() Stops the main program flow until the end of the diagnostic mode.
|
private |
Method: DiagnosticSend() Sends a message via UART using a pre-setted up handle.
|
private |
|
inlinestatic |
|
private |
Method: PacketAccepted() Sends a message confirming the successful packet processing by the device.
| bool CDiagnosticMode::isDiagnosticModeEnabled | ( | ) |
Method: IsDiagnosticModeEnabled() Returns true if device is working in Debug mode.
|
private |
| void CDiagnosticMode::SetUARTHandle | ( | UART_HandleTypeDef * | opUartHandle, |
| DMA_HandleTypeDef * | opDMAHandle ) |
Method: setUARTHandle() Sets the UART_HandleTypeDef handler to send messages via UART.
|
inlineprivate |
Method: UARTDataParser() Packet data parser. Changes the mode of operation in case of successful package parsing.
| void CDiagnosticMode::UARTRxInterruptHandler | ( | uint16_t | uSize | ) |
Method: UARTRxInterruptHandler() The handler of the received data in the UART RX interrupt.
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
private |