diff options
| author | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-05-15 08:34:54 +0000 | 
|---|---|---|
| committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-05-15 08:34:54 +0000 | 
| commit | 0cdde1845d6775cde50668ded358f346930eab37 (patch) | |
| tree | 415f121509c940b78d05697b7f0539c627281baa /testhal | |
| parent | 998ff59d1c189fb52c01d9c15a79e1026a906f96 (diff) | |
| download | ChibiOS-0cdde1845d6775cde50668ded358f346930eab37.tar.gz ChibiOS-0cdde1845d6775cde50668ded358f346930eab37.tar.bz2 ChibiOS-0cdde1845d6775cde50668ded358f346930eab37.zip | |
QSPI driver worked on a simple test case.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9484 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal')
| -rw-r--r-- | testhal/STM32/STM32L4xx/DSPI-N25Q128/main.c | 23 | 
1 files changed, 23 insertions, 0 deletions
| diff --git a/testhal/STM32/STM32L4xx/DSPI-N25Q128/main.c b/testhal/STM32/STM32L4xx/DSPI-N25Q128/main.c index 42a3984a4..942629734 100644 --- a/testhal/STM32/STM32L4xx/DSPI-N25Q128/main.c +++ b/testhal/STM32/STM32L4xx/DSPI-N25Q128/main.c @@ -17,6 +17,23 @@  #include "ch.h"
  #include "hal.h"
 +QSPIConfig qspicfg1 = {
 +  NULL,
 +  0
 +};
 +
 +qspi_command_t cmd_read_id = {
 +  QSPI_CFG_CMD(0x9E) | QSPI_CFG_CMD_MODE_ONE_LINE |
 +  QSPI_CFG_ADDR_MODE_NONE |
 +  QSPI_CFG_ALT_MODE_NONE |
 +  QSPI_CFG_DUMMY_CYCLES(0) |
 +  QSPI_CFG_DATA_MODE_ONE_LINE,
 +  0,
 +  0
 +};
 +
 +uint8_t buffer[512];
 +
  /*
   * LED blinker thread, times are in milliseconds.
   */
 @@ -59,6 +76,12 @@ int main(void) {    chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO + 1, Thread1, NULL);
    /*
 +   * Starting QSPI driver 1.
 +   */
 +  qspiStart(&QSPID1, &qspicfg1);
 +  qspiReceive(&QSPID1, &cmd_read_id, 17, buffer);
 +
 +  /*
     * Normal main() thread activity, in this demo it does nothing.
     */
    while (true) {
 | 
