/*!
 * @file        readme.txt
 *
 * @brief       This file is routine instruction
 *
 * @version     V1.0.0
 *
 * @date        2026-11-13
 *
 * @attention
 *
 *  Copyright (C) 2020-2026 Geehy Semiconductor
 *
 *  You may not use this file except in compliance with the
 *  GEEHY COPYRIGHT NOTICE (GEEHY SOFTWARE PACKAGE LICENSE).
 *
 *  The program is only for reference, which is distributed in the hope
 *  that it will be useful and instructional for customers to develop
 *  their software. Unless required by applicable law or agreed to in
 *  writing, the program is distributed on an "AS IS" BASIS, WITHOUT
 *  ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the GEEHY SOFTWARE PACKAGE LICENSE for the governing permissions
 *  and limitations under the License.
 */


&par Example Description

This example configures CAN1 in normal mode and exchanges one extended frame
between two APM32F107 MINI boards.

Select the board role in Include/main.h:
  - First board: leave IS_FIRST_BOARD defined. It sends ExtID 0x333333 with
    payload 0x01, 0x02, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, then waits.
  - Second board: comment out IS_FIRST_BOARD. It waits for the first frame,
    then replies with ExtID 0x444444 and payload 0x11, 0x12, 0x12, 0x13,
    0x14, 0x15, 0x16, 0x17.

Received bytes are printed on USART1. LED2 toggles every 500 ms.
Start the second board first, then start the first board.

CAN1 is remapped to PB9 (TX) and PB8 (RX). The default CAN1 pins PA12/PA11
are the USB pins on APM32F105/107.

&par Hardware Description

Connect two CAN transceivers and the bus as follows. Connect GND together
and fit a 120 ohm termination resistor at each end of the bus.

   CAN1 TX   PB9
   CAN1 RX   PB8
   CANH of board 1  --  CANH of board 2
   CANL of board 1  --  CANL of board 2

CAN1 is configured as follows on both boards:
  - Mode: Normal
  - Baud rate = 125 kbps
    (PCLK1 = 36 MHz, Prescaler = 18, TimeSeg1 = 11, TimeSeg2 = 4)
  - Sample point = 75%
  - Filter bank 0 accepts all frames into FIFO0
  - Automatic retransmission is enabled

USART1 is used for the result log:
  - TX = PA9, baud rate 115200, 8 data bits, 1 stop bit, no parity

&par Directory contents

  - CAN/CAN_Normal/Source/main.c              Main program
  - CAN/CAN_Normal/Source/apm32f10x_int.c     Core exception handlers
  - CAN/CAN_Normal/Include/main.h             Application definitions

&par IDE environment

  - MDK-ARM V5.36
  - EWARM V8.50.5.26295
  - Eclipse GNU Arm Embedded, configurations APM32F105 and APM32F107

&par Hardware and Software environment

  - This example runs on APM32F107 MINI devices.
