Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- uses: Open-CMSIS-Pack/gen-pack-action@main
with:
doxygen-version: 1.9.6
doxygen-version: 1.13.2
packchk-version: 1.4.1
gen-doc-script: ./Documentation/Doxygen/gen_doc.sh
doc-path: ./Documentation/html
Expand Down
10 changes: 5 additions & 5 deletions ARM.CMSIS-Driver.pdsc
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
#define RTE_Drivers_PHY_DP83848C /* Driver PHY DP83848C */
</RTE_Components_h>
<files>
<file category="doc" name="http://www.ti.com/product/DP83848C"/>
<file category="doc" name="https://www.ti.com/product/DP83848C"/>
<file category="source" name="Ethernet_PHY/DP83848C/PHY_DP83848C.c"/>
</files>
</component>
Expand Down Expand Up @@ -226,7 +226,7 @@
#define RTE_Drivers_PHY_ST802RT1 /* Driver PHY ST802RT1 */
</RTE_Components_h>
<files>
<file category="doc" name="http://www.st.com/content/ccc/resource/technical/document/data_brief/37/8e/14/c7/84/39/4d/61/CD00263138.pdf/files/CD00263138.pdf/jcr:content/translations/en.CD00263138.pdf"/>
<file category="doc" name="https://www.st.com/content/ccc/resource/technical/document/data_brief/37/8e/14/c7/84/39/4d/61/CD00263138.pdf/files/CD00263138.pdf/jcr:content/translations/en.CD00263138.pdf"/>
<file category="source" name="Ethernet_PHY/ST802RT1/PHY_ST802RT1.c"/>
</files>
</component>
Expand Down Expand Up @@ -311,7 +311,7 @@
#define RTE_Drivers_Flash_S29GL064Nx2 /* Driver Flash S29GL064Nx2 */
</RTE_Components_h>
<files>
<file category="doc" name="http://www.cypress.com/documentation/datasheets/s29gl064n-s29gl032n-64-mbit-32-mbit-3-v-page-mode-mirrorbit-flash"/>
<file category="doc" name="https://www.cypress.com/documentation/datasheets/s29gl064n-s29gl032n-64-mbit-32-mbit-3-v-page-mode-mirrorbit-flash"/>
<file category="source" name="Flash/S29GL064Nx2/S29GL064Nx2.c"/>
</files>
</component>
Expand All @@ -337,7 +337,7 @@
#define RTE_Drivers_I2C_MultiSlave /* Driver I2C Multi-Slave */
</RTE_Components_h>
<files>
<file category="doc" name="Documentation/html/driver_I2C.html"/>
<file category="doc" name="Documentation/html/page_driver_i2c.html"/>
<file category="header" name="Config/I2C_MultiSlave_Config.h" attr="config" version="1.0.0"/>
<file category="source" name="I2C/I2C_MultiSlave.c"/>
</files>
Expand All @@ -351,7 +351,7 @@
#define RTE_Drivers_SPI_MultiSlave /* Driver SPI Multi-Slave */
</RTE_Components_h>
<files>
<file category="doc" name="Documentation/html/driver_SPI.html"/>
<file category="doc" name="Documentation/html/page_driver_spi.html"/>
<file category="header" name="Config/SPI_MultiSlave_Config.h" attr="config" version="1.0.0"/>
<file category="header" name="SPI/SPI_MultiSlave.h"/>
<file category="source" name="SPI/SPI_MultiSlave.c"/>
Expand Down
1,072 changes: 685 additions & 387 deletions Documentation/Doxygen/driver.dxy.in

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Documentation/Doxygen/gen_doc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ set -o pipefail
# Set version of gen pack library
# For available versions see https://github.com/Open-CMSIS-Pack/gen-pack/tags.
# Use the tag name without the prefix "v", e.g., 0.7.0
REQUIRED_GEN_PACK_LIB="0.11.1"
REQUIRED_GEN_PACK_LIB="0.11.2"

DIRNAME=$(dirname "$(readlink -f "$0")")
GENDIR=../html
REQ_DXY_VERSION="1.9.6"
REQ_DXY_VERSION="1.13.2"

RUN_LINKCHECKER=1

Expand Down
49 changes: 49 additions & 0 deletions Documentation/Doxygen/src/ethernet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Ethernet {#page_driver_eth}

## Driver Implementations

The \ref pack_content provides implementations of **[CMSIS-Ethernet drivers](https://arm-software.github.io/CMSIS_6/latest/Driver/group__eth__interface__gr.html)** for the following devices:

| Driver | Description |
|----------------|-----------------------------------------------------------------------------------------------------|
| **KSZ8851SNL** | Ethernet PHY and MAC interfaces for the Microchip **[KSZ8851](https://www.microchip.com/KSZ8851)**. |
| **LAN9220** | Ethernet PHY and MAC interfaces for the Microchip **[LAN9220](https://www.microchip.com/LAN9220)**. |
| **DP83848C** | Ethernet PHY interface for the Texas Instruments **[DP83848C](http://www.ti.com/product/DP83848C)**.|
| **KSZ8061RNB** | Ethernet PHY interface for the Microchip **[KSZ8061](https://www.microchip.com/KSZ8061)**. |
| **KSZ8081RNA** | Ethernet PHY interface for the Microchip **[KSZ8081](https://www.microchip.com/KSZ8081)**. |
| **LAN8710A** | Ethernet PHY interface for the Microchip **[LAN8710A](https://www.microchip.com/LAN8710A)**. |
| **LAN8720** | Ethernet PHY interface for the Microchip **[LAN8720A](https://www.microchip.com/LAN8720A)**. |
| **LAN8740A** | Ethernet PHY interface for the Microchip **[LAN8740A](https://www.microchip.com/LAN8740A)**. |
| **LAN8742A** | Ethernet PHY interface for the Microchip **[LAN8742A](https://www.microchip.com/LAN8742A)**. |
| **ST802RT1** | Ethernet PHY interface for the STMicroelectronics **[ST802RT1](http://www.st.com/content/ccc/resource/technical/document/data_brief/37/8e/14/c7/84/39/4d/61/CD00263138.pdf/files/CD00263138.pdf/jcr:content/translations/en.CD00263138.pdf)**. |

## Multiple Driver Instances

CMSIS-Driver API supports multiple driver instances. The Ethernet drivers are implemented within a single C module and several driver instances of the same type can be used in a project as follows:

1. Add the first driver instance to the project. In IDEs with CMSIS-pack management support this can be done from the Run-Time Environment (RTE).
2. Create a copy of the driver's .c file with a different file name and add it to the project. This will be the second driver instance. For example, copy `ETH_LAN9220.c` file as `ETH2_LAN9220.c`.
3. Copy the driver's .h file to the project or add the driver's folder to the compiler include search path.
4. Specify the driver parameters for the second instance. For example, in `ETH2_LAN9220.c` new values to the following parameters are needed instead of default ones:
```c
#define ETH_MAC_NUM 1
#define ETH_PHY_NUM 1
#define LAN9220_BASE (0x53000000UL)
```
5. Now both Ethernet instances can be accessed from the application. For example:
```c
#include "Driver_ETH_MAC.h"
#include "Driver_ETH_PHY.h"

extern ARM_DRIVER_ETH_MAC Driver_ETH_MAC0;
extern ARM_DRIVER_ETH_MAC Driver_ETH_MAC1;

extern ARM_DRIVER_ETH_PHY Driver_ETH_PHY0;
extern ARM_DRIVER_ETH_PHY Driver_ETH_PHY1;

#define eth0 (&Driver_ETH_MAC0)
#define eth1 (&Driver_ETH_MAC1)

#define phy0 (&Driver_ETH_PHY0)
#define phy1 (&Driver_ETH_PHY1)
```
39 changes: 39 additions & 0 deletions Documentation/Doxygen/src/flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Flash {#page_driver_flash}

## Driver Implementations

The \ref pack_content contains implementations of **[CMSIS-Flash drivers](https://arm-software.github.io/CMSIS_6/latest/Driver/group__flash__interface__gr.html)** for the following devices:

| Driver | Description |
|----------------|-----------------------------------------------------------------------------|
| **AM29x800BB** | Flash interface for Parallel NOR Flash **AM29x800BB**. This product is discontinued. |
| **AT45DB641E** | Flash interface for SPI Serial DataFlash **[AT45DB641E](https://www.renesas.com/br/en/document/dst/at45db641e-datasheet)**. |
| **AT45DB642D** | Flash interface for SPI Serial DataFlash **AT45DB642D**. |
| **M29EW28F128**| Flash interface for Parallel NOR Flash **M29EW28F128**. |
| **M29W640FB** | Flash interface for Parallel NOR Flash **M29W640FB**. |
| **N25Q032A** | Flash interface for Serial NOR Flash **N25Q032A**. |
| **S29GL064Nx2**| Flash interface for Parallel NOR Flash **[S29GL064N](http://www.cypress.com/documentation/datasheets/s29gl064n-s29gl032n-64-mbit-32-mbit-3-v-page-mode-mirrorbit-flash)**. |

## Multiple Driver Instances

CMSIS-Driver API supports multiple driver instances. The Flash drivers are implemented within a single C module and several driver instances of the same type can be used in a project as follows:

1. Add the first driver instance to the project. In IDEs with CMSIS-pack management support this can be done from the Run-Time Environment (RTE).
2. Create a copy of the driver's .c file with a different file name and add it to the project. This will be the second driver instance. For example, copy `AT45DB641E.c` file as `AT45DB641E_2.c`.
3. Copy the driver's .h file to the project or add the driver's folder to the compiler include search path.
4. Specify the driver parameters for the second instance based on the hardware design. For example, in `AT45DB641E_2.c` the values for the flash driver number and SPI driver number need to be configured as shown below:
```c
#define DRIVER_FLASH_NUM 1
#define DRIVER_SPI_NUM 1
```
5. Now both Flash instances can be accessed from the application. For example:
```c
#include "Driver_Flash.h"

/* Flash driver instances */
extern ARM_DRIVER_FLASH Driver_Flash0;
extern ARM_DRIVER_FLASH Driver_Flash1;

#define flash0 (&Driver_Flash0)
#define flash1 (&Driver_Flash1)
```
5 changes: 5 additions & 0 deletions Documentation/Doxygen/src/history.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Revision History {#rev_hist}

CMSIS-Driver version is officially updated upon releases of the [CMSIS-Driver pack](https://www.keil.arm.com/packs/cmsis-driver-arm/versions/).

The table below provides information about the changes delivered with specific versions of CMSIS-Driver.
129 changes: 129 additions & 0 deletions Documentation/Doxygen/src/i2c.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# I2C {#page_driver_i2c}

The I2C MultiSlave wrapper [I2C_MultiSlave.c](https://github.com/ARM-software/CMSIS-Driver/blob/main/I2C/I2C_MultiSlave.c) resides on top of an arbitrary I2C CMSIS-Driver and exports maximum of eight I2C CMSIS-Drivers (with I2C Master functionality only). Slave functionalities are disabled and calling slave functions will return with an error. An I2C slave device connects to one of the exported driver and uses it as any other CMSIS I2C driver (in master mode only). The wrapper provides multi-thread protection.

Each slave can use its own bus speed configuration, but the MultiSlave wrapper will limit the bus speed to the lowest requested frequency (assuming that three slaves are present and if two slaves configure bus speed `ARM_I2C_BUS_SPEED_FAST` (400 KHz) and one slave `ARM_I2C_BUS_SPEED_STANDARD` (100 kHz), then the actual bus speed will be `ARM_I2C_BUS_SPEED_STANDARD`).

The wrapper is configured using the [I2C_MultiSlave_Config.h](https://github.com/ARM-software/CMSIS-Driver/blob/main/Config/I2C_MultiSlave_Config.h) file, which contains the following options:

- `#define I2C_DRIVER` specifies the underlying I2C CMSIS-Driver, which controls the I2C peripheral and accesses the bus. The wrapper connects to that driver.
- `#define I2C_ENABLE_SLAVE_x` enables each connected slave on the I2C bus. This basically means that the driver control block `Driver_I2Cn` will be exported by the wrapper for each particular slave.
- `#define I2C_DRIVER_SLAVE_x` sets the exported control block number n, for example `Driver_I2Cn`. The user application connects to this driver.

**Code example**

This is a demo application which demonstrates the usage of the I2C MultiSlave driver wrapper. It consists of two threads that periodically access two I2C slave devices.

```c
#include <string.h>
#include "cmsis_os2.h"

#include "RTE_Components.h"
#include CMSIS_device_header

#include "Driver_I2C.h" // ::CMSIS Driver:I2C

/* Thread prototypes */
static void Thread_A (void *argument);
static void Thread_B (void *argument);
static void app_main (void *argument);

/* A and B Thread IDs */
static osThreadId_t ThreadId_A;
static osThreadId_t ThreadId_B;

/* I2C A Driver, controls Slave Device 0, uses underlying Driver_I2C1 (see I2C_MultiSlave_Config.h) */
extern ARM_DRIVER_I2C Driver_I2C10;
#define I2C_A (&Driver_I2C10)

/* I2C B Driver, controls Slave Device 1, uses underlying Driver_I2C1 (see I2C_MultiSlave_Config.h) */
extern ARM_DRIVER_I2C Driver_I2C11;
#define I2C_B (&Driver_I2C11)

/*----------------------------------------------------------------------------
* I2C Thread A
*---------------------------------------------------------------------------*/
__NO_RETURN static void Thread_A (void *argument) {
uint8_t addr;
uint8_t reg;
uint8_t val;
(void)argument;

/* Initialize and configure I2C */
I2C_A->Initialize (NULL);
I2C_A->PowerControl(ARM_POWER_FULL);
I2C_A->Control (ARM_I2C_BUS_SPEED, ARM_I2C_BUS_SPEED_FAST);
I2C_A->Control (ARM_I2C_BUS_CLEAR, 0);

/* Periodically read device register at address 0x0F */
addr = 0x68;
reg = 0x0F;

while(1) {
I2C_A->MasterTransmit(addr, &reg, 1, true);
while (I2C_A->GetStatus().busy);

I2C_A->MasterReceive (addr, &val, 1, false);
while (I2C_B->GetStatus().busy);

osDelay(10);
}
}

/*----------------------------------------------------------------------------
* I2C Thread B
*---------------------------------------------------------------------------*/
__NO_RETURN static void Thread_B (void *argument) {
uint8_t addr;
uint8_t reg;
uint8_t val;
(void)argument;

/* Initialize and configure I2C */
I2C_B->Initialize (NULL);
I2C_B->PowerControl(ARM_POWER_FULL);
I2C_B->Control (ARM_I2C_BUS_SPEED, ARM_I2C_BUS_SPEED_STANDARD);
I2C_B->Control (ARM_I2C_BUS_CLEAR, 0);

/* Periodically write device register at address 0x02 */
addr = 0x44;
reg = 0x02;
val = 0xA5;

while(1) {
I2C_A->MasterTransmit(addr, &reg, 1, true);
while (I2C_A->GetStatus().busy);

I2C_A->MasterTransmit(addr, &val, 1, false);
while (I2C_B->GetStatus().busy);

osDelay(10);
}
}

/*----------------------------------------------------------------------------
* Application main thread
*---------------------------------------------------------------------------*/
__NO_RETURN static void app_main (void *argument) {
(void)argument;

/* Create SPI threads */
ThreadId_A = osThreadNew(Thread_A, NULL, NULL);
ThreadId_B = osThreadNew(Thread_B, NULL, NULL);

osDelay(osWaitForever);

for (;;) {}
}

int main (void) {

// System Initialization
SystemCoreClockUpdate();

osKernelInitialize(); // Initialize CMSIS-RTOS
osThreadNew(app_main, NULL, NULL); // Create application main thread
osKernelStart(); // Start thread execution
for (;;) {}
}
```
Loading