45 lines
905 B
C
45 lines
905 B
C
|
|
/*
|
||
|
|
* m95512.h
|
||
|
|
*
|
||
|
|
* Created on: Nov 1, 2023
|
||
|
|
* Author: Warner
|
||
|
|
*/
|
||
|
|
|
||
|
|
#ifndef M95512_H_
|
||
|
|
#define M95512_H_
|
||
|
|
|
||
|
|
|
||
|
|
#include "board.h"
|
||
|
|
#include "LPC54114_cm4.h"
|
||
|
|
#include "pin_mux.h"
|
||
|
|
#include "spi.h"
|
||
|
|
/*******************************************************************************
|
||
|
|
* Definitions
|
||
|
|
******************************************************************************/
|
||
|
|
// #define EXAMPLE_SPI_MASTER SPI0
|
||
|
|
|
||
|
|
|
||
|
|
#define WRITE_ENABLE 0x06
|
||
|
|
#define WRITE_DISABLE 0x04
|
||
|
|
#define READ_STATUS_REG 0x05
|
||
|
|
#define WRITE_STATUS_REG 0x01
|
||
|
|
#define READ_MEM_ARRAY 0x03
|
||
|
|
#define WRITE_MEM_ARRAY 0x02
|
||
|
|
|
||
|
|
//Status register bits
|
||
|
|
#define EE_SR_WIP 0x01
|
||
|
|
#define EE_SR_WEL 0x02
|
||
|
|
#define EE_SR_BP0 0x04
|
||
|
|
#define EE_SR_BP1 0x08
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
status_t M95512_WriteEnable(void);
|
||
|
|
status_t M95512_WriteDisable(void);
|
||
|
|
status_t M95512_ReadStatus(uint8_t *pdata);
|
||
|
|
status_t M95512_WriteStatus(uint8_t *pdata);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
#endif /* M95512_H_ */
|