Environment.h (BLACKSheep OS)

Aus BECOM Systems Support
Version vom 22. August 2023, 20:35 Uhr von en>Peter (1 Version importiert)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen

Introduction

This document describes the basic functionality of the header file Environment.h that must be included in a BLACKSheep® OS project.

The header file Environment.h contains many user-defined macros that describes the behavior of your BLACKSheep® OS firmware. Therefore you can i.e. specify which software-modules that should be loaded from BLACKSheep® OS, set the processor frequency or specify the UART used by the terminal.

Layout

The Environment.h is subdivided into several modules starting with a short description like this: <source lang="c"> /**********************************************************************************************

**                             Module Name                                                  **
**********************************************************************************************/

</source>

In most instances there follows two macros that specify if the module should be loaded or not and if the module should be able to print debug informations to the terminal. The syntax of the macros is: <source lang="c">

  1. define _USE_MODULE_NAME_ ///< Uncomment to use the module

//#define MODULE_NAME_DEBUG ///< Uncomment to get debug informations from module </source>

The following macros are used to define the behavior of the module.

Not all modules can be used by each processor, i.e. you cannot use the CAN Bus module on a BF561 processor!

Example

Following example shows how to configure the Environment.h to use the module Alive LED. This module starts a thread called led_thread that controls the blink period of a connected LED. <source lang="c"> /**********************************************************************************************

**                             Alive LED                                                    **
**********************************************************************************************/
  1. define _USE_ALIVE_LED_ ///< Uncomment to use a flashing LED for debug purposes

/**********************************************************************************************/

  1. define ALIVE_LED_PIN _PG10 ///< Alive LED pin
  2. define ALIVE_LED_INTERVAL 500 ///< Interval for flashing LED in ms

/**********************************************************************************************/ </source>

As you can see is the module in use, the LED is connected to the GPIO _PG10 and the blink interval is set to 500ms. In this case there are no debug informations available therefore the macro ALIVE_LED_DEBUG is obsolete.

Modules

Processor definitions

Defines the processor and the processor frequencies. <source lang="c"> /**********************************************************************************************

**                             Processor Definitions                                        **
**********************************************************************************************/
  1. define PROC_CLOCK_FREQ_IN 30 ///< Input clock source frequency in MHz
  2. define PROC_CLOCK_FREQ_CORE 510 ///< Core frequency in MHz
  3. define PROC_CLOCK_FREQ_SYSTEM 128 ///< System frequency in MHz
  4. define PROC_CLOCK_USE_PLL_INPUT_DIV ///< Uncomment to use the PLL input divider
  5. define PROC_VARIANT ADI_PWR_PROC_BF537SKBC600 ///< Processor variant (see adi_pwr.h)
  6. define PROC_PACKAGE ADI_PWR_PACKAGE_MBGA ///< Processor package (see adi_pwr.h)
  7. define PROC_VDDEXT ADI_PWR_VDDEXT_330 ///< External Voltage supply (see adi_pwr.h)
  8. define PROC_USE_EXTERNAL_VCCINT ///< Uncomment to use an external VccINT
  9. define PROC_VDDINT ADI_PWR_VLEV_140 ///< Core voltage (see adi_pwr.h)

/*********************************************************************************************/ </source>

The macro PROC_USE_EXTERNAL_VCCINT can only be used with the BF561.

BS UART

Defines the UART interface for the BLACKSheep® OS terminal.

<source lang="c"> /**********************************************************************************************

**                             BS UART                                                      **
**********************************************************************************************/
  1. define _USE_UART_ ///< Uncomment to use Uart for the terminal
  2. define _USE_BSUART_ ///< Uncomment to use BSUart
  3. define BSUART_DEBUG ///< Uncomment to get BSUart debug information
  4. define _BSUART_FORCE_ISR_TO_L1_ ///< Uncomment to force the ISR of the BS UART into L1 memory
  5. define _BSUART_USE_TX_DMA_ ///< May not work on all blackfin types.
                                          ///< "give DMA priority over cpu in external memory"
                                          ///<  has to be set, otherwise problems with xmodem transfer occurs

/**********************************************************************************************/

  1. define BSUART_UART_NR 0 ///< Number of the UART interface
  2. define BSUART_BAUDRATE 115200 ///< Baudrate of the terminal output
  3. define BSUART_RX_BUFFER_SIZE 2048 ///< Receive buffer size
  4. define BSUART_TX_BUFFER_SIZE 10000 ///< Transmit buffer size
  5. define BSUART_MESSAGE_MAX_LENGTH 256 ///< Maximal length of the message buffer

/*********************************************************************************************/ </source>

Bootloader Behavior

Defines the behavior of the BLACKSheep® OS bootloader

<source lang="c"> /**********************************************************************************************

**                             BOOTLOADER Behavior                                          **
**********************************************************************************************/
  1. define BOOTLOADER_ENABLE_FLASH_KEY_CHECK ///< Uncomment to enable the fwupdate command support
  2. define BOOTLOADER_ENABLE_KEY_PRESSED_CHECK ///< Uncomment to enter the bootloader via press of 'c' during boot
  3. define BOOTLOADER_WAIT_FOR_KEY_TIMEOUT 300 ///< [ms]

/**********************************************************************************************/ </source>

BLACKSheep

Defines the version of the firmware and some basic settings for the BLACKSheep® OS framework.

<source lang="c"> /**********************************************************************************************

**                             BLACKSheep                                                   **
**********************************************************************************************/
  1. define BS_VERSION_1 "VDK BLACKSheep for CM-BF537U" ///< BLACKSheep version
  2. define BS_VERSION_2 "Developed by Roland Oberhammer (suedtirolli)" ///< BLACKSheep version
  3. define BS_VERSION_3 "Refer to www.bluetechnix.com for further information." ///< BLACKSheep version
  4. define BS_VERSION_4 "" ///< BLACKSheep version
  5. define BS_FIRMWARE_VERSION "1.1.0" ///< BLACKSheep firmware version
  6. define BS_BOOT_DELAY 100 ///< Boot delay in ms
  7. define BS_IDE "" ///< IDE used to compile this project. Leave blank to generate automaticaly.
  8. define BS_NOF_DXE_IN_FLASH 0 ///< Application number of BLACKSheep in flash. 0 mean that BS is first dxe in flash, without any bootloader
  9. define BS_SECONDS_PRIOR_BOOT_APP 3 ///< Time to wait prior to boot the application
  10. define BS_DXE_SIZE_MAX 0x200000 ///< Maximal possible size of an application that can be load
  11. define BS_IVG_PERIPHERAL_ERROR 7 ///< IVG for peripheral errors
  12. define BS_IVG_DMA_ERROR 7 ///< IVG for DMA errors
  13. define BS_INT_MNG_NOF_SECONDARY_HANDLER 25 ///< Number of secondary Interrupt handlers
  14. define BS_NOF_USER_IVGS 7 ///< Number of user IVGs

//#define BS_NO_BOOT_FLASHING ///< Uncomment to disable the -b option in the flash command

  1. define BS_ENABLE_EXECUTE_USER_CODE 0 ///< Enable the execution of the function executeUserCode after the boot process. The function must be declared in an extern file.

/*********************************************************************************************/ </source>

BLACKSheep commands

Here you can activate or deactivate the commands that should be supported by BLACKSheep® OS.

<source lang="c"> /**********************************************************************************************

**                             BLACKSheep Commands                                          **
**********************************************************************************************/
  1. define BS_CMD_USE_HELLO ///< Uncomment to use command hello
  2. define BS_CMD_USE_CAN ///< Uncomment to use command can
  3. define BS_CMD_USE_CAT ///< Uncomment to use command cat
  4. define BS_CMD_USE_CD ///< Uncomment to use command cd
  5. define BS_CMD_USE_CP ///< Uncomment to use command cp
   #define BS_CMD_CP_BUFFER_SIZE	1024 * 1024 * 1	///< Buffer size for copy command
  1. define BS_CMD_USE_DATE ///< Uncomment to use command date
  2. define BS_CMD_USE_ENV ///< Uncomment to use the command env
  3. define BS_CMD_USE_EXTIME ///< Uncomment to use command extime
   #define DO_CYCLE_COUNTS      ///< Uncomment to use this function with better precision
  1. define BS_CMD_USE_FLASH ///< Uncomment to use command flash
  2. define BS_CMD_USE_FORMAT ///< Uncomment to use command format
  3. define BS_CMD_USE_FTP ///< Uncomment to use command ftp
  4. define BS_CMD_USE_GM ///< Uncomment to use command gm
  5. define BS_CMD_USE_GPIO ///< Uncomment to use command gpio
  6. define BS_CMD_USE_HELP ///< Uncomment to use command help
  7. define BS_CMD_USE_I2C ///< Uncomment to use command i2c
  8. define BS_CMD_USE_IFCONFIG ///< Uncomment to use command ifconfig
  9. define BS_CMD_USE_KILL ///< Uncomment to use command kill
  10. define BS_CMD_USE_LOAD ///< Uncomment to use command load
  11. define BS_CMD_USE_LS ///< Uncomment to use command ls
  12. define BS_CMD_USE_MD5 ///< Uncomment to use command md5
  13. define BS_CMD_USE_MKDIR ///< Uncomment to use command mkdir
  14. define BS_CMD_USE_MOUNT ///< Uncomment to use command mount
  15. define BS_CMD_USE_PASSWD ///< Uncomment to use command passwd
  16. define BS_CMD_USE_PINFO ///< Uncomment to use command pinfo
  17. define BS_CMD_USE_PROC_INFO ///< Uncomment to use command proc
  18. define BS_CMD_USE_PS ///< Uncomment to use command ps
  19. define BS_CMD_USE_PWD ///< Uncomment to use command pwd
  20. define BS_CMD_USE_REBOOT ///< Uncomment to use command reboot
  21. define BS_CMD_USE_REDIO ///< Uncomment to use command redio
  22. define BS_CMD_USE_RM ///< Uncomment to use command rm
  23. define BS_CMD_USE_TEST ///< Uncomment to use command test
  24. define BS_CMD_USE_TFTP ///< Uncomment to use command tftp
  25. define BS_CMD_USE_TIME ///< Uncomment to use command time
  26. define BS_CMD_USE_PWM ///< Uncomment to use command pwm
  27. define BS_CMD_USE_UMOUNT ///< Uncomment to use command umount
  28. define BS_CMD_USE_USBMOUNT ///< Uncomment to use command usbmount
  29. define BS_CMD_USE_VER ///< Uncomment to use command ver
  30. define BS_CMD_USE_VIEW ///< Uncomment to use command view
  31. define BS_CMD_USE_WDT ///< Uncomment to use command watchdog
  32. define BS_CMD_USE_XMR ///< Uncomment to use command xmr
  33. define BS_CMD_USE_XMT ///< Uncomment to use command xmt

/**********************************************************************************************/ </source>

Test facilities

Here you can define the behavior of the BLACKSheep® OS command test.

<source lang="c"> /**********************************************************************************************

**                             Test facilities                                              **
**********************************************************************************************/
  1. define TEST_SDRAM_SIZE (0x200000) ///< Size of block to be tested (2MB)
  2. define TEST_FLASH_SECTOR (FLASH_NUM_SECTORS - 12) ///< Sector to be tested
  3. define TEST_DPRAM_BASE_ADDRESS_A 0x20300000 ///< Base address A of DPRAM
  4. define TEST_DPRAM_BASE_ADDRESS_B 0x20200000 ///< Base address B of DPRAM
  5. define TEST_DPRAM_SIZE 0x1000 ///< Size of DPRAM (4kb)
  6. define TEST_FRAME_BUFFER_SIZE 0 ///< Frame buffer size. 0 means not used
  7. define TEST_FRAME_BUFFER_BASE 0 ///< Frame buffer base address. 0 means not used

/**********************************************************************************************/ </source>

Terminal

Configures the BLACKSheep® OS terminal that is started after booting.

<source lang="c"> /**********************************************************************************************

**                             Terminal                                                     **
**********************************************************************************************/
#define _USE_TERMINAL_                              ///< Uncomment to create the terminal after booting

/**********************************************************************************************/

  1. define TERMINAL_STANDARD_INPUT stdin ///< Input device
  2. define TERMINAL_STANDARD_OUTPUT stdout ///< Output device
  3. define TERMINAL_PROMPT "CM-BF537U boot" ///< Terminal prompt

/**********************************************************************************************/ </source>

Telnet

Here you can configure the Telnet tool supported by BLACKSheep.

<source lang="c"> /**********************************************************************************************

**                             Telnet                                                       **
**********************************************************************************************/
  1. define _USE_TELNET_ ///< Uncomment to use the Telnet service

/**********************************************************************************************/

  1. define TELNET_WELCOME_MESSAGE "Welcome on BLACKSheep Telnet terminal.\n\rType 'exit' to logout.\n\r\n\r" ///< Telnet welcome message
  2. define TELNET_PORT 23 ///< Port number

/**********************************************************************************************/ </source>

Web Server

In this section you can configure the embedded web server based on the free GoAhead Web Server. <source lang="c"> /**********************************************************************************************

**                             Web Server                                                   **
**********************************************************************************************/
  1. define _USE_WEB_SERVER_ ///< Uncomment to use the web server
  2. define WEB_SERVER_DEBUG ///< Uncomment to get web server debug informations

/**********************************************************************************************/

  1. define WEB_SERVER_ROOT_DIR "rd0:\\web" ///< Root directory
  2. define WEB_DEFAULT_PAGE "index.html" ///< Index page
  3. define WEB_SERVER_TCP_PORT 80 ///< TCP port
  4. define WEB_SERVER_STANDARD_OUTPUT stdout ///< Standard output device
  5. define WEB_SERVER_THREAD_PRIORITY 5 ///< Thread priority
  6. define WEB_SERVER_THREAD_NAME "httpd" ///< Thread name

/**********************************************************************************************/ </source>

Alive LED

In this section you can activate a simple thread that controls a LED.

<source lang="c"> /**********************************************************************************************

**                             Alive LED                                                    **
**********************************************************************************************/
  1. define _USE_ALIVE_LED_ ///< Uncomment to use a flashing LED for debug purposes

/**********************************************************************************************/

  1. define ALIVE_LED_PIN _PG10 ///< Alive LED pin
  2. define ALIVE_LED_INTERVAL 500 ///< Interval for flashing LED in ms

/**********************************************************************************************/ </source>

User Management

This section is used to set password requirements for telnet and terminal sessions.

<source lang="c"> /**********************************************************************************************

**                             User Management                                              **
**********************************************************************************************/
  1. define _USE_USER_MANAGEMENT_ ///< Uncomment to use the User management

/**********************************************************************************************/

  1. define USER_MANAGEMENT_PP_TELNET_REQ_PASS 0 ///< Set 1 to enable password protection for Telnet
  2. define USER_MANAGEMENT_PP_TERMINAL_REQ_PASS 0 ///< Set 1 to enable password protection for UART terminal
  3. define USER_MANAGEMENT_PP_DEFAULT_USER_NAME "user" ///< Default user name
  4. define USER_MANAGEMENT_PP_DEFAULT_PASSWORD "pass" ///< Default password

/*********************************************************************************************/ </source>

System Management

<source lang="c"> /**********************************************************************************************

**                             System Management                                            **
**********************************************************************************************/
  1. define SYSTEM_MGNT_SECTOR (FLASH_NUM_SECTORS - 8) ///< sector used to store system management settings
  2. define SYSTEM_USER_ARG_SIZE_MAX 10 ///< Number of arguments used for communication between bootloader and application

/*********************************************************************************************/ </source>

Asyncronous memory

Here you can set the values for the asyncronous memory interface of the Blackfin processor.

<source lang="c"> /**********************************************************************************************

**                             Asyncronous Memory                                           **
**********************************************************************************************/
  1. define AMI_EBIU_AMBCTL0_VALUE 0x7bb07bb0 ///< Value of the EBIU_AMBCTL0 register
  2. define AMI_EBIU_AMBCTL1_VALUE 0x7bb07bb0 ///< Value of the EBIU_AMBCTL1 register
  3. define AMI_EBIU_AMGCTL_VALUE 0x01f8 ///< Value of the EBIU_AMGCTL register

/*********************************************************************************************/ </source>

Flash memory

This section is reserved for flash memory settings.

<source lang="c"> /**********************************************************************************************

**                             FLASH Memory                                                 **
**********************************************************************************************/
  1. define FLASH_INTEL_STRATA ///< Uncomment if Intel Strata compatible flash
  2. define FLASH_START_ADDRESS 0x20000000 ///< Start address of the flash memory
  3. define FLASH_NUM_SECTORS 64 ///< Number of flash sectors
  4. define FLASH_SECTOR_SIZE 0x8000 ///< Size of flash sectors
  5. define FLASH_NOF_BANKS 1 ///< Number of flash banks
  6. define FLASH_BANK_SIZE 0x200000 ///< Size of a bank
  7. define FLASH_BANK_SELECT0 0 ///< Bank select pin for bank 0 (set 0 if not support)
  8. define FLASH_BANK_SELECT1 0 ///< Bank select pin for bank 1 (set 0 if not support)
  9. define FLASH_BANK_SELECT2 0 ///< Bank select pin for bank 2 (set 0 if not support)
  10. define FLASH_BANK_SELECT3 0 ///< Bank select pin for bank 3 (set 0 if not support)
  11. define FLASH_BANK_SELECT4 0 ///< Bank select pin for bank 4 (set 0 if not support)
  12. define FLASH_BANK_SELECT5 0 ///< Bank select pin for bank 5 (set 0 if not support)
  13. define FLASH_APP_ERASE_END_ADDR FLASH_START_ADDRESS + ((FLASH_NUM_SECTORS - 16) * FLASH_SECTOR_SIZE) ///< End address for erasing applications in flash
  14. define FLASH_RSDEV_PASS_PROTECT ///< Uncomment to protect the erase device function by password
  15. define FLASH_USE_WORKAROUND ///< Uncomment to use the flash workaround
  16. define FLASH_RSDEV_PASSWORD "bsnorsdev" ///< Select the password for rsdev, rsmsec and flash as bootloader, uncomment to set default
  1. define FLASH_ENV_TABLE_APP_NAME "app0_name" ///< Name of the 'application name'-variable in the environment table
  2. define FLASH_ENV_TABLE_APP_NAME_LENGTH 100 ///< Maximal length of the application name
  3. define FLASH_ENV_TABLE_APP_CRC32 "app0_crc32"///< Name of the 'application crc32'-variable in the environment table
  4. define FLASH_ENV_TABLE_APP_SIZE "app0_size" ///< Name of the 'application size'-variable in the environment table

/*********************************************************************************************/ </source>

MDMA manager

Here you can activate, deactivate and configure the MDMA manager.

<source lang="c"> /**********************************************************************************************

**                             MDMA manager                                                 **
**********************************************************************************************/
  1. define _USE_MDMA_MNGR_ ///< Uncomment to use the MDMA manager
  2. define MDMA_MNGR__DEBUG ///< Uncomment to get MDMA manager debug information

/**********************************************************************************************/

  1. define MDMA_MNGR_IVG 0 ///< IVG for DMA interrupt
  2. define MDMA_MNGR_ERROR_IVG 0 ///< IVG for DMA error

/*********************************************************************************************/ </source>

RAM Drive

Configure the RAM drive.

<source lang="c"> /**********************************************************************************************

**                             RAM Drive                                                    **
**********************************************************************************************/
  1. define _USE_RAM_DRIVE_ ///< Uncomment to use the RAM drive
  2. define RAM_DRIVE_DEBUG ///< Uncomment to get RAM drive debug information

/**********************************************************************************************/

  1. define RAM_DRIVE_BLOCK_COUNT (8192*4) ///< Block count of RAM drive
  2. define RAM_DRIVE_FILE_SYSTEM FILE_SYSTEM_FULLFAT_NAME ///< File system used by the RAM drive
  3. define RAM_DRIVE_PARTITION_NAME "rd0" ///< Partition name (0 if unknown)

/*********************************************************************************************/ </source>

Environment Table

Configurations for the environment table used to store settings in the non-volatile flash memory.

<source lang="c"> /**********************************************************************************************

**                             Environment Table                                            **
**********************************************************************************************/
  1. define EV_BASE_ADDRESS (FLASH_START_ADDRESS + ((FLASH_NUM_SECTORS - 4) * FLASH_SECTOR_SIZE)) ///< Address in flash where the environment table is stored
  2. define EV_STACK_SIZE 4096 ///< Size of the environment table

/*********************************************************************************************/ </source>

File system

Here you can choose which file systems should be supported by BLACKSheep® OS.

<source lang="c"> /**********************************************************************************************

**                             File system                                                  **
**********************************************************************************************/
  1. define _USE_FILE_SYSTEM_FREEDOS_ ///< Uncomment to use the FreeDOS file system
   #define FILE_SYSTEM_FREEDOS_NAME        "fat"       ///< Name of the FreeDOS file system 
  1. define _USE_FILE_SYSTEM_FULLFAT_ ///< Uncomment to use the FullFAT file system
   #define FILE_SYSTEM_FULLFAT_NAME        "fullfat"   ///< Name of the FullFAT file system
  1. define _USE_FILE_SYSTEM_STREAMING_IO_ ///< Uncomment to use Streaming IO file system
   #define FILE_SYSTEM_STREAMING_IO_NAME   "strio"     ///< Name of the Streaming IO file system

/*********************************************************************************************/ </source>

USB

Here you can activate the support for USB devices. <source lang="c"> /**********************************************************************************************

**                             USB                                                          **
**********************************************************************************************/
  1. define _USE_USB_ ///< Uncomment to use USB support
  2. define _USE_USB_NET2272_ ///< Uncomment to use net2272
  3. define _USE_CM_BF537U_SPECIFIC_USB_INIT_ ///< Uncomment for cm-bf537u usb support
  4. define _USE_USB_BULK_TRANSFER_ ///< Uncomment to initalize USB for Bulk Transfer
  5. define NET2272_DEBUG ///< Uncomment to get net2272 debug information

/**********************************************************************************************/

  1. ifdef _USE_USB_NET2272_
   #define _ADI_USB_NET2272_CONTROLLER_
  1. endif
  1. define USB_VID USB_VID_ADI_TOOLS ///< Vendor ID
  2. define USB_PID USB_PID_BF527KIT_BULK ///< Product ID
  1. ifdef _USE_CM_BF537U_SPECIFIC_USB_INIT_
   #define NET2272_BASE_ADDR         0x20200000                        ///< Base address of the NET2272 device
   #define NET2272_ADDR_SHIFT        1                                 ///< Address shift for addressing the NET2272
   #define NET2272_ADI_PERIPHERAL_ID ADI_INT_DMA1_ETHERNET_RX_PORTH_A  ///< Interrupt ID for peripheral interrupt
   #define NET2272_PF_RESET          _PH13                             ///< Pin PF_RESET
   #define NET2272_PF_INT            _PH14                             ///< Pin PF_INT
   #define NET2272_IVG               0 // use default                  ///< IVG fot NET2272
   #define NET2272_ADI_MDMA_ID       ADI_DMA_MDMA_1                    ///< MDMA ID
  1. else
   #define NET2272_BASE_ADDR         0x20300000                        ///< Base address of the NET2272 device
   #define NET2272_ADDR_SHIFT        1                                 ///< Address shift for addressing the NET2272
   #define NET2272_ADI_PERIPHERAL_ID ADI_INT_PORTFG_A                  ///< Interrupt ID for peripheral interrupt
   #define NET2272_PF_RESET          _PG14                             ///< Pin PF_RESET
   #define NET2272_PF_INT            _PG13                             ///< Pin PF_INT
   #define NET2272_IVG               0 // use default                  ///< IVG fot NET2272
   #define NET2272_ADI_MDMA_ID       ADI_DMA_MDMA_1                    ///< MDMA ID
  1. endif

/*********************************************************************************************/ </source>

Ethernet

In this section you can specify which Ethernet PHY should be used. Further you can set the configuration of the defined Ethernet PHY.

<source lang="c"> /**********************************************************************************************

**                             Ethernet                                                     **
**********************************************************************************************/
  1. define _USE_ETHERNET_ ///< Uncomment to use ethernet device
  2. define ETHERNET_DEBUG ///< Uncomment to get ethernet debug information

//#define _USE_ETH_MAC_INTERNAL_ ///< Uncomment to use the internal MAC

  1. define _USE_ETH_MAX_EXTERNAL ///< Uncomment to use the external MAC

/**********************************************************************************************/

  1. define ETH_PHY_DEVICE ETH_PHY_LAN9218 ///< PHY device defined in eth_dev.h
  2. define ETH_USE_RMII_DATA_INTERFACE ///< Uncomment to use the RMII data interface
  3. define ETH_MAC_ADDRESS "AC:DE:48:01:02:03" ///< MAC address of the device
  4. define ETH_IP_ADDRESS "192.168.0.10" ///< IP address of the device
  5. define ETH_SUBNET_MASK "255.255.255.0" ///< Subnet mask
  6. define ETH_GATEWAY_ADDRESS "0.0.0.0" ///< Gateway address
  7. define ETH_DHCP_ENABLED "0" ///< Set to 1 to enable the DHCP
  8. define ETH_MEM_BASE_SIZE ADI_ETHER_MEM_LAN9218_BASE_SIZE ///< Memory base size
  9. define ETH_MEM_PER_RECEIVE ADI_ETHER_MEM_LAN9218_PER_RECV ///< Memory per receive packet
  10. define ETH_MEM_PER_TRASMIT ADI_ETHER_MEM_LAN9218_PER_XMIT ///< Memory per trasmit packet
  11. define ETH_BASE_ADDR 0x20308000 ///< Base address for AMS
  12. define ETH_PERIPHERAL_ID 0 ///< Peripheral ID for external interrupt source
  13. define ETH_PF_INT_PIN _PG11 ///< Ethernet IRQ source pin
  14. define ETH_NO_RECEIVES 8 ///< Number of memory receives
  15. define ETH_NO_TRANSMITS 10 ///< Number of memory transmits
  16. define ETH_IP_STACK_ENABLE 1 ///< Enables the IP stack
  17. define ETH_STACK_SIZE 1024*1024*1 ///< Stack size
  18. define ETH_TCP_TEST_SERVER_PORT 5555 ///< Port number for TCP test
  19. define ETH_IVG_RXTX 13 ///< IVG for Ethernet RxTx
  20. define ETH_STACK_PRIORITY 3 ///< Stack priority
  21. define ETH_STACK_PERIOD 10 ///< Stack period

/*********************************************************************************************/ </source>

I2C interface

Here you can choose if you want to use the internal (if supported by processor) or the emulated I2C interface. You have to specify the I2C clock frequency of the slowest device on the bus.

<source lang="c"> /**********************************************************************************************

**                             I2C interface                                                **
**********************************************************************************************/
  1. define _USE_I2C_INTERFACE_ ///< Uncomment to use the I2C interface
  2. define I2C_DEBUG ///< Uncomment to get I2C debug information
  3. define _USE_I2C_INTERNAL ///< Uncomment to use the internal I2C, if not available comment it out

/**********************************************************************************************/

  1. define I2C_GLOBAL_HANDLER_NR 0 ///< Number of the I2C interface that is used as global handler
  2. define I2C_BIT_RATE 100000 ///< Bitrate fot the I2C interface
  3. define I2C_ENABLE_SCANBUS 0 ///< Enable calling the function I2CScanbus after initialization
  4. define I2C_SCANBUS_MAX_DEVICES 10 ///< Max devices for the I2CScanbus function. Need for memory allocation of g_anI2CScanbusIDs

// for I2C emulator

  1. define I2C_EMU_SDA 0 ///< GPIO, used as data for I2C, emulated in software, currently not in use
  2. define I2C_EMU_SCL 0 ///< GPIO, used as clock for I2C, emulated in software, currently not in use
  3. define I2C_EMU_TIMER 0 ///< TIMER, used for I2C, emulated in software

/*********************************************************************************************/ </source>


SPI interface

Here you can specify which SPI interface should be initialized when BLACKSheep® OS boots. <source lang="c"> /**********************************************************************************************

**                             SPI interface                                                **
**********************************************************************************************/
  1. define _USE_SPI_

//#define SPI_DEBUG /**********************************************************************************************/

  1. define SPI_INIT_BUS_0 ///< initialize SPI bus 0
  2. define SPI_INIT_BUS_1 ///< initialize SPI bus 1
  3. define SPI_INIT_BUS_2 ///< initialize SPI bus 2

/**********************************************************************************************/ </source>

SPI SD Card

This section is used to configure a connected SD Card over SPI interface.

<source lang="c"> /**********************************************************************************************

**                             SPI SD Card                                                  **
**********************************************************************************************/
  1. define _USE_SPI_SD_CARD_ ///< Uncomment to use the SPI SD Card
  2. define SPI_SD_CARD_DEBUG ///< Uncomment to get SPI SD card debug information

/**********************************************************************************************/

  1. define SPI_SD_CARD_BUS 0 ///< SPI Bus
  2. define SPI_SD_CARD_SLOT (_PF10 | 0x80000000) ///< CS Pin for the SD Card
  3. define SPI_SD_CARD_BAUDRATE 20000000 ///< Baudrate in transfer mode
  4. define SPI_SD_CARD_FILE_SYSTEM FILE_SYSTEM_FULLFAT_NAME ///< File system used by the SPI SD card
  5. define SPI_SD_CARD_PARTITION_NAME 0 ///< Partition name (0 if unknown)

/*********************************************************************************************/ </source> Supported file systems are: "fullfat" (FullFAT) and "fat" (FreeDOS). Be sure that the selected file system is initialized in the section File system.

SDH interface

Here you can configure the SDH interface of the processor. <source lang="c"> /***********************************************************************************************

**                             SDH interface                                                 **
***********************************************************************************************/
  1. define _USE_SDH_INTERFACE_ ///< Uncomment to use the SDH interface
  2. define SDH_DEBUG ///< Uncomment to get SDH debug information

/***********************************************************************************************/

  1. define SDH_MAX_SDH_INTERFACES 1 ///< Number of avaiable SDH interfaces
  2. define SDH_IRQ_SDH_MASK0 IRQ_SDH_MASK0 ///< Interrupt request flag for SDH Mask 0
  3. define SDH_IRQ_SDH_MASK1 IRQ_SDH_MASK1 ///< Interrupt request flag for SDH Mask 1
  4. define SDH_IRQ_DMA IRQ_DMA22 ///< Interrupt request flag for DMA
  5. define SDH_PD_DAT3_EN 1 ///< Pull Down on DAT3 enable
  6. define SDH_PU_DAT3_EN 0 ///< Pull Up on DAT3 enable
  7. define SDH_PU_DAT02_CMD_EN 1 ///< Pull Up on DAT0-2 and CMD enable
  8. define SDH_PERIPHERAL_RXTX_IVG 0 ///< IVG for SDH Peripheral Rx Tx
  9. define SDH_PERIPHERAL_STATUS_IVG 0 ///< IVG for SDH Peripheral Status
  10. define SDH_DMA_ERROR_IVG 0 ///< IVG for DMA Error

/**********************************************************************************************/ </source>


SDH SD Card

This section is used to configure a connected SD Card over SDH interface.

<source lang="c"> /**********************************************************************************************

**                             SDH SD Card                                                  **
**********************************************************************************************/
  1. define _USE_SDH_SD_CARD_ ///< Uncomment to use the SDH SD Card
  2. define SDH_SD_CARD_DEBUG ///< Uncomment to get SDH SD card debug information

/**********************************************************************************************/

  1. define SDH_SD_CARD_SDH_SLOT 0 ///< SDH Slot
  2. define SDH_SD_CARD_FILE_SYSTEM FILE_SYSTEM_FULLFAT_NAME ///< File system used by the SDH SD card
  3. define SDH_SD_CARD_PARTITION_NAME 0 ///< Partition name (0 if unknown)
  4. define SDH_SD_CARD_PIN_CARD_DETECT _PC5 ///< Card Detect pin
  5. define SDH_SD_CARD_PIN_DAT0 _PC8 ///< DAT0 pin
  6. define SDH_SD_CARD_CD_IVG 12 ///< IVG for Card Detect interrupt
  7. define SDH_SD_CARD_MODE SDH_SDIO_4_BIT ///< SDH mode
  8. define SDH_SD_CARD_IDENT_BITRATE 400000 ///< Identification mode bitrate
  9. define SDH_SD_CARD_TRANSFER_BITRATE 20000000 ///< Transfer mode bitrate
  10. define SDH_SD_CARD_TIMEOUT_CD 0x000F0000 ///< Timeout for card detect
  11. define SDH_SD_CARD_TIMEOUT_RW 0x00F00000 ///< Timeout for read and write commands

/*********************************************************************************************/ </source> Supported file systems are: "fullfat" (FullFAT) and "fat" (FreeDOS). Be sure that the selected file system is initialized in the section File system.

CF Card

This section is used to configure a connected CF Card in True IDE mode.

<source lang="c"> /**********************************************************************************************

**                             CF Card                                                      **
**********************************************************************************************/
  1. define _USE_CF_CARD_ ///< Uncomment to use the CF Card
  2. define CF_CARD_DEBUG ///< Uncomment to get CF card debug information

/**********************************************************************************************/

  1. define CF_CARD_IDE_BASE_ADDRESS 0x2020C000 ///< Base address
  2. define CF_CARD_IDE_ADDRESS_SHIFT 1 ///< Address A2, A1, A0 shift in True IDE mode
  3. define CF_CARD_PIN_RESET _CF_RESET ///< Reset pin
  4. define CF_CARD_PIN_IRQ _PG1 ///< Interrupt request pin
  5. define CF_CARD_PARTITION_NAME 0 ///< Partition name (0 if unknown)
  6. define CF_CARD_FILE_SYSTEM FILE_SYSTEM_FULLFAT_NAME ///< File system used by the CF card

/*********************************************************************************************/ </source> Supported file systems are: "fullfat" (FullFAT) and "fat" (FreeDOS). Be sure that the selected file system is initialized in the section File system.

CAN interface

Configure the CAN Bus interface. <source lang="c"> /**********************************************************************************************

**                             CAN Interface                                                **
**********************************************************************************************/
  1. define _USE_CAN_ ///< Uncomment to use the CAN interface
  2. define CAN_BUS_DEBUG ///< Uncomment to get CAN debug information

/**********************************************************************************************/

  1. define CAN_DEFAULT_INTERFACE 0 ///< Default interface
  2. define CAN_BIT_RATE 1000000 ///< Bit rate

/*********************************************************************************************/ </source>