1#include "device_info.hcs" 2root { 3 platform { 4 gpio_config { 5 match_attr = "gpio_config"; // 0-3 gpio test, 4-6 pwm test , 7-10 spi flash 11-12 uart4 13-15 uart5 16-17 uart1 debug com 18-19 i2c test 6 pin = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]; // pin index when register to hdf framework 7 realPin = [5, 6, 0, 1, 3, 6, 5, 5, 5, 4, 15, 10, 11, 12, 2, 12, 6, 7, 7, 8]; // pin number in stm32 led2 pe5, led3 pe6, 8 group = [4, 4, 4, 4, 0, 0, 8, 0, 1, 1, 0, 2, 2, 2, 3, 6, 1, 1, 7, 7]; // group of gpio 0:GPIOA 1:GPIOB 2:GPIOC 3:GPIOD 4:GPIOE 5: GPIOF 6:GPIOG 7:GPIOH 8:GPIOI 9 mode = [1, 1, 0, 0, 2, 2, 2, 2, 2, 2 ,1, 2, 2, 2, 2, 1, 2, 2, 2, 2]; // 0: input 1: output 2:alternate 3:analog 10 speed = [0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]; // 0: low 1: middle 2:high 3:very_high 11 pull = [0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 1, 1, 1, 1, 2, 1, 1, 0, 0]; // 0: nopull 1:up 2:down 12 pinNum = 20; 13 output = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1]; // 0:pushpull 1:opendrain 14 alternate = [0, 0, 0, 0, 1, 2, 3, 5, 5, 5, 0, 8, 8, 8, 8, 0, 7, 7, 4, 4]; 15 } 16 17 pwm_config { 18 pwm1_config { 19 match_attr = "config_pwm1"; // default use pwm1 20 pwmTim = 1; // timID tim2 0 :tim1, 1:tim2 ..... tim6 and tim7can't not use for pwm 21 pwmCh = 3; // tim chanel 4 0:ch1 1:ch2 2:ch3 3:ch4 22 prescaler = 4199; // prescaler for example tim2 clock is 84M, (84M/(4199+1)) = 20khz, 23 // set 20khz to caculate stanard ,tim2-tim7, tim12-tim14is 84M TIM8~TIM11 is 168M 24 // tim1~tim5 tim8 have 4 channel tim9,tim12 only have ch1, ch2, tim10, tim11,tim13,tim14 only ch1 25 } 26 pwm2_config { 27 match_attr = "config_pwm2"; 28 pwmTim = 2; 29 pwmCh = 0; 30 prescaler = 8399; 31 } 32 pwm3_config { 33 match_attr = "config_pwm7"; 34 pwmTim = 7; 35 pwmCh = 0; 36 prescaler = 8399; 37 } 38 } 39 spi_config { 40 spi_config1 { 41 match_attr = "spi_w25q_config"; 42 busNum = 0; 43 csNum = 0; 44 transDir = 0; // 0: TW_HAL_SPI_FULL_DUPLEX 1: TW_HAL_SPI_SIMPLEX_RX 2: TW_HAL_SPI_HALF_DUPLEX_RX 3: TW_HAL_SPI_HALF_DUPLEX_TX 45 transMode = 1; // 1: normal 0:dma 46 smMode = 1; // 0: slave 1: master 47 dataWidth = 0; // 0:8bit 1:16bit 48 clkMode = 0; // 0: cpol 0 cpha 0 1:CPOL = 1; CPHA = 0 2:CPOL = 0; CPHA = 1 3:CPOL = 1; CPHA = 1 49 nss = 0; // 0:NSS SOFT 1: NSS HARDWARE INPUT 2: NSS HARDWARE OUTPUT 50 baudRate = 1; // 0:div2 1:div4 2:div8 3:div16 4:div32 5:div64 6:div128 6:div256 51 bitOrder = 0; // 0: MSB first 1: LSB first 52 crcEnable = 0; // 0: crc disable 1: crc enable 53 crcPoly = 10; // Min_Data = 0x00 and Max_Data = 0xFFFF 54 spix = 0; // 0: spi1 1: spi2 2:spi3 55 csPin = 15; 56 csGpiox = 0; 57 standard = 0; // 0:motorola 1: ti 58 dummyByte = 255; 59 } 60 } 61 uart_config { 62 uart1_config { 63 match_attr = "uart_config1"; 64 num = 1; // 1 :usart1 2: USART2 3:USART3 4:UART4 5:UART5 6:USART6 65 baudRate = 115200; // baudrate 66 dataWidth = 0; // 0:8bit 1:9bit 67 stopBit = 1; // 0:0.5stop bits 1:1 stop bit 2:1.5 stop bits 2:2 stop bits 68 parity = 0; // 0: none 1: event 2:odd 69 transDir = 3; // 0: dir none 1: rx 2: tx 3:tx and rx 70 flowCtrl = 0; // 0: no flowcontrl 1: flowContorl RTS 2: flowControl CTS 3: flowControl RTS AND CTS 71 overSimpling = 0; // 0: overSimpling 16bits 1: overSimpling 8bits 72 transMode = 0; // 0:block 1:noblock 2:TX DMA RX NORMAL 3:TX NORMAL RX DMA 4: USART_TRANS_TX_RX_DMA 73 uartType = 0; // 0 : 232 1: 485 74 uartDePin = 0; // usart 485 pin 75 uartDeGroup = 0; // usart 485 control line 76 } 77 uart4_config { 78 match_attr = "uart_config4"; 79 num = 4; // 1 :uart1 2: USART2 3:USART3 4:UART4 5:UART5 6:USART6 80 baudRate = 115200; // baudrate 81 dataWidth = 0; // 0:8bit 1:9bit 82 stopBit = 1; // 0:0.5stop bits 1:1 stop bit 2:1.5 stop bits 2:2 stop bits 83 parity = 0; // 0: none 1: event 2:odd 84 transDir = 3; // 0: dir none 1: rx 2: tx 3:tx and rx 85 flowCtrl = 0; // 0: no flowcontrl 1: flowContorl RTS 2: flowControl CTS 3: flowControl RTS AND CTS 86 overSimpling = 0; // 0: overSimpling 16bits 1: overSimpling 8bits 87 transMode = 0; // 0:block 1:noblock 2:TX DMA RX NORMAL 3:TX NORMAL RX DMA 4: USART_TRANS_TX_RX_DMA 88 uartType = 0; // 0 : 232 1: 485 89 uartDePin = 0; // usart 485 pin 90 uartDeGroup = 0; // usart 485 control line 91 } 92 uart5_config { 93 match_attr = "uart_config5"; 94 num = 5; // 1 :uart1 2: USART2 3:USART3 4:UART4 5:UART5 6:USART6 95 baudRate = 115200; // baudrate 96 dataWidth = 0; // 0:8bit 1:9bit 97 stopBit = 1; // 0:0.5stop bits 1:1 stop bit 2:1.5 stop bits 2:2 stop bits 98 parity = 0; // 0: none 1: event 2:odd 99 transDir = 3; // 0: dir none 1: rx 2: tx 3:tx and rx 100 flowCtrl = 0; // 0: no flowcontrl 1: flowContorl RTS 2: flowControl CTS 3: flowControl RTS AND CTS 101 overSimpling = 0; // 0: overSimpling 16bits 1: overSimpling 8bits 102 transMode = 0; // 0:block 1:noblock 2:TX DMA RX NORMAL 3:TX NORMAL RX DMA 4: USART_TRANS_TX_RX_DMA 103 uartType = 1; // 0 : 232 1: 485 104 uartDePin = 12; // usart 485 pin 105 uartDeGroup = 6; // usart 485 control line 106 } 107 } 108 i2c_config { 109 i2c3_config { 110 match_attr = "i2c3_config"; 111 port = 3; 112 devMode = 0; //0 = master, 1= slave 113 devAddr = 0; 114 speed = 100000; 115 } 116 } 117 watchdog_config { 118 template watchdog_controller { 119 id = 0; 120 regBase = 0x12050000; 121 regStep = 0x1000; 122 timeout = 1000; // watchdog interval(ms) 123 match_attr = ""; 124 } 125 st_watchdog :: watchdog_controller { 126 match_attr = "st_watchdog"; 127 timeout = 500; 128 } 129 } 130 } 131 misc { 132 fs_config { 133 littlefs_config { 134 match_attr = "littlefs_config"; 135 mount_points = ["/talkweb"]; 136 partitions = [0x800000]; 137 block_size = [4096]; 138 block_count = [256]; 139 } 140 } 141 } 142} 143