Go to the documentation of this file.
38 #include "mikrosdk_version.h"
41 #if mikroSDK_GET_VERSION < 20800ul
42 #include "rcu_delays.h"
48 #include "drv_digital_out.h"
49 #include "drv_spi_master.h"
63 #define EXCELONLP_MAP_MIKROBUS( cfg, mikrobus ) \
64 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
65 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
66 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
67 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
68 cfg.wp = MIKROBUS( mikrobus, MIKROBUS_PWM )
75 #define EXCELONLP_RETVAL uint8_t
77 #define EXCELONLP_OK 0x00
78 #define EXCELONLP_INIT_ERROR 0xFF
85 #define EXCELONLP_OPCODE_SET_WRITE_ENABLE_LATCH 0x06
86 #define EXCELONLP_OPCODE_RESET_WRITE_ENABLE_LATCH 0x04
87 #define EXCELONLP_OPCODE_READ_STATUS_REGISTER 0x05
88 #define EXCELONLP_OPCODE_WRITE_STATUS_REGISTER 0x01
89 #define EXCELONLP_OPCODE_WRITE_MEMORY_DATA 0x02
90 #define EXCELONLP_OPCODE_READ_MEMORY_DATA 0x03
91 #define EXCELONLP_OPCODE_FAST_READ_MEMORY_DATA 0x0B
92 #define EXCELONLP_OPCODE_SPECIAL_SECTOR_WRITE 0x42
93 #define EXCELONLP_OPCODE_SPECIAL_SECTOR_READ 0x4B
94 #define EXCELONLP_OPCODE_READ_DEVICE_ID 0x9F
95 #define EXCELONLP_OPCODE_READ_UNIQUE_ID 0x4C
96 #define EXCELONLP_OPCODE_WRITE_SERIAL_NUMBER 0xC2
97 #define EXCELONLP_OPCODE_READ_SERIAL_NUMBER 0xC3
98 #define EXCELONLP_OPCODE_ENTER_DEEP_POWER_DOWN 0xBA
99 #define EXCELONLP_OPCODE_Enter_Hibernate_Mode 0xB9
194 uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len );
241 #endif // _EXCELONLP_H_
uint8_t excelonlp_read_memory_data(excelonlp_t *ctx, uint8_t opcode, uint32_t addr)
Functions for read data form memory.
void excelonlp_read_data(excelonlp_t *ctx, uint8_t opcode, uint8_t *out_buf, uint8_t n_data)
Functions for read data.
void excelonlp_write_memory_data(excelonlp_t *ctx, uint8_t opcode, uint32_t addr, uint8_t c_data)
Functions for write data to memory.
pin_name_t sck
Definition: excelonlp.h:136
void excelonlp_cfg_setup(excelonlp_cfg_t *cfg)
Config Object Initialization function.
uint32_t spi_speed
Definition: excelonlp.h:145
digital_out_t cs
Definition: excelonlp.h:114
pin_name_t mosi
Definition: excelonlp.h:135
spi_master_chip_select_polarity_t cs_polarity
Definition: excelonlp.h:147
Click configuration structure definition.
Definition: excelonlp.h:131
pin_name_t miso
Definition: excelonlp.h:134
pin_name_t wp
Definition: excelonlp.h:141
void excelonlp_generic_transfer(excelonlp_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
Generic transfer function.
EXCELONLP_RETVAL excelonlp_init(excelonlp_t *ctx, excelonlp_cfg_t *cfg)
Initialization function.
void excelonlp_send_command(excelonlp_t *ctx, uint8_t opcode)
Functions for send opcode command.
pin_name_t cs
Definition: excelonlp.h:137
#define EXCELONLP_RETVAL
Definition: excelonlp.h:75
pin_name_t chip_select
Definition: excelonlp.h:123
spi_master_t spi
Definition: excelonlp.h:122
digital_out_t wp
Definition: excelonlp.h:118
Click ctx object definition.
Definition: excelonlp.h:113
spi_master_mode_t spi_mode
Definition: excelonlp.h:146