Eve_Hal framework APIs for FT9XX host platform. More...
Go to the source code of this file.
Macros | |
#define | GPIO_SS_NB (sizeof(s_SpimGpioSS) / sizeof(s_SpimGpioSS[0])) |
Functions | |
MISC | |
void | ticker () |
Clear the interrupt and increment the counter. | |
static void | initSdHost () |
Sdcard initialization. | |
void | EVE_Mcu_initialize () |
Init FT9x host MCU. | |
void | EVE_Mcu_release () |
Release FT9x host MCU. | |
void | EVE_Millis_initialize () |
Init FT9x timer. | |
void | EVE_Millis_release () |
Release FT9x timer. | |
uint32_t | EVE_millis () |
Get clock in miliseond. | |
uint64_t | EVE_millis64 () |
Get clock in miliseond. | |
void | EVE_sleep (uint32_t ms) |
Sleep in milisecond. | |
bool | EVE_UtilImpl_bootupDisplayGpio (EVE_HalContext *phost) |
Display GPIO pins. | |
INIT | |
void | EVE_HalImpl_initialize () |
Initialize HAL platform. | |
void | EVE_HalImpl_release () |
Release HAL platform. | |
EVE_HAL_EXPORT size_t | EVE_Hal_list () |
List the available devices. | |
EVE_HAL_EXPORT void | EVE_Hal_info (EVE_DeviceInfo *deviceInfo, size_t deviceIdx) |
Get info of the specified device. Devices of type EVE_HOST_UNKNOWN should be ignored. | |
EVE_HAL_EXPORT bool | EVE_Hal_isDevice (EVE_HalContext *phost, size_t deviceIdx) |
Check whether the context is the specified device. | |
bool | EVE_HalImpl_defaults (EVE_HalParameters *parameters, size_t deviceIdx) |
Get the default configuration parameters. | |
void | setSPI (EVE_HalContext *phost, EVE_SPI_CHANNELS_T numchnls, uint8_t numdummy) |
Set number of SPI channel. | |
bool | EVE_HalImpl_open (EVE_HalContext *phost, const EVE_HalParameters *parameters) |
Opens a new HAL context using the specified parameters. | |
void | EVE_HalImpl_close (EVE_HalContext *phost) |
Close a HAL context. | |
void | EVE_HalImpl_idle (EVE_HalContext *phost) |
Idle. Call regularly to update frequently changing internal state. | |
TRANSFER | |
void | EVE_Hal_startTransfer (EVE_HalContext *phost, EVE_TRANSFER_T rw, uint32_t addr) |
Start data transfer to Coprocessor. | |
void | EVE_Hal_endTransfer (EVE_HalContext *phost) |
End data transfer. | |
void | EVE_Hal_flush (EVE_HalContext *phost) |
Flush data to Coprocessor. | |
static void | rdBuffer (EVE_HalContext *phost, uint8_t *buffer, uint32_t size) |
Read a block data from Coprocessor. | |
static void | wrBuffer (EVE_HalContext *phost, const uint8_t *buffer, uint32_t size) |
Write a block data to Coprocessor. | |
static uint8_t | transfer8 (EVE_HalContext *phost, uint8_t value) |
Write 8 bit to Coprocessor. | |
uint8_t | EVE_Hal_transfer8 (EVE_HalContext *phost, uint8_t value) |
Write 8 bits to Coprocessor. | |
uint16_t | EVE_Hal_transfer16 (EVE_HalContext *phost, uint16_t value) |
Write 2 bytes to Coprocessor. | |
uint32_t | EVE_Hal_transfer32 (EVE_HalContext *phost, uint32_t value) |
Write 4 bytes to Coprocessor. | |
void | EVE_Hal_transferMem (EVE_HalContext *phost, uint8_t *result, const uint8_t *buffer, uint32_t size) |
Transfer (read/write) a block data to Coprocessor. | |
void | EVE_Hal_transferProgMem (EVE_HalContext *phost, uint8_t *result, eve_progmem_const uint8_t *buffer, uint32_t size) |
Transfer a block data from program memory. | |
uint32_t | EVE_Hal_transferString (EVE_HalContext *phost, const char *str, uint32_t index, uint32_t size, uint32_t padMask) |
Transfer a string to EVE platform. | |
UTILITY | |
void | EVE_Hal_hostCommand (EVE_HalContext *phost, uint8_t cmd) |
Send a host command to Coprocessor. | |
void | EVE_Hal_hostCommandExt3 (EVE_HalContext *phost, uint32_t cmd) |
This API sends a 3byte command to the phost. | |
bool | EVE_Hal_powerCycle (EVE_HalContext *phost, bool up) |
Toggle PD_N pin of FT800 board for a power cycle. | |
void | EVE_Hal_setSPI (EVE_HalContext *phost, EVE_SPI_CHANNELS_T numchnls, uint8_t numdummy) |
Set number of SPI channel. | |
void | EVE_Hal_restoreSPI (EVE_HalContext *phost) |
uint32_t | EVE_Hal_currentFrequency (EVE_HalContext *phost) |
Get current system clock of Coprocessor. | |
Variables | |
static const uint8_t | s_SpimGpioSS [4] = { GPIO_SPIM_SS0, GPIO_SPIM_SS1, GPIO_SPIM_SS2, 35 } |
static const pad_dir_t | s_SpimFuncSS [4] = { pad_spim_ss0, pad_spim_ss1, pad_spim_ss2, pad_spim_ss3 } |
static uint32_t | s_TotalMilliseconds = 0 |
static uint64_t | s_TotalMilliseconds64 = 0 |
Eve_Hal framework APIs for FT9XX host platform.
MIT License
Copyright (c) [2019] [Bridgetek Pte Ltd (BRTChip)]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Definition in file EVE_HalImpl_FT9XX.c.
#define GPIO_SS_NB (sizeof(s_SpimGpioSS) / sizeof(s_SpimGpioSS[0])) |
Definition at line 44 of file EVE_HalImpl_FT9XX.c.
uint32_t EVE_Hal_currentFrequency | ( | EVE_HalContext * | phost | ) |
Get current system clock of Coprocessor.
phost | Pointer to Hal context |
Definition at line 650 of file EVE_HalImpl_FT9XX.c.
void EVE_Hal_endTransfer | ( | EVE_HalContext * | phost | ) |
End data transfer.
phost | Pointer to Hal context |
Definition at line 291 of file EVE_HalImpl_FT9XX.c.
void EVE_Hal_flush | ( | EVE_HalContext * | phost | ) |
Flush data to Coprocessor.
phost | Pointer to Hal context |
Definition at line 304 of file EVE_HalImpl_FT9XX.c.
void EVE_Hal_hostCommand | ( | EVE_HalContext * | phost, |
uint8_t | cmd | ||
) |
Send a host command to Coprocessor.
phost | Pointer to Hal context |
cmd | Command to send |
Definition at line 544 of file EVE_HalImpl_FT9XX.c.
void EVE_Hal_hostCommandExt3 | ( | EVE_HalContext * | phost, |
uint32_t | cmd | ||
) |
This API sends a 3byte command to the phost.
phost | Pointer to Hal context |
cmd | Command to send |
Definition at line 565 of file EVE_HalImpl_FT9XX.c.
EVE_HAL_EXPORT void EVE_Hal_info | ( | EVE_DeviceInfo * | deviceInfo, |
size_t | deviceIdx | ||
) |
Get info of the specified device. Devices of type EVE_HOST_UNKNOWN should be ignored.
deviceInfo | |
deviceIdx |
Definition at line 87 of file EVE_HalImpl_FT9XX.c.
EVE_HAL_EXPORT bool EVE_Hal_isDevice | ( | EVE_HalContext * | phost, |
size_t | deviceIdx | ||
) |
Check whether the context is the specified device.
phost | Pointer to Hal context |
deviceIdx |
Definition at line 103 of file EVE_HalImpl_FT9XX.c.
EVE_HAL_EXPORT size_t EVE_Hal_list | ( | ) |
List the available devices.
List the available devices
Definition at line 76 of file EVE_HalImpl_FT9XX.c.
bool EVE_Hal_powerCycle | ( | EVE_HalContext * | phost, |
bool | up | ||
) |
Toggle PD_N pin of FT800 board for a power cycle.
phost | Pointer to Hal context |
up | Up or Down |
Definition at line 588 of file EVE_HalImpl_FT9XX.c.
void EVE_Hal_restoreSPI | ( | EVE_HalContext * | phost | ) |
Restore platform to previously configured EVE SPI channel mode
Definition at line 636 of file EVE_HalImpl_FT9XX.c.
void EVE_Hal_setSPI | ( | EVE_HalContext * | phost, |
EVE_SPI_CHANNELS_T | numchnls, | ||
uint8_t | numdummy | ||
) |
Set number of SPI channel.
phost | Pointer to Hal context |
numchnls | Number of channel |
numdummy | Number of dummy bytes |
Definition at line 615 of file EVE_HalImpl_FT9XX.c.
void EVE_Hal_startTransfer | ( | EVE_HalContext * | phost, |
EVE_TRANSFER_T | rw, | ||
uint32_t | addr | ||
) |
Start data transfer to Coprocessor.
phost | Pointer to Hal context |
rw | Read or Write |
addr | Address to read/write |
Definition at line 257 of file EVE_HalImpl_FT9XX.c.
uint16_t EVE_Hal_transfer16 | ( | EVE_HalContext * | phost, |
uint16_t | value | ||
) |
Write 2 bytes to Coprocessor.
phost | Pointer to Hal context |
value | Value to write |
Definition at line 374 of file EVE_HalImpl_FT9XX.c.
uint32_t EVE_Hal_transfer32 | ( | EVE_HalContext * | phost, |
uint32_t | value | ||
) |
Write 4 bytes to Coprocessor.
phost | Pointer to Hal context |
value | Value to write |
Definition at line 399 of file EVE_HalImpl_FT9XX.c.
uint8_t EVE_Hal_transfer8 | ( | EVE_HalContext * | phost, |
uint8_t | value | ||
) |
Write 8 bits to Coprocessor.
phost | Pointer to Hal context |
value | Value to write |
Definition at line 362 of file EVE_HalImpl_FT9XX.c.
void EVE_Hal_transferMem | ( | EVE_HalContext * | phost, |
uint8_t * | result, | ||
const uint8_t * | buffer, | ||
uint32_t | size | ||
) |
Transfer (read/write) a block data to Coprocessor.
phost | Pointer to Hal context |
result | Buffer to get data transfered, NULL when write |
buffer | Buffer where data is transfered, NULL when read |
size | Size of buffer |
Definition at line 429 of file EVE_HalImpl_FT9XX.c.
void EVE_Hal_transferProgMem | ( | EVE_HalContext * | phost, |
uint8_t * | result, | ||
eve_progmem_const uint8_t * | buffer, | ||
uint32_t | size | ||
) |
Transfer a block data from program memory.
phost | Pointer to Hal context |
result | Buffer to get data transfered, NULL when write |
buffer | Buffer where data is transfered, NULL when read |
size | Size of buffer |
Definition at line 457 of file EVE_HalImpl_FT9XX.c.
uint32_t EVE_Hal_transferString | ( | EVE_HalContext * | phost, |
const char * | str, | ||
uint32_t | index, | ||
uint32_t | size, | ||
uint32_t | padMask | ||
) |
Transfer a string to EVE platform.
phost | Pointer to Hal context |
str | String to transfer |
index | Start position in the string |
size | Size of string |
padMask | Padding mask |
Definition at line 496 of file EVE_HalImpl_FT9XX.c.
void EVE_HalImpl_close | ( | EVE_HalContext * | phost | ) |
Close a HAL context.
phost | Pointer to Hal context |
Definition at line 223 of file EVE_HalImpl_FT9XX.c.
bool EVE_HalImpl_defaults | ( | EVE_HalParameters * | parameters, |
size_t | deviceIdx | ||
) |
Get the default configuration parameters.
parameters | EVE_Hal framework's parameters |
deviceIdx |
Definition at line 116 of file EVE_HalImpl_FT9XX.c.
void EVE_HalImpl_idle | ( | EVE_HalContext * | phost | ) |
Idle. Call regularly to update frequently changing internal state.
phost | Pointer to Hal context |
Definition at line 237 of file EVE_HalImpl_FT9XX.c.
void EVE_HalImpl_initialize | ( | ) |
Initialize HAL platform.
Initialize HAL platform
Definition at line 57 of file EVE_HalImpl_FT9XX.c.
bool EVE_HalImpl_open | ( | EVE_HalContext * | phost, |
const EVE_HalParameters * | parameters | ||
) |
Opens a new HAL context using the specified parameters.
phost | Pointer to Hal context |
parameters | EVE_Hal framework's parameters |
Definition at line 191 of file EVE_HalImpl_FT9XX.c.
void EVE_HalImpl_release | ( | ) |
Release HAL platform.
Release HAL platform
Definition at line 65 of file EVE_HalImpl_FT9XX.c.
void EVE_Mcu_initialize | ( | ) |
Init FT9x host MCU.
Definition at line 720 of file EVE_HalImpl_FT9XX.c.
void EVE_Mcu_release | ( | ) |
Release FT9x host MCU.
Definition at line 781 of file EVE_HalImpl_FT9XX.c.
uint32_t EVE_millis | ( | ) |
Get clock in miliseond.
Need to ensure that below api is called at least once in 6.5 seconds duration for FT900 platform as this module doesnt use timer for context update global counter to loopback after ~49.71 days
Definition at line 842 of file EVE_HalImpl_FT9XX.c.
uint64_t EVE_millis64 | ( | ) |
Get clock in miliseond.
Need to ensure that below api is called at least once in 6.5 seconds duration for FT900 platform as this module doesnt use timer for context update global counter to loopback after ~49.71 days
Definition at line 862 of file EVE_HalImpl_FT9XX.c.
void EVE_Millis_initialize | ( | ) |
Init FT9x timer.
Definition at line 802 of file EVE_HalImpl_FT9XX.c.
void EVE_Millis_release | ( | ) |
Release FT9x timer.
Definition at line 826 of file EVE_HalImpl_FT9XX.c.
void EVE_sleep | ( | uint32_t | ms | ) |
Sleep in milisecond.
ms | Milisecond |
Definition at line 895 of file EVE_HalImpl_FT9XX.c.
bool EVE_UtilImpl_bootupDisplayGpio | ( | EVE_HalContext * | phost | ) |
Display GPIO pins.
phost | Pointer to Hal context |
Definition at line 915 of file EVE_HalImpl_FT9XX.c.
|
static |
Sdcard initialization.
Definition at line 685 of file EVE_HalImpl_FT9XX.c.
|
inlinestatic |
Read a block data from Coprocessor.
phost | Pointer to Hal context |
buffer | Buffer to get result |
size | Number of bytes to read |
Definition at line 317 of file EVE_HalImpl_FT9XX.c.
void setSPI | ( | EVE_HalContext * | phost, |
EVE_SPI_CHANNELS_T | numchnls, | ||
uint8_t | numdummy | ||
) |
Set number of SPI channel.
phost | Pointer to Hal context |
numchnls | Number of channel |
numdummy | Number of dummy bytes |
Definition at line 130 of file EVE_HalImpl_FT9XX.c.
void ticker | ( | ) |
Clear the interrupt and increment the counter.
Definition at line 878 of file EVE_HalImpl_FT9XX.c.
|
inlinestatic |
Write 8 bit to Coprocessor.
phost | Pointer to Hal context |
value | Value to write |
Definition at line 341 of file EVE_HalImpl_FT9XX.c.
|
inlinestatic |
Write a block data to Coprocessor.
phost | Pointer to Hal context |
buffer | Data buffer to write |
size | Size of buffer |
Definition at line 329 of file EVE_HalImpl_FT9XX.c.
|
static |
Definition at line 42 of file EVE_HalImpl_FT9XX.c.
|
static |
Definition at line 41 of file EVE_HalImpl_FT9XX.c.
|
static |
Definition at line 792 of file EVE_HalImpl_FT9XX.c.
|
static |
Definition at line 793 of file EVE_HalImpl_FT9XX.c.