% # @file custom_code.goilTemplate # # @section desc File description # # Root template file for teensy # # @section copyright Copyright # # Trampoline OS # # Trampoline is copyright (c) IRCCyN # Trampoline is protected by the French intellectual property law. # # This software is distributed under the Lesser GNU Public Licence # # @section infos File informations # # $Date$ # $Rev$ # $Author$ # $URL$ # # before generating IRQ related code, the PINx interrupt sources are # converted into a PORTy_IRQ interrupt source # # Mapping of the Teensy is as follow # # +--------------+------+------------+--------------+------+------------+ # | Teensy Pin # | PORT | Port Pin # | Teensy Pin # | PORT | Port Pin # | # +--------------+------+------------+--------------+------+------------+ # | 0 | B | 16 | 17 | B | 1 | # +--------------+------+------------+--------------+------+------------+ # | 1 | B | 17 | 18 | B | 3 | # +--------------+------+------------+--------------+------+------------+ # | 2 | D | 0 | 19 | B | 2 | # +--------------+------+------------+--------------+------+------------+ # | 3 | A | 12 | 20 | D | 5 | # +--------------+------+------------+--------------+------+------------+ # | 4 | A | 13 | 21 | D | 6 | # +--------------+------+------------+--------------+------+------------+ # | 5 | D | 7 | 22 | C | 1 | # +--------------+------+------------+--------------+------+------------+ # | 6 | D | 4 | 23 | C | 2 | # +--------------+------+------------+--------------+------+------------+ # | 7 | D | 2 | 24 | A | 5 | # +--------------+------+------------+--------------+------+------------+ # | 8 | D | 3 | 25 | B | 19 | # +--------------+------+------------+--------------+------+------------+ # | 9 | C | 3 | 26 | E | 1 | # +--------------+------+------------+--------------+------+------------+ # | 10 | C | 4 | 27 | C | 9 | # +--------------+------+------------+--------------+------+------------+ # | 11 | C | 6 | 28 | C | 8 | # +--------------+------+------------+--------------+------+------------+ # | 12 | C | 7 | 29 | C | 10 | # +--------------+------+------------+--------------+------+------------+ # | 13 | C | 5 | 30 | C | 11 | # +--------------+------+------------+--------------+------+------------+ # | 14 | D | 1 | 31 | E | 0 | # +--------------+------+------------+--------------+------+------------+ # | 15 | C | 0 | 32 | B | 18 | # +--------------+------+------------+--------------+------+------------+ # | 16 | B | 0 | 33 | A | 4 | # +--------------+------+------------+--------------+------+------------+ let infoTeensyPin := @( @{ PORT: "B", PIN: 16 }, # 0 @{ PORT: "B", PIN: 17 }, # 1 @{ PORT: "D", PIN: 0 }, # 2 @{ PORT: "A", PIN: 12 }, # 3 @{ PORT: "A", PIN: 13 }, # 4 @{ PORT: "D", PIN: 7 }, # 5 @{ PORT: "D", PIN: 4 }, # 6 @{ PORT: "D", PIN: 2 }, # 7 @{ PORT: "D", PIN: 3 }, # 8 @{ PORT: "C", PIN: 3 }, # 9 @{ PORT: "C", PIN: 4 }, # 10 @{ PORT: "C", PIN: 6 }, # 11 @{ PORT: "C", PIN: 7 }, # 12 @{ PORT: "C", PIN: 5 }, # 13 @{ PORT: "D", PIN: 1 }, # 14 @{ PORT: "C", PIN: 0 }, # 15 @{ PORT: "B", PIN: 0 }, # 16 @{ PORT: "B", PIN: 1 }, # 17 @{ PORT: "B", PIN: 3 }, # 18 @{ PORT: "B", PIN: 2 }, # 19 @{ PORT: "D", PIN: 5 }, # 20 @{ PORT: "D", PIN: 6 }, # 21 @{ PORT: "C", PIN: 1 }, # 22 @{ PORT: "C", PIN: 2 }, # 23 @{ PORT: "A", PIN: 5 }, # 24 @{ PORT: "B", PIN: 19 }, # 25 @{ PORT: "E", PIN: 1 }, # 26 @{ PORT: "C", PIN: 9 }, # 27 @{ PORT: "C", PIN: 8 }, # 28 @{ PORT: "C", PIN: 10 }, # 29 @{ PORT: "C", PIN: 11 }, # 30 @{ PORT: "E", PIN: 0 }, # 31 @{ PORT: "B", PIN: 18 }, # 32 @{ PORT: "A", PIN: 4 } # 33 ) write to PROJECT."/tpl_vectors.c": let EXTENSIONINTERRUPTVECTORS := "c" template tpl_interrupt_vectors in code end write write to PROJECT."/tpl_primary_irq.S": let EXTENSIONSECONDSTAGE := "S" template tpl_primary_irq in code end write write to PROJECT."/cmsis_wrapper.h": let EXTENSIONSECONDSTAGE := "h" template tpl_wrapper in code end write write to PROJECT."/tpl_external_interrupts.c": let EXTENSIONSECONDSTAGE := "c" template if exists tpl_external_interrupts_c in code end write