shared_fooの不要ディレクトリ削除前のもの
Révision | 1e09fc84d5975771c5fbb2be289ab3699f68fba7 (tree) |
---|---|
l'heure | 2018-03-21 15:12:03 |
Auteur | takemasa <suikan@user...> |
Commiter | takemasa |
Refactored the consntat name to distinguish the type cleary.
@@ -12,8 +12,8 @@ | ||
12 | 12 | <targetDefinitions> |
13 | 13 | <board id="nucleo-f746zg"> |
14 | 14 | <name>NUCLEO-F746ZG</name> |
15 | - <dbgIF>SWD</dbgIF> | |
16 | 15 | <dbgIF>JTAG</dbgIF> |
16 | + <dbgIF>SWD</dbgIF> | |
17 | 17 | <dbgDEV>ST-Link</dbgDEV> |
18 | 18 | <mcuId>stm32f746zgtx</mcuId> |
19 | 19 | </board> |
@@ -44,20 +44,20 @@ void InitTestUart(UART_HandleTypeDef * uart_handle, SPI_HandleTypeDef * spi_hand | ||
44 | 44 | murasaki::platform.logger = new murasaki::UartLogger(murasaki::platform.uart_console); |
45 | 45 | |
46 | 46 | // Setting SPI slave devices. |
47 | - murasaki::platform.slave_1 = new murasaki::SpiSlaveSpecifier(murasaki::kscpFallThenRise, | |
48 | - murasaki::kscpLatchThenShift, | |
47 | + murasaki::platform.slave_1 = new murasaki::SpiSlaveSpecifier(murasaki::kspoFallThenRise, | |
48 | + murasaki::ksphLatchThenShift, | |
49 | 49 | SPI_CS1_GPIO_Port, |
50 | 50 | SPI_CS1_Pin); |
51 | - murasaki::platform.slave_1 = new murasaki::SpiSlaveSpecifier(murasaki::kscpFallThenRise, | |
52 | - murasaki::kscpShiftThenLatch, | |
51 | + murasaki::platform.slave_1 = new murasaki::SpiSlaveSpecifier(murasaki::kspoFallThenRise, | |
52 | + murasaki::ksphShiftThenLatch, | |
53 | 53 | SPI_CS2_GPIO_Port, |
54 | 54 | SPI_CS2_Pin); |
55 | - murasaki::platform.slave_1 = new murasaki::SpiSlaveSpecifier(murasaki::kscpRiseThenFall, | |
56 | - murasaki::kscpLatchThenShift, | |
55 | + murasaki::platform.slave_1 = new murasaki::SpiSlaveSpecifier(murasaki::kspoRiseThenFall, | |
56 | + murasaki::ksphLatchThenShift, | |
57 | 57 | SPI_CS3_GPIO_Port, |
58 | 58 | SPI_CS3_Pin); |
59 | - murasaki::platform.slave_1 = new murasaki::SpiSlaveSpecifier(murasaki::kscpRiseThenFall, | |
60 | - murasaki::kscpShiftThenLatch, | |
59 | + murasaki::platform.slave_1 = new murasaki::SpiSlaveSpecifier(murasaki::kspoRiseThenFall, | |
60 | + murasaki::ksphShiftThenLatch, | |
61 | 61 | SPI_CS4_GPIO_Port, |
62 | 62 | SPI_CS4_Pin); |
63 | 63 | // Setting SPI master |
@@ -66,8 +66,8 @@ enum UartHardwareFlowControl | ||
66 | 66 | */ |
67 | 67 | enum SpiClockPolarity |
68 | 68 | { |
69 | - kscpRiseThenFall = 0, //!< kscpRiseThenFall POL = 0 | |
70 | - kscpFallThenRise //!< kscpFallThenrise POL = 1 | |
69 | + kspoRiseThenFall = 0, //!< kscpRiseThenFall POL = 0 | |
70 | + kspoFallThenRise //!< kscpFallThenrise POL = 1 | |
71 | 71 | }; |
72 | 72 | |
73 | 73 | /** |
@@ -78,8 +78,8 @@ enum SpiClockPolarity | ||
78 | 78 | */ |
79 | 79 | enum SpiClockPhase |
80 | 80 | { |
81 | - kscpLatchThenShift = 0, //!< kscpLatchThenShift | |
82 | - kscpShiftThenLatch //!< kscpShiftThenLatch | |
81 | + ksphLatchThenShift = 0, //!< kscpLatchThenShift PHA=0. The first edge is latching. The second edge is shifting. | |
82 | + ksphShiftThenLatch //!< kscpShiftThenLatch PHA = 1. The first edge is shifting. The second edge is latching. | |
83 | 83 | }; |
84 | 84 | |
85 | 85 | /** |
@@ -61,9 +61,9 @@ bool SpiMaster::TransmitAndReceive(murasaki::AbstractSpiSlaveSpecifier* spi_spec | ||
61 | 61 | |
62 | 62 | // Set clock POL of the SPI format. |
63 | 63 | peripheral_->Init.CLKPolarity = |
64 | - (spi_spec->GetCpol() == kscpRiseThenFall) ? SPI_POLARITY_LOW : SPI_POLARITY_HIGH; | |
64 | + (spi_spec->GetCpol() == kspoRiseThenFall) ? SPI_POLARITY_LOW : SPI_POLARITY_HIGH; | |
65 | 65 | // Set clock PHA of the SPI format. |
66 | - peripheral_->Init.CLKPhase = (spi_spec->GetCpha() == kscpLatchThenShift) ? SPI_PHASE_1EDGE : SPI_PHASE_2EDGE; | |
66 | + peripheral_->Init.CLKPhase = (spi_spec->GetCpha() == ksphLatchThenShift) ? SPI_PHASE_1EDGE : SPI_PHASE_2EDGE; | |
67 | 67 | |
68 | 68 | MURASAKI_ASSERT(HAL_SPI_Init(peripheral_) == HAL_OK); |
69 | 69 |