Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed DirectSPI FastPWM
sys.h@21:dc161a192ba7, 2020-10-09 (annotated)
- Committer:
- mimi3
- Date:
- Fri Oct 09 07:47:36 2020 +0900
- Revision:
- 21:dc161a192ba7
- Parent:
- 16:1bb81504b23b
trivial change
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| mimi3 | 0:9a5c2fb0d96f | 1 | #ifndef __SYS_H__ |
| mimi3 | 0:9a5c2fb0d96f | 2 | #define __SYS_H__ |
| mimi3 | 0:9a5c2fb0d96f | 3 | |
| mimi3 | 0:9a5c2fb0d96f | 4 | #include <stdint.h> |
| mimi3 | 0:9a5c2fb0d96f | 5 | #include <stdbool.h> |
| mimi3 | 0:9a5c2fb0d96f | 6 | #include "mbed.h" |
| mimi3 | 0:9a5c2fb0d96f | 7 | |
| mimi3 | 0:9a5c2fb0d96f | 8 | /* Selectable options depended on each situation. |
| mimi3 | 0:9a5c2fb0d96f | 9 | * If a functionality is needed, the value should be set to 1. |
| mimi3 | 0:9a5c2fb0d96f | 10 | * */ |
| mimi3 | 0:9a5c2fb0d96f | 11 | |
| mimi3 | 0:9a5c2fb0d96f | 12 | /*---------------------- |
| mimi3 | 0:9a5c2fb0d96f | 13 | -- Selectable Options |
| mimi3 | 0:9a5c2fb0d96f | 14 | ----------------------*/ |
| mimi3 | 0:9a5c2fb0d96f | 15 | #define PWM16BIT 1 |
| mimi3 | 0:9a5c2fb0d96f | 16 | #define DATA_8BIT_SUPPORT 1 |
| mimi3 | 16:1bb81504b23b | 17 | #define HAVE_BUTTON_SW 1 // for 'Play','Pause','Power off' |
| mimi3 | 0:9a5c2fb0d96f | 18 | /* Enable either the type of blink or dimmer */ |
| mimi3 | 16:1bb81504b23b | 19 | #define HAVE_LED_IND_PWM 1 // blink LED during playing (750msec interval) |
| mimi3 | 16:1bb81504b23b | 20 | #define HAVE_LED_IND_BLINK 0 // dimmer LED during playing |
| mimi3 | 0:9a5c2fb0d96f | 21 | /**********************/ |
| mimi3 | 16:1bb81504b23b | 22 | #define HAVE_LED_PAUSE_INDICATOR 1 // blink or dimmer during pausing |
| mimi3 | 16:1bb81504b23b | 23 | #define HAVE_POWER_OFF_MODE 0 // under construction |
| mimi3 | 0:9a5c2fb0d96f | 24 | //-- Select FAT32/FAT16 or FAT16 only |
| mimi3 | 16:1bb81504b23b | 25 | #define HAVE_FAT32 1 // 0: FAT16 only, 1: FAT16 and FAT32 support |
| mimi3 | 0:9a5c2fb0d96f | 26 | //--- end option setting |
| mimi3 | 0:9a5c2fb0d96f | 27 | |
| mimi3 | 0:9a5c2fb0d96f | 28 | // TEST PORT |
| mimi3 | 0:9a5c2fb0d96f | 29 | #define TEST_PORT PA_8 // D7 |
| mimi3 | 0:9a5c2fb0d96f | 30 | // LED indicator |
| mimi3 | 0:9a5c2fb0d96f | 31 | #define IND_LED PB_10 |
| mimi3 | 0:9a5c2fb0d96f | 32 | |
| mimi3 | 0:9a5c2fb0d96f | 33 | //-- debug purpose |
| mimi3 | 0:9a5c2fb0d96f | 34 | #define UART_INFO 1 |
| mimi3 | 0:9a5c2fb0d96f | 35 | #define DEBUG_WAV_PLAYER 0 |
| mimi3 | 0:9a5c2fb0d96f | 36 | #define DEBUG_FAT_LIB 0 |
| mimi3 | 0:9a5c2fb0d96f | 37 | #define DEBUG_SD_CARD 0 |
| mimi3 | 0:9a5c2fb0d96f | 38 | #define TEST_PORT_ENABLE 1 |
| mimi3 | 0:9a5c2fb0d96f | 39 | // |
| mimi3 | 0:9a5c2fb0d96f | 40 | #define HAVE_DIRECT_SPI 1 |
| mimi3 | 0:9a5c2fb0d96f | 41 | |
| mimi3 | 0:9a5c2fb0d96f | 42 | typedef uint16_t word; |
| mimi3 | 0:9a5c2fb0d96f | 43 | typedef uint32_t dword; |
| mimi3 | 0:9a5c2fb0d96f | 44 | typedef uint8_t byte; |
| mimi3 | 0:9a5c2fb0d96f | 45 | typedef int8_t sbyte; |
| mimi3 | 0:9a5c2fb0d96f | 46 | typedef bool sbit; |
| mimi3 | 0:9a5c2fb0d96f | 47 | |
| mimi3 | 7:0ea766ea5ee9 | 48 | #ifdef __CC_ARM |
| mimi3 | 7:0ea766ea5ee9 | 49 | # define OPT_SPEED /* N/A */ |
| mimi3 | 7:0ea766ea5ee9 | 50 | #else |
| mimi3 | 6:d9ea630e1ba5 | 51 | # define OPT_SPEED __attribute__((optimize("O3"))) |
| mimi3 | 6:d9ea630e1ba5 | 52 | #endif |
| mimi3 | 6:d9ea630e1ba5 | 53 | |
| mimi3 | 0:9a5c2fb0d96f | 54 | #endif /* __SYS_H__ */ |
| mimi3 | 0:9a5c2fb0d96f | 55 | |
| mimi3 | 0:9a5c2fb0d96f | 56 |