Revision 15f74f80

View differences:

drivers/P9221R/v1/alld_P9221R.c
19 19
/**
20 20
 * @file    alld_P9221R.c
21 21
 *
22
 * @brief   Power Monitor function implementations
22
 * @brief   QI charger
23 23
 *
24 24
 * @addtogroup lld_power
25 25
 * @{
drivers/P9221R/v1/alld_P9221R.h
18 18

  
19 19
/**
20 20
 * @file    alld_P9221R.h
21
 * @brief   Power Monitor macros and structures.
21
 * @brief   QI charger macros and structures.
22 22
 *
23 23
 * @addtogroup lld_power
24 24
 * @{
drivers/PN532/v1/alld_PN532.c
19 19
/**
20 20
 * @file    alld_PN532.c
21 21
 *
22
 * @brief   ??
22
 * @brief   NFC 
23 23
 *
24
 * @addtogroup ??
24
 * @addtogroup lld_power //TODO
25 25
 * @{
26 26
 */
27 27

  
......
50 50
/******************************************************************************/
51 51
/* EXPORTED FUNCTIONS                                                         */
52 52
/******************************************************************************/
53
//TODO functions
53

  
54
/**
55
 * @brief Read the value of one or more of the registers.
56
 * @param[in]   i2cd        i2c driver
57
 * @param[in]   PRd         pn532 driver
58
 * @param[in]   addr        register address
59
 * @param[out]  data        register content
60
 * @param[in]   num         number of subsequent registers to read
61
 * @param[in]   timeout     timeout
62
 * @return                  An indicator whether the call was successfull
63
 */
64
apalExitStatus_t pn532_lld_read_register(const PN532Driver* const pn532, const pn532_lld_register_t addr, uint8_t* const data, const uint8_t num, const apalTime_t timeout)
65
{
66
  apalDbgAssert(pn532 != NULL);
67
  apalDbgAssert(pn532->i2cd != NULL);
68
  apalDbgAssert(data != NULL);
69

  
70
  uint8_t tx[2] = {(addr & 0xFF00) >> 8, addr & 0x00FF};
71

  
72
  apalExitStatus_t status = apalI2CMasterTransmit(pn532->i2cd, (PN532_LLD_I2C_ADDR_FIXED | pn532->addr), tx, 2, data, num, timeout);
73

  
74
  return status;
75
}
76

  
77
//TODO funktions
54 78

  
55 79
/** @} */
56 80

  
drivers/PN532/v1/alld_PN532.h
20 20
 * @file    alld_PN532.h
21 21
 * @brief   NFC
22 22
 *
23
 * @addtogroup 
23
 * @addtogroup lld_power //TODO
24 24
 * @{
25 25
 */
26 26

  
......
32 32
/******************************************************************************/
33 33
/* CONSTANTS                                                                  */
34 34
/******************************************************************************/
35

  
36 35
/**
37 36
 * @brief Maximum I2C frequency.
38 37
 */
39
//#define P9221R_LLD_I2C_MAXFREQUENCY   400000
38
#define PN532_LLD_I2C_MAXFREQUENCY   400000
40 39

  
41 40
/******************************************************************************/
42 41
/* SETTINGS                                                                   */
......
54 53
 * @brief I2C address masks.
55 54
 */
56 55
enum {
57
  PETER
56
  PN532_LLD_I2C_ADDR_FIXED   = 0x0061u, //TODO
58 57
};
59 58

  
60 59
/**
61 60
 * @brief Registers.
62 61
 */
63 62
typedef enum {
64
  HASE
65
}PN532_lld_register_t;
63
  PN532_LLD_REGISTER 		= 0x0000,  //TODO
64
}pn532_lld_register_t;
66 65

  
67 66

  
68 67
typedef struct {
69
  int hase;
68
  apalI2CDriver_t* i2cd;
69
  apalI2Caddr_t addr;
70
  uint16_t current_lsb_uA;
70 71
} PN532Driver;
71 72

  
72 73

  
......
81 82
#ifdef __cplusplus
82 83
extern "C" {
83 84
#endif
84
  //apalExitStatus_t p9221r_lld_read_register(const P9221RDriver* const p9221r, const p9221r_lld_register_t addr, uint8_t* const data, const uint8_t num, const apalTime_t timeout);
85
  apalExitStatus_t pn532_lld_read_register(const PN532Driver* const pn532, const pn532_lld_register_t addr, uint8_t* const data, const uint8_t num, const apalTime_t timeout);
86
 
85 87
#ifdef __cplusplus
86 88
}
87 89
#endif

Also available in: Unified diff