68 #ifndef BSP430_UTILITY_M25P_H
69 #define BSP430_UTILITY_M25P_H
88 #ifndef configBSP430_PLATFORM_M25P
89 #define configBSP430_PLATFORM_M25P 0
110 #if defined(BSP430_DOXYGEN)
111 #define BSP430_PLATFORM_M25P include <bsp430/platform.h>
114 #if defined(BSP430_DOXYGEN) || ! defined(BSP430_PLATFORM_M25P_SPI_CTL0_BYTE)
129 #define BSP430_PLATFORM_M25P_SPI_CTL0_BYTE BSP430_SERIAL_ADJUST_CTL0_INITIALIZER(UCCKPL | UCMSB | UCMST)
132 #if defined(BSP430_DOXYGEN)
136 #define BSP430_PLATFORM_M25P_SPI_PERIPH_HANDLE include <bsp430/platform.h>
141 #define BSP430_PLATFORM_M25P_PWR_PORT_PERIPH_HANDLE include <bsp430/platform.h>
146 #define BSP430_PLATFORM_M25P_PWR_PORT_BIT include <bsp430/platform.h>
151 #define BSP430_PLATFORM_M25P_RSTn_PORT_PERIPH_HANDLE include <bsp430/platform.h>
156 #define BSP430_PLATFORM_M25P_RSTn_PORT_BIT include <bsp430/platform.h>
161 #define BSP430_PLATFORM_M25P_CSn_PORT_PERIPH_HANDLE include <bsp430/platform.h>
166 #define BSP430_PLATFORM_M25P_CSn_PORT_BIT include <bsp430/platform.h>
172 #define BSP430_PLATFORM_M25P_SUPPORTS_PE include <bsp430/platform.h>
181 #define BSP430_PLATFORM_M25P_SUPPORTS_PW include <bsp430/platform.h>
186 #define BSP430_PLATFORM_M25P_SECTOR_SIZE include <bsp430/platform.h>
194 #define BSP430_PLATFORM_M25P_SUBSECTOR_SIZE include <bsp430/platform.h>
199 #define BSP430_PLATFORM_M25P_SECTOR_COUNT include <bsp430/platform.h>
229 #define BSP430_M25P_CMD_WREN 0x06
231 #define BSP430_M25P_CMD_WRDI 0x04
233 #define BSP430_M25P_CMD_RDID 0x9f
235 #define BSP430_M25P_CMD_RDSR 0x05
237 #define BSP430_M25P_CMD_WRSR 0x01
239 #define BSP430_M25P_CMD_WRLR 0xe5
241 #define BSP430_M25P_CMD_RDLR 0xe8
243 #define BSP430_M25P_CMD_READ 0x03
245 #define BSP430_M25P_CMD_FAST_READ 0x0b
247 #define BSP430_M25P_CMD_PW 0x0a
249 #define BSP430_M25P_CMD_PP 0x02
251 #define BSP430_M25P_CMD_PE 0xdb
255 #define BSP430_M25P_CMD_SSE 0x20
257 #define BSP430_M25P_CMD_SE 0xd8
259 #define BSP430_M25P_CMD_BE 0xc7
261 #define BSP430_M25P_CMD_DP 0xb9
263 #define BSP430_M25P_CMD_RELDP 0xab
265 #define BSP430_M25P_CMD_RES 0xab
268 #define BSP430_M25P_SR_WIP 0x01
270 #define BSP430_M25P_SR_WEL 0x02
273 #define BSP430_M25P_SR_BP0 0x04
276 #define BSP430_M25P_SR_BP1 0x08
279 #define BSP430_M25P_SR_SRWD 0x80
282 #define BSP430_M25P_RESET_SET(dev_) do { \
283 if (NULL != (dev_)->rstn_port) { \
284 (dev_)->rstn_port->out &= ~(dev_)->rstn_bit; \
289 #define BSP430_M25P_RESET_CLEAR(dev_) do { \
290 if (NULL != (dev_)->rstn_port) { \
291 (dev_)->rstn_port->out |= (dev_)->rstn_bit; \
297 #define BSP430_M25P_CS_ASSERT(dev_) do { \
298 (dev_)->csn_port->out &= ~(dev_)->csn_bit; \
302 #define BSP430_M25P_CS_DEASSERT(dev_) do { \
303 (dev_)->csn_port->out |= (dev_)->csn_bit; \
331 unsigned char ctl0_byte,
332 unsigned char ctl1_byte,
333 unsigned int prescaler);
479 const uint8_t * tx_data,
#define BSP430_CORE_RESTORE_INTERRUPT_STATE(state_)
Definition: core.h:731
int iBSP430m25pStrobeAddressCommand_rh(hBSP430m25p dev, uint8_t cmd, unsigned long addr)
hBSP430m25p hBSP430m25pInitialize(hBSP430m25p dev, unsigned char ctl0_byte, unsigned char ctl1_byte, unsigned int prescaler)
Common header included by all BSP430 leaf headers.
Definition: serial_.h:193
int iBSP430m25pInitiateCommand_rh(hBSP430m25p dev, uint8_t cmd)
#define BSP430_CORE_INLINE
Definition: core.h:439
#define BSP430_CORE_SAVED_INTERRUPT_STATE(var_)
Definition: core.h:719
int iBSP430m25pCompleteTxRx_rh(hBSP430m25p dev, const uint8_t *tx_data, size_t tx_len, size_t rx_len, uint8_t *rx_data)
Declarations for abstracted serial interface.
int iBSP430m25pStrobeCommand_rh(hBSP430m25p dev, uint8_t cmd)
volatile sBSP430hplPORT * rstn_port
Definition: m25p.h:216
int iBSP430m25pStatus_rh(hBSP430m25p dev)
sBSP430m25p * hBSP430m25p
Definition: m25p.h:226
hBSP430halSERIAL spi
Definition: m25p.h:209
Hardware presentation/abstraction for Digital I/O Port (PORT#/PORT#_R)
volatile sBSP430hplPORT * csn_port
Definition: m25p.h:212
#define BSP430_CORE_DISABLE_INTERRUPT()
Definition: core.h:762
static BSP430_CORE_INLINE int iBSP430m25pStatus(hBSP430m25p dev)
Definition: m25p.h:355
uint8_t rstn_bit
Definition: m25p.h:222
struct sBSP430m25p sBSP430m25p
uint8_t csn_bit
Definition: m25p.h:219
int iBSP430m25pInitiateAddressCommand_rh(hBSP430m25p dev, uint8_t cmd, unsigned long addr)