21 static void (*debug_out)(uint8_t byte);
23 static const struct error_desc{
32 {
E_GPIO_PORT,
"Error GPIO: Port doesn't exist\n\r" },
33 {
E_GPIO_PIN,
"Error GPIO: Pin doesnt' exist\n\r" },
34 {
E_GPIO_ISR,
"Error GPIO: ISR EXTI line in use\n\r" },
43 {
E_USART_NOINT,
"Error USART: Interrupt option doesn't exist\n\r" },
46 {
E_I2C_PORT,
"Error I2C: Port doesn't exist\n\r" },
47 {
E_I2C_WRITE,
"Error I2C: Write transmission timeout\n\r" },
48 {
E_I2C_READ,
"Error I2C: Read transmission timeout\n\r" },
49 {
E_I2C_START,
"Error I2C: Start transmission timeout\n\r" },
50 {
E_I2C_STOP,
"Error I2C: Stop transmission timeout\n\r" },
65 {
E_ADC_PORT,
"Error ADC: Port doesn't exist with ADC\n\r" },
66 {
E_ADC_PIN,
"Error ADC: No ADC on pin\n\r" },
72 {
E_FLASH_PAGE,
"Error FLASH: Page number out of bounds\n\r" },
78 {
E_SPI_PORT,
"Error SPI: Port doesn't exist \n\r" }
85 debug_out = output_handle;
96 if(debug_out == NULL){
107 if(debug_out == NULL){
116 for(index = 0; index < (
sizeof(errordesc) /
sizeof(errordesc[0])); index++){
118 if(errorNum == errordesc[index].code){
125 if(index == (
sizeof(errordesc) /
sizeof(errordesc[0]))){
131 while(errordesc[index].message[pos] !=
'\0'){
133 debug_out(errordesc[index].message[pos]);
Error timer: Pulse too long.
Header file for stm32f103cb DEBUG.
void MCU_debugEnable(void(*output_handle)(uint8_t))
Enables the debug feature.
Error timer: Timer doesn't exist.
Error clock: Clock speed doesn't exist.
ERROR GPIO: Port doesn't exist.
ERROR I2C: Port doesn't exist.
Error IWDG: Period too long.
void MCU_printError(mcu_error errorNum)
Print a given error number as a character stream.
uint8_t MCU_debugIsEnabled(void)
Checks if debug is enabled.
Error FLASH: Page number out of bounds.
Error RTC: Invalid period specified.
ERROR GPIO: Pin doesn't exist.
Error USART: Baud rate not available.
ERROR GPIO: ISR EXTI line in use.
ERROR I2C: Timeout during get()
Error SPI: Port doesn't exist.
ERROR I2C: Timeout during stop()
Error USART: Port doesn't exist.
Error ADC: Port doesn't exist with ADC.
ERROR I2C: Timeout during start()
ERROR I2C: Timeout during put()
Error USART: Parity option not available.
Error ADC: No ADC on pin.
ERROR MCU: Unknown error code.
ERROR GPIO: ISR trigger doesn't exist.
Error USART: Interrupt option doesn't exist.
Error timer: Period too long / frequency too high.
Error systick: Timeout value is too short.
void MCU_debugDisable(void)
Disables the debug feature.
Error USART: Stop bits don't exist.
Error timer: Channel doesn't exist.
Error USART: Data frame not available.
mcu_error
Error enumerators for the Debug peripheral.