Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
|
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cascoda-bm/cascoda_evbme.h"
#include "cascoda-bm/cascoda_interface.h"
#include "cascoda-bm/cascoda_sensorif.h"
#include "cascoda-bm/cascoda_serial.h"
#include "cascoda-bm/cascoda_spi.h"
#include "cascoda-bm/cascoda_types.h"
#include "cascoda-bm/cascoda_wait.h"
#include "cascoda-util/cascoda_tasklet.h"
#include "cascoda-util/cascoda_time.h"
#include "ca821x_api.h"
#include "cascoda-bm/test15_4_evbme.h"
Classes | |
struct | read_data_helper_args |
struct | page_program_helper_args |
Macros | |
#define | TEST_MSDULENGTH (40) |
#define | TEST_MSDUHANDLE (0xAA) |
#define | TEST_MSDU |
#define | TEST_PANID 0x5C, 0xCA |
#define | TEST_DSTADDR 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88 |
#define | NUMBER_OF_BYTES_IN_A_PAGE 256 |
#define | NUMBER_OF_BYTES_IN_HALF_A_PAGE (NUMBER_OF_BYTES_IN_A_PAGE / 2) |
#define | NUMBER_OF_PAGES_TOTAL 4096 |
#define | NUMBER_OF_HALF_PAGES_TOTAL (NUMBER_OF_PAGES_TOTAL * 2) |
#define | NUMBER_OF_PAGES_IN_A_SECTOR 16 |
#define | NUMBER_OF_HALF_PAGES_IN_A_SECTOR (NUMBER_OF_PAGES_IN_A_SECTOR * 2) |
#define | NUMBER_OF_PAGES_IN_A_32KB_BLOCK 128 |
#define | NUMBER_OF_HALF_PAGES_IN_A_32KB_BLOCK (NUMBER_OF_PAGES_IN_A_32KB_BLOCK * 2) |
#define | NUMBER_OF_PAGES_IN_A_64KB_BLOCK (NUMBER_OF_PAGES_IN_A_32KB_BLOCK * 2) |
#define | NUMBER_OF_HALF_PAGES_IN_A_64KB_BLOCK (NUMBER_OF_PAGES_IN_A_64KB_BLOCK * 2) |
Typedefs | |
typedef struct read_data_helper_args | read_data_helper_args |
typedef struct page_program_helper_args | page_program_helper_args |
typedef enum statusRegister1_masks | statusRegister1_masks |
Masks for individual bits in Status Register 1. More... | |
typedef enum statusRegister1_pos | statusRegister1_pos |
Bit positions for Status Register 1. More... | |
Enumerations | |
enum | FLASH_nextState { FLASH_GET_DEVICE_ID , FLASH_READ_STATUS_REG1 , FLASH_WRITE_ENABLE_DISABLE , FLASH_CHIP_ERASE_AND_READ_DATA , FLASH_PAGE_PROGRAM_AND_ERASE_SECTOR , FLASH_PAGE_PROGRAM_AND_ERASE_BLOCK32K , FLASH_PAGE_PROGRAM_AND_ERASE_BLOCK64K , FLASH_POWERDOWN_AND_RELEASE , FLASH_PROGRAM_READ_AND_ERASE_UNDER_STRESS , FLASH_PROGRAM_AND_OVERWRITE , END } |
enum | statusRegister1_masks { BUSY_mask = 0x01 , WEL_mask = 0x02 , BP0_mask = 0x04 , BP1_mask = 0x08 , BP2_mask = 0x10 , TB_mask = 0x20 , SEC_mask = 0x40 , SRP0_mask = 0x80 , WEL_mask = 0x02 } |
Masks for individual bits in Status Register 1. More... | |
enum | statusRegister1_pos { BUSY_pos = 0 , WEL_pos , BP0_pos , BP1_pos , BP2_pos , TB_pos , SEC_pos , SRP0_pos , WEL_pos = 1 } |
Bit positions for Status Register 1. More... | |
Variables | |
ca_tasklet | testTasklet |
struct ca821x_dev | dev |
#define NUMBER_OF_BYTES_IN_A_PAGE 256 |
#define NUMBER_OF_BYTES_IN_HALF_A_PAGE (NUMBER_OF_BYTES_IN_A_PAGE / 2) |
#define NUMBER_OF_HALF_PAGES_IN_A_32KB_BLOCK (NUMBER_OF_PAGES_IN_A_32KB_BLOCK * 2) |
#define NUMBER_OF_HALF_PAGES_IN_A_64KB_BLOCK (NUMBER_OF_PAGES_IN_A_64KB_BLOCK * 2) |
#define NUMBER_OF_HALF_PAGES_IN_A_SECTOR (NUMBER_OF_PAGES_IN_A_SECTOR * 2) |
#define NUMBER_OF_HALF_PAGES_TOTAL (NUMBER_OF_PAGES_TOTAL * 2) |
#define NUMBER_OF_PAGES_IN_A_32KB_BLOCK 128 |
#define NUMBER_OF_PAGES_IN_A_64KB_BLOCK (NUMBER_OF_PAGES_IN_A_32KB_BLOCK * 2) |
#define NUMBER_OF_PAGES_IN_A_SECTOR 16 |
#define NUMBER_OF_PAGES_TOTAL 4096 |
#define TEST_DSTADDR 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88 |
#define TEST_MSDU |
#define TEST_MSDUHANDLE (0xAA) |
#define TEST_MSDULENGTH (40) |
#define TEST_PANID 0x5C, 0xCA |
typedef struct page_program_helper_args page_program_helper_args |
typedef struct read_data_helper_args read_data_helper_args |
typedef enum statusRegister1_masks statusRegister1_masks |
Masks for individual bits in Status Register 1.
typedef enum statusRegister1_pos statusRegister1_pos |
Bit positions for Status Register 1.
enum FLASH_nextState |
enum statusRegister1_pos |
ca_error handle_tests | ( | ) |
int main | ( | void | ) |
Main Program Endless Loop.
int test15_4_serial_dispatch | ( | uint8_t * | buf, |
size_t | len, | ||
struct ca821x_dev * | pDeviceRef | ||
) |
ca_error test_ChipEraseAndReadData | ( | void * | aContext | ) |
ca_error test_GetDeviceId | ( | ) |
ca_error test_OverWriteData | ( | void * | aContext | ) |
ca_error test_PageProgramAndEraseBlock32k | ( | void * | aContext | ) |
ca_error test_PageProgramAndEraseBlock64k | ( | void * | aContext | ) |
ca_error test_PageProgramAndEraseSector | ( | void * | aContext | ) |
ca_error test_PowerDownAndReleasePowerDown | ( | void * | aContext | ) |
ca_error test_ReadStatusRegister1 | ( | ) |
ca_error test_WriteEnableAndDisable | ( | void * | aContext | ) |
ca_error W25Q80DLSNIG_PowerDown | ( | ) |
Put the external flash chip in power down mode.
When in power down mode, the external flash chip consumes less power and will ignore all instructions except for RELEASE_POWERDOWN_ID.
CA_ERROR_SUCCESS | Success. |
CA_ERROR_BUSY | SPI is currently being used to communicate with the RF chip. |
ca_error W25Q80DLSNIG_ReadStatusRegister1 | ( | uint8_t * | statusRegister1 | ) |
Read the 8-bit Status Register 1.
(Function used internally by BSP_ExternalFlashGetStatus)
statusRegister1 | Stores the value of Status Register 1 that was read. |
CA_ERROR_SUCCESS | Success. |
CA_ERROR_BUSY | SPI is currently being used to communicate with the RF chip. |
ca_error W25Q80DLSNIG_ReleasePowerDown | ( | void | ) |
Release the external flash chip from power down mode.
This is a multi-purpose instruction, because it can also get the ID of the device at the same time.
CA_ERROR_SUCCESS | Success. |
CA_ERROR_BUSY | SPI is currently being used to communicate with the RF chip. |
ca_error W25Q80DLSNIG_WriteDisable | ( | ) |
Set the Write Enable Latch bit in the Status Register to a 0.
(Function used for testing purposes).
CA_ERROR_SUCCESS | Success. |
CA_ERROR_BUSY | SPI is currently being used to communicate with the RF chip. |
ca_error W25Q80DLSNIG_WriteEnable | ( | ) |
Forward declarations for non-BSP functions.
Forward declarations for non-BSP functions.
The WEL bit must be set prior to every Page Program, Sector Erase, Block Erase, Chip Erase and Write Status Register instruction. The WEL bit is reset to 0 upon completion of every aforementioned instruction. (Function used internally by BSP_ExternalFlashChipErase, BSP_ExternalFlashPartialErase and BSP_ExternalFlashProgram)
CA_ERROR_SUCCESS | Success. |
CA_ERROR_BUSY | SPI is currently being used to communicate with the RF chip. |
struct ca821x_dev dev |
ca_tasklet testTasklet |