UART_HAL

void Uart_Init(UartConfig_t const * const Config); void Uart_BaudRateSet(UartChannel_t const Channel, UartConfig_t const * const Config); uint8_t Uart_CharGet(UartChannel_t const Channel); void Uart_CharPut(UartChannel_t const Channel, char const Ch); uint8_t Uart_IsDataPresent(UartChannel_t const Channel); void Uart_RegisterWrite(uint32_t const Address, uint32_t...

Read More >>>

StackGuard_Figure2

void main(void) { uint32_t * GuardPtr = (uint32_t*) GUARD_START; for(int Index=0; Index < GUARD_SIZE; Index++) { if(*GuardPtr == 0xC0DE) { // Do Nothing or signal OK } else { // Flag error! Attempt recovery ......

Read More >>>

assert_Figure3

/* Precondition: State should be less than maximum * Postcondition: SystemState */ SystemState_t System_StateSet(SystemState_t State) { assert(State < SYSTEM_STATE_MAX); SystemState = State; assert(SystemState < SYSTEM_STATE_MAX); return SystemState; }

Read More >>>

ITM_SendData

__STATIC_INLINE uint32_t ITM_SendData (uint8_t Channel, uint32_t Data, uint8_t DataSizeInBytes) { assert(Channel < 32); assert(DataSizeInBytes <= 4); /* 1, 2, 4 are valid */ assert((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL); /* ITM enabled */ assert((ITM->TER & (1UL...

Read More >>>